Save encounter workflow

Overview

This transaction allows a PoC system to save encounter to the SHR. The transaction is verified and validated against the other registries before it is saved in the SHR. The following sequence diagram shows the steps involved.

 

Technical details

RefInteractionEndpointDataTransaction Specification
1Send encounter to be storedPOST /ws/rest/v1/patient/$<pat-ID>/encountersHL7 v2.5 ORU_R01Save Patient Encounter
2Resolve client identifierPOST openempi-admin/openempi-ws-rest/person-query-resource/findPersonByIdOpenEMPI XMLGet Enterprise Client ID - Internal 
3Return person record HTTP 200 OKGet Enterprise Client ID - Internal 
4Extract ECID and enrich message none  
5Resolve provider identifierGET webservices/lookupbyid/nid/?id_type=ECID&id_number=xxxHTTP requestGet Enterprise Professional ID - Internal
6Return provider EPID HTTP 200 OK - (plain text identifier)Get Enterprise Professional ID - Internal
7Enrich message with EPID if provider exists, else errornone  
8Query facility detailsGET api/collections/$<resmap.collection.id>.rss?fosaid=xxxHTTP RequestGet HC Facility - Internal
9Return facility details HTTP 200 OK - ResMap RSS feed with custom XMLGet HC Facility - Internal 
10If facility exists continue, else errornone  
11Validate termGET /validate.php?namespaceCode=CODE&conceptCode=CODEHTTP RequestVerify Code - Internal
12Return valid: true or false HTTP 200 OK - Custom TS-browser XMLVerify Code - Internal 
13If not valid error, else continuenone  
14Save encounterPOST /openmrs/ws/rest/RHEA/patient/encounters?patientId=1234&idType=ECIDHL7 v2.5 ORU_R01Save Patient Encounter - Internal
15Acknowledge encounter saved HTTP 201 CreatedSave Patient Encounter - Internal 
16Acknowledge encounter saved HTTP 201 CreatedSave Patient Encounter