care.facility.models.shifting module¶
- class ShiftingRequest(id, external_id, created_date, modified_date, deleted, origin_facility, shifting_approving_facility, assigned_facility_type, assigned_facility, assigned_facility_external, patient, emergency, is_up_shift, reason, vehicle_preference, preferred_vehicle_choice, comments, refering_facility_contact_name, refering_facility_contact_number, is_kasp, status, breathlessness_level, is_assigned_to_user, assigned_to, ambulance_driver_name, ambulance_phone_number, ambulance_number, created_by, last_edited_by)¶
Bases:
FacilityBaseModel- origin_facility¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- shifting_approving_facility¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- assigned_facility_type¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- assigned_facility¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- assigned_facility_external¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- patient¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- emergency¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_up_shift¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reason¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- vehicle_preference¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- preferred_vehicle_choice¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- comments¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- refering_facility_contact_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- refering_facility_contact_number¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_kasp¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- status¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- breathlessness_level¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_assigned_to_user¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- assigned_to¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- ambulance_driver_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- ambulance_phone_number¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- ambulance_number¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- created_by¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- last_edited_by¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- CSV_MAPPING = {'assigned_facility__name': 'To Facility', 'created_date': 'Created Date', 'emergency': 'Emergency Shift', 'is_up_shift': 'Upshift', 'modified_date': 'Modified Date', 'origin_facility__name': 'From Facility', 'patient__age': 'Patient Age', 'patient__is_antenatal': 'Patient is Antenatal', 'patient__name': 'Patient Name', 'patient__phone_number': 'Patient Phone Number', 'reason': 'Reason for Shifting', 'shifting_approving_facility__name': 'Approving Facility', 'status': 'Current Status', 'vehicle_preference': 'Vehicle Preference'}¶
- CSV_ANNOTATE_FIELDS = {'patient__age': PatientAgeFunc(Value('year'), Func(CASE WHEN <Q: (AND: ('patient__death_datetime__isnull', True))> THEN Now(), ELSE F(patient__death_datetime__date), Coalesce(F(patient__date_of_birth), Func(F(patient__year_of_birth), Value(1), Value(1), function=MAKE_DATE)), function=age))}¶
- CSV_MAKE_PRETTY = {'emergency': <function pretty_boolean>, 'is_up_shift': <function pretty_boolean>, 'patient__is_antenatal': <function pretty_boolean>, 'status': <function ShiftingRequest.<lambda>>}¶
- static has_write_permission(request)¶
- static has_read_permission(request)¶
- has_object_read_permission(request)¶
- has_object_write_permission(request)¶
- has_object_transfer_permission(request)¶
- has_object_update_permission(request)¶
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- assigned_facility_id¶
- assigned_to_id¶
- created_by_id¶
- created_date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- deleted¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- external_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_assigned_facility_type_display(*, field=<django.db.models.fields.IntegerField: assigned_facility_type>)¶
- get_breathlessness_level_display(*, field=<django.db.models.fields.IntegerField: breathlessness_level>)¶
- get_preferred_vehicle_choice_display(*, field=<django.db.models.fields.IntegerField: preferred_vehicle_choice>)¶
- get_status_display(*, field=<django.db.models.fields.IntegerField: status>)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- last_edited_by_id¶
- modified_date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- origin_facility_id¶
- patient_id¶
- shifting_approving_facility_id¶
- shiftingrequestcomment_set¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- class ShiftingRequestComment(id, external_id, created_date, modified_date, deleted, request, created_by, comment)¶
Bases:
FacilityBaseModel- request¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- created_by¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- comment¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- static has_write_permission(request)¶
- static has_read_permission(request)¶
- has_object_read_permission(request)¶
- has_object_write_permission(request)¶
- has_object_update_permission(request)¶
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- created_by_id¶
- created_date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- deleted¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- external_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- modified_date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- request_id¶