care.facility.models.asset module

get_random_asset_id()
class AvailabilityStatus(*values)

Bases: TextChoices

NOT_MONITORED = 'Not Monitored'
OPERATIONAL = 'Operational'
DOWN = 'Down'
UNDER_MAINTENANCE = 'Under Maintenance'
class AssetLocation(*args, **kwargs)

Bases: BaseModel, FacilityRelatedPermissionMixin

This model is also used to store rooms that the assets are in, Since these rooms are mapped to actual rooms in the hospital, Beds are also connected to this model to remove duplication of efforts

class RoomType(*values)

Bases: Enum

OTHER = 1
ICU = 10
WARD = 20
RoomTypeChoices = [(1, 'OTHER'), (10, 'ICU'), (20, 'WARD')]
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

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.parent is a ForwardManyToOneDescriptor instance.

middleware_address

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

asset_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

bed_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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.

facility_id
facilitydefaultassetlocation_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

from_location

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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_location_type_display(*, field=<django.db.models.fields.IntegerField: location_type>)
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.

patientconsultation_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

to_location

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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

userdefaultassetlocation_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class AssetType(*values)

Bases: Enum

INTERNAL = 50
EXTERNAL = 100
class Status(*values)

Bases: Enum

ACTIVE = 50
TRANSFER_IN_PROGRESS = 100
class Asset(id, external_id, created_date, modified_date, deleted, name, description, asset_type, asset_class, status, current_location, is_working, not_working_reason, serial_number, warranty_details, meta, vendor_name, support_name, support_phone, support_email, qr_code_id, manufacturer, warranty_amc_end_of_validity, last_service)

Bases: BaseModel

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

asset_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

asset_class

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.

current_location

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.parent is a ForwardManyToOneDescriptor instance.

is_working

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

not_working_reason

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

serial_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

warranty_details

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

meta

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

vendor_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

support_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

support_phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

support_email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

qr_code_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

manufacturer

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

warranty_amc_end_of_validity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_service

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.parent is a ForwardManyToOneDescriptor instance.

CSV_MAPPING = {'asset_class': 'Class', 'asset_type': 'Type', 'current_location__name': 'Current Location Name', 'description': 'Description', 'is_working': 'Working Status', 'last_service__note': 'Notes', 'last_service__serviced_on': 'Last Service Date', 'manufacturer': 'Manufacturer', 'meta__camera_access_key': 'Config: Camera Access Key', 'meta__local_ip_address': 'Config - IP Address', 'name': 'Name', 'not_working_reason': 'Not Working Reason', 'qr_code_id': 'QR Code ID', 'serial_number': 'Serial Number', 'status': 'Status', 'support_email': 'Support Email', 'support_name': 'Support Name', 'support_phone': 'Support Phone Number', 'vendor_name': 'Vendor Name', 'warranty_amc_end_of_validity': 'Warranty End Date'}
CSV_MAKE_PRETTY = {'asset_type': <function Asset.<lambda>>, 'is_working': <function Asset.<lambda>>, 'status': <function Asset.<lambda>>}
property resolved_middleware
delete(*args, **kwargs)
static has_write_permission(request)
has_object_write_permission(request)
static has_read_permission(request)
has_object_read_permission(request)
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

assetbed_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

assetservice_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

assettransaction_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

assigned_consultation_beds

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

bed_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

consultationbedasset_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

created_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

current_location_id
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_asset_class_display(*, field=<django.db.models.fields.CharField: asset_class>)
get_asset_type_display(*, field=<django.db.models.fields.IntegerField: asset_type>)
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_service_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.

user

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class AvailabilityRecord(*args, **kwargs)

Bases: BaseModel

Model to store the availability status of an object (Asset/AssetLocation for now) at a particular timestamp.

Fields: - content_type: ContentType of the related model - object_external_id: UUIDField to store the external_id of the related model - content_object: To get the linked object - status: CharField with choices from AvailabilityStatus - timestamp: DateTimeField to store the timestamp of the availability record

Note: A pair of (object_external_id, timestamp) is unique

content_type

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.parent is a ForwardManyToOneDescriptor instance.

object_external_id

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.

timestamp

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property content_object
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

content_type_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_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)
get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
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.

class UserDefaultAssetLocation(id, external_id, created_date, modified_date, deleted, user, location)

Bases: BaseModel

user

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.parent is a ForwardManyToOneDescriptor instance.

location

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.parent is a ForwardManyToOneDescriptor instance.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

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.

location_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.

user_id
class FacilityDefaultAssetLocation(id, external_id, created_date, modified_date, deleted, facility, location)

Bases: BaseModel

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.parent is a ForwardManyToOneDescriptor instance.

location

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.parent is a ForwardManyToOneDescriptor instance.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

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.

facility_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_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.

class AssetTransaction(id, external_id, created_date, modified_date, deleted, asset, from_location, to_location, performed_by)

Bases: BaseModel

asset

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.parent is a ForwardManyToOneDescriptor instance.

from_location

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.parent is a ForwardManyToOneDescriptor instance.

to_location

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.parent is a ForwardManyToOneDescriptor instance.

performed_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.parent is a ForwardManyToOneDescriptor instance.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

asset_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.

from_location_id
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.

performed_by_id
to_location_id
class AssetService(id, external_id, created_date, modified_date, deleted, asset, serviced_on, note)

Bases: BaseModel

asset

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.parent is a ForwardManyToOneDescriptor instance.

serviced_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

note

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property edit_history
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

asset_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.

edits

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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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.

last_service

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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

modified_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class AssetServiceEdit(id, asset_service, edited_on, edited_by, serviced_on, note)

Bases: Model

asset_service

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.parent is a ForwardManyToOneDescriptor instance.

edited_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

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.parent is a ForwardManyToOneDescriptor instance.

serviced_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

note

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

asset_service_id
edited_by_id
get_next_by_edited_on(*, field=<django.db.models.fields.DateTimeField: edited_on>, is_next=True, **kwargs)
get_next_by_serviced_on(*, field=<django.db.models.fields.DateField: serviced_on>, is_next=True, **kwargs)
get_previous_by_edited_on(*, field=<django.db.models.fields.DateTimeField: edited_on>, is_next=False, **kwargs)
get_previous_by_serviced_on(*, field=<django.db.models.fields.DateField: serviced_on>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>