-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
542 additions
and
274 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,24 @@ | ||
""" | ||
Specific API endpoints for the TB module | ||
""" | ||
from django.utils import timezone | ||
from opal.core.views import json_response | ||
from opal.core.api import patient_from_pk, LoginRequiredViewset | ||
from collections import OrderedDict | ||
from plugins.labtests.api import RecentResultsApiView | ||
|
||
from apps.tb.utils import get_tb_summary_information | ||
|
||
|
||
class TbTestSummary(LoginRequiredViewset): | ||
class TbTestSummary(RecentResultsApiView): | ||
base_name = 'tb_test_summary' | ||
"""" | ||
Example payload | ||
return [ | ||
{ | ||
name: 'C REACTIVE PROTEIN', | ||
date: '', | ||
result: '1' | ||
}, | ||
{ | ||
name: 'ALT', | ||
date: '', | ||
result: '1' | ||
} | ||
] | ||
""" | ||
@patient_from_pk | ||
def retrieve(self, request, patient): | ||
tb_summary_information = get_tb_summary_information(patient) | ||
result = [] | ||
for obs_name, summary in tb_summary_information.items(): | ||
result.append({ | ||
"name": obs_name, | ||
"date": summary["observation_datetime"], | ||
"result": summary["observation_value"] | ||
}) | ||
|
||
return json_response(dict(results=result)) | ||
RELEVANT_TESTS = OrderedDict(( | ||
("AFB : CULTURE", ["TB: Culture Result"]), | ||
("TB PCR TEST", ["TB PCR"]), | ||
("C REACTIVE PROTEIN", ["C Reactive Protein"]), | ||
("LIVER PROFILE", ["ALT", "AST", "Total Bilirubin"]), | ||
("QUANTIFERON TB GOLD IT", [ | ||
"QFT IFN gamma result (TB1)", | ||
"QFT IFN gamme result (TB2)", | ||
"QFT TB interpretation" | ||
]), | ||
('HEPATITIS B SURFACE AG', ["Hepatitis B 's'Antigen........"]), | ||
('HEPATITIS C ANTIBODY', ["Hepatitis C IgG Antibody......"]), | ||
('HIV 1 + 2 ANTIBODIES', ['HIV 1 + 2 Antibodies..........']), | ||
("25-OH Vitamin D", ["25-OH Vitamin D"]), | ||
),) |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
32 changes: 0 additions & 32 deletions
32
intrahospital_api/management/commands/load_tests_from_json.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.