Service package¶
Service.admin module¶
The admin service module: Admin table services.
Provides the application with the modelled CRUD functionality needed to manage the admin SQLite table.
- Src.Service.admin.create_admin(username, password, email)[source]¶
Create an Admin record within the applications Admin SQLite database table.
- Parameters:
username (str) – The admins username
password (str) – The admins password, this is expected to be encrypted prior to this function call
email (str) – The admins email address
- Src.Service.admin.delete_admin()[source]¶
Deletes the applications admin user by clearing all records from the Admin SQLite database table
- Src.Service.admin.get_admin_email()[source]¶
Retrieves the applications admin users email address, queried from the admin SQLite database table.
- Returns:
The admins email address
- Return type:
str
Service.amt_rebuild module¶
The amt rebuild service module: Amt table rebuild services.
Provides the application with the modelled functionality needed to support the import of a new AMT distribution into the Amt SQLite table.
Service.create module¶
The create service module: Create record services.
Provides the application with the modelled create functionality needed to construct a new AMT or Snomed database table record.
- Src.Service.create.create_amt(CTPP_SCTID, CTPP_PT, ARTG_ID, TPP_SCTID, TPUU_PT, TPP_PT, TPUU_SCTID, TPP_TP_SCTID, TPP_TP_PT, TPUU_TP_SCTID, TPUU_TP_PT, MPP_SCTID, MPP_PT, MPUU_SCTID, MPUU_PT, MP_SCTID, MP_PT)[source]¶
Creates a new Amt record within the Amt SQLite database table.
- Parameters:
CTPP_SCTID (str) – The new Amt records CTPP_SCTID field value
CTPP_PT (str) – The new Amt records CTPP_PT field value
ARTG_ID (str) – The new Amt records ARTG_ID field value
TPP_SCTID (str) – The new Amt records TPP_SCTID field value
TPUU_PT (str) – The new Amt records TPUU_PT field value
TPP_PT (str) – The new Amt records TPP_PT field value
TPUU_SCTID (str) – The new Amt records TPUU_SCTID field value
TPP_TP_SCTID (str) – The new Amt records TPP_TP_SCTID field value
TPP_TP_PT (str) – The new Amt records TPP_TP_PT field value
TPUU_TP_SCTID (str) – The new Amt records TPUU_TP_SCTID field value
TPUU_TP_PT (str) – The new Amt records TPUU_TP_PT field value
MPP_SCTID (str) – The new Amt records MPP_SCTID field value
MPP_PT (str) – The new Amt records MPP_PT field value
MPUU_SCTID (str) – The new Amt records MPUU_SCTID field value
MPUU_PT (str) – The new Amt records MPUU_PT field value
MP_SCTID (str) – The new Amt records MP_SCTID field value
MP_PT (str) – The new Amt records MP_PT field value
- Returns:
The newly created Amt record
- Return type:
- Src.Service.create.create_snomed(MP_PT, AU_Substance_SCTID, Int_Substance_SCTID)[source]¶
Creates a new Snomed record within the Snomed SQLite database table.
- Parameters:
MP_PT (str) – The new Snomed records MP_PT field value
AU_Substance_SCTID (str) – The new Snomed records AU_Substance_SCTID field value
Int_Substance_SCTID (str) – The new Snomed records Int_Substance_SCTID field value
- Returns:
The newly created Snomed record
- Return type:
Service.delete module¶
The delete service module: Delete record services.
Provides the application with the modelled delete functionality needed to delete an AMT or Snomed database table record.
- Src.Service.delete.amt_delete_by_filter(filters)[source]¶
Deletes an Amt record from the SQLite database table by field filter/s.
- Parameters:
filters (JSON) – The field filters to query by
- Returns:
The deleted Amt record
- Return type:
- Src.Service.delete.amt_delete_by_id(id)[source]¶
Deletes an Amt record from the SQLite database table by ID.
- Parameters:
id (Int) – The ID field to query by
- Returns:
The deleted Amt record
- Return type:
Service.search module¶
The search service module: Search record services.
Provides the application with the modelled search functionality needed to query for an AMT or Snomed database table record.
- Src.Service.search.amt_query_all()[source]¶
Queries all Amt records from the SQLite database table.
- Returns:
The list containing all of the Amt records found within the table
- Return type:
list
- Src.Service.search.amt_search_by_fields_ret_all(search_filters)[source]¶
Queries the Amt SQLite database table by field filter/s
- Parameters:
search_filters (JSON) – The field filter/s to query by
- Returns:
The list containing all retrieved Amt records
- Return type:
list
- Src.Service.search.amt_search_by_fields_ret_one(search_filters)[source]¶
Queries the Amt SQLite database table by field filter/s
- Parameters:
search_filters (JSON) – The field filter/s to query by
- Returns:
The retrieved Amt record or None
- Return type:
Amt/None
- Src.Service.search.amt_search_by_id(id)[source]¶
Queries the Amt SQLite database table by id
- Parameters:
id (Int) – The ID field value to query for
- Returns:
The Amt record found
- Return type:
- Src.Service.search.amt_unmapped_search()[source]¶
Queries all Amt records from that have no relation mapped to the Snomed SQLite database table.
- Returns:
The list consisting of all Amt records that have no mapping to the Snomed SQLite database table
- Return type:
- Src.Service.search.snomed_query_all()[source]¶
Queries all Snomed records from the SQLite database table.
- Returns:
The list containing all of the Snomed records found within the table
- Return type:
list
- Src.Service.search.snomed_search_by_fields_ret_all(search_filters)[source]¶
Queries the Snomed SQLite database table by field filter/s
- Parameters:
search_filters (JSON) – The field filter/s to query by
- Returns:
The list containing all retrieved Snomed records
- Return type:
list
Service.snomed_import module¶
The snomed import service module: Snomed import services.
Provides the application with the modelled Snomed import functionality needed to construct the Snomed SQLite table.
Service.update module¶
The update service module: Update record services.
Provides the application with the modelled update functionality needed to update an existing AMT or Snomed database table record.
- Src.Service.update.update_AU_Substance_SCTID_by_filters(filters, value)[source]¶
Queries a Snomed record by field filter/s and updates the AU_Substance_SCTID field of a Snomed Record
- Parameters:
filters (JSON) – The field filters to query by
value (str) – The value to update the AU_Substance_SCTID field to
- Returns:
The updates Snomed record
- Return type:
- Src.Service.update.update_AU_Substance_SCTID_by_id(id, value)[source]¶
Queries a Snomed record by id (MP_PT) and updates the AU_Substance_SCTID field of a Snomed Record
- Parameters:
id (str) – The MP_PT field to query by
value (str) – The value to update the AU_Substance_SCTID field to
- Returns:
The updates Snomed record
- Return type:
- Src.Service.update.update_Int_Substance_SCTID_by_filters(filters, value)[source]¶
Queries a Snomed record by field filter/s and updates the Int_Substance_SCTID field of a Snomed Record
- Parameters:
filters (JSON) – The field filters to query by
value (str) – The value to update the Int_Substance_SCTID field to
- Returns:
The updates Snomed record
- Return type:
- Src.Service.update.update_Int_Substance_SCTID_by_id(id, value)[source]¶
Queries a Snomed record by id (MP_PT) and updates the Int_Substance_SCTID field of a Snomed Record
- Parameters:
id (str) – The MP_PT field to query by
value (str) – The value to update the Int_Substance_SCTID field to
- Returns:
The updates Snomed record
- Return type:
Service.version module¶
The version service module: Version table services.
Provides the application with the modelled CRUD functionality needed to manage the version SQLite table.
- Src.Service.version.create_version(date, file, link)[source]¶
Creates a new Version record within the Version SQLite database table.
- Parameters:
date (str) – The version date
file (str) – The file name
link (str) – The distribution download URL
- Returns:
The newly created Version record
- Return type: