Wardboard

Defines models for the Wardboard view.

Swap Beds

class wardboard.wardboard_swap_beds[source]

Allows a patient to swap beds with another patient on the same ward.

do_swap(cr, uid, ids, context=None)[source]

Swaps the bed locations of two patients.

Parameters:ids (list) – list of ids for records
Returns:True
Return type:bool
onchange_location2(cr, uid, ids, location2_id, context=None)[source]

Returns dictionary containing the patient id of patient in the location of the location2_id parameter.

Parameters:location2_id (int) – location id
Returns:dictionary containing patient id
Return type:dict

Patient Placement

class wardboard.wardboard_patient_placement[source]

Moves patient from a bed location to another vacant bed location.

do_move(cr, uid, ids, context=None)[source]

Moves the patient from their current bed location to a destination bed location.

Parameters:ids (list) – record ids
Returns:True
Return type:bool

Device Session Start

class wardboard.wardboard_device_session_start[source]

Starts a device session.

do_start(cr, uid, ids, context=None)[source]

Starts a session for a device.

Parameters:ids (list) – record ids
Returns:True
Return type:bool
onchange_device_category_id(cr, uid, ids, device_category_id, context=None)[source]

Returns domain dictionary containing the type id of the device.

Parameters:device_category_id (int) – category id of the device
Returns:domain dictionary containing device_type_id
Return type:dict
onchange_device_id(cr, uid, ids, device_id, context=None)[source]

Given a device device id, it returns a domain dictionary containing the type id.

Parameters:device_id (int) – id of the device
Returns:domain dictionary containing device_id
Return type:dict
onchange_device_type_id(cr, uid, ids, device_type_id, context=None)[source]

Given a device type id, it returns a domain dictionary containing the device id.

Parameters:device_type_id (int) – type id of the device
Returns:domain dictionary containing device_id
Return type:dict

Device Session Complete

class wardboard.wardboard_device_session_complete[source]

Completes a session for a device.

do_complete(cr, uid, ids, context=None)[source]

Completed a session for a device.

Parameters:ids (list) – record ids
Returns:Odoo action definition
Return type:dict

Device Session

class wardboard.nh_clinical_device_session[source]

Extends session.

device_session_complete(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for device session complete for the view view_wardboard_device_session_complete_form.

Parameters:ids (list) – record ids
Returns:Odoo action definition
Return type:dict

Wardboard

class wardboard.nh_clinical_wardboard[source]

Represents a patient with basic patient information (admission, spell, location, etc.).

Also includes observation data such as EWS etc.

Wardboard overrides the init method and others to provide an implementation that is backed by database views. When accessing fields on a wardboard, rather than allowing Odoo’s ORM to retrieve them from database tables, we are using function fields that call methods that execute hand-written SQL queries on database views. We ensure that the database views these methods use are created when the model is first loaded and it’s init method is called.

Calling create on wardboard fails. Instead you should just browse for them as if they already exist, using the spell id as the id (or multiple spell ids). The id(s) used are passed to the function fields to retrieve the data, so a wardboard record with the correct id simply has the means to get the data you’d expect, it does not need to be formally created.

device_session_start(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for device session start for the view view_wardboard_device_session_start_form.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
onchange_critical_care(cr, uid, ids, pc, ps, cc, context=None)[source]

Checks if any of the other special circumstances parameters are True and returns a warning if that is the case.

Parameters:
  • pc (str) – palliative care value
  • ps (str) – post surgery value
  • cc (str) – critical care value
Returns:

dictionary containing warning and/or values

Return type:

dict

onchange_palliative_care(cr, uid, ids, pc, ps, cc, context=None)[source]

Checks if any of the other special circumstances parameters are True and returns a warning if that is the case.

Parameters:
  • pc (str) – palliative care value
  • ps (str) – post surgery value
  • cc (str) – critical care value
Returns:

dictionary containing warning and/or values

Return type:

dict

onchange_post_surgery(cr, uid, ids, pc, ps, cc, context=None)[source]

Checks if any of the other special circumstances parameters are True and returns a warning if that is the case.

Parameters:
  • pc (str) – palliative care value
  • ps (str) – post surgery value
  • cc (str) – critical care value
Returns:

dictionary containing warning and/or values

Return type:

dict

open_previous_spell(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for wardboard for the view view_wardboard_form_discharged to open a previous spell.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
wardboard_chart(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for wardboard for the view view_wardboard_chart_form.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
wardboard_ews(cr, uid, ids, context=None)[source]

Returns an Odoo tree window action for completed ews.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
wardboard_patient_placement(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for patient placement for the view view_wardboard_patient_placement_form. Raises an exception if patient isn’t placed in a bed.

Parameters:ids (list) – records ids
Raises:osv.except_osv
Returns:Odoo form window action
Return type:dict
wardboard_place(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for patient placement for the view view_patient_placement_complete.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
wardboard_prescribe(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for wardboard for the view view_wardboard_prescribe_form.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
wardboard_swap_beds(cr, uid, ids, context=None)[source]

Returns an Odoo form window action for swap beds for the view view_wardboard_swap_beds_form.

Parameters:ids (list) – records ids
Returns:Odoo form window action
Return type:dict
write(cr, uid, ids, vals, context=None)[source]

Extends Odoo’s write().

Returns:True
Return type:bool