forked from cityEHR/cityehr-documentation
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathusing-the-cityehr-api.dita
More file actions
81 lines (81 loc) · 4.88 KB
/
Copy pathusing-the-cityehr-api.dita
File metadata and controls
81 lines (81 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD LIGHTWEIGHT DITA Topic//EN" "topic.dtd">
<topic id="using-the-cityehr-api">
<title>Using the cityEHR API</title>
<shortdesc/>
<body>
<section id="Enabling-API-Access">
<title>Enabling API Access</title>
<p>cityEHR has an Application Programming Interface (API) exposed as a RESTful web service. API For any installation API access can be enabled in the Administration page System | Manage System Parameters by clicking the Edit check box, then checking API Access and pressing Save.</p>
<p/>
<p>
<image href="images/admin-manage-sys-api.png" format="image/png">
<alt>Enabling API access</alt>
</image>
</p>
<p/>
<p>With cityEHR accessible on <i>http://localhost:8080/cityehr</i>, the API can be invoked using the URL</p>
<p><i>http://localhost:8080/cityehr//ehr/api</i></p>
<p>When the API is disabled, the response (as shown in the Firefox web browser) is a simple statement with guidance on how to enable it.</p>
<p/>
<p>
<image href="images/disabled-api-message.png" format="image/png">
<alt>Disabled API message</alt>
</image>
</p>
<p/>
<p>When the API is enabled the response (as shown in the Firefox web browser) provides a summary of the API specification.</p>
<p>
<image href="images/enabled-api-message.png" format="image/png">
<alt>Enabled API message</alt>
</image>
</p>
<p>Each command is shown with an example call, response and a list of its parameters.</p>
<p>
<image href="images/enabled-api-message-cmd.png" format="image/png">
<alt>API command parameters</alt>
</image>
</p>
<p/>
<p>There are two styles of API call – either style invokes the same command:</p>
<p/>
<p>/ehr/api/authenticate/?userId=user&password=secret</p>
<p>or</p>
<p>/ehr/api/?command=authenticate&userId=user&password=secret</p>
<p/>
</section>
<section id="Using-the-cityEHR-API">
<title>Using the cityEHR API</title>
<p><b>Authenticate and Start a Session</b></p>
<p>http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=password</p>
<p>
<image href="images/api-response-sessionid.png" format="image/png">
<alt/>
</image>
</p>
<p>
<xref href="http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=wrong" format="html" scope="external">http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=wrong</xref>
</p>
<p>
<image href="images/api-response-failed.png" format="image/png">
<alt/>
</image>
</p>
<ol>
<li>
<p><b>Get List of Applications</b></p>
</li>
</ol>
<p><xref href="http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=wrong" format="html" scope="external">http://localhost:8080/</xref><xref href="http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=wrong" format="html" scope="external"><u>cityehr</u></xref>/ehr/api/getApplicationList/?userId=admin&sessionId=863fa22fd0253e00333d96bb4417973a</p>
<p/>
<p><b>Get Patient Demographics</b></p>
<p><xref href="http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=wrong" format="html" scope="external">http://localhost:8080/cityehr</xref>/ehr/api/getDemographics/?userId=admin&sessionId=863fa22fd0253e00333d96bb4417973a&applicationId=TSO-13606-EHR_Extract-cityEHR&patientId=K123456789</p>
<p/>
<p>Get List of Patient Compositions</p>
<p><xref href="http://localhost:8080/cityehr/ehr/api/authenticate/?userId=admin&password=wrong" format="html" scope="external">http://localhost:8080/cityehr</xref>/ehr/api/getCompositionList/?userId=admin&sessionId=863fa22fd0253e00333d96bb4417973a&applicationId=TSO-13606-EHR_Extract-cityEHR&patientId=K123456789</p>
<p/>
<p><b>Get Patient Composition</b></p>
<p>/ehr/api/getComposition/?userId=admin&sessionId=863fa22fd0253e00333d96bb4417973a&applicationId=TSO-13606-EHR_Extract-cityEHR&patientId=K123456789&compositionId=2023-10-26T20-52-40.71*01-00-CityEHR-Form-BaseRegistration-admin&mime=application/pdf</p>
</section>
</body>
</topic>