Activity Data

class activity_extension.nh_activity_data(pool, cr)[source]

Extends class nh_activity_data.

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

Writes shift_coordinator_id for ward manager responsible for the activity’s location. If location doesn’t exist or it’s not within the ward or there’s no ward assigned, then no audit happens.

Parameters:activity_id (int) – activity id
Returns:True if the shift_coordinator_id is stored. Otherwise False
Return type:bool
cancel(*args, **kwargs)[source]

Extends cancel() method to audit the ward manager responsible for activity location.

Parameters:activity_id (int) – activity id
Returns:True
Return type:bool
complete(*args, **kwargs)[source]

Extends complete() method to audit the ward manager responsible for activity location.

Parameters:activity_id (int) – activity id
Returns:True
Return type:bool
get_activity_location_id(*args, **kwargs)[source]

Gets the activity’s location id.

Parameters:activity_id (int) – activity id
Returns:location_id. See class nh_clinical_location
Return type:int
get_activity_patient_id(*args, **kwargs)[source]

Gets the activity’s patient id.

Parameters:activity_id (int) – activity id
Returns:patient_id. See class nh_clinical_patient
Return type:int
get_activity_pos_id(*args, **kwargs)[source]

Gets activity point of service (POST) id.

Parameters:activity_id (int) – activity id of updated activity
Returns:POS id
Return type:int
get_activity_user_ids(*args, **kwargs)[source]

Gets the activity’s user ids.

Parameters:activity_id (int) – activity id
Returns:patient_id. See class res_users
Return type:list
get_child_activity(activity_model, activity, data_model, context=None)[source]

Generator to return the child activity of the specified data model. The inputs use the Odoo v8 API record sets

Parameters:
  • activity_model – Instance of nh.activity environment
  • activity – Activity instance to get child of
  • data_model – data_model child activity should be
  • context – Odoo context
Returns:

Record of child activity

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

Triggers the list of activities in the _POLICY['activities'] list.

Parameters:
  • activity_id (int) – id of activity triggering policy
  • location_id (int) – location id [optional]. Required for checking context
  • case (bool or int) – default False. Otherwise integer related to risk of patient
Returns:

True

Return type:

bool

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

Extends update_activity() method.

Parameters:activity_id (int) – activity id of updated activity
Returns:True
Return type:bool