Skip to content

Commit

Permalink
merges in the TB fixes branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Aug 15, 2018
2 parents 2e3a7da + ee918dc commit f4f1c72
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 5 deletions.
20 changes: 20 additions & 0 deletions apps/tb/data/lookuplists/tbcasemanager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"tbcasemanager": [
{
"synonyms": [],
"name": "Justinea Mungai"
},
{
"synonyms": [],
"name": "Angelita Solomalai"
},
{
"synonyms": [],
"name": "Jacqueline Barrett"
},
{
"synonyms": [],
"name": "Clare Campbell"
}
]
}
83 changes: 83 additions & 0 deletions apps/tb/migrations/0029_auto_20180815_1338.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-08-15 12:38
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import opal.models


class Migration(migrations.Migration):

dependencies = [
('opal', '0034_auto_20171214_1845'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tb', '0028_pregnancy'),
]

operations = [
migrations.CreateModel(
name='TBCaseManager',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True)),
],
options={
'ordering': ['name'],
'abstract': False,
},
),
migrations.CreateModel(
name='TBManagement',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(blank=True, null=True)),
('updated', models.DateTimeField(blank=True, null=True)),
('consistency_token', models.CharField(max_length=8)),
('ltbr_number', models.CharField(blank=True, max_length=200, null=True)),
('case_manager_ft', models.CharField(blank=True, default=b'', max_length=255, null=True)),
('case_manager_fk', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='tb.TBCaseManager')),
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_tb_tbmanagement_subrecords', to=settings.AUTH_USER_MODEL)),
('episode', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='opal.Episode')),
('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='updated_tb_tbmanagement_subrecords', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
bases=(opal.models.UpdatesFromDictMixin, opal.models.ToDictMixin, models.Model),
),
migrations.AlterModelOptions(
name='bcg',
options={'verbose_name': 'BCG'},
),
migrations.AlterModelOptions(
name='contactdetails',
options={'verbose_name': 'Contact Details', 'verbose_name_plural': 'Contact Details'},
),
migrations.AlterModelOptions(
name='nextofkin',
options={'verbose_name': 'Next Of Kin', 'verbose_name_plural': 'Next Of Kin'},
),
migrations.AlterModelOptions(
name='patientconsultation',
options={'verbose_name': 'Patient Consultation'},
),
migrations.AlterModelOptions(
name='socialhistory',
options={'verbose_name': 'Social History', 'verbose_name_plural': 'Social Histories'},
),
migrations.AlterModelOptions(
name='tbhistory',
options={'verbose_name': 'History of TB', 'verbose_name_plural': 'History of TB'},
),
migrations.AlterModelOptions(
name='travel',
options={'verbose_name': 'Travel History', 'verbose_name_plural': 'Travel Histories'},
),
migrations.AlterField(
model_name='employment',
name='financial_status',
field=models.CharField(blank=True, choices=[(b'Nil income', b'Nil income'), (b'On benefits', b'On benefits'), (b'Other(SS/NASS)', b'Other(SS/NASS)'), (b'Employed', b'Employed')], max_length=256),
),
]
16 changes: 16 additions & 0 deletions apps/tb/migrations/0031_merge_20180815_2323.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-08-15 22:23
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('tb', '0030_auto_20180815_2203'),
('tb', '0029_auto_20180815_1338'),
]

operations = [
]
16 changes: 16 additions & 0 deletions apps/tb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,22 @@ class TBMeta(models.EpisodeSubrecord):
directly_observed_therapy = fields.BooleanField(default=False)


class TBCaseManager(lookuplists.LookupList):
pass


class TBManagement(models.EpisodeSubrecord):
_is_singleton = True

class Meta:
verbose_name = "TB Management"

case_manager = ForeignKeyOrFreeText(TBCaseManager)
ltbr_number = fields.CharField(
max_length=200, blank=True, null=True,
verbose_name="LTBR Number"
)

class TBAppointment(models.PatientSubrecord):
state = fields.CharField(
max_length=256, blank=True, default=""
Expand Down
11 changes: 7 additions & 4 deletions apps/tb/pathways.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ class TBConsultationPathway(pathways.PagePathway):
model=tb_models.ContactDetails,
help_text_template="pathway/steps/help_text/contact_details.html"
),
HelpTextStep(
model=tb_models.NextOfKin,
help_text="This will be pulled in from Cerner"
),
# TODO: Enable this once we are pulling from cerner.
# In the meantime it's less useful to have the placeholder
#
# HelpTextStep(
# model=tb_models.NextOfKin,
# help_text="This will be pulled in from Cerner"
# ),
HelpTextStep(
model=tb_models.CommuninicationConsiderations,
),
Expand Down
3 changes: 2 additions & 1 deletion apps/tb/templates/detail/tb.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<div class="col-md-8">
<div ng-show="episode.stage !== 'New Referral'">
{% record_panel models.ReferralRoute %}
{% record_panel models.TBManagement %}
{% record_panel models.PastMedicalHistory %}
{% record_panel models.CommuninicationConsiderations %}
{% record_panel models.Nationality %}
Expand Down Expand Up @@ -113,7 +114,7 @@ <h3>
</h3>
</div>
<div class="panel-body">
<a target="_blank" href="http://freenet/carestream/?pid=[[ episode.demographics[0].hospital_number ]]">PACs</a>
<a target="_blank" href="http://freenet/carestream/?pid=[[ episode.demographics[0].hospital_number ]]">PACS</a>
</div>
</div>
{% record_panel models.TBAppointment editable=0 %}
Expand Down
3 changes: 3 additions & 0 deletions apps/tb/templates/forms/tb_management_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% load forms %}
{% input field="TBManagement.ltbr_number" %}
{% input field="TBManagement.case_manager" %}
8 changes: 8 additions & 0 deletions apps/tb/templates/records/tb_management.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<span ng-show="item.ltbr_number">
[[ item.ltbr_number ]]
<br />
</span>
<span ng-show="item.case_manager">
[[ item.case_manager ]]
<br />
</span>
1 change: 1 addition & 0 deletions elcid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ class ReferralRoute(omodels.EpisodeSubrecord):
("Find & treat", "Find & treat",),
("Prison screening", "Prison screening",),
("Port Health/HPA", "Port Health/HPA",),
("Private", "Private")
)

REFERRAL_REASON = (
Expand Down

0 comments on commit f4f1c72

Please sign in to comment.