Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed demographics model, migration #322

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions elcid/migrations/0010_auto_20171211_1321.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('elcid', '0009_auto_20171107_2248'),
]

operations = [
migrations.AlterField(
model_name='demographics',
name='date_of_birth',
field=models.DateField(null=True, verbose_name=b'Date of Birth', blank=True),
),
migrations.AlterField(
model_name='demographics',
name='date_of_death',
field=models.DateField(null=True, verbose_name=b'Date of Death', blank=True),
),
migrations.AlterField(
model_name='demographics',
name='death_indicator',
field=models.BooleanField(default=False, help_text=b'This field will be True if the patient is deceased.'),
),
migrations.AlterField(
model_name='demographics',
name='gp_practice_code',
field=models.CharField(max_length=20, null=True, verbose_name=b'GP Practice Code', blank=True),
),
migrations.AlterField(
model_name='demographics',
name='hospital_number',
field=models.CharField(help_text=b'The unique identifier for this patient at the hospital.', max_length=255, blank=True),
),
migrations.AlterField(
model_name='demographics',
name='nhs_number',
field=models.CharField(max_length=255, null=True, verbose_name=b'NHS Number', blank=True),
),
]
23 changes: 1 addition & 22 deletions elcid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,10 @@ def get_for_lookup_list(model, values):
)


class Demographics(PatientSubrecord, ExternallySourcedModel):
class Demographics(omodels.Demographics, ExternallySourcedModel):
_is_singleton = True
_icon = 'fa fa-user'

hospital_number = models.CharField(max_length=255, blank=True)
nhs_number = models.CharField(max_length=255, blank=True, null=True)

surname = models.CharField(max_length=255, blank=True)
first_name = models.CharField(max_length=255, blank=True)
middle_name = models.CharField(max_length=255, blank=True, null=True)
title = ForeignKeyOrFreeText(omodels.Title)
date_of_birth = models.DateField(null=True, blank=True)
marital_status = ForeignKeyOrFreeText(omodels.MaritalStatus)
religion = models.CharField(max_length=255, blank=True, null=True)
date_of_death = models.DateField(null=True, blank=True)
post_code = models.CharField(max_length=20, blank=True, null=True)
gp_practice_code = models.CharField(max_length=20, blank=True, null=True)
birth_place = ForeignKeyOrFreeText(omodels.Destination)
ethnicity = ForeignKeyOrFreeText(omodels.Ethnicity)
death_indicator = models.BooleanField(default=False)

# not strictly correct, but it will be updated when opal core models
# are updated
sex = ForeignKeyOrFreeText(omodels.Gender)

def set_death_indicator(self, value, *args, **kwargs):
if not value:
return
Expand Down