Skip to content

Commit 505c02d

Browse files
committed
Merge branch 'v0.5.4'
2 parents 8101edb + 5e01bad commit 505c02d

7 files changed

+20
-27
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.4 Release
2+
We change how we handle tags, we no longer delete them, we just archive them
3+
4+
15
## 0.5.3 Release
26

37
#### Wardrounds update

elcid/models.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,13 @@ def set_reason_for_interaction(self, incoming_value, user, data):
303303
else:
304304
episode = Episode.objects.get(pk=data["episode_id"])
305305

306-
exists = Tagging.objects.filter(
306+
existing = Tagging.objects.filter(
307307
episode=episode, team__name=MICROHAEM_TEAM_NAME
308308
)
309-
exists = exists.exists()
310-
if not exists:
309+
310+
if existing.exists():
311+
existing.update(archived=False)
312+
else:
311313
Tagging.objects.create(
312314
episode=episode,
313315
team=Team.objects.get(name=MICROHAEM_TEAM_NAME)

elcid/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
EMAIL_HOST = 'localhost'
260260

261261

262-
VERSION_NUMBER = '0.5.3'
262+
VERSION_NUMBER = '0.5.4'
263263
#TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
264264
#TEST_RUNNER = 'django_test_coverage.runner.CoverageTestSuiteRunner'
265265

elcid/test/test_views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ def test_add_microbiology_input(self):
184184
self.assertEqual(len(tags), 0)
185185
self.post_json(self.url, self.args)
186186
updated_tags = self.episode.get_tag_names(self.user)
187-
self.assertEqual(updated_tags, [constants.MICROHAEM_TEAM_NAME])
187+
self.assertEqual(list(updated_tags), [constants.MICROHAEM_TEAM_NAME])
188188
self.post_json(self.url, self.args)
189189

190190
# make sure tags don't get applied twice if run twice
191191
updated_tags = self.episode.get_tag_names(self.user)
192-
self.assertEqual(updated_tags, [constants.MICROHAEM_TEAM_NAME])
192+
self.assertEqual(list(updated_tags), [constants.MICROHAEM_TEAM_NAME])

elcid/wardrounds.py

+6-19
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,8 @@ def episodes(self):
4141
episodes = Episode.objects.filter(
4242
category__in=['inpatient', 'Walkin'],
4343
discharge_date__gte=two_weeks_ago)
44-
4544
if team:
46-
result = []
47-
48-
history_tags_for_episodes = Tagging.historic_tags_for_episodes(
49-
episodes
50-
)
51-
52-
for episode_id, tag_dict in history_tags_for_episodes.iteritems():
53-
if team in tag_dict:
54-
result.append(episode_id)
55-
56-
existing_episode_ids_with_tags = Tagging.objects.filter(
57-
team__name=team, episode__in=episodes
58-
).values_list("episode_id", flat=True)
59-
60-
result.extend(existing_episode_ids_with_tags)
61-
62-
return Episode.objects.filter(id__in=result)
45+
return episodes.filter(tagging__team__name=team)
6346
else:
6447
return episodes
6548

@@ -106,4 +89,8 @@ class OPATCurrentList(WardRound):
10689
description = 'All patients on the OPAT current list'
10790

10891
def episodes(self):
109-
return Episode.objects.filter(active=True, tagging__team__name='opat_current')
92+
return Episode.objects.filter(
93+
active=True,
94+
tagging__team__name='opat_current',
95+
tagging__archived=False
96+
)

etc/gunicorn.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; =====================
44

55
[program:gunicorn]
6-
command=/home/ohc/.virtualenvs/elcid053/bin/gunicorn elcid.wsgi -c %(here)s/gunicorn_conf.py
6+
command=/home/ohc/.virtualenvs/elcid054/bin/gunicorn elcid.wsgi -c %(here)s/gunicorn_conf.py
77
directory=%(here)s/../
88
;user=nobody
99
numprocs=1

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ django-celery==3.1.17
2020

2121
django-compressor==1.5
2222

23-
-e git+https://github.com/openhealthcare/[email protected].4#egg=opal
23+
-e git+https://github.com/openhealthcare/[email protected].5#egg=opal
2424

2525
-e git+https://github.com/openhealthcare/[email protected]#egg=opal_observations
2626
-e git+https://github.com/openhealthcare/[email protected]#egg=opal_walk_in

0 commit comments

Comments
 (0)