care.facility.models.file_upload module

class BaseFileUpload(*args, **kwargs)

Bases: Model

class FileCategory(*values)

Bases: TextChoices

UNSPECIFIED = 'UNSPECIFIED'
XRAY = 'XRAY'
AUDIO = 'AUDIO'
IDENTITY_PROOF = 'IDENTITY_PROOF'
external_id

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

name

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

internal_name

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

associating_id

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

file_type

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

file_category

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

created_date

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.

upload_completed

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.

objects
class Meta

Bases: object

abstract = False
save(*args, **kwargs)
delete(*args)
get_extension()
signed_url(duration=3600, mime_type=None, bucket_type=BucketType.PATIENT)
read_signed_url(duration=3600, bucket_type=BucketType.PATIENT)
put_object(file, bucket_type=BucketType.PATIENT, **kwargs)
get_object(bucket_type=BucketType.PATIENT, **kwargs)
file_contents()
get_file_category_display(*, field=<django.db.models.fields.CharField: file_category>)
class FileUpload(*args, **kwargs)

Bases: BaseFileUpload

Stores data about all file uploads the file can belong to any type ie Patient , Consultation , Daily Round and so on … the file will be uploaded to the corresponding folders the file name will be randomised and converted into an internal name before storing in S3 all data will be private and file access will be given on a NEED TO BASIS ONLY

class FileType(*values)

Bases: IntegerChoices

OTHER = 0
PATIENT = 1
CONSULTATION = 2
SAMPLE_MANAGEMENT = 3
CLAIM = 4
DISCHARGE_SUMMARY = 5
COMMUNICATION = 6
CONSENT_RECORD = 7
ABDM_HEALTH_INFORMATION = 8
file_type

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

is_archived

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

archive_reason

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

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

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

archived_datetime

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

FileTypeChoices = [(0, 'OTHER'), (1, 'PATIENT'), (2, 'CONSULTATION'), (3, 'SAMPLE_MANAGEMENT'), (4, 'CLAIM'), (5, 'DISCHARGE_SUMMARY'), (6, 'COMMUNICATION'), (7, 'CONSENT_RECORD'), (8, 'ABDM_HEALTH_INFORMATION')]
FileCategoryChoices = [('UNSPECIFIED', 'UNSPECIFIED'), ('XRAY', 'XRAY'), ('AUDIO', 'AUDIO'), ('IDENTITY_PROOF', 'IDENTITY_PROOF')]
save(*args, **kwargs)
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

archived_by_id
associating_id

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

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.

file_category

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

get_file_category_display(*, field=<django.db.models.fields.CharField: file_category>)
get_file_type_display(*, field=<django.db.models.fields.IntegerField: file_type>)
id

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

internal_name

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.

name

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

upload_completed

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

uploaded_by_id