API

class api.nh_clinical_api(pool, cr)[source]

Core API for nh_clinical

admit(*args, **kwargs)[source]

Admits a patient into a specified location.

Parameters:
  • hospital_number (str) – Hospital number of the patient
  • data (dict) – contains location_code, start_date and a list of dictionaries of consulting and referring doctors, containing the following keys: type, code, title, given_name and family_name
Returns:

True

Return type:

bool

admit_update(*args, **kwargs)[source]

Updates the spell information of a patient.

Parameters:
  • hospital_number (str) – hospital number of the patient
  • data (dict) – may contain other_identifier and patient_identifier among others
Returns:

True

Return type:

bool

cancel_admit(*args, **kwargs)[source]

Cancels the open admission of the patient.

Parameters:hospital_number (str) – hospital number of the patient
Returns:True
Return type:bool
cancel_discharge(*args, **kwargs)[source]

Cancels the last discharge of a patient.

Parameters:hospital_number (str) – hospital number of the patient
Returns:True
Return type:bool
cancel_transfer(*args, **kwargs)[source]

Cancels the last transfer of a patient.

Parameters:hospital_number (str) – hospital number of the patient
Returns:True
Return type:bool
check_activity_access(*args, **kwargs)[source]

Verifies if an activity is assigned to a user.

Parameters:
  • uid (int) – id of user to verify
  • activity_id (int) – id of activity to verify
Returns:

True if user is assigned. Otherwise False

Return type:

bool

discharge(*args, **kwargs)[source]

Discharges a patient.

Parameters:
  • hospital_number (str) – hospital number of the patient
  • data (dict) – may contain the key discharge_date
Returns:

True

Return type:

bool

merge(*args, **kwargs)[source]

Merges a specified patient into a patient.

Parameters:
  • hospital_number (str) – hospital number of the patient merged INTO
  • data (dict) – may contain the key from_identifier, the hospital number of the patient merged FROM
Returns:

True

Return type:

bool

register(*args, **kwargs)[source]

Registers a new patient in the system.

Parameters:
  • hospital_number (str) – hospital number of the patient
  • data – may contain the following keys: patient_identifier, family_name, given_name, middle_names, dob, gender and sex
Returns:

True

Return type:

bool

transfer(*args, **kwargs)[source]

Transfers the patient to a specified location.

Parameters:
  • hospital_number (str) – hospital number of the patient
  • data (dict) – required is location_code of the patient’s transfer destination
Returns:

True

Return type:

bool

update(*args, **kwargs)[source]

Update patient information.

Parameters:
  • hospital_number (str) – hospital number of the patient
  • data (dict) – may contain the following keys: patient_identifier and other_identifier among others
Returns:

True

Return type:

bool