Skip to content

Commit 8d84cb5

Browse files
authored
EA-197 Add documentation for new EMR API REST endpoints (#180)
* EA-197 Add documentation for new EMR API REST endpoints * EA-197 Add documentation for new EMR API REST endpoints * EA-197 Add documentation for new EMR API REST endpoints
1 parent 0561c41 commit 8d84cb5

File tree

5 files changed

+353
-0
lines changed

5 files changed

+353
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ build/
1515
.cache
1616
.vagrant
1717
.sass-cache
18+
*.iml
1819

1920
# YARD artifacts
2021
.yardoc
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# EMRAPI Configuration
2+
3+
## EMR API Configuration Overview
4+
5+
The EMR API module provides several high-level APIs and configuration settings. The configuration endpoint provided by the `emrapi` module enables RESTful access to these configuration values.
6+
7+
## Available operations for EMRAPI Configuration
8+
9+
1. [Get EMRAPI Configuration](#get-emrapi-configuration)
10+
11+
## Get EMRAPI Configuration
12+
13+
> Get EMRAPI configuration
14+
15+
```shell
16+
GET /openmrs/ws/rest/v1/emrapi/configuration
17+
```
18+
19+
```java
20+
21+
OkHttpClient client = new OkHttpClient().newBuilder()
22+
.build();
23+
Request request = new Request.Builder()
24+
.url("/openmrs/ws/rest/v1/emrapi/configuration")
25+
.method("GET", null)
26+
.addHeader("Authorization", "Basic YWRtaW46QWRtaW4xMjM=")
27+
.addHeader("Cookie", "JSESSIONID=33B84B3BEA8E81E9D22D5A722815E010")
28+
.build();
29+
Response response = client.newCall(request).execute();
30+
```
31+
32+
```javascript
33+
34+
var requestHeaders = new Headers();
35+
requestHeaders.append("Authorization", "Basic YWRtaW46QWRtaW4xMjM=");
36+
requestHeaders.append("Cookie", "JSESSIONID=33B84B3BEA8E81E9D22D5A722815E010");
37+
38+
var requestOptions = {
39+
method: 'GET',
40+
headers: requestHeaders,
41+
redirect: 'follow'
42+
};
43+
44+
fetch("/openmrs/ws/rest/v1/emrapi/configuration", requestOptions)
45+
.then(response => response.text())
46+
.then(result => console.log(result))
47+
.catch(error => console.log('error', error));
48+
```
49+
50+
> Success Response
51+
52+
```response
53+
{
54+
"metadataSourceName": string,
55+
"orderingProviderEncounterRole": encounterRole,
56+
"supportsTransferLocationTag": locationTag,
57+
"unknownLocation": location,
58+
"denyAdmissionConcept": concept,
59+
"admissionForm": form,
60+
"exitFromInpatientEncounterType": encounterType,
61+
"extraPatientIdentifierTypes": patientIdentifierType[],
62+
"consultFreeTextCommentsConcept": concept,
63+
"sameAsConceptMapType": conceptMapType,
64+
"testPatientPersonAttributeType": personAttributeType,
65+
"admissionDecisionConcept": concept,
66+
"supportsAdmissionLocationTag": locationTag,
67+
"checkInEncounterType": encounterType,
68+
"transferWithinHospitalEncounterType": encounterType,
69+
"suppressedDiagnosisConcepts": concept[],
70+
"primaryIdentifierType": patientIdentifierType,
71+
"nonDiagnosisConceptSets": concept[],
72+
"fullPrivilegeLevel": role,
73+
"unknownProvider": provider,
74+
"diagnosisSets": concept[],
75+
"personImageDirectory": string,
76+
"visitNoteEncounterType": encounterType,
77+
"consultEncounterType": encounterType,
78+
"diagnosisMetadata": {
79+
"diagnosisCertaintyConcept": concept,
80+
"diagnosisOrderConcept": concept,
81+
"codedDiagnosisConcept": concept,
82+
"nonCodedDiagnosisConcept": concept,
83+
"diagnosisSetConcept": concept
84+
},
85+
"narrowerThanConceptMapType": conceptMapType,
86+
"clinicianEncounterRole": encounterRole,
87+
"conceptSourcesForDiagnosisSearch": conceptSource[],
88+
"patientDiedConcept": concept,
89+
"emrApiConceptSource": conceptSource,
90+
"lastViewedPatientSizeLimit": integer,
91+
"identifierTypesToSearch": patientIdentifierType[],
92+
"telephoneAttributeType": personAttributeType,
93+
"checkInClerkEncounterRole": encounterRole,
94+
"dischargeForm": form,
95+
"unknownCauseOfDeathConcept": concept,
96+
"visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary": boolean,
97+
"atFacilityVisitType": visitType,
98+
"visitExpireHours": integer,
99+
"admissionEncounterType": encounterType,
100+
"dispositions": [
101+
{
102+
"uuid": string,
103+
"name": string,
104+
"conceptCode": string,
105+
"type: string,
106+
"careSettingTypes": string[],
107+
"encounterTypes": string[],
108+
"excludedEncounterTypes": string[],
109+
"keepsVisitOpen": boolean,
110+
"actions": string[],
111+
"additionalObs": [
112+
{
113+
"label": string,
114+
"conceptCode: string,
115+
"params: map<string, string>
116+
}
117+
],
118+
}
119+
],
120+
"dispositionDescriptor": {
121+
"admissionLocationConcept": concept,
122+
"dateOfDeathConcept": concept,
123+
"dispositionConcept": concept,
124+
"internalTransferLocationConcept": concept,
125+
"dispositionSetConcept": concept
126+
},
127+
"highPrivilegeLevel": role,
128+
"supportsLoginLocationTag": locationTag,
129+
"unknownPatientPersonAttributeType": personAttributeType,
130+
"supportsVisitsLocationTag": locationTag,
131+
"transferForm": form
132+
}
133+
```
134+
135+
### Supported Parameters:
136+
137+
* `v`: optional, defaults to `ref`. This allows specifying the desired representation of ref | default | full | custom
138+
139+
The endpoint supports all standard representations (ref, default, full, and custom). If no representation is specified, the `ref` is returned.
140+
For any given representation, all properties are returned with the given representation.
141+
A custom representation can be used to retrieve only specific properties of interest, and specific data within those representations.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Inpatient Admission
2+
3+
## Overview
4+
Provides a means to retrieve inpatient admissions associated with active visits that meet the given request criteria.
5+
6+
## Available operations for Inpatient Admission
7+
8+
1. [Get Inpatient Admission](#get-inpatient-admission)
9+
10+
## Get Inpatient Admission
11+
12+
> Get Inpatient Admission
13+
14+
```shell
15+
GET /openmrs/ws/rest/v1/emrapi/inpatient/admission?visitLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&totalCount=true
16+
```
17+
18+
```java
19+
20+
OkHttpClient client = new OkHttpClient().newBuilder()
21+
.build();
22+
Request request = new Request.Builder()
23+
.url("/openmrs/ws/rest/v1/emrapi/inpatient/admission?visitLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&totalCount=true")
24+
.method("GET", null)
25+
.addHeader("Authorization", "Basic YWRtaW46QWRtaW4xMjM=")
26+
.addHeader("Cookie", "JSESSIONID=33B84B3BEA8E81E9D22D5A722815E010")
27+
.build();
28+
Response response = client.newCall(request).execute();
29+
30+
```
31+
32+
```javascript
33+
34+
var requestHeaders = new Headers();
35+
requestHeaders.append("Authorization", "Basic YWRtaW46QWRtaW4xMjM=");
36+
requestHeaders.append("Cookie", "JSESSIONID=33B84B3BEA8E81E9D22D5A722815E010");
37+
38+
var requestOptions = {
39+
method: 'GET',
40+
headers: requestHeaders,
41+
redirect: 'follow'
42+
};
43+
44+
fetch("/openmrs/ws/rest/v1/emrapi/inpatient/admission?visitLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&totalCount=true", requestOptions)
45+
.then(response => response.text())
46+
.then(result => console.log(result))
47+
.catch(error => console.log('error', error));
48+
49+
```
50+
51+
> Success Response
52+
53+
```response
54+
55+
{
56+
"results": [
57+
{
58+
"visit": visit,
59+
"patient": patient,
60+
"currentInpatientLocation": location,
61+
"adtEncounters": encounter[],
62+
"admissionEncounters": encounter[],
63+
"transferEncounters": encounter[],
64+
"dischargeEncounters": encounter[],
65+
"latestAdtEncounter": encounter,
66+
"admissionAndTransferEncounters": encounter[],
67+
"firstAdmissionOrTransferEncounter": encounter,
68+
"latestAdmissionOrTransferEncounter": encounter,
69+
"encounterAssigningToCurrentInpatientLocation": encounter,
70+
"discharged": boolean
71+
}
72+
],
73+
"totalCount": integer
74+
}
75+
```
76+
77+
This endpoint returns paged data. The maximum number of results for any paged response is controlled by the webservices.rest module configuration.
78+
79+
### Supported Parameters:
80+
81+
* `visitLocation`: optional location uuid. If specified, limits the admissions to those associated with a visit at the given location or parent visit location
82+
* `currentInpatientLocation`: optional list of location uuids. If specified, limits the admissions to those where the patient is currently at one of the given locations
83+
* `includeDischarged`: optional, defaults to false. If true, includes patients who have active visits but whose most recent ADT encounter is a discharge
84+
* `totalCount`: optional, defaults to false. This is a standard REST parameter which, if passed with `true`, will included a `totalCount` property in the response.
85+
* `v`: optional, defaults to `default`. This allows specifying the desired representation of ref | default | full | custom
86+
87+
### Available representations
88+
89+
#### Full representation:
90+
91+
* visit: full
92+
* all other properties: default
93+
94+
#### Default Representation:
95+
96+
* visit: default
97+
* currentInpatientLocation: ref,
98+
* firstAdmissionOrTransferEncounter: custom:(uuid,display,encounterDatetime,location:ref,encounterType:ref),
99+
* latestAdmissionOrTransferEncounter: custom:(uuid,display,encounterDatetime,location:ref,encounterType:ref),
100+
* encounterAssigningToCurrentInpatientLocation: custom:(uuid,display,encounterDatetime,location:ref,encounterType:ref),
101+
* discharged: default
102+
103+
#### Ref Representation
104+
105+
All properties returned as `ref` representations
106+
107+
#### Custom Representation
108+
109+
Any custom representation is supported.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Inpatient Request
2+
3+
## Overview
4+
Provides a means to retrieve inpatient requests (eg. requests for admission, discharge, or transfer) associated with active visits that meet the given request criteria.
5+
6+
## Available operations for Inpatient Request
7+
8+
1. [Get Inpatient Request](#get-inpatient-request)
9+
10+
## Get Inpatient Request
11+
12+
> Get Inpatient Request
13+
14+
```shell
15+
GET /openmrs/ws/rest/v1/emrapi/inpatient/inpatient/request?dispositionType=ADMIT&visitLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&dispositionLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&totalCount=true&v=full
16+
```
17+
18+
```java
19+
20+
OkHttpClient client = new OkHttpClient().newBuilder()
21+
.build();
22+
Request request = new Request.Builder()
23+
.url("/openmrs/ws/rest/v1/emrapi/inpatient/inpatient/request?dispositionType=ADMIT&visitLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&dispositionLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&totalCount=true&v=full")
24+
.method("GET", null)
25+
.addHeader("Authorization", "Basic YWRtaW46QWRtaW4xMjM=")
26+
.addHeader("Cookie", "JSESSIONID=33B84B3BEA8E81E9D22D5A722815E010")
27+
.build();
28+
Response response = client.newCall(request).execute();
29+
30+
```
31+
32+
```javascript
33+
34+
var requestHeaders = new Headers();
35+
requestHeaders.append("Authorization", "Basic YWRtaW46QWRtaW4xMjM=");
36+
requestHeaders.append("Cookie", "JSESSIONID=33B84B3BEA8E81E9D22D5A722815E010");
37+
38+
var requestOptions = {
39+
method: 'GET',
40+
headers: requestHeaders,
41+
redirect: 'follow'
42+
};
43+
44+
fetch("/openmrs/ws/rest/v1/emrapi/inpatient/inpatient/request?dispositionType=ADMIT&visitLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&dispositionLocation=b6fcd85f-5995-43c9-875f-3bb2299087ff&totalCount=true&v=full", requestOptions)
45+
.then(response => response.text())
46+
.then(result => console.log(result))
47+
.catch(error => console.log('error', error));
48+
49+
```
50+
51+
> Success Response
52+
53+
```response
54+
55+
{
56+
"results": [
57+
{
58+
"visit": visit,
59+
"patient": patient,
60+
"dispositionType": ADMIT | TRANSFER | DISCHARGE,
61+
"dispositionEncounter": encounter,
62+
"dispositionObsGroup": obs,
63+
"disposition": concept,
64+
"dispositionLocation": location
65+
}
66+
],
67+
"totalCount": integer
68+
}
69+
```
70+
71+
This endpoint returns paged data. The maximum number of results for any paged response is controlled by the webservices.rest module configuration.
72+
73+
### Supported Parameters:
74+
75+
* `visitLocation`: optional location uuid. If specified, limits the requests to those associated with a visit at the given location or parent visit location
76+
* `dispositionLocation`: optional list of location uuids. If specified, limits the requests to those requesting one of the specified locations
77+
* `dispositionType`: optional list of `ADMIT`, `TRANSFER` OR `DISCHAGE` allows indicating with specific types of requests should be returned
78+
* `totalCount`: optional, defaults to false. This is a standard REST parameter which, if passed with `true`, will included a `totalCount` property in the response.
79+
* `v`: optional, defaults to `default`. This allows specifying the desired representation of ref | default | full | custom
80+
81+
### Available representations
82+
83+
#### Full representation:
84+
85+
* visit: `full`
86+
* all other properties: `default`
87+
88+
#### Default Representation:
89+
90+
* visit: `default`
91+
* all other properties: `ref`
92+
93+
#### Ref Representation
94+
95+
All properties returned as `ref` representations
96+
97+
#### Custom Representation
98+
99+
Any custom representation is supported.

source/index.html.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ includes:
7171
- ImplementationId/implementation_id
7272
- AdministrationLinks/administration_links
7373
- DatabaseChanges/database_changes
74+
- EmrApi/emrapi_configuration
75+
- EmrApi/inpatient_admission
76+
- EmrApi/inpatient_request
7477
- contrib
7578

7679

0 commit comments

Comments
 (0)