-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This lays down the groundwork for invite APIs
- Loading branch information
1 parent
f2f5a76
commit 686bbf0
Showing
16 changed files
with
879 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from django.contrib import admin | ||
|
||
from mycarehub.common.admin import BaseAdmin | ||
|
||
from .models import ( | ||
Client, | ||
ClientFacility, | ||
Identifier, | ||
RelatedPerson, | ||
SecurityQuestion, | ||
SecurityQuestionResponse, | ||
) | ||
|
||
|
||
@admin.register(Identifier) | ||
class IdentifierAdmin(BaseAdmin): | ||
pass | ||
|
||
|
||
@admin.register(SecurityQuestion) | ||
class SecurityQuestionAdmin(BaseAdmin): | ||
pass | ||
|
||
|
||
@admin.register(SecurityQuestionResponse) | ||
class SecurityQuestionResponseAdmin(BaseAdmin): | ||
pass | ||
|
||
|
||
@admin.register(RelatedPerson) | ||
class RelatedPersonAdmin(BaseAdmin): | ||
pass | ||
|
||
|
||
@admin.register(Client) | ||
class ClientAdmin(BaseAdmin): | ||
pass | ||
|
||
|
||
@admin.register(ClientFacility) | ||
class ClientFacilityAdmin(BaseAdmin): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ClientsConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "mycarehub.clients" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
# Generated by Django 3.2.9 on 2021-11-08 17:23 | ||
|
||
from django.conf import settings | ||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import mycarehub.common.models.base_models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('common', '0003_auto_20211108_2023'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Client', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(default=django.utils.timezone.now)), | ||
('created_by', models.UUIDField(blank=True, null=True)), | ||
('updated', models.DateTimeField(default=django.utils.timezone.now)), | ||
('updated_by', models.UUIDField(blank=True, null=True)), | ||
('client_type', models.CharField(choices=[('PMTCT', 'PMTCT'), ('OTZ', 'OTZ'), ('OTZ_PLUS', 'OTZ Plus'), ('HVL', 'HVL'), ('OVC', 'OVC'), ('DREAMS', 'DREAMS'), ('HIGH_RISK', 'High Risk Clients'), ('SPOUSES', 'SPOUSES'), ('YOUTH', 'Youth')], max_length=64)), | ||
('enrollment_date', models.DateTimeField(auto_now_add=True)), | ||
('fhir_patient_id', models.TextField(blank=True, null=True, unique=True)), | ||
('emr_health_record_id', models.TextField(blank=True, null=True, unique=True)), | ||
('treatment_buddy', models.TextField(blank=True)), | ||
('counselled', models.BooleanField(default=False)), | ||
('languages', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('en', 'English'), ('sw', 'Swahili')], max_length=150, null=True), blank=True, null=True, size=None)), | ||
('addresses', models.ManyToManyField(related_name='client_addresses', to='common.Address')), | ||
('chv', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='client_chvs', to=settings.AUTH_USER_MODEL)), | ||
('contacts', models.ManyToManyField(related_name='client_contacts', to='common.Contact')), | ||
('current_facility', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='common.facility')), | ||
], | ||
options={ | ||
'ordering': ('-updated', '-created'), | ||
'abstract': False, | ||
}, | ||
managers=[ | ||
('objects', mycarehub.common.models.base_models.AbstractBaseManager()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='SecurityQuestion', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(default=django.utils.timezone.now)), | ||
('created_by', models.UUIDField(blank=True, null=True)), | ||
('updated', models.DateTimeField(default=django.utils.timezone.now)), | ||
('updated_by', models.UUIDField(blank=True, null=True)), | ||
('stem', models.TextField()), | ||
('description', models.TextField()), | ||
('sequence', models.IntegerField(default=0)), | ||
('response_type', models.CharField(choices=[('TEXT', 'Text Response'), ('DATE', 'Date Response'), ('NUMBER', 'Number Response'), ('BOOLEAN', 'Boolean Response')], max_length=32)), | ||
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clients_securityquestion_related', to='common.organisation')), | ||
], | ||
options={ | ||
'ordering': ('-updated', '-created'), | ||
'abstract': False, | ||
}, | ||
managers=[ | ||
('objects', mycarehub.common.models.base_models.AbstractBaseManager()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='RelatedPerson', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(default=django.utils.timezone.now)), | ||
('created_by', models.UUIDField(blank=True, null=True)), | ||
('updated', models.DateTimeField(default=django.utils.timezone.now)), | ||
('updated_by', models.UUIDField(blank=True, null=True)), | ||
('first_name', models.TextField()), | ||
('last_name', models.TextField()), | ||
('other_name', models.TextField()), | ||
('date_of_birth', models.DateField(blank=True, null=True)), | ||
('gender', models.CharField(choices=[('MALE', 'Male'), ('FEMALE', 'Female')], max_length=16)), | ||
('relationship_type', models.CharField(choices=[('SPOUSE', 'Spouse'), ('NEXT_OF_KIN', 'Next of kin'), ('CHILD', 'Child'), ('PARENT', 'Parent'), ('SIBLING', 'Sibling'), ('NEIGHBOUR', 'Neighbour'), ('OTHER', 'Other')], max_length=64)), | ||
('addresses', models.ManyToManyField(related_name='related_person_addresses', to='common.Address')), | ||
('contacts', models.ManyToManyField(related_name='related_person_contacts', to='common.Contact')), | ||
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clients_relatedperson_related', to='common.organisation')), | ||
], | ||
options={ | ||
'ordering': ('-updated', '-created'), | ||
'abstract': False, | ||
}, | ||
managers=[ | ||
('objects', mycarehub.common.models.base_models.AbstractBaseManager()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Identifier', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(default=django.utils.timezone.now)), | ||
('created_by', models.UUIDField(blank=True, null=True)), | ||
('updated', models.DateTimeField(default=django.utils.timezone.now)), | ||
('updated_by', models.UUIDField(blank=True, null=True)), | ||
('identifier_type', models.CharField(choices=[('CCC', 'Comprehensive Care Clinic Number'), ('NATIONAL_ID', 'National ID Document'), ('BIRTH_CERTIFICATE', 'Birth Certificate'), ('PASSPORT', 'Passport'), ('UNIQUE', 'Unique Identifier')], max_length=64)), | ||
('identifier_value', models.TextField()), | ||
('identifier_use', models.CharField(choices=[('OFFICIAL', 'Official Identifier'), ('TEMPORARY', 'Temporary Identifier'), ('OLD', 'Old (retired) Identifier')], max_length=64)), | ||
('description', models.TextField()), | ||
('valid_from', models.DateTimeField(auto_now_add=True)), | ||
('valid_to', models.DateTimeField(blank=True, null=True)), | ||
('is_primary_identifier', models.BooleanField(default=False)), | ||
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clients_identifier_related', to='common.organisation')), | ||
], | ||
options={ | ||
'ordering': ('-updated', '-created'), | ||
'abstract': False, | ||
}, | ||
managers=[ | ||
('objects', mycarehub.common.models.base_models.AbstractBaseManager()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='ClientFacility', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(default=django.utils.timezone.now)), | ||
('created_by', models.UUIDField(blank=True, null=True)), | ||
('updated', models.DateTimeField(default=django.utils.timezone.now)), | ||
('updated_by', models.UUIDField(blank=True, null=True)), | ||
('assigned', models.DateTimeField()), | ||
('transferred_out', models.DateTimeField(blank=True, null=True)), | ||
('client', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='clients.client')), | ||
('facility', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='common.facility')), | ||
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clients_clientfacility_related', to='common.organisation')), | ||
], | ||
options={ | ||
'ordering': ('-updated', '-created'), | ||
'abstract': False, | ||
}, | ||
managers=[ | ||
('objects', mycarehub.common.models.base_models.AbstractBaseManager()), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='client', | ||
name='identifiers', | ||
field=models.ManyToManyField(related_name='client_identifiers', to='clients.Identifier'), | ||
), | ||
migrations.AddField( | ||
model_name='client', | ||
name='organisation', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clients_client_related', to='common.organisation'), | ||
), | ||
migrations.AddField( | ||
model_name='client', | ||
name='related_persons', | ||
field=models.ManyToManyField(related_name='client_related_persons', to='clients.RelatedPerson'), | ||
), | ||
migrations.AddField( | ||
model_name='client', | ||
name='user', | ||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.CreateModel( | ||
name='SecurityQuestionResponse', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(default=django.utils.timezone.now)), | ||
('created_by', models.UUIDField(blank=True, null=True)), | ||
('updated', models.DateTimeField(default=django.utils.timezone.now)), | ||
('updated_by', models.UUIDField(blank=True, null=True)), | ||
('timestamp', models.DateTimeField(auto_now_add=True)), | ||
('response', models.TextField()), | ||
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='clients_securityquestionresponse_related', to='common.organisation')), | ||
('question', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='clients.securityquestion')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'unique_together': {('user', 'question')}, | ||
}, | ||
managers=[ | ||
('objects', mycarehub.common.models.base_models.AbstractBaseManager()), | ||
], | ||
), | ||
] |
Empty file.
Oops, something went wrong.