Last active
August 29, 2019 16:00
-
-
Save tony-shannon/f7cdf2f7f3169e5cd3464fd72d6fe91d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
pre HIT | |
TemplateID: | |
IDCR - Adverse Reaction List.v1 | |
Summary AQL /query: | |
To populate the list of items when the heading is selected. | |
GET | |
select | |
a/uid/value as uid, | |
a/composer/name as author, | |
a/context/start_time/value as date_created, | |
b_a/uid/value as entryID, | |
b_a/data[at0001]/items[at0002]/value/value as cause, | |
b_a/data[at0001]/items[at0002]/value/defining_code/code_string as cause_code, | |
b_a/data[at0001]/items[at0002]/value/defining_code/terminology_id/value as cause_terminology, | |
b_a/data[at0001]/items[at0009]/items[at0011]/value/value as reaction, | |
b_a/data[at0001]/items[at0009]/items[at0011]/value/defining_code/code_string as reaction_code, | |
b_a/data[at0001]/items[at0009]/items[at0011]/value/terminology_id/value as reaction_terminology, | |
b_a/provider/external_ref/id/value as originalComposition, | |
b_a/provider/name as originalSource | |
from EHR e [ehr_id/value = '{{ehrId}}'] | |
contains COMPOSITION a[openEHR-EHR-COMPOSITION.adverse_reaction_list.v1] | |
contains EVALUATION b_a[openEHR-EHR-EVALUATION.adverse_reaction_risk.v1] | |
where | |
a/name/value='Adverse reaction list' | |
Detail AQL /query: | |
To populate the detailed view / edit when a single record within the heading is selected. | |
POST | |
Sample Composition(FLAT JSON) for POST/PUT /composition: | |
To create or update a composition for a single item via the /composition Ehrscape API call. | |
{ | |
"ctx/composer_name": "Dr Ian Shannon", | |
"ctx/health_care_facility|id": "999999-345", | |
"ctx/health_care_facility|name": "Home", | |
"ctx/id_namespace": "NHS-UK", | |
"ctx/id_scheme": "2.16.840.1.113883.2.1.4.3", | |
"ctx/language": "en", | |
"ctx/territory": "GB", | |
"ctx/time": "2016-12-20T00:11:02.518+02:00", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/_provider|name": "iHEALTHLINK Discharge", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/_provider|id": "http://showcase.1.rippleosi.org/1234567", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/_uid": "{{$guid}}", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/causative_agent|code": "91936005", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/causative_agent|value": "allergy to penicillin", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/causative_agent|terminology": "SNOMED-CT", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/reaction_details/manifestation:0|code": "28926001", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/reaction_details/manifestation:0|value": "eruption due to drug", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/reaction_details/manifestation:0|terminology": "SNOMED-CT", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:0/reaction_details/comment": "History unclear", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/_uid": "{{$guid}}", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/causative_agent|code": "304270095", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/causative_agent|value": "Erythromycin", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/causative_agent|terminology": "SNOMED-CT", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/reaction_details/manifestation:0|code": "422400008", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/reaction_details/manifestation:0|value": "Vomiting", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/reaction_details/manifestation:0|terminology": "SNOMED-CT", | |
"adverse_reaction_list/allergies_and_adverse_reactions/adverse_reaction_risk:1/reaction_details/comment": "Reported by patient's carer" | |
} | |
with HIT (more verbose version via automation, & more symmetry also) | |
GET response | |
{ | |
"problem_list": { | |
"_uid": "e3572fa2-2ad1-404c-a372-b3c5fbbc3f19::example.ethercis.com::1", | |
"language|code": "en", | |
"language|terminology": "ISO_639-1", | |
"territory|code": "GB", | |
"territory|terminology": "ISO_3166-1", | |
"context": { | |
"_health_care_facility|id": "123456-123", | |
"_health_care_facility|id_scheme": "ETHERCIS-SCHEME", | |
"_health_care_facility|id_namespace": "DEMOGRAPHIC", | |
"_health_care_facility|name": "FACILITY", | |
"xds_metadata": [ | |
{ | |
"author_specialty": "DEFAULT_TEXT_VALUE", | |
"class_code": "DEFAULT_TEXT_VALUE", | |
"document_type": "DEFAULT_TEXT_VALUE", | |
"confidentiality_code": "DEFAULT_TEXT_VALUE", | |
"health_care_facility_type": "DEFAULT_TEXT_VALUE", | |
"practice_setting_code": "DEFAULT_TEXT_VALUE", | |
"event_code": [ | |
"DEFAULT_TEXT_VALUE" | |
], | |
"document_media": "www.iana.org", | |
"document_media|mediatype": "text/plain", | |
"document_media|alternatetext": "alternative text" | |
} | |
], | |
"start_time": "2019-08-29T15:58:15.486Z", | |
"setting|code": "238", | |
"setting|value": "Other Care", | |
"setting|terminology": "openehr" | |
}, | |
"problems_and_issues": { | |
"problem_diagnosis": [ | |
{ | |
"problem_diagnosis_name": "DEFAULT_TEXT_VALUE", | |
"clinical_description": "DEFAULT_TEXT_VALUE", | |
"body_site": "DEFAULT_TEXT_VALUE", | |
"date_time_of_onset": "1900-01-01T00:00:00.000Z", | |
"date_time_clinically_recognised": "1900-01-01T00:00:00.000Z", | |
"severity|code": "at0047", | |
"severity|value": "Mild", | |
"severity|terminology": "local", | |
"date_time_of_resolution": { | |
"iLocalMillis": -2208988800000, | |
"iChronology": { | |
"iBase": { | |
"iMinDaysInFirstWeek": 4 | |
} | |
} | |
}, | |
"problem_diagnosis_status": { | |
"diagnostic_status|code": "at0016", | |
"diagnostic_status|value": "Preliminary", | |
"diagnostic_status|terminology": "local", | |
"active_inactive|code": "at0026", | |
"active_inactive|value": "Active", | |
"active_inactive|terminology": "local", | |
"resolution_status|code": "at0084", | |
"resolution_status|value": "Resolved", | |
"resolution_status|terminology": "local", | |
"episodicity|code": "at0034", | |
"episodicity|value": "New episode", | |
"episodicity|terminology": "local", | |
"first_occurrence": true, | |
"drg_category|code": "at0064", | |
"drg_category|value": "Principal diagnosis", | |
"drg_category|terminology": "local" | |
}, | |
"diagnostic_certainty|code": "at9999", | |
"diagnostic_certainty|value": "DEFAULT_CODED_TEXT_VALUE", | |
"diagnostic_certainty|terminology": "local", | |
"comment": "DEFAULT_TEXT_VALUE", | |
"last_updated": "1900-01-01T00:00:00.000Z", | |
"language|code": "en", | |
"language|terminology": "ISO_639-1", | |
"encoding|code": "UTF-8", | |
"encoding|terminology": "IANA_character-sets" | |
} | |
] | |
}, | |
"composer|id": "1234-5678", | |
"composer|id_scheme": "ETHERCIS-TEST", | |
"composer|id_namespace": "DEMOGRAPHIC", | |
"composer|name": "Composer", | |
"composer": { | |
"_identifier": [ | |
"1234-5678" | |
] | |
} | |
} | |
} | |
POST material | |
{ | |
"ctx": { | |
"composer_name": "{{composer}}", | |
"health_care_facility|id": "999999-345", | |
"health_care_facility|name": "Home", | |
"id_namespace": "NHS-UK", | |
"id_scheme": "2.16.840.1.113883.2.1.4.3", | |
"language": "en", | |
"territory": "GB", | |
"time": "{{now}}" | |
}, | |
"problem_list": { | |
"problems_and_issues": { | |
"problem_diagnosis": [ | |
{ | |
"date_time_of_onset": "1900-01-01T00:00:00.000Z", | |
"date_time_clinically_recognised": "1900-01-01T00:00:00.000Z", | |
"severity|code": "at0047", | |
"severity|value": "Mild", | |
"severity|terminology": "local", | |
"date_time_of_resolution": { | |
"iLocalMillis": -2208988800000, | |
"iChronology": { | |
"iBase": { | |
"iMinDaysInFirstWeek": 4 | |
} | |
} | |
}, | |
"problem_diagnosis_status": { | |
"diagnostic_status|code": "at0016", | |
"diagnostic_status|value": "Preliminary", | |
"diagnostic_status|terminology": "local", | |
"active_inactive|code": "at0026", | |
"active_inactive|value": "Active", | |
"active_inactive|terminology": "local", | |
"resolution_status|code": "at0084", | |
"resolution_status|value": "Resolved", | |
"resolution_status|terminology": "local", | |
"episodicity|code": "at0034", | |
"episodicity|value": "New episode", | |
"episodicity|terminology": "local", | |
"first_occurrence": true, | |
"drg_category|code": "at0064", | |
"drg_category|value": "Principal diagnosis", | |
"drg_category|terminology": "local" | |
}, | |
"diagnostic_certainty|code": "at9999", | |
"diagnostic_certainty|value": "DEFAULT_CODED_TEXT_VALUE", | |
"diagnostic_certainty|terminology": "local", | |
"last_updated": "1900-01-01T00:00:00.000Z", | |
"language|code": "en", | |
"language|terminology": "ISO_639-1", | |
"encoding|code": "UTF-8", | |
"encoding|terminology": "IANA_character-sets", | |
"problem_diagnosis_name|value": "{{obj.value}}", | |
"problem_diagnosis_name|code": "{{obj.code}}", | |
"problem_diagnosis_name|terminology": "{{obj.terminology}}", | |
"clinical_description|value": "{{obj.value}}", | |
"clinical_description|code": "{{obj.code}}", | |
"clinical_description|terminology": "{{obj.terminology}}", | |
"body_site|value": "{{obj.value}}", | |
"body_site|code": "{{obj.code}}", | |
"body_site|terminology": "{{obj.terminology}}", | |
"comment|value": "{{obj.value}}", | |
"comment|code": "{{obj.code}}", | |
"comment|terminology": "{{obj.terminology}}" | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment