NHClinical API Overrides

class nh_observations.nh_clinical_extension.nh_clinical_api_extension(pool, cr)[source]

Extends the NH Clinical API

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

Cancels all not completed or cancelled activities of the provided type and spell.

Parameters:
  • parent_id (int) – activity id
  • model (str) – activity type _name attribute.
Returns:

True

Return type:

bool

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

Creates and completes a new rev frequency task to update the frequency of the specified activity type.

The update of the frequency also triggers an update of the date_scheduled. See nh_observations.observations .nh_clinical_patient_observation.write.

Parameters:
  • patient_id (int) – patient id.
  • activity_type (str) – activity type _name attribute
  • frequency (int) – new frequency in minutes
Returns:

True

Return type:

bool

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

Creates and completes a new rev frequency task to update the frequency of the specified activity type.

Parameters:
  • patient_id (int) – patient id.
  • activity_type (str) – activity type _name attribute
  • frequency (int) – new frequency in minutes
Returns:

True

Return type:

bool

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

Creates a new notification for every element in the notifications list provided in values:

{
    'notifications': [{
        'model': (str) type of notification,  //required
        'summary': (str) notification text,  //optional
        'groups': (list of str) user groups for which the
                    notification is created, //required
        'assign': (bool)  //assign the notification to the user?
    }, ...],
    'parent_id': spell type activity id,
    'creator_id': activity id triggering,
    'patient_id': patient id,
    'model': self._name,
    'group': group name of the user triggering ('hca','nurse')
}
Parameters:values (dict) – contains information to create the notifications.