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

Cerner merge test deployment #1496

Merged
merged 390 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
390 commits
Select commit Hold shift + click to select a range
5655b8d
Fixup pro tip: Don't access variables that are created on the followi…
davidmiller Feb 21, 2023
07b6b8f
Fixup: append not assign
davidmiller Feb 21, 2023
82753f9
Fixes update_demographics.parse_merge_comments to assign the correct …
Feb 22, 2023
c3a10e7
Fixes unit tests for update_demographics.parse_merge_comments
Feb 22, 2023
f634f74
Merge pull request #1414 from openhealthcare/recursion-adjustments2
davidmiller Feb 22, 2023
d60eb03
Merge pull request #1361 from openhealthcare/merge-get-or-create-patient
davidmiller Feb 22, 2023
1765ec6
Merge pull request #1374 from openhealthcare/merge-icu-handover
davidmiller Feb 23, 2023
ef65444
Merge pull request #1401 from openhealthcare/contact-tracing-preview-…
davidmiller Feb 23, 2023
36c120b
Merges v0.107.1 into the cerner-merge-branch
Feb 23, 2023
5c09a56
Sideroom status: initial models
davidmiller Feb 23, 2023
c9cb314
Merge branch 'v0.107.1' of github.com:openhealthcare/elcid-rfh into c…
davidmiller Feb 23, 2023
6d224d6
Sideroom list to show extra fields, new contact tracing screen
davidmiller Feb 23, 2023
091bda7
Merge branch 'contact-tracing-preview' of github.com:openhealthcare/e…
davidmiller Feb 23, 2023
530dd5d
Previous MRN is not a useful front end field
davidmiller Feb 28, 2023
a00e849
Link to sideroom list if on a sideroom, change note name
davidmiller Mar 3, 2023
1b85773
Merge branch 'v0.107.1' into cerner-merge-branch-merge
Mar 6, 2023
5efcb62
Merges in 107.1
davidmiller Mar 7, 2023
eb56315
Reenables the TB appointment load
Dec 13, 2022
067958d
Disable the clinic day appointment load
Dec 13, 2022
81da15d
Merge transfer-hsitory into cerner-ergebranch
davidmiller Mar 7, 2023
fe1db73
Merge branch 'cerner-merge-branch' of github.com:openhealthcare/elcid…
davidmiller Mar 7, 2023
1710ef7
Merge remote-tracking branch 'origin/135-write-to-epr-initials' into …
davidmiller Mar 7, 2023
03c38e9
Don't show status badge from a CI we don't use
davidmiller Mar 7, 2023
adf982e
Merge branch 'cerner-merge-branch' into cerner-merge-branch-merge
Mar 7, 2023
00a42a7
Merge pull request #1415 from openhealthcare/cerner-merge-branch-merge
fredkingham Mar 7, 2023
4698265
IPC fixups:
davidmiller Mar 8, 2023
64230de
Changes the update demographics get_active_mrn_and_merged_mrn_data to…
Mar 10, 2023
0a99480
Adds an inital pass of merge_all_patients command
Mar 10, 2023
b54bd74
Allow for merge comments being null or empty in update_demogrpahics
Mar 10, 2023
ccc1697
Passes the cache in to the merge patient functionality
Mar 10, 2023
12c7c98
Allows for there not to be a row for an mrn when looking at merges up…
Mar 10, 2023
784cf84
Bug fixes update demographics so we don't always do the upstream quer…
Mar 10, 2023
b22a8dd
Bug fix to the merge all patients script
Mar 10, 2023
27dc75f
Changes transfer history/encounter batch loads
Mar 10, 2023
58df15a
Changes batch_load2 to user merged MRN lookups
Mar 10, 2023
1fc50ba
Changes ipc.loader.load_all_extra_ipc_patients to look at merged mrns
Dec 9, 2022
9a85d0f
Changes the IPC episode loader to work with merged MRNs
Dec 9, 2022
3ce2221
Renames get_patients_from_mrns to find_patients_from_mrns
Dec 12, 2022
610e695
Removes the unused "updated" variable in the ipc status loader
Jan 10, 2023
ad5cf4b
Makes the load_ipc_status mgmt command load all patients
Jan 10, 2023
536f551
Adds a comment to the load ipc bed status command
Jan 10, 2023
4527f5c
Removes ipc.loader as its not used.
Mar 7, 2023
ab1e657
Changes the IPC Status load to create patients
Mar 9, 2023
85a877f
Formalises the cache
Mar 13, 2023
5da59ae
Adds check_and_handle_upstream_merges_for_mrns
Mar 13, 2023
efa697d
Updates merge_all_patients to use check_and_handle_upstream_merges_fo…
Mar 13, 2023
ec2aced
Adds the merge_all_patients_since mgmt command
Mar 13, 2023
d1edffe
Converts merge_all_patients_since to use spaces not tabs
Mar 13, 2023
701c7e3
Renames merges_all_patients_since to merges_patients_since
Mar 13, 2023
7d93671
Adds facts for the merge_patients_since cmd
Mar 13, 2023
8d46537
change merge_patients_since not to reraise
Mar 15, 2023
daa3577
Makes the error messages include the MRN in create_rfh_patient_from_h…
Mar 16, 2023
3cd3657
Adds in a unit test to check an error in the intrahospital_api.loader
Mar 16, 2023
276bf1a
Fixes/improves comments in the update_demographics.py
Mar 17, 2023
9826a46
Changes the appointment fields so that they are all lower case
Mar 17, 2023
7d942a6
Makes the bed status loader not create patients with empty MRNs
Mar 16, 2023
8487baf
Changes elcid utils to handle None as an MRN
Mar 16, 2023
9a0012a
Moves opal-observations into the elcid package
Mar 10, 2023
e169277
Moves obs into plugins.obs
Mar 10, 2023
dd7899b
Removes the unused obs.admin file
Mar 10, 2023
b809328
Make the Observation model inherit from PreviousMRN
Mar 10, 2023
21e012e
Fixes unit tests in the obs plugin
Mar 13, 2023
445eea3
Makes the error for multiple active mrns clearer
Mar 12, 2023
0b78793
Fixes the unit tests for update demographics
Mar 13, 2023
f44270d
Changes a print statement to a logger statement
Mar 27, 2023
e1d4ab5
Adds unit tests for creating/merged transfer histories
Mar 27, 2023
b848272
Fixes a typo in the admissions loader test
Mar 27, 2023
6cc2ef2
White space fix in the admissions.loader
Mar 27, 2023
7a8ecc5
Moves the one of merge all patient db logic into the mgmt command
Mar 27, 2023
9466ecc
Changes merge all patients so that it does not load the patient.
Mar 27, 2023
7d2ff68
Renames cache to mrn_to_upstream_merge_data in update_demographics
Mar 27, 2023
e81199d
Merge pull request #1426 from openhealthcare/merge-lab-tests
davidmiller Mar 28, 2023
8bcc726
Renames the cache variable in the loader to mrn_to_upstream_merge_data
Mar 28, 2023
da56c44
Replaces cache in update demographics tests with mrn_to_upstream_merg…
Mar 28, 2023
07c4692
Makes us not raise an error is a merged MRN in the upstream result
Mar 28, 2023
52874d8
Fixes bug in merge_all_patients
Apr 4, 2023
fef84ee
Merge remote-tracking branch 'origin/v0.108' into contact-tracing-pre…
davidmiller Apr 11, 2023
a9725ab
Show Sex on Siderooms
davidmiller Apr 11, 2023
fd8d245
show newlines for actions
davidmiller Apr 11, 2023
540de0c
Merge pull request #1444 from openhealthcare/v0.108
fredkingham Apr 11, 2023
b602de6
Merge remote-tracking branch 'origin/cerner-merge-branch' into contac…
davidmiller Apr 11, 2023
89cf76c
Make sure the tb patient load handles merged MRNs
Apr 11, 2023
08d896d
Creates Nationality.birth_place and copies the data from Demographics…
Apr 11, 2023
2e40bc7
Changes the front end to populate TB.birth_place to be
Apr 11, 2023
12b97c8
Makes covid create_followup_episodes work with merged mrns
Apr 11, 2023
415d5b7
Changes the covid loader to work with MergedMRNs
Apr 11, 2023
726bca2
Fixes the bed status loader so bed status.patient can be None
Apr 12, 2023
5977d35
Merge all patients should not bulk create at the end
Apr 12, 2023
6e3a3a9
Merge pull request #1449 from openhealthcare/fix-bed-status
davidmiller Apr 12, 2023
67114ac
Merge pull request #1445 from openhealthcare/merge-tb-patient-load
davidmiller Apr 12, 2023
4d4c48d
Merge pull request #1447 from openhealthcare/merge-patient-covid-loader
davidmiller Apr 12, 2023
523f734
Remove the mrn to patient cache in merge all patients
Apr 12, 2023
8e77d0a
Stops a naming conflict in merge_all_patients
Apr 12, 2023
b188970
Allow reverse code for copying over birth place
Apr 13, 2023
fde9381
Remove the rfh_patient from create_rfh_patient_from_hospital_number
Apr 13, 2023
fc9d80c
Merge pull request #1446 from openhealthcare/tb-birth-place
davidmiller Apr 13, 2023
3b094b4
Merge pull request #1451 from openhealthcare/remove-get-or-create-rfh…
davidmiller Apr 13, 2023
92d7f0c
Renames a variable in admissions loader
Apr 13, 2023
ef4c388
Merge branch 'cerner-merge-branch' into merge-encounters-and-transfer…
Apr 13, 2023
a4a3f47
Removes upstream transfer history rows with invalid MRNs
Apr 13, 2023
18639a0
Remove upstream encounter rows with invalid MRNs
Apr 13, 2023
d8956e0
Fixes a variable name in the admissions tests
Apr 13, 2023
3461375
Merge branch 'cerner-merge-branch' into merge-encounters-and-transfer…
Apr 13, 2023
9c4853b
Fixes a bug where our_merge_datetime was not set.
Apr 17, 2023
e33c2c8
Renames 'load_demographics' to 'search_upstream_demographics'
Apr 17, 2023
73cbaa3
Look up the merged MRN in search_upstream_demographics
Apr 17, 2023
2b88a87
Removes run_async=False from the admissions loader
Apr 18, 2023
87a5229
Adds a check management command to make sure our merging is working
Mar 13, 2023
69b7759
Changes admissions.loader as we don't need to strip MRNs
Apr 20, 2023
1797b4a
Changes update_demographics merge messages to be warn not error
Apr 20, 2023
8452f91
Removes an unused import in elcid.utils
Apr 20, 2023
63722c3
Merge pull request #1436 from openhealthcare/explicit-error-messages
davidmiller Apr 21, 2023
75e7563
If a patient id is passed to a celery task that does not exist, do no…
Apr 21, 2023
1529fa0
Removes an unused import statements in merge_patient
Apr 23, 2023
6fbeef7
Mocks load_patient in a unit test to stop excessive logging
Apr 23, 2023
d2dd853
Makes merge_patient log patients.to_dict
Apr 23, 2023
4a6e5d9
Merge pull request #1457 from openhealthcare/down-grade-merge-problem…
davidmiller Apr 24, 2023
8eba5ca
Merge pull request #1461 from openhealthcare/async_celery_load_patien…
davidmiller Apr 24, 2023
3ed923d
Simplifies the check merged patients command.
Apr 24, 2023
f2823ff
Merge pull request #1458 from openhealthcare/remove-unused-import
davidmiller Apr 24, 2023
db2343b
Changes the check_merge command to explicitly ignore flawed rows
Apr 24, 2023
b0a4d09
Improves comments on chech_merged_patients
Apr 24, 2023
da6fb42
Send a descriptive email rather than logger.error
Apr 24, 2023
2c6fd16
Allow the patient-api directive to pass in a patient id if it doesn't…
davidmiller Apr 25, 2023
e4b0d80
Add .text-strong to elcid css
davidmiller Apr 25, 2023
f548224
Handle flawed active MRNs in the check_merged_patients cmd
Apr 25, 2023
dca87b0
Update display of TB MDT and TB Detail pages to use new TB results
davidmiller Apr 26, 2023
7550760
Fixup: Don't double iterate PCR tests
davidmiller Apr 26, 2023
bddad33
Flag PCRs too
davidmiller Apr 26, 2023
c2c2573
Add current location to MDT
davidmiller Apr 26, 2023
1fd0672
Merge pull request #1452 from openhealthcare/our_merge_datetime_fix
davidmiller Apr 27, 2023
0934b2a
Changes merge patient to log to a seperate file
Apr 27, 2023
57c276a
Merge pull request #1464 from openhealthcare/v0.108
fredkingham Apr 27, 2023
3b08ce7
Fixes the previous MRN message at the bottom of modals
Apr 27, 2023
a6c7b6d
Fixes created/updated/previous MRN modal footer for formItem
Apr 27, 2023
13287b5
Adds another active MRN to ignore in check_merged_patients
Apr 27, 2023
001e7a0
Improves comments in check_merged_patients
Apr 28, 2023
6368941
Adds in a merge_dup_episode_categories mgmt command
Apr 28, 2023
013597a
Changes merge all patients use transactions and batch create
Apr 17, 2023
c8accfc
Adds the merge patients since cron job to sync_demogrpahics
Apr 19, 2023
d432f66
Changes the merge all patients cron job to run every 6 hours
Apr 20, 2023
bcd392b
Updates the doc strings on unit tests in test_update_demographics
Apr 20, 2023
871a196
Adds additional checks in update_demographics tests
Apr 20, 2023
ebf03de
Fixes a bug in merge_patient not reloading patients
Apr 20, 2023
68779f2
Removes transaction.atomic from merge_all_patients
Apr 25, 2023
7ea3f11
Fixes a comment in merge_all_patients
Apr 25, 2023
c26f277
Changes the admissions loader to be clearer about MRN cleaning
Apr 23, 2023
7f437c7
Removes settings.ADD_PATIENT_LAB_TESTS as this is False
Apr 28, 2023
3d56c36
Changes add patient pathway to use the new create patient API
Apr 28, 2023
0c34188
Changes BloodCultureIsolate.update_from_dict
May 9, 2023
f158207
Removes TrackedModel from BloodCultureIsolate
May 10, 2023
886e434
Updates the BloodCulturePanelCtrl and BloodCultureIsolate
May 9, 2023
542c1fa
Updates BloodCultureIsolateApi.destroy
May 10, 2023
cc92b3a
Merge pull request #1465 from openhealthcare/previous-mrn-modal-fix-1
davidmiller May 11, 2023
657e5ad
Merge pull request #1425 from openhealthcare/merge-encounters-and-tra…
davidmiller May 11, 2023
6893e10
Changes merge_patient to log the old patient.to_json to seperate file
Apr 28, 2023
173ceb5
Merge pull request #1462 from openhealthcare/log-before-and-after-merge
davidmiller May 12, 2023
b1ef0fe
Allow ScrollTo Ward; exclude known junk wards
davidmiller May 12, 2023
3e14af2
Adds 2 additional checks to check_merged_patients
May 10, 2023
b47accc
Removes a layer of indirection in merge_dup_episode_categories
May 12, 2023
f73aba0
Renames variables in merge_dup_episode_categories
May 12, 2023
a2d53d8
Changes merge_dup_episodes logging
May 12, 2023
f8d139d
Adds a logger for the ipc module
May 12, 2023
644fcd4
Changes load_ipc_status to use the logger module
May 12, 2023
dfa7a67
Removes the RNOH logic from the add patient pathway.
May 15, 2023
cee0a3b
Changes get_or_create_patient to handle CernerPatientNotFoundException
May 15, 2023
93e54a0
Changes the AddPatientPathway as it no longer needs to check for Cern…
May 15, 2023
61760bc
Removes unused imports in elcid/pathways.py
May 15, 2023
2bac115
Moves the check_merged_patient into monitoring
May 12, 2023
994d504
Refactors check_and_handle_upstream_merges_for_mrns
May 15, 2023
c48d0c3
Merge branch 'cerner-merge-branch' into merge-all-patients-1
May 16, 2023
606b64a
Fixes unit tests in update_demographics
May 16, 2023
471c7d9
Adds another unit test to CheckAndHandleUpstreamMergesForMRNsTestCase
May 16, 2023
aac8808
Simplifies units tests for update_demographics
May 16, 2023
caa8f54
Changes check_and_handle_upstream_merges_for_mrns to send emails
May 16, 2023
1461f58
Update check_merged_patients.py
davidmiller May 17, 2023
7671554
Merge branch 'v0.108' into cerner-merge-branch
May 17, 2023
67072c8
Merge branch 'v0.108' into cerner-merge-branch
May 17, 2023
2bbfc5b
Merge branch 'cerner-merge-branch' into merge-all-patients-1
May 17, 2023
a486f5b
Changes update_demographics to use utils.send_email
May 17, 2023
e5e6970
Moves the too many mergedMRNs email and tweaks it in update_demographics
May 17, 2023
a952d1f
Merge branch 'merge-all-patients-1' into cerner-merge-test-deployment
May 17, 2023
b4429fe
Changes merge_patients_since to email if processing a lot of MRNs
May 17, 2023
ffef5e9
Moves test_merge_patients_since into intrahospital_api
May 17, 2023
8f14059
Merge pull request #1466 from openhealthcare/merge-dup-episode-catego…
davidmiller May 18, 2023
39c0c41
Fixup: Cerner is a noun
davidmiller May 18, 2023
fbaa894
Fixup
davidmiller May 18, 2023
641576d
Fixup: Capitalization
davidmiller May 18, 2023
3eccb22
Merge pull request #1454 from openhealthcare/new-patient-demographics…
davidmiller May 18, 2023
774afce
Merge branch 'cerner-merge-branch' into chech-merge-patients
May 18, 2023
132efb5
Use utils.send_email in check_merged_patients
May 18, 2023
60652f4
Merge branch 'chech-merge-patients' of github.com:openhealthcare/elci…
May 18, 2023
b0a21b9
Changes UNEXPECTED_VOLUMES_THRESHOLD to 1000
May 18, 2023
cb6d013
Fixes a typo in the alert email subject in merge_patients_since
May 18, 2023
014edc7
Refactors check_and_handle_upstream_merges_for_mrns to remove duplica…
May 18, 2023
9aa5b68
Fixes a unit test in intrahospital_api.test.test_loader
May 18, 2023
58c1b2a
Merge branch 'cerner-merge-branch' into chech-merge-patients
May 18, 2023
7bc51dc
Merge branch 'cerner-merge-branch' into merge-all-patients-1
May 18, 2023
62d6dee
Removes a redundant if statement in update_demographics
May 18, 2023
906fadf
Merge pull request #1428 from openhealthcare/chech-merge-patients
davidmiller May 19, 2023
471b3f4
Refactor check_and_handle_upstream_merges_for_mrns
davidmiller May 19, 2023
606a973
Update update_demographics.py
davidmiller May 19, 2023
925a47a
Fixup:indentation
davidmiller May 19, 2023
0eff5ab
Fixup:Variable name
davidmiller May 19, 2023
5bb511f
Fixup:variable names
davidmiller May 19, 2023
66c6bad
Adds in a comment in the elcid.api.BloodCultureIsolateApi.destroy
May 19, 2023
ff41ee2
Fixup:Variable name
davidmiller May 19, 2023
9d8d2a0
Merge pull request #1471 from openhealthcare/davidmiller-patch-7
fredkingham May 19, 2023
e1861b4
renams mrn_in_elcid to is_mrn_in_elcid
May 22, 2023
d653aca
Changes return values of update_demographics.get_or_create_active_pat…
May 22, 2023
f452199
Renames merge_patient to merge_elcid_data and stops it calling load_p…
May 22, 2023
dc38eb1
No action button for TB MDT
davidmiller May 22, 2023
7363399
Make flags disappear after MDT note
davidmiller May 22, 2023
1290224
Display deceased status on MDT
davidmiller May 22, 2023
5215c4a
Make MDT 7 dys again
davidmiller May 22, 2023
223e340
Fixes a typo in a modal header
May 22, 2023
ba9a40c
Merge branch 'tb-mdt' into cerner-merge-test-deployment
May 22, 2023
5cbc445
Refactors check_and_handle_upstream_merges_for_mrns
May 22, 2023
7d2ef63
Merge branch 'v0.109' into cerner-merge-test-deployment
May 25, 2023
51faace
Merge pull request #1491 from openhealthcare/cerner-merge-branch
davidmiller Jun 1, 2023
f5feadb
Improve Ward nav styles
davidmiller Jun 1, 2023
fc3009e
Allow filtering of the sideroom list by organism, and show counts of sex
davidmiller Jun 1, 2023
ffd2b39
Bugfix: Closed bays should only be displayed on the isolation list fo…
davidmiller Jun 1, 2023
2738df5
Merge latest contact tracing preview
davidmiller Jun 1, 2023
4a12d2c
Highlight what is a sideroom / temp sideroom
davidmiller Jun 1, 2023
f0b5de4
merge upstream contact-tracing-preview
davidmiller Jun 1, 2023
f414668
Remove editable IPC reason for interaction
davidmiller Jun 1, 2023
6da5051
Link to sideroom list from detail page when a closed open bay
davidmiller Jun 1, 2023
2356a5a
Improve display of wards for RFH
davidmiller Jun 1, 2023
7d21a9f
Trial of Per flag lab numbers
davidmiller Jun 1, 2023
41ffc5e
Add lab detail modal and directive to render links into text
davidmiller Jun 2, 2023
70e5d1e
merging IPC branch
davidmiller Jun 2, 2023
d2fde28
Expiry is the other way round
davidmiller Jun 2, 2023
5f2dbb7
Merge branch 'contact-tracing-preview' into cerner-merge-test-deployment
davidmiller Jun 2, 2023
1952fee
Sometimes a patient doesn't have covid, then gets it. we shouldn't be…
davidmiller Jun 2, 2023
962c0e0
Merge branch 'contact-tracing-preview' into cerner-merge-test-deployment
davidmiller Jun 2, 2023
38f7b36
Make sideroom status editable from the sideroom list
davidmiller Jun 2, 2023
20905eb
merging IPC branch
davidmiller Jun 2, 2023
6d359e7
Merge blood culture work"
davidmiller Jun 2, 2023
1847a03
Add covid test links to sideroom list
davidmiller Jun 2, 2023
8825be8
Merge branch 'contact-tracing-preview' into cerner-merge-test-deployment
davidmiller Jun 2, 2023
db7ed73
Remove ward from sideroom list, lighten open bay colors
davidmiller Jun 2, 2023
d01cd3b
merging IPC branch
davidmiller Jun 2, 2023
914748b
Merge bugfix
davidmiller Jun 20, 2023
a651a80
Merge branch 'cerner-merge-test-deployment' into merge-111
davidmiller Sep 10, 2023
fa585e2
Merge pull request #1494 from openhealthcare/merge-111
davidmiller Sep 10, 2023
4f04aa9
Eventual clinical advice does not require reason for interaction
davidmiller Sep 10, 2023
a06bc1c
Make demographic sync match live server
davidmiller Sep 10, 2023
59c0355
Add merge migration
davidmiller Sep 11, 2023
262d7df
Merge remote-tracking branch 'origin/merge-all-patients-1' into cerne…
davidmiller Sep 11, 2023
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ elCID is an electronic Clinical Infection Database.
It is built using the [Opal](https://github.com/openhealthcare/opal) framework.

[![Build
Status](https://travis-ci.org/openhealthcare/elcid-rfh.png)](https://travis-ci.org/openhealthcare/elcid-rfh)
[![Coverage Status](https://coveralls.io/repos/github/openhealthcare/elcid/badge.svg?branch=v0.2.4)](https://coveralls.io/github/openhealthcare/elcid?branch=v0.2.4)

http://elcid.openhealthcare.org.uk
Expand Down
32 changes: 31 additions & 1 deletion elcid/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,17 @@ def list(self, request, *args, **kwargs):
hospital_number=hospital_number
).last()

# If we can't find a patient in demographics
# check to see if it is an inactive MRN that
# has been merged with a different MRN on elcid
if not demographics:
merged_mrn = emodels.MergedMRN.objects.filter(
mrn=hospital_number
).first()
if merged_mrn:
demographics = merged_mrn.patient.demographics()


# the patient is in elcid
if demographics:
return json_response(dict(
Expand All @@ -584,7 +595,7 @@ def list(self, request, *args, **kwargs):
return json_response(dict(status=self.PATIENT_NOT_FOUND))
else:
if settings.USE_UPSTREAM_DEMOGRAPHICS:
demographics = loader.load_demographics(hospital_number)
demographics = loader.search_upstream_demographics(hospital_number)
if demographics:
return json_response(dict(
patient=dict(demographics=[demographics]),
Expand All @@ -605,6 +616,25 @@ def create(self, request):
status_code=status.HTTP_201_CREATED
)

@item_from_pk
def destroy(self, request, item):
"""
Delete a blood culture isolate.
Update the updated* and previous_mrn fields of the parent
blood culture set.
"""
blood_culture_set = item.blood_culture_set

# This uses the set_{field_name} behaviour from update_from_dict.
# We pass in None as the set_{field_name} interface takes in the value
# to set as the first argument but this is unused for the updated* methods.
blood_culture_set.set_updated_by_id(None, request.user)
blood_culture_set.set_updated(None, request.user)
if blood_culture_set.previous_mrn:
blood_culture_set.previous_mrn = None
blood_culture_set.save()
return super().destroy(request, item.id)


class AddToServiceViewSet(LoginRequiredViewset):
basename = 'add_to_service'
Expand Down
90 changes: 83 additions & 7 deletions elcid/assets/css/elcid.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion elcid/assets/css/elcid.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions elcid/assets/css/elcid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ body{
height: calc(100%);
}

.text-strong{
font-weight: bold;
}

.green {
color: $green;
}
Expand Down Expand Up @@ -292,6 +296,17 @@ a.list-group-item {
}
}

.no-touchevents
table td i.edit{
color: $faded;

&:hover{
color: #333;
}

}


.death-banner {
margin-top: -95px;
padding-top: 80px;
Expand Down Expand Up @@ -694,3 +709,60 @@ div.add-isolate:hover{
max-width: 150px;
}
}


.scrollable-table-container {
overflow-y: scroll;
height: 75%;
position: fixed;
width: 100%;
}

.border-bottom-secondary,
.table-bordered th.border-bottom-secondary{
border-bottom: $secondary 2px solid;
}

.table-striped > tbody > tr.table-changed-heading:nth-child(odd) > th,
.table-changed-heading th{
background-color: $blue-light;
border-bottom: $secondary 1px solid;
}

h1 small a{
font-size: 14px;
}

#sideroom-ward-nav {
position: fixed;
padding-top: 12px;
top: 142px;
border-right: 2px solid $secondary;
height: 100%;
}
#sideroom-ward-nav a{
padding-left: 4px;
}
#sideroom-gender-count {
color: $obsidian;
font-size: 0.4em;
}
#sideroom-gender-count div{
margin-right: 12px;
}
#sideroom-gender-count div,
#sideroom-gender-count p{
display: inline-block;
}

table.table.table-striped tr.highlighted-row td{
background: lighten($blue-light, 18%);
}
.max-360 {
max-width: 360px;
}
.known-wards .row{
padding-bottom: 12px;
padding-top: 12px;
border-bottom: solid 1px $obsidian-light;
}
7 changes: 6 additions & 1 deletion elcid/assets/js/elcid/controllers/blood_culture_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ angular.module('opal.controllers').controller('BloodCulturePanelCtrl', function(
var deferred = $q.defer();
$http.get("/api/v0.1/blood_culture_set/" + bcs.id + "/").then(function(result){
var bcs_idx = _.findIndex($scope.patient.blood_culture_set, {id: bcs.id})
// when we update isolates we update the fields the previous_mrn, updated*
// fields on the set.
$scope.patient.blood_culture_set[bcs_idx].isolates = result.data.isolates;
$scope.patient.blood_culture_set[bcs_idx].previous_mrn = result.data.previous_mrn;
$scope.patient.blood_culture_set[bcs_idx].updated = result.data.updated;
$scope.patient.blood_culture_set[bcs_idx].updated_by_id = result.data.updated_by_id;
deferred.resolve();
})

return deferred.promise;
};
});
});
61 changes: 47 additions & 14 deletions elcid/assets/js/elcid/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,53 @@ directives.directive('printPage', function () {


directives.directive('scrollOnClick', function() {
return {
restrict: 'A',
link: function(scope, $elm, attrs) {
var idToScroll = attrs.target;
$elm.on('click', function() {
var $target;
if (idToScroll) {
$target = $(idToScroll);
} else {
$target = $elm;
return {
restrict: 'A',
link: function(scope, $elm, attrs) {
var idToScroll = attrs.target;
var offset = attrs.offset
$elm.on('click', function() {
var $target;
if (idToScroll) {
$target = $(idToScroll);
} else {
$target = $elm;
}
if (offset){
offset = parseInt(offset);
} else {
offset = 100
}
$("html,body").animate({scrollTop: $target.offset().top-offset}, "slow");
return false;
});
}
$("html,body").animate({scrollTop: $target.offset().top-100}, "slow");
return false;
});
}
}
});


directives.directive('labNumberString', function(){
return {
// require: "ngModel",
scope: true,
template: "[[text]]<br/><span ng-repeat=\"lab_number in lab_numbers\"><a class=\"orange-link pointer\" ng-click=\"open_modal('LabDetailModalCtrl', '/templates/lab/lab_detail_modal.html', {'lab_number': lab_number} )\">[[ lab_number ]]</a> </span>",
link: function(scope, element, attrs){
if(attrs.text){
var text = scope.$eval(attrs.text);
}
if(attrs.rawText){
var text = attrs.rawText
}

var regexp = /[0-9]+[LK][0-9]+/g;
scope.text = text;
scope.lab_numbers = [];

if(text){ // sometimes patients don't have Covid.
matches = text.match(regexp);
scope.lab_numbers = _.map(matches, function(x){ return x.replace(/^0+/, '') });
}
}
}

})
Loading
Loading