· 5 years ago · Jun 26, 2020, 01:30 PM
1
2
3<!doctype html>
4<html>
5 <head>
6 <meta charset="utf-8">
7 <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
9 <title>OpenMRS Docs</title>
10
11 <link rel="stylesheet" type="text/css" href="swagger-ui.css">
12
13 <style>
14 .highlight table td { padding: 5px; }
15.highlight table pre { margin: 0; }
16.highlight .gh {
17 color: #999999;
18}
19.highlight .sr {
20 color: #f6aa11;
21}
22.highlight .go {
23 color: #888888;
24}
25.highlight .gp {
26 color: #555555;
27}
28.highlight .gs {
29}
30.highlight .gu {
31 color: #aaaaaa;
32}
33.highlight .nb {
34 color: #f6aa11;
35}
36.highlight .cm {
37 color: #75715e;
38}
39.highlight .cp {
40 color: #75715e;
41}
42.highlight .c1 {
43 color: #75715e;
44}
45.highlight .cs {
46 color: #75715e;
47}
48.highlight .c, .highlight .cd {
49 color: #75715e;
50}
51.highlight .err {
52 color: #960050;
53}
54.highlight .gr {
55 color: #960050;
56}
57.highlight .gt {
58 color: #960050;
59}
60.highlight .gd {
61 color: #49483e;
62}
63.highlight .gi {
64 color: #49483e;
65}
66.highlight .ge {
67 color: #49483e;
68}
69.highlight .kc {
70 color: #66d9ef;
71}
72.highlight .kd {
73 color: #66d9ef;
74}
75.highlight .kr {
76 color: #66d9ef;
77}
78.highlight .no {
79 color: #66d9ef;
80}
81.highlight .kt {
82 color: #66d9ef;
83}
84.highlight .mf {
85 color: #ae81ff;
86}
87.highlight .mh {
88 color: #ae81ff;
89}
90.highlight .il {
91 color: #ae81ff;
92}
93.highlight .mi {
94 color: #ae81ff;
95}
96.highlight .mo {
97 color: #ae81ff;
98}
99.highlight .m, .highlight .mb, .highlight .mx {
100 color: #ae81ff;
101}
102.highlight .sc {
103 color: #ae81ff;
104}
105.highlight .se {
106 color: #ae81ff;
107}
108.highlight .ss {
109 color: #ae81ff;
110}
111.highlight .sd {
112 color: #e6db74;
113}
114.highlight .s2 {
115 color: #e6db74;
116}
117.highlight .sb {
118 color: #e6db74;
119}
120.highlight .sh {
121 color: #e6db74;
122}
123.highlight .si {
124 color: #e6db74;
125}
126.highlight .sx {
127 color: #e6db74;
128}
129.highlight .s1 {
130 color: #e6db74;
131}
132.highlight .s {
133 color: #e6db74;
134}
135.highlight .na {
136 color: #a6e22e;
137}
138.highlight .nc {
139 color: #a6e22e;
140}
141.highlight .nd {
142 color: #a6e22e;
143}
144.highlight .ne {
145 color: #a6e22e;
146}
147.highlight .nf {
148 color: #a6e22e;
149}
150.highlight .vc {
151 color: #ffffff;
152}
153.highlight .nn {
154 color: #ffffff;
155}
156.highlight .nl {
157 color: #ffffff;
158}
159.highlight .ni {
160 color: #ffffff;
161}
162.highlight .bp {
163 color: #ffffff;
164}
165.highlight .vg {
166 color: #ffffff;
167}
168.highlight .vi {
169 color: #ffffff;
170}
171.highlight .nv {
172 color: #ffffff;
173}
174.highlight .w {
175 color: #ffffff;
176}
177.highlight {
178 color: #ffffff;
179}
180.highlight .n, .highlight .py, .highlight .nx {
181 color: #ffffff;
182}
183.highlight .ow {
184 color: #f92672;
185}
186.highlight .nt {
187 color: #f92672;
188}
189.highlight .k, .highlight .kv {
190 color: #f92672;
191}
192.highlight .kn {
193 color: #f92672;
194}
195.highlight .kp {
196 color: #f92672;
197}
198.highlight .o {
199 color: #f92672;
200}
201 </style>
202 <link href="stylesheets/screen.css" rel="stylesheet" media="screen" />
203 <link href="stylesheets/print.css" rel="stylesheet" media="print" />
204 <script src="javascripts/all.js"></script>
205 </head>
206
207 <body class="index" data-languages="["shell","java"]">
208 <a href="#" id="nav-button">
209 <span>
210 NAV
211 <img src="images/navbar.png" alt="Navbar" />
212 </span>
213 </a>
214
215
216 <div class="toc-wrapper">
217 <img src="images/logo.png" class="logo" alt="Logo" />
218 <div class="lang-selector">
219 <a href="#" data-language-name="shell">shell</a>
220 <a href="#" data-language-name="java">java</a>
221 </div>
222 <div class="search">
223 <input type="text" class="search" id="input-search" placeholder="Search">
224 </div>
225 <ul class="search-results"></ul>
226 <ul id="toc" class="toc-list-h1">
227 <li>
228 <a href="#openmrs-rest-api" class="toc-h1 toc-link" data-title="OpenMRS REST API">OpenMRS REST API</a>
229 </li>
230 <li>
231 <a href="#getting-started" class="toc-h1 toc-link" data-title="Getting Started">Getting Started</a>
232 </li>
233 <li>
234 <a href="#current-version" class="toc-h1 toc-link" data-title="Current version">Current version</a>
235 </li>
236 <li>
237 <a href="#purpose" class="toc-h1 toc-link" data-title="Purpose">Purpose</a>
238 </li>
239 <li>
240 <a href="#schema" class="toc-h1 toc-link" data-title="Schema">Schema</a>
241 </li>
242 <li>
243 <a href="#resources" class="toc-h1 toc-link" data-title="Resources">Resources</a>
244 </li>
245 <li>
246 <a href="#subresources" class="toc-h1 toc-link" data-title="Subresources">Subresources</a>
247 <ul class="toc-list-h2">
248 <li>
249 <a href="#examples" class="toc-h2 toc-link" data-title="Examples">Examples</a>
250 </li>
251 <li>
252 <a href="#get-an-encounter-list-for-a-specific-patient" class="toc-h2 toc-link" data-title="Get an encounter list for a specific patient.">Get an encounter list for a specific patient.</a>
253 </li>
254 <li>
255 <a href="#get-an-encounter-list-for-a-specific-location" class="toc-h2 toc-link" data-title="Get an encounter list for a specific location.">Get an encounter list for a specific location.</a>
256 </li>
257 </ul>
258 </li>
259 <li>
260 <a href="#resources-with-subtypes" class="toc-h1 toc-link" data-title="Resources with subtypes">Resources with subtypes</a>
261 <ul class="toc-list-h2">
262 <li>
263 <a href="#examples-2" class="toc-h2 toc-link" data-title="Examples">Examples</a>
264 </li>
265 <li>
266 <a href="#get-encounter-orders-of-drug-order-subtype" class="toc-h2 toc-link" data-title="Get encounter orders of drug order subtype.">Get encounter orders of drug order subtype.</a>
267 </li>
268 </ul>
269 </li>
270 <li>
271 <a href="#authentication" class="toc-h1 toc-link" data-title="Authentication">Authentication</a>
272 <ul class="toc-list-h2">
273 <li>
274 <a href="#retrieve-session-token" class="toc-h2 toc-link" data-title="Retrieve session token">Retrieve session token</a>
275 </li>
276 <li>
277 <a href="#logout-user-end-session" class="toc-h2 toc-link" data-title="Logout User/End session">Logout User/End session</a>
278 </li>
279 <li>
280 <a href="#changing-password" class="toc-h2 toc-link" data-title="Changing Password">Changing Password</a>
281 </li>
282 <li>
283 <a href="#getting-all-location-without-authentication" class="toc-h2 toc-link" data-title="Getting all location without authentication">Getting all location without authentication</a>
284 </li>
285 </ul>
286 </li>
287 <li>
288 <a href="#system-setting" class="toc-h1 toc-link" data-title="System Setting">System Setting</a>
289 <ul class="toc-list-h2">
290 <li>
291 <a href="#system-setting-overview" class="toc-h2 toc-link" data-title="System Setting Overview">System Setting Overview</a>
292 </li>
293 <li>
294 <a href="#available-operations-for-systemsetting-type" class="toc-h2 toc-link" data-title="Available operations for systemsetting type.">Available operations for systemsetting type.</a>
295 </li>
296 <li>
297 <a href="#list-system-settings" class="toc-h2 toc-link" data-title="List System Settings">List System Settings</a>
298 </li>
299 <li>
300 <a href="#create-a-system-setting" class="toc-h2 toc-link" data-title="Create a System Setting">Create a System Setting</a>
301 </li>
302 <li>
303 <a href="#update-a-system-setting" class="toc-h2 toc-link" data-title="Update a System Setting">Update a System Setting</a>
304 </li>
305 <li>
306 <a href="#delete-a-system-setting" class="toc-h2 toc-link" data-title="Delete a System Setting">Delete a System Setting</a>
307 </li>
308 </ul>
309 </li>
310 <li>
311 <a href="#system-information" class="toc-h1 toc-link" data-title="System Information">System Information</a>
312 <ul class="toc-list-h2">
313 <li>
314 <a href="#system-information-overview" class="toc-h2 toc-link" data-title="System Information Overview">System Information Overview</a>
315 </li>
316 <li>
317 <a href="#available-operations-for-systeminformation-type" class="toc-h2 toc-link" data-title="Available operations for systeminformation type.">Available operations for systeminformation type.</a>
318 </li>
319 <li>
320 <a href="#list-system-inforamation" class="toc-h2 toc-link" data-title="List System Inforamation">List System Inforamation</a>
321 </li>
322 </ul>
323 </li>
324 <li>
325 <a href="#user" class="toc-h1 toc-link" data-title="User">User</a>
326 <ul class="toc-list-h2">
327 <li>
328 <a href="#user-overview" class="toc-h2 toc-link" data-title="User Overview">User Overview</a>
329 </li>
330 <li>
331 <a href="#available-operations-for-user" class="toc-h2 toc-link" data-title="Available operations for User">Available operations for User</a>
332 </li>
333 <li>
334 <a href="#list-user" class="toc-h2 toc-link" data-title="List user">List user</a>
335 </li>
336 <li>
337 <a href="#create-a-user" class="toc-h2 toc-link" data-title="Create a user">Create a user</a>
338 </li>
339 <li>
340 <a href="#update-a-user" class="toc-h2 toc-link" data-title="Update a user">Update a user</a>
341 </li>
342 <li>
343 <a href="#delete-a-user" class="toc-h2 toc-link" data-title="Delete a user">Delete a user</a>
344 </li>
345 </ul>
346 </li>
347 <li>
348 <a href="#role" class="toc-h1 toc-link" data-title="Role">Role</a>
349 <ul class="toc-list-h2">
350 <li>
351 <a href="#role-overview" class="toc-h2 toc-link" data-title="Role Overview">Role Overview</a>
352 </li>
353 <li>
354 <a href="#available-operations-for-role" class="toc-h2 toc-link" data-title="Available operations for Role.">Available operations for Role.</a>
355 </li>
356 <li>
357 <a href="#list-roles" class="toc-h2 toc-link" data-title="List roles">List roles</a>
358 </li>
359 <li>
360 <a href="#get-a-role-by-uuid" class="toc-h2 toc-link" data-title="Get a role by UUID.">Get a role by UUID.</a>
361 </li>
362 <li>
363 <a href="#create-a-role" class="toc-h2 toc-link" data-title="Create a role">Create a role</a>
364 </li>
365 <li>
366 <a href="#update-a-role" class="toc-h2 toc-link" data-title="Update a role">Update a role</a>
367 </li>
368 <li>
369 <a href="#delete-a-role" class="toc-h2 toc-link" data-title="Delete a role">Delete a role</a>
370 </li>
371 </ul>
372 </li>
373 <li>
374 <a href="#person" class="toc-h1 toc-link" data-title="Person">Person</a>
375 <ul class="toc-list-h2">
376 <li>
377 <a href="#person-overview" class="toc-h2 toc-link" data-title="Person Overview">Person Overview</a>
378 </li>
379 <li>
380 <a href="#subresource-types" class="toc-h2 toc-link" data-title="Subresource types">Subresource types</a>
381 </li>
382 <li>
383 <a href="#available-operations-for-person-type" class="toc-h2 toc-link" data-title="Available Operations for Person type">Available Operations for Person type</a>
384 </li>
385 <li>
386 <a href="#search-persons" class="toc-h2 toc-link" data-title="Search Persons">Search Persons</a>
387 </li>
388 <li>
389 <a href="#create-a-person" class="toc-h2 toc-link" data-title="Create a person">Create a person</a>
390 </li>
391 <li>
392 <a href="#update-a-person" class="toc-h2 toc-link" data-title="Update a person">Update a person</a>
393 </li>
394 <li>
395 <a href="#delete-a-person" class="toc-h2 toc-link" data-title="Delete a person">Delete a person</a>
396 </li>
397 <li>
398 <a href="#list-person-name-subresource" class="toc-h2 toc-link" data-title="List person name subresource">List person name subresource</a>
399 </li>
400 <li>
401 <a href="#create-person-name-subresource" class="toc-h2 toc-link" data-title="Create person name subresource">Create person name subresource</a>
402 </li>
403 <li>
404 <a href="#update-person-name-subresource" class="toc-h2 toc-link" data-title="Update person name subresource">Update person name subresource</a>
405 </li>
406 <li>
407 <a href="#delete-person-name-subresource" class="toc-h2 toc-link" data-title="Delete person name subresource">Delete person name subresource</a>
408 </li>
409 <li>
410 <a href="#list-person-address-subresource" class="toc-h2 toc-link" data-title="List person address subresource">List person address subresource</a>
411 </li>
412 <li>
413 <a href="#create-person-address-subresource" class="toc-h2 toc-link" data-title="Create person address subresource">Create person address subresource</a>
414 </li>
415 <li>
416 <a href="#update-person-address-subresource" class="toc-h2 toc-link" data-title="Update person address subresource">Update person address subresource</a>
417 </li>
418 <li>
419 <a href="#delete-a-person-address-subresource" class="toc-h2 toc-link" data-title="Delete a person address subresource">Delete a person address subresource</a>
420 </li>
421 <li>
422 <a href="#list-person-attribute-subresource" class="toc-h2 toc-link" data-title="List person attribute subresource">List person attribute subresource</a>
423 </li>
424 <li>
425 <a href="#create-person-attribute-subresource" class="toc-h2 toc-link" data-title="Create person attribute subresource">Create person attribute subresource</a>
426 </li>
427 <li>
428 <a href="#update-person-attribute-subresource" class="toc-h2 toc-link" data-title="Update person attribute subresource">Update person attribute subresource</a>
429 </li>
430 <li>
431 <a href="#delete-person-attribute-subresource" class="toc-h2 toc-link" data-title="Delete person attribute subresource">Delete person attribute subresource</a>
432 </li>
433 </ul>
434 </li>
435 <li>
436 <a href="#person-attribute-type" class="toc-h1 toc-link" data-title="Person Attribute Type">Person Attribute Type</a>
437 <ul class="toc-list-h2">
438 <li>
439 <a href="#person-attribute-type-overview" class="toc-h2 toc-link" data-title="Person Attribute Type Overview">Person Attribute Type Overview</a>
440 </li>
441 <li>
442 <a href="#available-operations" class="toc-h2 toc-link" data-title="Available operations.">Available operations.</a>
443 </li>
444 <li>
445 <a href="#list-person-attribute-types" class="toc-h2 toc-link" data-title="List person attribute types">List person attribute types</a>
446 </li>
447 <li>
448 <a href="#create-a-person-attribute-type" class="toc-h2 toc-link" data-title="Create a person attribute type">Create a person attribute type</a>
449 </li>
450 <li>
451 <a href="#update-a-person-attribute-type" class="toc-h2 toc-link" data-title="Update a person attribute type">Update a person attribute type</a>
452 </li>
453 <li>
454 <a href="#delete-a-person-attribute-type" class="toc-h2 toc-link" data-title="Delete a person attribute type">Delete a person attribute type</a>
455 </li>
456 </ul>
457 </li>
458 <li>
459 <a href="#patients" class="toc-h1 toc-link" data-title="Patients">Patients</a>
460 <ul class="toc-list-h2">
461 <li>
462 <a href="#patients-overview" class="toc-h2 toc-link" data-title="Patients Overview">Patients Overview</a>
463 </li>
464 <li>
465 <a href="#subresource-types-of-patient" class="toc-h2 toc-link" data-title="Subresource types of Patient">Subresource types of Patient</a>
466 </li>
467 <li>
468 <a href="#available-operations-for-patients" class="toc-h2 toc-link" data-title="Available operations for Patients">Available operations for Patients</a>
469 </li>
470 <li>
471 <a href="#search-patients" class="toc-h2 toc-link" data-title="Search patients">Search patients</a>
472 </li>
473 <li>
474 <a href="#create-a-patient" class="toc-h2 toc-link" data-title="Create a patient">Create a patient</a>
475 </li>
476 <li>
477 <a href="#update-a-patient" class="toc-h2 toc-link" data-title="Update a patient">Update a patient</a>
478 </li>
479 <li>
480 <a href="#delete-a-patient" class="toc-h2 toc-link" data-title="Delete a patient">Delete a patient</a>
481 </li>
482 <li>
483 <a href="#list-patientidentifier-sub-resources" class="toc-h2 toc-link" data-title="List patientIdentifier sub resources">List patientIdentifier sub resources</a>
484 </li>
485 <li>
486 <a href="#create-a-patientidentifier-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Create a patientIdentifier sub resource with properties">Create a patientIdentifier sub resource with properties</a>
487 </li>
488 <li>
489 <a href="#update-patientidentifier-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Update patientIdentifier sub resource with properties">Update patientIdentifier sub resource with properties</a>
490 </li>
491 <li>
492 <a href="#delete-patientidentifier-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Delete patientIdentifier sub resource with properties">Delete patientIdentifier sub resource with properties</a>
493 </li>
494 <li>
495 <a href="#list-allergy-subresources" class="toc-h2 toc-link" data-title="List allergy subresources">List allergy subresources</a>
496 </li>
497 <li>
498 <a href="#create-a-allergy-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Create a allergy sub resource with properties">Create a allergy sub resource with properties</a>
499 </li>
500 <li>
501 <a href="#update-allergy-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Update allergy sub resource with properties">Update allergy sub resource with properties</a>
502 </li>
503 <li>
504 <a href="#delete-allergy-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Delete allergy sub resource with properties">Delete allergy sub resource with properties</a>
505 </li>
506 </ul>
507 </li>
508 <li>
509 <a href="#patientidentifiertype" class="toc-h1 toc-link" data-title="PatientIdentifierType">PatientIdentifierType</a>
510 <ul class="toc-list-h2">
511 <li>
512 <a href="#patientidentifiertype-overview" class="toc-h2 toc-link" data-title="PatientIdentifierType Overview">PatientIdentifierType Overview</a>
513 </li>
514 <li>
515 <a href="#properties-on-patientidentifiertype" class="toc-h2 toc-link" data-title="Properties on PatientIdentifierType:">Properties on PatientIdentifierType:</a>
516 </li>
517 <li>
518 <a href="#available-operations-for-patientidentifiertype" class="toc-h2 toc-link" data-title="Available operations for PatientIdentifierType">Available operations for PatientIdentifierType</a>
519 </li>
520 <li>
521 <a href="#list-patientidentifiertype-resource" class="toc-h2 toc-link" data-title="List PatientIdentifierType resource">List PatientIdentifierType resource</a>
522 </li>
523 <li>
524 <a href="#create-a-patientidentifiertype" class="toc-h2 toc-link" data-title="Create a patientIdentifierType">Create a patientIdentifierType</a>
525 </li>
526 <li>
527 <a href="#update-a-patientidentifiertype" class="toc-h2 toc-link" data-title="Update a patientIdentifierType">Update a patientIdentifierType</a>
528 </li>
529 <li>
530 <a href="#delete-a-patientidentifiertype" class="toc-h2 toc-link" data-title="Delete a patientIdentifierType">Delete a patientIdentifierType</a>
531 </li>
532 </ul>
533 </li>
534 <li>
535 <a href="#visits" class="toc-h1 toc-link" data-title="Visits">Visits</a>
536 <ul class="toc-list-h2">
537 <li>
538 <a href="#visits-overview" class="toc-h2 toc-link" data-title="Visits Overview">Visits Overview</a>
539 </li>
540 <li>
541 <a href="#let-39-s-look-at-an-example-of-visits" class="toc-h2 toc-link" data-title="Let's look at an example of Visits">Let's look at an example of Visits</a>
542 </li>
543 <li>
544 <a href="#visits-sub-resource-types" class="toc-h2 toc-link" data-title="Visits Sub Resource types">Visits Sub Resource types</a>
545 </li>
546 <li>
547 <a href="#available-operations-for-visits" class="toc-h2 toc-link" data-title="Available operations for Visits">Available operations for Visits</a>
548 </li>
549 <li>
550 <a href="#list-visits" class="toc-h2 toc-link" data-title="List visits">List visits</a>
551 </li>
552 <li>
553 <a href="#create-visit" class="toc-h2 toc-link" data-title="Create visit">Create visit</a>
554 </li>
555 <li>
556 <a href="#update-visit" class="toc-h2 toc-link" data-title="Update visit">Update visit</a>
557 </li>
558 <li>
559 <a href="#delete-visit" class="toc-h2 toc-link" data-title="Delete visit">Delete visit</a>
560 </li>
561 <li>
562 <a href="#list-attribute-subresources" class="toc-h2 toc-link" data-title="List attribute subresources">List attribute subresources</a>
563 </li>
564 <li>
565 <a href="#create-an-attribute-subresource-with-properties" class="toc-h2 toc-link" data-title="Create an attribute subresource with properties">Create an attribute subresource with properties</a>
566 </li>
567 <li>
568 <a href="#update-attribute-subresource" class="toc-h2 toc-link" data-title="Update attribute subresource">Update attribute subresource</a>
569 </li>
570 <li>
571 <a href="#delete-attribute-subresource" class="toc-h2 toc-link" data-title="Delete attribute subresource">Delete attribute subresource</a>
572 </li>
573 </ul>
574 </li>
575 <li>
576 <a href="#visits-type" class="toc-h1 toc-link" data-title="Visits Type">Visits Type</a>
577 <ul class="toc-list-h2">
578 <li>
579 <a href="#visits-type-overview" class="toc-h2 toc-link" data-title="Visits Type Overview">Visits Type Overview</a>
580 </li>
581 <li>
582 <a href="#available-operations-for-visits-type" class="toc-h2 toc-link" data-title="Available operations for Visits Type">Available operations for Visits Type</a>
583 </li>
584 <li>
585 <a href="#create-a-visit-type" class="toc-h2 toc-link" data-title="Create a visit type">Create a visit type</a>
586 </li>
587 <li>
588 <a href="#update-a-visit-type" class="toc-h2 toc-link" data-title="Update a visit type">Update a visit type</a>
589 </li>
590 <li>
591 <a href="#delete-a-visit-type" class="toc-h2 toc-link" data-title="Delete a visit type">Delete a visit type</a>
592 </li>
593 </ul>
594 </li>
595 <li>
596 <a href="#visits-attribute-type" class="toc-h1 toc-link" data-title="Visits Attribute Type">Visits Attribute Type</a>
597 <ul class="toc-list-h2">
598 <li>
599 <a href="#visits-attribute-type-overview" class="toc-h2 toc-link" data-title="Visits Attribute Type Overview">Visits Attribute Type Overview</a>
600 </li>
601 <li>
602 <a href="#available-operations-for-visits-attribute-type" class="toc-h2 toc-link" data-title="Available operations for Visits Attribute Type">Available operations for Visits Attribute Type</a>
603 </li>
604 <li>
605 <a href="#list-visits-attribute-types" class="toc-h2 toc-link" data-title="List visits attribute types">List visits attribute types</a>
606 </li>
607 <li>
608 <a href="#create-a-visit-attribute-type" class="toc-h2 toc-link" data-title="Create a visit attribute type">Create a visit attribute type</a>
609 </li>
610 <li>
611 <a href="#update-a-visit-attribute-type" class="toc-h2 toc-link" data-title="Update a visit attribute type">Update a visit attribute type</a>
612 </li>
613 <li>
614 <a href="#delete-a-visit-attribute-type" class="toc-h2 toc-link" data-title="Delete a visit attribute type">Delete a visit attribute type</a>
615 </li>
616 </ul>
617 </li>
618 <li>
619 <a href="#location" class="toc-h1 toc-link" data-title="Location">Location</a>
620 <ul class="toc-list-h2">
621 <li>
622 <a href="#location-overview" class="toc-h2 toc-link" data-title="Location Overview">Location Overview</a>
623 </li>
624 <li>
625 <a href="#location-sub-resource-types" class="toc-h2 toc-link" data-title="Location Sub Resource types">Location Sub Resource types</a>
626 </li>
627 <li>
628 <a href="#available-operations-for-location" class="toc-h2 toc-link" data-title="Available operations for location">Available operations for location</a>
629 </li>
630 <li>
631 <a href="#list-location" class="toc-h2 toc-link" data-title="List location">List location</a>
632 </li>
633 <li>
634 <a href="#create-a-location" class="toc-h2 toc-link" data-title="Create a location">Create a location</a>
635 </li>
636 <li>
637 <a href="#update-a-location" class="toc-h2 toc-link" data-title="Update a location">Update a location</a>
638 </li>
639 <li>
640 <a href="#delete-a-location" class="toc-h2 toc-link" data-title="Delete a location">Delete a location</a>
641 </li>
642 <li>
643 <a href="#list-location-attribute-subresources" class="toc-h2 toc-link" data-title="List location attribute subresources">List location attribute subresources</a>
644 </li>
645 <li>
646 <a href="#create-a-location-attribute-subresource-with-properties" class="toc-h2 toc-link" data-title="Create a location attribute subresource with properties">Create a location attribute subresource with properties</a>
647 </li>
648 <li>
649 <a href="#update-a-location-attribute-subresource" class="toc-h2 toc-link" data-title="Update a location attribute subresource">Update a location attribute subresource</a>
650 </li>
651 <li>
652 <a href="#delete-a-location-attribute-subresource" class="toc-h2 toc-link" data-title="Delete a location attribute subresource">Delete a location attribute subresource</a>
653 </li>
654 </ul>
655 </li>
656 <li>
657 <a href="#location-tag-type" class="toc-h1 toc-link" data-title="Location Tag Type">Location Tag Type</a>
658 <ul class="toc-list-h2">
659 <li>
660 <a href="#location-tag-overview" class="toc-h2 toc-link" data-title="Location Tag Overview">Location Tag Overview</a>
661 </li>
662 <li>
663 <a href="#available-operations-for-location-tag" class="toc-h2 toc-link" data-title="Available operations for Location Tag">Available operations for Location Tag</a>
664 </li>
665 <li>
666 <a href="#list-location-tags" class="toc-h2 toc-link" data-title="List location tags">List location tags</a>
667 </li>
668 <li>
669 <a href="#create-a-location-tag" class="toc-h2 toc-link" data-title="Create a location tag">Create a location tag</a>
670 </li>
671 <li>
672 <a href="#update-a-location-tag" class="toc-h2 toc-link" data-title="Update a location tag">Update a location tag</a>
673 </li>
674 <li>
675 <a href="#delete-a-location-tag" class="toc-h2 toc-link" data-title="Delete a location tag">Delete a location tag</a>
676 </li>
677 </ul>
678 </li>
679 <li>
680 <a href="#location-attribute-type" class="toc-h1 toc-link" data-title="Location Attribute Type">Location Attribute Type</a>
681 <ul class="toc-list-h2">
682 <li>
683 <a href="#location-attribute-overview" class="toc-h2 toc-link" data-title="Location Attribute Overview">Location Attribute Overview</a>
684 </li>
685 <li>
686 <a href="#available-operations-for-location-attribute" class="toc-h2 toc-link" data-title="Available operations for Location Attribute">Available operations for Location Attribute</a>
687 </li>
688 <li>
689 <a href="#create-a-location-attribute-type" class="toc-h2 toc-link" data-title="Create a location attribute type">Create a location attribute type</a>
690 </li>
691 <li>
692 <a href="#update-a-location-attribute-type" class="toc-h2 toc-link" data-title="Update a location attribute type">Update a location attribute type</a>
693 </li>
694 <li>
695 <a href="#delete-a-location-attribute-type" class="toc-h2 toc-link" data-title="Delete a location attribute type">Delete a location attribute type</a>
696 </li>
697 </ul>
698 </li>
699 <li>
700 <a href="#encounters" class="toc-h1 toc-link" data-title="Encounters">Encounters</a>
701 <ul class="toc-list-h2">
702 <li>
703 <a href="#encounter-overview" class="toc-h2 toc-link" data-title="Encounter Overview">Encounter Overview</a>
704 </li>
705 <li>
706 <a href="#let-39-s-look-at-an-example-of-encounter" class="toc-h2 toc-link" data-title="Let's look at an example of Encounter">Let's look at an example of Encounter</a>
707 </li>
708 <li>
709 <a href="#sub-resource-types-of-encounter" class="toc-h2 toc-link" data-title="Sub Resource types of Encounter">Sub Resource types of Encounter</a>
710 </li>
711 <li>
712 <a href="#available-operations-for-encounter" class="toc-h2 toc-link" data-title="Available operations for Encounter">Available operations for Encounter</a>
713 </li>
714 <li>
715 <a href="#list-encounters" class="toc-h2 toc-link" data-title="List encounters">List encounters</a>
716 </li>
717 <li>
718 <a href="#create-an-encounter" class="toc-h2 toc-link" data-title="Create an encounter">Create an encounter</a>
719 </li>
720 <li>
721 <a href="#update-an-encounter" class="toc-h2 toc-link" data-title="Update an encounter">Update an encounter</a>
722 </li>
723 <li>
724 <a href="#delete-an-encounter" class="toc-h2 toc-link" data-title="Delete an encounter">Delete an encounter</a>
725 </li>
726 <li>
727 <a href="#list-encounter-provider-subresources" class="toc-h2 toc-link" data-title="List encounter provider subresources">List encounter provider subresources</a>
728 </li>
729 <li>
730 <a href="#create-an-encounter-provider-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Create an encounter provider sub resource with properties">Create an encounter provider sub resource with properties</a>
731 </li>
732 <li>
733 <a href="#update-encounter-provider-subresource" class="toc-h2 toc-link" data-title="Update encounter provider subresource">Update encounter provider subresource</a>
734 </li>
735 <li>
736 <a href="#delete-encounter-provider-subresource" class="toc-h2 toc-link" data-title="Delete encounter provider subresource">Delete encounter provider subresource</a>
737 </li>
738 </ul>
739 </li>
740 <li>
741 <a href="#encounter-type" class="toc-h1 toc-link" data-title="Encounter Type">Encounter Type</a>
742 <ul class="toc-list-h2">
743 <li>
744 <a href="#encounter-type-overview" class="toc-h2 toc-link" data-title="Encounter Type Overview">Encounter Type Overview</a>
745 </li>
746 <li>
747 <a href="#available-operations-for-encounter-type" class="toc-h2 toc-link" data-title="Available operations for Encounter Type">Available operations for Encounter Type</a>
748 </li>
749 <li>
750 <a href="#list-encounter-types" class="toc-h2 toc-link" data-title="List encounter types">List encounter types</a>
751 </li>
752 <li>
753 <a href="#create-an-encounter-type" class="toc-h2 toc-link" data-title="Create an encounter type">Create an encounter type</a>
754 </li>
755 <li>
756 <a href="#update-an-encounter-type" class="toc-h2 toc-link" data-title="Update an encounter type">Update an encounter type</a>
757 </li>
758 <li>
759 <a href="#delete-an-encounter-type" class="toc-h2 toc-link" data-title="Delete an encounter type">Delete an encounter type</a>
760 </li>
761 </ul>
762 </li>
763 <li>
764 <a href="#encounter-role" class="toc-h1 toc-link" data-title="Encounter Role">Encounter Role</a>
765 <ul class="toc-list-h2">
766 <li>
767 <a href="#encounter-role-overview" class="toc-h2 toc-link" data-title="Encounter Role Overview">Encounter Role Overview</a>
768 </li>
769 <li>
770 <a href="#available-operation-for-encounter-roles" class="toc-h2 toc-link" data-title="Available operation for Encounter Roles">Available operation for Encounter Roles</a>
771 </li>
772 <li>
773 <a href="#list-encounter-roles" class="toc-h2 toc-link" data-title="List encounter roles">List encounter roles</a>
774 </li>
775 <li>
776 <a href="#create-an-encounter-role" class="toc-h2 toc-link" data-title="Create an encounter role">Create an encounter role</a>
777 </li>
778 <li>
779 <a href="#update-an-encounter-role" class="toc-h2 toc-link" data-title="Update an encounter role">Update an encounter role</a>
780 </li>
781 <li>
782 <a href="#delete-an-encounter-role" class="toc-h2 toc-link" data-title="Delete an encounter role">Delete an encounter role</a>
783 </li>
784 </ul>
785 </li>
786 <li>
787 <a href="#concepts" class="toc-h1 toc-link" data-title="Concepts">Concepts</a>
788 <ul class="toc-list-h2">
789 <li>
790 <a href="#concepts-overview" class="toc-h2 toc-link" data-title="Concepts Overview">Concepts Overview</a>
791 </li>
792 <li>
793 <a href="#sub-resource-types-of-concepts" class="toc-h2 toc-link" data-title="Sub Resource types of Concepts">Sub Resource types of Concepts</a>
794 </li>
795 <li>
796 <a href="#available-operations-for-concepts" class="toc-h2 toc-link" data-title="Available operations for Concepts">Available operations for Concepts</a>
797 </li>
798 <li>
799 <a href="#list-concepts" class="toc-h2 toc-link" data-title="List concepts">List concepts</a>
800 </li>
801 <li>
802 <a href="#create-a-concept" class="toc-h2 toc-link" data-title="Create a concept">Create a concept</a>
803 </li>
804 <li>
805 <a href="#update-a-concept" class="toc-h2 toc-link" data-title="Update a concept">Update a concept</a>
806 </li>
807 <li>
808 <a href="#delete-a-concept" class="toc-h2 toc-link" data-title="Delete a concept">Delete a concept</a>
809 </li>
810 <li>
811 <a href="#list-concept-mapping" class="toc-h2 toc-link" data-title="List concept mapping">List concept mapping</a>
812 </li>
813 <li>
814 <a href="#create-a-concept-mapping-with-properties" class="toc-h2 toc-link" data-title="Create a concept mapping with properties">Create a concept mapping with properties</a>
815 </li>
816 <li>
817 <a href="#update-a-concept-mapping" class="toc-h2 toc-link" data-title="Update a concept mapping">Update a concept mapping</a>
818 </li>
819 <li>
820 <a href="#delete-a-concept-mapping" class="toc-h2 toc-link" data-title="Delete a concept mapping">Delete a concept mapping</a>
821 </li>
822 <li>
823 <a href="#list-concept-name" class="toc-h2 toc-link" data-title="List concept name">List concept name</a>
824 </li>
825 <li>
826 <a href="#create-a-concept-name-with-properties" class="toc-h2 toc-link" data-title="Create a concept name with properties">Create a concept name with properties</a>
827 </li>
828 <li>
829 <a href="#update-concept-name" class="toc-h2 toc-link" data-title="Update concept name">Update concept name</a>
830 </li>
831 <li>
832 <a href="#delete-concept-name" class="toc-h2 toc-link" data-title="Delete concept name">Delete concept name</a>
833 </li>
834 <li>
835 <a href="#list-concept-attribute" class="toc-h2 toc-link" data-title="List concept attribute">List concept attribute</a>
836 </li>
837 <li>
838 <a href="#create-a-concept-attribute-with-properties" class="toc-h2 toc-link" data-title="Create a concept attribute with properties">Create a concept attribute with properties</a>
839 </li>
840 <li>
841 <a href="#update-concept-attribute" class="toc-h2 toc-link" data-title="Update concept attribute">Update concept attribute</a>
842 </li>
843 <li>
844 <a href="#delete-concept-attribute" class="toc-h2 toc-link" data-title="Delete concept attribute">Delete concept attribute</a>
845 </li>
846 <li>
847 <a href="#list-concept-descriptions" class="toc-h2 toc-link" data-title="List concept descriptions">List concept descriptions</a>
848 </li>
849 <li>
850 <a href="#create-a-concept-description-with-properties" class="toc-h2 toc-link" data-title="Create a concept description with properties">Create a concept description with properties</a>
851 </li>
852 <li>
853 <a href="#update-concept-description" class="toc-h2 toc-link" data-title="Update concept description">Update concept description</a>
854 </li>
855 <li>
856 <a href="#delete-concept-description" class="toc-h2 toc-link" data-title="Delete concept description">Delete concept description</a>
857 </li>
858 </ul>
859 </li>
860 <li>
861 <a href="#concept-source" class="toc-h1 toc-link" data-title="Concept Source">Concept Source</a>
862 <ul class="toc-list-h2">
863 <li>
864 <a href="#concept-source-overview" class="toc-h2 toc-link" data-title="Concept Source Overview">Concept Source Overview</a>
865 </li>
866 <li>
867 <a href="#available-operations-for-concept-source" class="toc-h2 toc-link" data-title="Available operations for Concept Source.">Available operations for Concept Source.</a>
868 </li>
869 <li>
870 <a href="#list-concept-source" class="toc-h2 toc-link" data-title="List concept source">List concept source</a>
871 </li>
872 <li>
873 <a href="#create-a-concept-source" class="toc-h2 toc-link" data-title="Create a concept source">Create a concept source</a>
874 </li>
875 <li>
876 <a href="#update-a-concept-source" class="toc-h2 toc-link" data-title="Update a concept source">Update a concept source</a>
877 </li>
878 <li>
879 <a href="#delete-a-concept-source" class="toc-h2 toc-link" data-title="Delete a concept source">Delete a concept source</a>
880 </li>
881 </ul>
882 </li>
883 <li>
884 <a href="#concept-attribute-type" class="toc-h1 toc-link" data-title="Concept Attribute Type">Concept Attribute Type</a>
885 <ul class="toc-list-h2">
886 <li>
887 <a href="#concept-attribute-type-overview" class="toc-h2 toc-link" data-title="Concept Attribute Type Overview">Concept Attribute Type Overview</a>
888 </li>
889 <li>
890 <a href="#available-operations-for-concept-attribute-type" class="toc-h2 toc-link" data-title="Available operations for Concept Attribute Type.">Available operations for Concept Attribute Type.</a>
891 </li>
892 <li>
893 <a href="#list-concept-attribute-types" class="toc-h2 toc-link" data-title="List concept attribute types">List concept attribute types</a>
894 </li>
895 <li>
896 <a href="#create-a-concept-attribute-type" class="toc-h2 toc-link" data-title="Create a concept attribute type">Create a concept attribute type</a>
897 </li>
898 <li>
899 <a href="#update-a-concept-attribute-type" class="toc-h2 toc-link" data-title="Update a concept attribute type">Update a concept attribute type</a>
900 </li>
901 <li>
902 <a href="#delete-a-concept-attribute-type" class="toc-h2 toc-link" data-title="Delete a concept attribute type">Delete a concept attribute type</a>
903 </li>
904 </ul>
905 </li>
906 <li>
907 <a href="#concept-data-type" class="toc-h1 toc-link" data-title="Concept Data Type">Concept Data Type</a>
908 <ul class="toc-list-h2">
909 <li>
910 <a href="#concept-data-type-overview" class="toc-h2 toc-link" data-title="Concept Data Type Overview">Concept Data Type Overview</a>
911 </li>
912 <li>
913 <a href="#available-operations-for-concept-data-type" class="toc-h2 toc-link" data-title="Available operations for Concept Data Type.">Available operations for Concept Data Type.</a>
914 </li>
915 <li>
916 <a href="#list-concept-data-types" class="toc-h2 toc-link" data-title="List concept data types">List concept data types</a>
917 </li>
918 <li>
919 <a href="#delete-a-concept-data-type" class="toc-h2 toc-link" data-title="Delete a concept data type">Delete a concept data type</a>
920 </li>
921 </ul>
922 </li>
923 <li>
924 <a href="#concept-map-type" class="toc-h1 toc-link" data-title="Concept Map Type">Concept Map Type</a>
925 <ul class="toc-list-h2">
926 <li>
927 <a href="#overview" class="toc-h2 toc-link" data-title="Overview">Overview</a>
928 </li>
929 <li>
930 <a href="#available-operations" class="toc-h2 toc-link" data-title="Available operations.">Available operations.</a>
931 </li>
932 </ul>
933 </li>
934 <li>
935 <a href="#concept-reference-term" class="toc-h1 toc-link" data-title="Concept Reference Term">Concept Reference Term</a>
936 <ul class="toc-list-h2">
937 <li>
938 <a href="#overview" class="toc-h2 toc-link" data-title="Overview">Overview</a>
939 </li>
940 <li>
941 <a href="#available-operations" class="toc-h2 toc-link" data-title="Available operations.">Available operations.</a>
942 </li>
943 </ul>
944 </li>
945 <li>
946 <a href="#concept-class" class="toc-h1 toc-link" data-title="Concept Class">Concept Class</a>
947 <ul class="toc-list-h2">
948 <li>
949 <a href="#overview" class="toc-h2 toc-link" data-title="Overview">Overview</a>
950 </li>
951 <li>
952 <a href="#available-operations" class="toc-h2 toc-link" data-title="Available operations.">Available operations.</a>
953 </li>
954 </ul>
955 </li>
956 <li>
957 <a href="#providers" class="toc-h1 toc-link" data-title="Providers">Providers</a>
958 <ul class="toc-list-h2">
959 <li>
960 <a href="#provider-overview" class="toc-h2 toc-link" data-title="Provider Overview">Provider Overview</a>
961 </li>
962 <li>
963 <a href="#sub-resource-types-of-provider" class="toc-h2 toc-link" data-title="Sub Resource types of Provider">Sub Resource types of Provider</a>
964 </li>
965 <li>
966 <a href="#provider-attribute" class="toc-h2 toc-link" data-title="Provider Attribute.">Provider Attribute.</a>
967 </li>
968 <li>
969 <a href="#available-operations-for-provider" class="toc-h2 toc-link" data-title="Available operations for Provider.">Available operations for Provider.</a>
970 </li>
971 <li>
972 <a href="#list-providers" class="toc-h2 toc-link" data-title="List providers">List providers</a>
973 </li>
974 <li>
975 <a href="#create-a-provider" class="toc-h2 toc-link" data-title="Create a provider">Create a provider</a>
976 </li>
977 <li>
978 <a href="#update-a-provider" class="toc-h2 toc-link" data-title="Update a provider">Update a provider</a>
979 </li>
980 <li>
981 <a href="#delete-a-provider" class="toc-h2 toc-link" data-title="Delete a provider">Delete a provider</a>
982 </li>
983 <li>
984 <a href="#list-provider-attribute-subresources" class="toc-h2 toc-link" data-title="List provider attribute subresources">List provider attribute subresources</a>
985 </li>
986 <li>
987 <a href="#create-a-provider-attribute-sub-resource-with-properties" class="toc-h2 toc-link" data-title="Create a provider attribute sub resource with properties">Create a provider attribute sub resource with properties</a>
988 </li>
989 <li>
990 <a href="#update-provider-attribute-subresource" class="toc-h2 toc-link" data-title="Update provider attribute subresource">Update provider attribute subresource</a>
991 </li>
992 <li>
993 <a href="#delete-provider-attribute-subresource" class="toc-h2 toc-link" data-title="Delete provider attribute subresource">Delete provider attribute subresource</a>
994 </li>
995 </ul>
996 </li>
997 <li>
998 <a href="#provider-attribute-type" class="toc-h1 toc-link" data-title="Provider Attribute Type">Provider Attribute Type</a>
999 <ul class="toc-list-h2">
1000 <li>
1001 <a href="#provider-attribute-overview" class="toc-h2 toc-link" data-title="Provider Attribute Overview">Provider Attribute Overview</a>
1002 </li>
1003 <li>
1004 <a href="#available-operations-for-provider-attribute-type" class="toc-h2 toc-link" data-title="Available operations for Provider Attribute type.">Available operations for Provider Attribute type.</a>
1005 </li>
1006 <li>
1007 <a href="#list-provider-attribute-types" class="toc-h2 toc-link" data-title="List provider attribute types">List provider attribute types</a>
1008 </li>
1009 <li>
1010 <a href="#create-a-provider-attribute-type" class="toc-h2 toc-link" data-title="Create a provider attribute type">Create a provider attribute type</a>
1011 </li>
1012 <li>
1013 <a href="#update-a-provider-attribute-type" class="toc-h2 toc-link" data-title="Update a provider attribute type">Update a provider attribute type</a>
1014 </li>
1015 <li>
1016 <a href="#delete-a-provider-attribute-type" class="toc-h2 toc-link" data-title="Delete a provider attribute type">Delete a provider attribute type</a>
1017 </li>
1018 </ul>
1019 </li>
1020 <li>
1021 <a href="#observations" class="toc-h1 toc-link" data-title="Observations">Observations</a>
1022 <ul class="toc-list-h2">
1023 <li>
1024 <a href="#observations-overview" class="toc-h2 toc-link" data-title="Observations Overview">Observations Overview</a>
1025 </li>
1026 <li>
1027 <a href="#available-operations-for-observations" class="toc-h2 toc-link" data-title="Available operations for Observations.">Available operations for Observations.</a>
1028 </li>
1029 <li>
1030 <a href="#list-observations" class="toc-h2 toc-link" data-title="List observations">List observations</a>
1031 </li>
1032 <li>
1033 <a href="#create-an-observation" class="toc-h2 toc-link" data-title="Create an observation">Create an observation</a>
1034 </li>
1035 <li>
1036 <a href="#update-an-observation" class="toc-h2 toc-link" data-title="Update an observation">Update an observation</a>
1037 </li>
1038 <li>
1039 <a href="#delete-an-observation" class="toc-h2 toc-link" data-title="Delete an observation">Delete an observation</a>
1040 </li>
1041 </ul>
1042 </li>
1043 <li>
1044 <a href="#order" class="toc-h1 toc-link" data-title="Order">Order</a>
1045 <ul class="toc-list-h2">
1046 <li>
1047 <a href="#order-overview" class="toc-h2 toc-link" data-title="Order Overview">Order Overview</a>
1048 </li>
1049 <li>
1050 <a href="#available-operations-for-order-type" class="toc-h2 toc-link" data-title="Available operations for Order type.">Available operations for Order type.</a>
1051 </li>
1052 <li>
1053 <a href="#list-orders" class="toc-h2 toc-link" data-title="List orders">List orders</a>
1054 </li>
1055 <li>
1056 <a href="#create-an-order" class="toc-h2 toc-link" data-title="Create an order">Create an order</a>
1057 </li>
1058 <li>
1059 <a href="#update-an-order" class="toc-h2 toc-link" data-title="Update an order">Update an order</a>
1060 </li>
1061 <li>
1062 <a href="#delete-an-order" class="toc-h2 toc-link" data-title="Delete an order">Delete an order</a>
1063 </li>
1064 </ul>
1065 </li>
1066 <li>
1067 <a href="#order-type" class="toc-h1 toc-link" data-title="Order type">Order type</a>
1068 <ul class="toc-list-h2">
1069 <li>
1070 <a href="#order-type-overview" class="toc-h2 toc-link" data-title="Order type Overview">Order type Overview</a>
1071 </li>
1072 <li>
1073 <a href="#available-operations-for-order-type" class="toc-h2 toc-link" data-title="Available operations for Order type.">Available operations for Order type.</a>
1074 </li>
1075 <li>
1076 <a href="#list-orders" class="toc-h2 toc-link" data-title="List orders">List orders</a>
1077 </li>
1078 <li>
1079 <a href="#create-an-order-type" class="toc-h2 toc-link" data-title="Create an order type">Create an order type</a>
1080 </li>
1081 <li>
1082 <a href="#update-an-order-type" class="toc-h2 toc-link" data-title="Update an order type">Update an order type</a>
1083 </li>
1084 <li>
1085 <a href="#delete-an-order-type" class="toc-h2 toc-link" data-title="Delete an order type">Delete an order type</a>
1086 </li>
1087 </ul>
1088 </li>
1089 <li>
1090 <a href="#forms" class="toc-h1 toc-link" data-title="Forms">Forms</a>
1091 <ul class="toc-list-h2">
1092 <li>
1093 <a href="#forms-overview" class="toc-h2 toc-link" data-title="Forms Overview">Forms Overview</a>
1094 </li>
1095 <li>
1096 <a href="#subresource-types-of-forms" class="toc-h2 toc-link" data-title="Subresource types of Forms">Subresource types of Forms</a>
1097 </li>
1098 <li>
1099 <a href="#available-operations-for-forms" class="toc-h2 toc-link" data-title="Available operations for Forms">Available operations for Forms</a>
1100 </li>
1101 <li>
1102 <a href="#list-forms" class="toc-h2 toc-link" data-title="List Forms">List Forms</a>
1103 </li>
1104 <li>
1105 <a href="#create-a-form" class="toc-h2 toc-link" data-title="Create-a-form">Create-a-form</a>
1106 </li>
1107 <li>
1108 <a href="#update-a-form" class="toc-h2 toc-link" data-title="Update a form">Update a form</a>
1109 </li>
1110 <li>
1111 <a href="#delete-a-form" class="toc-h2 toc-link" data-title="Delete a form">Delete a form</a>
1112 </li>
1113 <li>
1114 <a href="#list-formfields" class="toc-h2 toc-link" data-title="List formfields">List formfields</a>
1115 </li>
1116 <li>
1117 <a href="#create-formfield-subresource-with-properties" class="toc-h2 toc-link" data-title="create formfield subresource with properties">create formfield subresource with properties</a>
1118 </li>
1119 <li>
1120 <a href="#update-formfields-subresource-with-properties" class="toc-h2 toc-link" data-title="Update formFields subresource with properties">Update formFields subresource with properties</a>
1121 </li>
1122 <li>
1123 <a href="#delete-formfields-subresource-with-properties" class="toc-h2 toc-link" data-title="Delete formFields subresource with properties">Delete formFields subresource with properties</a>
1124 </li>
1125 </ul>
1126 </li>
1127 <li>
1128 <a href="#contributing" class="toc-h1 toc-link" data-title="Contributing">Contributing</a>
1129 </li>
1130 </ul>
1131 <ul class="toc-footer">
1132 <li><a href='https://openmrs.org/'>OpenMRS website</a></li>
1133 <li><a href='https://github.com/openmrs'>OpenMRS on GitHub</a></li>
1134 <li><a href='https://wiki.openmrs.org/'>OpenMRS wiki</a></li>
1135 <li><a href='https://wiki.openmrs.org/x/toJuBg'>OpenMRS SDK setup guide</a></li>
1136 </ul>
1137 </div>
1138 <div class="page-wrapper">
1139 <div class="dark-box"></div>
1140 <div class="content">
1141 <h1 id='openmrs-rest-api'>OpenMRS REST API</h1>
1142<blockquote>
1143<p>Getting started with examples. </p>
1144</blockquote>
1145<pre class="highlight java tab-java"><code>
1146<span class="c1">//before executing the examples, get the okttp dependency jar and import it the project.</span>
1147<span class="c1">//these code stubs will be elided from all the examples for clarity</span>
1148
1149<span class="kn">import</span> <span class="nn">okhttp3.MediaType</span><span class="o">;</span>
1150<span class="kn">import</span> <span class="nn">okhttp3.OkHttpClient</span><span class="o">;</span>
1151<span class="kn">import</span> <span class="nn">okhttp3.Request</span><span class="o">;</span>
1152<span class="kn">import</span> <span class="nn">okhttp3.RequestBody</span><span class="o">;</span>
1153<span class="kn">import</span> <span class="nn">okhttp3.Response</span><span class="o">;</span>
1154<span class="kn">import</span> <span class="nn">java.io.IOException</span><span class="o">;</span>
1155
1156<span class="kd">public</span> <span class="kd">class</span> <span class="nc">Main</span> <span class="o">{</span>
1157 <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
1158 <span class="k">try</span> <span class="o">{</span>
1159 <span class="c1">// the examples go here</span>
1160
1161 <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">exception</span><span class="o">)</span> <span class="o">{</span>
1162
1163 <span class="c1">//handle exception here</span>
1164 <span class="o">}</span>
1165 <span class="o">}</span>
1166<span class="o">}</span>
1167
1168</code></pre>
1169<p>Welcome to the OpenMRS REST API documentation! OpenMRS is a software
1170platform and a reference application which enables the design of a customized
1171medical records system with no programming knowledge (although medical and
1172systems analysis knowledge is required).</p>
1173
1174<p>It is a common platform upon which medical informatics efforts in developing
1175countries can be built. The system is based on a conceptual database structure
1176which is not dependent on the actual types of medical information required to
1177be collected or on particular data collection forms and so can be customized
1178for different uses.</p>
1179
1180<p>This document provides High level documentation of OpenMRS APIs with code
1181samples which are in the dark area to the right. If you find anything missing
1182or incorrect please consider proposing revision on <a href="https://github.com/openmrs/openmrs-contrib-rest-api-docs">GitHub</a>.</p>
1183
1184<p>This documentation serves as a reference to the bespoke <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">REST</a>
1185API for <a href="https://openmrs.org/">OpenMRS</a>.</p>
1186<h1 id='getting-started'>Getting Started</h1>
1187<p>If you are new to OpenMRS checkout the <a href="https://wiki.openmrs.org/display/docs/Getting+Started+as+a+Developer">Getting Started as a Developer Guide</a>
1188from OpenMRS</p>
1189<h1 id='current-version'>Current version</h1>
1190<ul>
1191<li><p>By default, all requests to <code>/openmrs/ws/rest</code> receive the v1 version of the REST API.</p></li>
1192<li><p>The OpenMRS REST Web Services module includes dynamically generated documentation.
1193For example, see the
1194<a href="https://demo.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm">swagger documentation</a> on the demo server (username <strong>admin</strong>, password <strong>Admin123</strong>).</p></li>
1195</ul>
1196<h1 id='purpose'>Purpose</h1>
1197<ul>
1198<li><p>The purpose of this documentation is to provide a brief and good taste and experience of the APIs that are used in OpenMRS community to the new developers so that they can onboard in the projects within the organization easily.</p></li>
1199<li><p>The documentation also aims to assist the existing developers in getting to know the APIs' conceptual context and how they help the consumers during the interaction in the real world.</p></li>
1200</ul>
1201<h1 id='schema'>Schema</h1>
1202<blockquote>
1203<p>Fetching concepts</p>
1204</blockquote>
1205<pre class="highlight shell tab-shell"><code>curl -X GET <span class="s2">"https://demo.openmrs.org/openmrs/ws/rest/v1/concept"</span>
1206connection: keep-alive
1207content-length: 9731
1208content-type: application/json;charset<span class="o">=</span>UTF-8
1209date: Wed, 20 Nov 2019 14:13:54 GMT
1210etag: <span class="s2">"04c83ff0cf2cc35cf05a2075ad117df83"</span>
1211server: nginx/1.10.3 <span class="o">(</span>Ubuntu<span class="o">)</span>
1212strict-transport-security: max-age<span class="o">=</span>15768000
1213</code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1214 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1215<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1216 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/concept"</span><span class="o">)</span>
1217 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"GET"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1218 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1219 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1220 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1221<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1222</code></pre>
1223<p>All API access is over HTTPS, and can be accessed from <code>https://demo.openmrs.org/openmrs/ws/rest/v1</code>. All data is sent and received as JSON.</p>
1224<h1 id='resources'>Resources</h1>
1225<ul>
1226<li><p>OpenMRS objects (persons, patients, encounters, observations, etc.) are exposed by the REST Web Services
1227modules as a REST resource, as documented here.</p></li>
1228<li><p>Resources have a default representation, which returns key properties. Most resources can be fetched using a
1229full representation (using the parameter <code>v=full</code>) that includes a more comprehensive list of properties.</p></li>
1230</ul>
1231<h1 id='subresources'>Subresources</h1>
1232<ul>
1233<li><p>Some resources are not defined or do not make sense apart from their parent object. We refer
1234to these as subresources.</p></li>
1235<li><p>Examples of subresources are PersonNames, PersonAddresses, ConceptNames, etc.</p></li>
1236<li><p>You can act on subresources under the parent's URL</p></li>
1237</ul>
1238<h3 id='examples'>Examples</h3>
1239<blockquote>
1240<p>Adding a person's name</p>
1241</blockquote>
1242<pre class="highlight shell tab-shell"><code>POST /openmrs/ws/rest/v1/person/:target_person_uuid/name
1243<span class="o">{</span>
1244 <span class="s2">"givenName"</span>: <span class="s2">"John"</span>,
1245 <span class="s2">"familyName"</span>: <span class="s2">"Smith"</span>
1246<span class="o">}</span>
1247</code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1248 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1249<span class="n">MediaType</span> <span class="n">mediaType</span> <span class="o">=</span> <span class="n">MediaType</span><span class="o">.</span><span class="na">parse</span><span class="o">(</span><span class="s">"application/json"</span><span class="o">);</span>
1250<span class="n">RequestBody</span> <span class="n">body</span> <span class="o">=</span> <span class="n">RequestBody</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">mediaType</span><span class="o">,</span> <span class="s">"{\r\n \"givenName\": \"John\",\r\n \"familyName\": \"Smith\"\r\n}"</span><span class="o">);</span>
1251<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1252 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/person/070f0120-0283-4858-885d-a20d967729cf/name
1253"</span><span class="o">)</span>
1254 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"POST"</span><span class="o">,</span> <span class="n">body</span><span class="o">)</span>
1255 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1256 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Content-Type"</span><span class="o">,</span> <span class="s">"application/json"</span><span class="o">)</span>
1257 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1258 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1259<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1260</code></pre><h4 id='adding-a-person-name'>Adding a person name.</h4>
1261<blockquote>
1262<p>Editing a person's name</p>
1263</blockquote>
1264<pre class="highlight shell tab-shell"><code>POST /openmrs/ws/rest/v1/person/:target_person_uuid/name/:target_name_uuid
1265<span class="o">{</span>
1266 <span class="s2">"givenName"</span>: <span class="s2">"Johnny"</span>
1267<span class="o">}</span>
1268</code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1269 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1270<span class="n">MediaType</span> <span class="n">mediaType</span> <span class="o">=</span> <span class="n">MediaType</span><span class="o">.</span><span class="na">parse</span><span class="o">(</span><span class="s">"application/json"</span><span class="o">);</span>
1271<span class="n">RequestBody</span> <span class="n">body</span> <span class="o">=</span> <span class="n">RequestBody</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">mediaType</span><span class="o">,</span> <span class="s">"{\r\n \"givenName\": \"Johnny\"\r\n}"</span><span class="o">);</span>
1272<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1273 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/person/070f0120-0283-4858-885d-a20d967729cf/name/c280a829-7a86-47a5-b876-df8f53e89dac
1274"</span><span class="o">)</span>
1275 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"POST"</span><span class="o">,</span> <span class="n">body</span><span class="o">)</span>
1276 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1277 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Content-Type"</span><span class="o">,</span> <span class="s">"application/json"</span><span class="o">)</span>
1278 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1279 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1280<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1281</code></pre><h4 id='editing-a-person-39-s-name'>Editing a person's name.</h4>
1282<ul>
1283<li><p>A subresource can have only one parent.</p></li>
1284<li><p>If it seems like a resource has two or more parents, then it is most likely a top-level resource.</p></li>
1285<li><p>For example, "encounters" should not be a subresource of "patient" and "location" resources (answering questions of "all encounters of a patient" and "all encounters at a location").</p></li>
1286</ul>
1287<h4 id='instead-these-should-be-queries-on-the-encounter-resource'>Instead, these should be queries on the encounter resource:</h4><h3 id='get-an-encounter-list-for-a-specific-patient'>Get an encounter list for a specific patient.</h3>
1288<blockquote>
1289<p>Get an encounter list for a specific patient</p>
1290</blockquote>
1291<pre class="highlight shell tab-shell"><code> GET /encounter?patient<span class="o">=</span>:target_patient_uuid
1292</code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1293 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1294<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1295 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/encounter?patient=7379bf1c-b64f-4958-b27f-2a769d8d291c"</span><span class="o">)</span>
1296 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"GET"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1297 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1298 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1299 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1300<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1301</code></pre><h3 id='get-an-encounter-list-for-a-specific-location'>Get an encounter list for a specific location.</h3>
1302<blockquote>
1303<p>Get an encounter list for a specific location</p>
1304</blockquote>
1305<pre class="highlight shell tab-shell"><code> GET /encounter?location<span class="o">=</span>:target_location_uuid
1306</code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1307 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1308<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1309 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/encounter?location=aff27d58-a15c-49a6-9beb-d30dcfc0c66e"</span><span class="o">)</span>
1310 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"GET"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1311 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1312 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1313 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1314<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1315</code></pre><h1 id='resources-with-subtypes'>Resources with subtypes</h1>
1316<ul>
1317<li><p>Some resources can have subtypes. For example, the Order resource contains DrugOrder and TestOrder subtypes</p></li>
1318<li><p>When creating a resource that has subtypes via a <code>POST</code>, you must specify which subtype of the resource you are creating,
1319with a special t property of the resource.</p></li>
1320</ul>
1321<h3 id='examples-2'>Examples</h3>
1322<blockquote>
1323<p>POST examples on order resource</p>
1324</blockquote>
1325<pre class="highlight shell tab-shell"><code>POST /openmrs/ws/rest/v1/order
1326<span class="o">{</span>
1327 <span class="s2">"type"</span>:<span class="s2">"testorder"</span>,
1328 <span class="s2">"encounter"</span>: <span class="s2">"69f83020-caf2-4c9e-bca7-89b8e62b52e1"</span>,
1329 <span class="s2">"action"</span>: <span class="s2">"new"</span>,
1330 <span class="s2">"urgency"</span>: <span class="s2">"ROUTINE"</span>,
1331 <span class="s2">"dateActivated"</span>: <span class="s2">"2018-10-16 12:08:43"</span>
1332<span class="o">}</span>
1333</code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1334 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1335<span class="n">MediaType</span> <span class="n">mediaType</span> <span class="o">=</span> <span class="n">MediaType</span><span class="o">.</span><span class="na">parse</span><span class="o">(</span><span class="s">"application/json"</span><span class="o">);</span>
1336<span class="n">RequestBody</span> <span class="n">body</span> <span class="o">=</span> <span class="n">RequestBody</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">mediaType</span><span class="o">,</span> <span class="s">"{\r\n \"type\":\"testorder\",\r\n \"encounter\": \"69f83020-caf2-4c9e-bca7-89b8e62b52e1\",\r\n \"action\": \"new\",\r\n \"urgency\": \"ROUTINE\",\r\n \"dateActivated\": \"2018-10-16 12:08:43\"\r\n}"</span><span class="o">);</span>
1337<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1338 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/order"</span><span class="o">)</span>
1339 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"POST"</span><span class="o">,</span> <span class="n">body</span><span class="o">)</span>
1340 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1341 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Content-Type"</span><span class="o">,</span> <span class="s">"application/json"</span><span class="o">)</span>
1342 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1343 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1344<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1345</code></pre>
1346<ul>
1347<li><p>If you GET a resource that has subtypes, each result will be one of those subtypes,
1348which you can see by looking at the special property of each result.</p></li>
1349<li><p>You may query for only a certain subtype of a resource by providing a t query parameter.</p></li>
1350</ul>
1351<h3 id='get-encounter-orders-of-drug-order-subtype'>Get encounter orders of drug order subtype.</h3>
1352<blockquote>
1353<p>Get encounter orders of drug order subtype</p>
1354</blockquote>
1355<pre class="highlight shell tab-shell"><code>GET /openmrs/ws/rest/v1/order?type<span class="o">=</span>drugorder&v<span class="o">=</span>full<span class="s1">'
1356</span></code></pre><pre class="highlight java tab-java"><code><span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1357 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1358<span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1359 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/order?type=drugorder"</span><span class="o">)</span>
1360 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"GET"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1361 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1362 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Cookie"</span><span class="o">,</span> <span class="s">"JSESSIONID=6D8DA35A3C57ECF332AFACC843609A23"</span><span class="o">)</span>
1363 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1364<span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1365</code></pre><h1 id='authentication'>Authentication</h1>
1366<ul>
1367<li><p>Almost every API endpoint(other than the <code>/session</code> endpoint) in OpenMRS API requires authentication
1368in order to interact.</p></li>
1369<li><p>Currently, only BASIC authentication is supported. Along with the HTTP request, a request header of
1370<code>Authorization: Basic <base64 of username:password></code> needs to be sent.</p></li>
1371<li><p>Alternatively, a session token can be used to interact with the API endpoints.</p></li>
1372</ul>
1373<h2 id='retrieve-session-token'>Retrieve session token</h2><pre class="highlight shell tab-shell"><code>GET /openmrs/ws/rest/v1/session
1374 -H <span class="s1">'Authorization: Basic Auth <base64 encoded username:password'</span>
1375
1376HTTP/1.1 200 OK
1377Set-Cookie: <span class="nv">JSESSIONID</span><span class="o">=</span>FB0629C001449CE14DF1078ACDDBA858; <span class="nv">Path</span><span class="o">=</span>/openmrs; HttpOnly
1378<span class="o">{</span>
1379 <span class="s2">"authenticated"</span>: <span class="nb">true</span>,
1380 <span class="s2">"locale"</span>: <span class="s2">"en_GB"</span>,
1381 <span class="s2">"sessionId"</span>: <span class="s2">"FB0629C001449CE14DF1078ACDDBA858"</span>,
1382 <span class="s2">"user"</span>: <span class="o">{</span>
1383 <span class="s2">"systemId"</span>: <span class="s2">"admin"</span>,
1384 <span class="o">}</span>
1385<span class="o">}</span>
1386</code></pre><pre class="highlight java tab-java"><code> <span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1387 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1388 <span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1389 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/session"</span><span class="o">)</span>
1390 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"GET"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1391 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1392 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1393 <span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1394
1395</code></pre>
1396<p>The session token is retrieved using Basic authentication on the <code>/session</code> endpoint. The response will include a <code>JSESSIONID</code> in the header. This session ID is also included in the response object</p>
1397
1398<p>The session token is retrieved using Basic authentication on the <code>/session</code> endpoint. The response will include a <code>JSESSIONID</code> in the header. This session ID is also included in the response object</p>
1399
1400<p>The <code>sessionId</code> token should be passed with all subsequent calls as a cookie named <code>JSESSIONID</code>.</p>
1401<h2 id='logout-user-end-session'>Logout User/End session</h2><pre class="highlight shell tab-shell"><code>DELETE /openmrs/ws/rest/v1/session -H <span class="s1">'Accept: application/json'</span>
1402-H <span class="s1">'Authorization: Basic Auth'</span> <span class="o">(</span>required to identify the user<span class="o">)</span>
1403</code></pre><pre class="highlight java tab-java"><code> <span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">().</span><span class="na">build</span><span class="o">();</span>
1404 <span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1405 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/session"</span><span class="o">)</span>
1406 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"DELETE"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1407 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1408 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1409 <span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1410</code></pre><h2 id='changing-password'>Changing Password</h2><pre class="highlight java tab-java"><code>
1411 <span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1412 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1413 <span class="n">MediaType</span> <span class="n">mediaType</span> <span class="o">=</span> <span class="n">MediaType</span><span class="o">.</span><span class="na">parse</span><span class="o">(</span><span class="s">"application/json"</span><span class="o">);</span>
1414
1415 <span class="c1">//password should contain atleast 1 integer</span>
1416 <span class="n">RequestBody</span> <span class="n">body</span> <span class="o">=</span> <span class="n">RequestBody</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">mediaType</span><span class="o">,</span> <span class="s">"{ \r\n \"newPassword\" : \"password1\"\r\n}"</span><span class="o">);</span>
1417 <span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1418 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/password/45ce6c2e-dd5a-11e6-9d9c-0242ac150002"</span><span class="o">)</span>
1419 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"POST"</span><span class="o">,</span> <span class="n">body</span><span class="o">)</span>
1420 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1421 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Content-Type"</span><span class="o">,</span> <span class="s">"application/json"</span><span class="o">)</span>
1422 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1423 <span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1424<span class="o">}</span>
1425
1426</code></pre><pre class="highlight shell tab-shell"><code>POST /openmrs/ws/rest/v1/password/:target_user_uuid
1427<span class="o">{</span>
1428 <span class="s2">"newPassword"</span> : <span class="s2">"newPassword"</span>
1429<span class="o">}</span>
1430</code></pre>
1431<p><b>Since version 2.17 of the webservices.rest module:</b></p>
1432
1433<ul>
1434<li>An administrator (with the <code>EDIT_USER_PASSWORDS</code> privilege) can change the password for other users by
1435posting a new password to <code>/password/:target_user_uuid</code>.</li>
1436<li>The new password must contain atleast one integer.</li>
1437</ul>
1438<pre class="highlight shell tab-shell"><code>POST /openmrs/ws/rest/v1/password
1439<span class="o">{</span>
1440 <span class="s2">"oldPassword"</span> : <span class="s2">"oldPassword"</span>,
1441 <span class="s2">"newPassword"</span> : <span class="s2">"newPassword"</span>
1442<span class="o">}</span>
1443</code></pre><pre class="highlight java tab-java"><code> <span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">().</span><span class="na">build</span><span class="o">();</span>
1444 <span class="n">MediaType</span> <span class="n">mediaType</span> <span class="o">=</span> <span class="n">MediaType</span><span class="o">.</span><span class="na">parse</span><span class="o">(</span><span class="s">"application/json"</span><span class="o">);</span>
1445
1446 <span class="n">RequestBody</span> <span class="n">body</span> <span class="o">=</span> <span class="n">RequestBody</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">mediaType</span><span class="o">,</span> <span class="s">"{\r\n \"oldPassword\" : \"Admin123\",\r\n \"newPassword\" : \"newPassword1\"\r\n}"</span><span class="o">);</span>
1447 <span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1448 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/password"</span><span class="o">)</span>
1449 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"POST"</span><span class="o">,</span> <span class="n">body</span><span class="o">)</span>
1450 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1451 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Content-Type"</span><span class="o">,</span> <span class="s">"application/json"</span><span class="o">)</span>
1452 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1453 <span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1454</code></pre>
1455<ul>
1456<li>After authenticating user can change their own password, by posting to <code>/password</code>.</li>
1457<li>The new password must contain atleast one integer.</li>
1458</ul>
1459<h2 id='getting-all-location-without-authentication'>Getting all location without authentication</h2><pre class="highlight shell tab-shell"><code>GET /openmrs/ws/rest/v1/location?tag<span class="o">=</span>Login+Location<span class="s1">'
1460</span></code></pre><pre class="highlight java tab-java"><code>
1461 <span class="n">OkHttpClient</span> <span class="n">client</span> <span class="o">=</span> <span class="k">new</span> <span class="n">OkHttpClient</span><span class="o">().</span><span class="na">newBuilder</span><span class="o">()</span>
1462 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1463 <span class="n">Request</span> <span class="n">request</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Request</span><span class="o">.</span><span class="na">Builder</span><span class="o">()</span>
1464 <span class="o">.</span><span class="na">url</span><span class="o">(</span><span class="s">"https://demo.openmrs.org/openmrs/ws/rest/v1/location?tag=Login+Location"</span><span class="o">)</span>
1465 <span class="o">.</span><span class="na">method</span><span class="o">(</span><span class="s">"GET"</span><span class="o">,</span> <span class="kc">null</span><span class="o">)</span>
1466 <span class="o">.</span><span class="na">addHeader</span><span class="o">(</span><span class="s">"Authorization"</span><span class="o">,</span> <span class="s">"Basic YWRtaW46QWRtaW4xMjM="</span><span class="o">)</span>
1467 <span class="o">.</span><span class="na">build</span><span class="o">();</span>
1468 <span class="n">Response</span> <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">newCall</span><span class="o">(</span><span class="n">request</span><span class="o">).</span><span class="na">execute</span><span class="o">();</span>
1469
1470</code></pre>
1471<p>While fetching individual locations requires authentication, you can get a list of available locations by passing
1472the special <code>tag</code> "Login Location" as a query parameter.</p>
1473<h1 id='system-setting'>System Setting</h1><h2 id='system-setting-overview'>System Setting Overview</h2>
1474<ul>
1475<li><p>System Settings are used to store module and system-wide settings. They primarily consist of a property name and a value and a description explaining how this property is being used.</p></li>
1476<li><p>System Settings are configuration variables that can be modified without restarting or recompiling the application. They're useful when module code needs to refer to a value that's unique to a particular installation, such as a concept ID number or a file path.</p></li>
1477<li><p>some examples : </p>
1478
1479<ul>
1480<li>system-wide setting: <code>Default Location</code> which specifies the name of the location to use as a system default. </li>
1481<li>module-specific system setting: <code>Require Email as Username</code> is a system setting under the user module which accepts boolean type as a valid value. </li>
1482</ul></li>
1483</ul>
1484<h2 id='available-operations-for-systemsetting-type'>Available operations for systemsetting type.</h2>
1485<ol>
1486<li><a href="#list-system-settings">List System Settings</a></li>
1487<li><a href="#create-a-system-setting">Create a System Setting</a></li>
1488<li><a href="#update-a-system-setting">Update a System Setting</a></li>
1489<li><a href="#delete-a-system-setting">Delete a System Setting</a></li>
1490</ol>
1491<h2 id='list-system-settings'>List System Settings</h2><pre class="highlight shell_session"><code>GET /systemsetting?limit=5
1492</code></pre>
1493<ul>
1494<li>Fetch all non-retired System Settings that match any specified parameters otherwise fetch all non-retired System Settings.
1495If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</li>
1496</ul>
1497<h3 id='query-parameters'>Query Parameters</h3>
1498<table><thead>
1499<tr>
1500<th>Parameter</th>
1501<th>Type</th>
1502<th>Description</th>
1503</tr>
1504</thead><tbody>
1505<tr>
1506<td><em>limit</em></td>
1507<td><code>integer</code></td>
1508<td>use this parameter to limit the number of results to be returned</td>
1509</tr>
1510<tr>
1511<td><em>startIndex</em></td>
1512<td><code>integer</code></td>
1513<td>the offset where to start the query</td>
1514</tr>
1515<tr>
1516<td><em>v</em></td>
1517<td><code>String</code></td>
1518<td>the required representation to return (i.e., ref, default, full or custom )</td>
1519</tr>
1520<tr>
1521<td><em>q</em></td>
1522<td><code>String</code></td>
1523<td>the search query</td>
1524</tr>
1525</tbody></table>
1526<h3 id='get-a-particular-system-setting'>Get a particular System Setting</h3><pre class="highlight shell_session"><code>GET /systemsetting/:target_systemsetting_uuid
1527</code></pre>
1528<p>Retrieve a particular System Setting. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
1529<h2 id='create-a-system-setting'>Create a System Setting</h2><pre class="highlight shell_session"><code>POST /systemsetting
1530{
1531 "property": "property name",
1532 "description": "dummy description",
1533 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
1534 "datatypeConfig": "default",
1535 "preferredHandlerClassname":"org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler"
1536 "handlerConfig": "default",
1537 "value": "dummy value"
1538}
1539</code></pre>
1540<ul>
1541<li><p>To create a System Setting, you need to specify below attributes in the request body. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
1542<h3 id='attributes'>Attributes</h3>
1543<table><thead>
1544<tr>
1545<th>Parameter</th>
1546<th>Type</th>
1547<th>Description</th>
1548</tr>
1549</thead><tbody>
1550<tr>
1551<td><em>property</em></td>
1552<td><code>String</code></td>
1553<td>the property name for this System Setting, names can be up to 255 chars, must be unique, and follow a convention of module ID followed by category & name lower camelCase separated by periods for e.g., addresshierarchy.allowFreetext.</td>
1554</tr>
1555<tr>
1556<td><em>description</em></td>
1557<td><code>String</code></td>
1558<td>a description for the usage of this property.</td>
1559</tr>
1560<tr>
1561<td><em>datatypeClassname</em></td>
1562<td><code>String</code></td>
1563<td>Data type for this System Setting.OpenMRS provides Custom data type resource, which gives flexibility to select the data type accordingly.</td>
1564</tr>
1565<tr>
1566<td><em>datatypeConfig</em></td>
1567<td><code>String</code></td>
1568<td>An optional identifier from the fulfiller e.g., lab</td>
1569</tr>
1570<tr>
1571<td><em>preferredHandlerClassname</em></td>
1572<td><code>String</code></td>
1573<td>Handler subresource for the Custom Data Type used. Can optionally define a specific handler class wants to use (otherwise, the framework will choose the best handler for the chosen DataType).</td>
1574</tr>
1575<tr>
1576<td><em>handlerConfig</em></td>
1577<td><code>String</code></td>
1578<td>Allow the handler have any name and config it wants/needs. This will help to identify the data type unambiguously which has been contained and will allow introspecting.</td>
1579</tr>
1580<tr>
1581<td><em>value</em></td>
1582<td><code>String</code></td>
1583<td>the value assigned to this system setting.</td>
1584</tr>
1585</tbody></table></li>
1586</ul>
1587<h2 id='update-a-system-setting'>Update a System Setting</h2><pre class="highlight shell_session"><code>POST /systemsetting/:target_systemsetting_uuid
1588{
1589 "property": "property name",
1590 "description": "dummy description",
1591 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
1592 "datatypeConfig": "default",
1593 "preferredHandlerClassname":"org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler"
1594 "handlerConfig": "default",
1595 "value": "dummy value"
1596}
1597</code></pre>
1598<ul>
1599<li>Update a System Setting with given UUID, this method only modifies properties in the request. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</li>
1600</ul>
1601<h3 id='attributes-2'>Attributes</h3>
1602<table><thead>
1603<tr>
1604<th>Parameter</th>
1605<th>Type</th>
1606<th>Description</th>
1607</tr>
1608</thead><tbody>
1609<tr>
1610<td><em>property</em></td>
1611<td><code>String</code></td>
1612<td>the property name for this System Setting, names can be up to 255 chars, must be unique, and follow a convention of module ID followed by category & name lower camelCase separated by periods for e.g., addresshierarchy.allowFreetext.</td>
1613</tr>
1614<tr>
1615<td><em>description</em></td>
1616<td><code>String</code></td>
1617<td>a description for the usage of this property.</td>
1618</tr>
1619<tr>
1620<td><em>datatypeClassname</em></td>
1621<td><code>String</code></td>
1622<td>Data type for this System Setting.OpenMRS provides Custom data type resource, which gives flexibility to select the data type accordingly.</td>
1623</tr>
1624<tr>
1625<td><em>datatypeConfig</em></td>
1626<td><code>String</code></td>
1627<td>An optional identifier from the fulfiller e.g., lab</td>
1628</tr>
1629<tr>
1630<td><em>preferredHandlerClassname</em></td>
1631<td><code>String</code></td>
1632<td>Handler subresource for the Custom Data Type used. Can optionally define a specific handler class wants to use (otherwise, the framework will choose the best handler for the chosen DataType).</td>
1633</tr>
1634<tr>
1635<td><em>handlerConfig</em></td>
1636<td><code>String</code></td>
1637<td>Allow the handler have any name and config it wants/needs. This will help to identify the data type unambiguously which has been contained and will allow introspecting.</td>
1638</tr>
1639<tr>
1640<td><em>value</em></td>
1641<td><code>String</code></td>
1642<td>the value assigned to this system setting.</td>
1643</tr>
1644</tbody></table>
1645<h2 id='delete-a-system-setting'>Delete a System Setting</h2><pre class="highlight shell_session"><code>DELETE /systemsetting/:target_systemsetting_uuid?purge=true
1646</code></pre>
1647<ul>
1648<li><p>Delete or void a System Setting by its UUID. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
1649<h3 id='query-parameters-2'>Query Parameters</h3>
1650<table><thead>
1651<tr>
1652<th>Parameter</th>
1653<th>Type</th>
1654<th>Description</th>
1655</tr>
1656</thead><tbody>
1657<tr>
1658<td><em>purge</em></td>
1659<td><code>Boolean</code></td>
1660<td>The resource will be voided unless purge = ‘true’.Purging will attempt to remove the attribute type from the system irreversibly. Attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
1661</tr>
1662</tbody></table></li>
1663</ul>
1664<h1 id='system-information'>System Information</h1><h2 id='system-information-overview'>System Information Overview</h2>
1665<ul>
1666<li>System Information directly fetches the system information from AdministrationService and displays it by splitting it into name value pairs across 5 headers in legacy UI module.</li>
1667</ul>
1668
1669<table><thead>
1670<tr>
1671<th>Header</th>
1672<th>Brief Description</th>
1673</tr>
1674</thead><tbody>
1675<tr>
1676<td>1. OpenMRS Information</td>
1677<td>This section holds information like OpenMRS Version Snapshot and other system wide informations like System Date and Time.</td>
1678</tr>
1679<tr>
1680<td>2. Java Runtime Environment Information</td>
1681<td>This section has the relevant Java parameters along with the the operating system and its architecture information.For e.g. <code>Operating System</code> : <code>Linux</code></td>
1682</tr>
1683<tr>
1684<td>3. Memory Information</td>
1685<td>This section holds the total , free and the maximum heap Size memory information of the system.</td>
1686</tr>
1687<tr>
1688<td>4. Database Information</td>
1689<td>This section has the relevant information about the database. For e.g. <code>Database Schema name</code> : <code>openmrs-db</code></td>
1690</tr>
1691<tr>
1692<td>5. Module Information</td>
1693<td>This section has the record of all the snapshot versions for each of the current modules. For e.g. <code>Allergy UI Module</code> : <code>1.8.3-SNAPSHOT</code></td>
1694</tr>
1695</tbody></table>
1696<h2 id='available-operations-for-systeminformation-type'>Available operations for systeminformation type.</h2><h2 id='list-system-inforamation'>List System Inforamation</h2><pre class="highlight shell_session"><code>GET /systeminformation?limit=5&startIndex=0&v=default
1697
1698</code></pre>
1699<ul>
1700<li>Fetch all System Information that match any specified parameters otherwise fetch all the System Information if no query parameters specified.
1701If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</li>
1702</ul>
1703<h3 id='query-parameters'>Query Parameters</h3>
1704<table><thead>
1705<tr>
1706<th>Parameter</th>
1707<th>Type</th>
1708<th>Description</th>
1709</tr>
1710</thead><tbody>
1711<tr>
1712<td><em>limit</em></td>
1713<td><code>integer</code></td>
1714<td>use this parameter to limit the number of results to be returned</td>
1715</tr>
1716<tr>
1717<td><em>startIndex</em></td>
1718<td><code>integer</code></td>
1719<td>the offset where to start the query</td>
1720</tr>
1721<tr>
1722<td><em>v</em></td>
1723<td><code>String</code></td>
1724<td>the required representation to return (i.e., ref, default, full or custom )</td>
1725</tr>
1726</tbody></table>
1727<h1 id='user'>User</h1><h2 id='user-overview'>User Overview</h2>
1728<p>A User in OpenMRS is an account that a person may use to log into the system.</p>
1729
1730<p>The real-life person is represented by a Person record in OpenMRS, and a person may have more than one user account. If you want a patient to be able to view her record in OpenMRS, then you need to create a user account and link it to the patient's person record.</p>
1731<h2 id='available-operations-for-user'>Available operations for User</h2>
1732<ol>
1733<li><a href="#list-user">List users</a></li>
1734<li><a href="#create-a-user">Create a user</a></li>
1735<li><a href="#update-a-user">Update a user</a></li>
1736<li><a href="#delete-a-user">Delete a user</a></li>
1737</ol>
1738<h2 id='list-user'>List user</h2><h3 id='list-all-non-retired-users'>List all non-retired users.</h3><pre class="highlight shell_session"><code>GET /user?
1739q=user1
1740</code></pre>
1741<p>Quickly filter users with given query parameters. Returns a <code>404 Not Found</code> status if the user does not exist.
1742 If not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
1743<h3 id='query-parameters'>Query Parameters</h3>
1744<table><thead>
1745<tr>
1746<th>Parameter</th>
1747<th>Type</th>
1748<th>Description</th>
1749</tr>
1750</thead><tbody>
1751<tr>
1752<td><em>q</em></td>
1753<td><code>Search Query</code></td>
1754<td>Filter users by username or system ID</td>
1755</tr>
1756</tbody></table>
1757<h3 id='get-user-by-uuid'>Get user by UUID.</h3><pre class="highlight shell_session"><code>GET /user/:target_user_uuid
1758</code></pre>
1759<p>Retrieve a user by its UUID. Returns a <code>404 Not Found</code> status if the user does not exist. If not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
1760<h2 id='create-a-user'>Create a user</h2><pre class="highlight shell_session"><code>POST /user
1761{
1762 "name": "Mohit Kumar",
1763 "description": "A GSoD participant."
1764 "username": "batbrain7"
1765 "password": "******"
1766 "person" :
1767 {
1768 "names": [
1769 {
1770 "givenName": "Mohit",
1771 "familyName": "Kumar"
1772 }
1773 ],
1774 "gender": "M",
1775 "birthdate": "1997-09-02",
1776 "addresses": [
1777 {
1778 "address1": "30, Vivekananda Layout, Munnekolal,Marathahalli",
1779 "cityVillage": "Bengaluru",
1780 "country": "India",
1781 "postalCode": "560037"
1782 }
1783 ]
1784},
1785"systemId": "string",
1786"userProperty": {},
1787"secretQuestion" : "What is the name of your high school?"
1788}
1789</code></pre>
1790<ul>
1791<li>For convenience, the person's information can be included in order to create the corresponding person record at the same time as their user record. When creating a user record for an existing person, the existing person must only be referenced by UUID. If you are not logged in to perform this action,
1792a <code>401 Unauthorized</code> status is returned.</li>
1793</ul>
1794<h3 id='attributes'>Attributes</h3>
1795<table><thead>
1796<tr>
1797<th>Parameter</th>
1798<th>Type</th>
1799<th>Description</th>
1800</tr>
1801</thead><tbody>
1802<tr>
1803<td><em>name</em></td>
1804<td><code>String</code></td>
1805<td>Name of the user</td>
1806</tr>
1807<tr>
1808<td><em>description</em></td>
1809<td>`String</td>
1810<td>Description of the user</td>
1811</tr>
1812<tr>
1813<td><em>username</em></td>
1814<td>`String</td>
1815<td>username of the user</td>
1816</tr>
1817<tr>
1818<td><em>password</em></td>
1819<td>`String</td>
1820<td>password of the user</td>
1821</tr>
1822<tr>
1823<td><em>person</em></td>
1824<td><code>String</code></td>
1825<td>person resource associated with the user</td>
1826</tr>
1827<tr>
1828<td><em>systemId</em></td>
1829<td><code>String</code></td>
1830<td>a unique identifier assigned to each user</td>
1831</tr>
1832<tr>
1833<td><em>roles</em></td>
1834<td><code>Array[] : role</code></td>
1835<td>a list of roles attributed to the user</td>
1836</tr>
1837<tr>
1838<td><em>userProperties</em></td>
1839<td><code>JSON Object</code></td>
1840<td>A set of key value pairs. Used to store user specific data</td>
1841</tr>
1842<tr>
1843<td><em>secretQuestion</em></td>
1844<td><code>String</code></td>
1845<td>A secret question chosen by the user</td>
1846</tr>
1847</tbody></table>
1848<h2 id='update-a-user'>Update a user</h2><pre class="highlight shell_session"><code>POST /user/:target_user_uuid
1849{
1850 "name": "Mohit Sharma",
1851 "description": "An OpenMRS Developer."
1852 "username": "batbrain7"
1853 "password": "******"
1854 "person" :
1855 {
1856 "names": [
1857 {
1858 "givenName": "Mohit",
1859 "familyName": "Sharma"
1860 }
1861 ],
1862 "gender": "M",
1863 "birthdate": "1997-09-02",
1864 "addresses": [
1865 {
1866 "address1": "30, Vivekananda Layout, Munnekolal,Marathahalli",
1867 "cityVillage": "Bengaluru",
1868 "country": "India",
1869 "postalCode": "560037"
1870 }
1871 ]
1872},
1873"systemId": "string",
1874"userProperty": {},
1875"secretQuestion" : "In which year did you graduate"
1876}
1877</code></pre>
1878<ul>
1879<li>Update a target user with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
1880status if the user does not exist. If not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</li>
1881</ul>
1882<h3 id='attributes-2'>Attributes</h3>
1883<table><thead>
1884<tr>
1885<th>Parameter</th>
1886<th>Type</th>
1887<th>Description</th>
1888</tr>
1889</thead><tbody>
1890<tr>
1891<td><em>name</em></td>
1892<td><code>String</code></td>
1893<td>Name of the user</td>
1894</tr>
1895<tr>
1896<td><em>description</em></td>
1897<td>`String</td>
1898<td>Description of the user</td>
1899</tr>
1900<tr>
1901<td><em>username</em></td>
1902<td>`String</td>
1903<td>username of the user</td>
1904</tr>
1905<tr>
1906<td><em>password</em></td>
1907<td>`String</td>
1908<td>password of the user</td>
1909</tr>
1910<tr>
1911<td><em>person</em></td>
1912<td><code>String</code></td>
1913<td>person resource associated with the user</td>
1914</tr>
1915<tr>
1916<td><em>systemId</em></td>
1917<td><code>String</code></td>
1918<td>a unique identifier assigned to each user</td>
1919</tr>
1920<tr>
1921<td><em>roles</em></td>
1922<td><code>Array[] : role</code></td>
1923<td>a list of roles attributed to the user</td>
1924</tr>
1925<tr>
1926<td><em>userProperties</em></td>
1927<td><code>JSON Object</code></td>
1928<td>A set of key value pairs. Used to store user specific data</td>
1929</tr>
1930<tr>
1931<td><em>secretQuestion</em></td>
1932<td><code>String</code></td>
1933<td>A secret question chosen by the user</td>
1934</tr>
1935</tbody></table>
1936<h2 id='delete-a-user'>Delete a user</h2><pre class="highlight shell_session"><code>DELETE /user/:target_user_uuid?purge=true
1937</code></pre>
1938<ul>
1939<li>Delete or retire a target user by its UUID. Returns a <code>404 Not Found</code> status if the user does not exist. If not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</li>
1940</ul>
1941<h3 id='query-parameters-2'>Query Parameters</h3>
1942<table><thead>
1943<tr>
1944<th>Parameter</th>
1945<th>Type</th>
1946<th>Description</th>
1947</tr>
1948</thead><tbody>
1949<tr>
1950<td><em>purge</em></td>
1951<td><code>Boolean</code></td>
1952<td>The resource will be voided unless purge = ‘true’</td>
1953</tr>
1954</tbody></table>
1955<h1 id='role'>Role</h1><h2 id='role-overview'>Role Overview</h2>
1956<p>A <strong>Role</strong> represents a group of privileges in the system. Roles may inherit privileges from other roles, and users may have one or more roles.</p>
1957<h2 id='available-operations-for-role'>Available operations for Role.</h2>
1958<ol>
1959<li><a href="#list-roles">List roles</a></li>
1960<li><a href="#create-a-role">Create a role</a></li>
1961<li><a href="#update-a-role">Update a role</a></li>
1962<li><a href="#delete-a-role">Delete a role</a></li>
1963</ol>
1964<h2 id='list-roles'>List roles</h2><pre class="highlight shell_session"><code>GET /role
1965</code></pre>
1966<ul>
1967<li><p>Fetch all the roles that match any specified parameters otherwise fetch all roles. Returns a <code>200 OK</code> status with the role response. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p></li>
1968<li><h2 id='get-a-role-by-uuid'>Get a role by UUID.</h2></li>
1969</ul>
1970<pre class="highlight shell_session"><code>GET /role/:target_role_uuid
1971</code></pre>
1972<p>Retrieve a role by its UUID. Returns a <code>404 Not Found</code> status if the role does not exist. If the
1973 user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
1974<h2 id='create-a-role'>Create a role</h2><pre class="highlight shell_session"><code>POST /role
1975{
1976 "name": "Clinician",
1977 "description": "A provider assisting the Lead Surgeon.",
1978 "privileges": [{
1979 "name": "Delete Patients",
1980 "description": "Able to delete patients"
1981 }]
1982}
1983</code></pre>
1984<ul>
1985<li><p>To create a role, you need to specify below attributes in the request body. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
1986<h3 id='attributes'>Attributes</h3>
1987<table><thead>
1988<tr>
1989<th>Parameter</th>
1990<th>Type</th>
1991<th>Description</th>
1992</tr>
1993</thead><tbody>
1994<tr>
1995<td><em>name</em></td>
1996<td><code>String</code></td>
1997<td>Name of the role (Required)</td>
1998</tr>
1999<tr>
2000<td><em>description</em></td>
2001<td><code>String</code></td>
2002<td>Description of the role (Required)</td>
2003</tr>
2004<tr>
2005<td><em>privileges</em></td>
2006<td><code>Array[] : privileges</code></td>
2007<td>An array of the privilege resource</td>
2008</tr>
2009<tr>
2010<td><em>inheritedRoles</em></td>
2011<td><code>Array[] : inheritedRoles</code></td>
2012<td>An array of the inheritedRoles type</td>
2013</tr>
2014</tbody></table></li>
2015</ul>
2016<h2 id='update-a-role'>Update a role</h2><pre class="highlight shell_session"><code>POST /role
2017{
2018 "name": "Configures Forms",
2019 "description": "Manages forms and attaches them to the UI"
2020}
2021</code></pre>
2022<ul>
2023<li><p>Update a role with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code> status if the role does not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2024<h3 id='attributes-2'>Attributes</h3>
2025<table><thead>
2026<tr>
2027<th>Parameter</th>
2028<th>Type</th>
2029<th>Description</th>
2030</tr>
2031</thead><tbody>
2032<tr>
2033<td><em>name</em></td>
2034<td><code>String</code></td>
2035<td>Name of the role (Required)</td>
2036</tr>
2037<tr>
2038<td><em>description</em></td>
2039<td><code>String</code></td>
2040<td>Description of the role (Required)</td>
2041</tr>
2042<tr>
2043<td><em>privileges</em></td>
2044<td><code>Array[] : privileges</code></td>
2045<td>An array of the privilege resource</td>
2046</tr>
2047<tr>
2048<td><em>inheritedRoles</em></td>
2049<td><code>Array[] : inheritedRoles</code></td>
2050<td>An array of the inheritedRoles type</td>
2051</tr>
2052</tbody></table></li>
2053</ul>
2054<h2 id='delete-a-role'>Delete a role</h2><pre class="highlight shell_session"><code>DELETE /role/:target_role_uuid?purge=true
2055</code></pre>
2056<ul>
2057<li><p>Delete a role by its UUID. Returns a <code>404 Not Found</code> status if the role does not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2058<h3 id='query-parameters'>Query Parameters</h3>
2059<table><thead>
2060<tr>
2061<th>Parameter</th>
2062<th>Type</th>
2063<th>Description</th>
2064</tr>
2065</thead><tbody>
2066<tr>
2067<td><em>purge</em></td>
2068<td><code>Boolean</code></td>
2069<td>must be <code>true</code> to delete the role from the system; if <code>false</code>, the request will have no effect</td>
2070</tr>
2071</tbody></table></li>
2072</ul>
2073<h1 id='person'>Person</h1><h2 id='person-overview'>Person Overview</h2>
2074<p>Every individual who is referred to in a patient record in OpenMRS is stored in the system as a Person. These include Patients, any patient relative or caretaker, Providers, and Users.</p>
2075
2076<p>All Persons have these characteristics.</p>
2077<h2 id='subresource-types'>Subresource types</h2><h3 id='names'>Names</h3>
2078<p>A person can have one or more names, one of which must be marked as the <strong>preferred</strong> name. The preferred name will be displayed in search results and patient screens.</p>
2079<h3 id='addresses'>Addresses</h3>
2080<p>A person may have zero or more contact addresses. You may configure the format of these addresses for your particular locale.</p>
2081<h3 id='person-attributes'>Person Attributes</h3>
2082<p>To support your local needs, you can define additional information about the people in your system, on top of those that are natively supported by OpenMRS. You can define the datatype of a Person Attribute, as well as any constraints on the possible values, using metadata. This metadata is called a Person Attribute Type.</p>
2083
2084<p>Person Attributes are suitable for storing other information. But historical values of person attributes are not retained. For example, you should use a person attribute to record a patient's contact telephone number. This information may change, but if it does so, the system need only store the most recent value, and need not retain previous values. It is not appropriate to use a person attribute to store something like the patient's height, which is recorded at a given point in time, but can be expected to change and should be tracked as it does so.</p>
2085<h2 id='available-operations-for-person-type'>Available Operations for Person type</h2>
2086<ol>
2087<li><a href="#search-persons">Search Persons</a></li>
2088<li><a href="#create-a-person">Create Persons</a></li>
2089<li><a href="#update-a-person">Update Persons</a></li>
2090<li><a href="#delete-a-person">Delete Persons</a></li>
2091<li><a href="#list-person-name-subresource">List person name</a></li>
2092<li><a href="#create-person-name-subresource">Create person name</a></li>
2093<li><a href="#update-person-name-subresource">Update person name</a></li>
2094<li><a href="#delete-person-name-subresource">Delete person name</a></li>
2095<li><a href="#list-person-address-subresource">List person addresses</a></li>
2096<li><a href="#create-person-address-subresource">Create person address</a></li>
2097<li><a href="#create-person-address-subresource">Update person address</a></li>
2098<li><a href="#create-person-address-subresource">Delete person address</a></li>
2099<li><a href="#list-person-attribute-subresource">List person attributes</a></li>
2100<li><a href="#create-person-attribute-subresource">Create person attribute</a></li>
2101<li><a href="#update-person-attribute-subresource">Update person attribute</a></li>
2102<li><a href="#delete-person-attribute-subresource">Delete person attribute</a></li>
2103</ol>
2104<h2 id='search-persons'>Search Persons</h2><h3 id='search-persons-2'>Search Persons</h3><pre class="highlight shell_session"><code>GET /person?q=john
2105</code></pre>
2106<p>Fetch all non-voided persons that match the search query parameter. Returns a <code>200 OK</code> status with the Person response.</p>
2107<h3 id='parameters'>Parameters</h3>
2108<table><thead>
2109<tr>
2110<th>Parameter</th>
2111<th>Type</th>
2112<th>Description</th>
2113</tr>
2114</thead><tbody>
2115<tr>
2116<td><em>q</em></td>
2117<td><em>string</em></td>
2118<td><em>search by name</em></td>
2119</tr>
2120</tbody></table>
2121<h3 id='list-person-by-uuid'>List person by UUID</h3><pre class="highlight shell_session"><code>GET /person/:target_person_uuid
2122</code></pre>
2123<p>Retrieve a person by their UUID. Returns a <code>404 Not Found</code> status if the person does not exist in the system. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2124<h2 id='create-a-person'>Create a person</h2><pre class="highlight plaintext"><code>POST /person
2125{
2126 "names": [
2127 {
2128 "givenName": "Mohit",
2129 "familyName": "Kumar"
2130 }
2131 ],
2132 "gender": "M",
2133 "birthdate": "1997-09-02",
2134 "addresses": [
2135 {
2136 "address1": "30, Vivekananda Layout, Munnekolal,Marathahalli",
2137 "cityVillage": "Bengaluru",
2138 "country": "India",
2139 "postalCode": "560037"
2140 }
2141 ]
2142}
2143</code></pre>
2144<ul>
2145<li><p>To create a person you need to specify the below properties in the request. <code>401 Unauthorized</code> is returned if the request is not authenticated or if the authenticated user does not have appropriate permissions.</p>
2146<h3 id='attributes'>Attributes</h3>
2147<table><thead>
2148<tr>
2149<th>Parameter</th>
2150<th>Type</th>
2151<th>Description</th>
2152</tr>
2153</thead><tbody>
2154<tr>
2155<td><em>names</em></td>
2156<td><code>Array[] : names</code></td>
2157<td>List of names</td>
2158</tr>
2159<tr>
2160<td><em>gender</em></td>
2161<td>String</td>
2162<td>The patient's gender ("M" for male, "F" for female, or "U" for unknown)</td>
2163</tr>
2164<tr>
2165<td><em>age</em></td>
2166<td>Integer</td>
2167<td>The estimated age in years. Used when birthdate is unknown.</td>
2168</tr>
2169<tr>
2170<td><em>birthDate</em></td>
2171<td>String</td>
2172<td>Date of birth of a person</td>
2173</tr>
2174<tr>
2175<td><em>birthDateEstimated</em></td>
2176<td>Boolean</td>
2177<td>True if the birthdate is estimated; false if birthdate is accurate.</td>
2178</tr>
2179<tr>
2180<td><em>birthTime</em></td>
2181<td>String</td>
2182<td>The time of birth of the person</td>
2183</tr>
2184<tr>
2185<td><em>dead</em></td>
2186<td>Boolean</td>
2187<td>True if the patient is dead.</td>
2188</tr>
2189<tr>
2190<td><em>deathDate</em></td>
2191<td>String</td>
2192<td>Date of death of the person</td>
2193</tr>
2194<tr>
2195<td><em>causeOfDeath</em></td>
2196<td><code>Concept UUID</code></td>
2197<td>Reason for the death of the person</td>
2198</tr>
2199<tr>
2200<td><em>deathdateEstimated</em></td>
2201<td>Boolean</td>
2202<td><code>true</code> if deathDate is estimate; <code>false</code> if deathDate is accurate</td>
2203</tr>
2204<tr>
2205<td><em>addresses</em></td>
2206<td><code>Array[] : addresses</code></td>
2207<td>The address details aggregated in an array</td>
2208</tr>
2209<tr>
2210<td><em>attributes</em></td>
2211<td><code>Array[] : attributes</code></td>
2212<td>The attribute details aggregated in an array</td>
2213</tr>
2214</tbody></table></li>
2215</ul>
2216<h2 id='update-a-person'>Update a person</h2><pre class="highlight shell_session"><code>POST /person/:target_person_uuid
2217{
2218 "gender": "M",
2219 "birthdate": "1997-01-13",
2220}
2221</code></pre>
2222<ul>
2223<li><p>Update a person. This method only modifies properties specified in the request. Returns a <code>404 Not found</code>.
2224If not authenticated or authenticated user does not have sufficient privileges, <code>401 Unauthorized</code> status is returned.</p>
2225
2226<p>An example of the request is as follows : </p></li>
2227</ul>
2228<h2 id='delete-a-person'>Delete a person</h2><pre class="highlight shell_session"><code>DELETE /person/:target_person_uuid?purge=true
2229</code></pre>
2230<ul>
2231<li><p>Delete or Void a target person. Returns a <code>404 Not Found</code> status if person not exists. If not authenticated or authenticated user does not have sufficient privileges, <code>401 Unauthorized</code> status is returned.</p>
2232<h3 id='query-parameters'>Query Parameters</h3>
2233<table><thead>
2234<tr>
2235<th>Parameter</th>
2236<th>Type</th>
2237<th>Description</th>
2238</tr>
2239</thead><tbody>
2240<tr>
2241<td><em>purge</em></td>
2242<td><code>Boolean</code></td>
2243<td>The resource will be voided unless purge = ‘true’</td>
2244</tr>
2245</tbody></table></li>
2246</ul>
2247<h2 id='list-person-name-subresource'>List person name subresource</h2><pre class="highlight shell_session"><code>GET /person/:target_person_uuid/name
2248</code></pre>
2249<ul>
2250<li>List all the person name subresource corresponding to a <code>target_person_uuid</code>. Returns <code>404 Not Found</code> status if the person does not exist.
2251If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code>
2252status is returned.</li>
2253</ul>
2254<pre class="highlight shell_session"><code>GET /person/:target_person_uuid/name/:target_name_uuid
2255</code></pre>
2256<ul>
2257<li>List the person name by its <code>UUID</code> and corresponding to a <code>target_person_uuid</code>. Returns <code>404 Not Found</code> status if the person does not exist.
2258If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code>
2259status is returned.</li>
2260</ul>
2261<h2 id='create-person-name-subresource'>Create person name subresource</h2><pre class="highlight shell_session"><code>POST person/:target_person_uuid/name
2262{
2263 "givenName": "Mohit",
2264 "familyName": "Kumar",
2265 "preferred": true,
2266 "prefix": "Mr."
2267}
2268</code></pre>
2269<ul>
2270<li><p>To create a person name subresource for a specific person resource you need to specify below properties in your request body.
2271If user not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2272<h3 id='attributes-2'>Attributes</h3>
2273<table><thead>
2274<tr>
2275<th>Parameter</th>
2276<th>Type</th>
2277<th>Description</th>
2278</tr>
2279</thead><tbody>
2280<tr>
2281<td><em>givenName</em></td>
2282<td><code>String</code></td>
2283<td>name of the person</td>
2284</tr>
2285<tr>
2286<td><em>middleName</em></td>
2287<td><code>String</code></td>
2288<td>middle name of the person</td>
2289</tr>
2290<tr>
2291<td><em>familyName</em></td>
2292<td><code>String</code></td>
2293<td>family name/surname of the person</td>
2294</tr>
2295<tr>
2296<td><em>familyName2</em></td>
2297<td><code>String</code></td>
2298<td>second family name/surname of the person</td>
2299</tr>
2300<tr>
2301<td><em>preferred</em></td>
2302<td><code>Boolean</code></td>
2303<td>true if this is the person's preferred name. When a person has only one name, it should be marked as preferred; when a person has multiple names, only one name can be preferred.</td>
2304</tr>
2305<tr>
2306<td><em>prefix</em></td>
2307<td><code>String</code></td>
2308<td>prefix for the name</td>
2309</tr>
2310<tr>
2311<td><em>familyNamePrefix</em></td>
2312<td><code>String</code></td>
2313<td>prefix if any for the family name</td>
2314</tr>
2315<tr>
2316<td><em>familyNameSuffix</em></td>
2317<td><code>String</code></td>
2318<td>Suffix if any for the family name</td>
2319</tr>
2320<tr>
2321<td><em>degree</em></td>
2322<td><code>String</code></td>
2323<td>degree attained by the person</td>
2324</tr>
2325</tbody></table></li>
2326</ul>
2327<h2 id='update-person-name-subresource'>Update person name subresource</h2><pre class="highlight shell_session"><code>POST person/:target_person_uuid/name
2328{
2329 "givenName": "Mohit",
2330 "familyName": "Verma",
2331 "preferred": true,
2332 "prefix": "Dr."
2333}
2334</code></pre>
2335<ul>
2336<li><p>To update a person name with given UUID value for a specific person resource, you need to specify below properties in your request body.
2337If user not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2338<h3 id='attributes-3'>Attributes</h3>
2339<table><thead>
2340<tr>
2341<th>Parameter</th>
2342<th>Type</th>
2343<th>Description</th>
2344</tr>
2345</thead><tbody>
2346<tr>
2347<td><em>givenName</em></td>
2348<td><code>String</code></td>
2349<td>name of the person</td>
2350</tr>
2351<tr>
2352<td><em>middleName</em></td>
2353<td><code>String</code></td>
2354<td>middle name of the person</td>
2355</tr>
2356<tr>
2357<td><em>familyName</em></td>
2358<td><code>String</code></td>
2359<td>family name/surname of the person</td>
2360</tr>
2361<tr>
2362<td><em>familyName2</em></td>
2363<td><code>String</code></td>
2364<td>second family name/surname of the person</td>
2365</tr>
2366<tr>
2367<td><em>preferred</em></td>
2368<td><code>Boolean</code></td>
2369<td>true if this is the person's preferred name. When a person has only one name, it should be marked as preferred; when a person has multiple names, only one name can be preferred.</td>
2370</tr>
2371<tr>
2372<td><em>prefix</em></td>
2373<td><code>String</code></td>
2374<td>prefix for the name</td>
2375</tr>
2376<tr>
2377<td><em>familyNamePrefix</em></td>
2378<td><code>String</code></td>
2379<td>prefix if any for the family name</td>
2380</tr>
2381<tr>
2382<td><em>familyNameSuffix</em></td>
2383<td><code>String</code></td>
2384<td>Suffix if any for the family name</td>
2385</tr>
2386<tr>
2387<td><em>degree</em></td>
2388<td><code>String</code></td>
2389<td>degree attained by the person</td>
2390</tr>
2391</tbody></table></li>
2392</ul>
2393<h2 id='delete-person-name-subresource'>Delete person name subresource</h2><pre class="highlight shell_session"><code>DELETE /person/:target_person_uuid/person/:target_name_uuid
2394</code></pre>
2395<ul>
2396<li>Delete or void a target name subresource. Returns a <code>404 Not Found</code> status if an attribute does not exist.
2397If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</li>
2398</ul>
2399<h2 id='list-person-address-subresource'>List person address subresource</h2><pre class="highlight shell_session"><code>GET /person/:target_person_uuid/address
2400</code></pre>
2401<ul>
2402<li>List all the person addresses corresponding to a <code>target_person_uuid</code>. Returns a <code>404 Not Found</code> status if person address does not exist. If the user is not logged in to perform this action, a <code>401 unauthorized</code> status is returned.</li>
2403</ul>
2404<pre class="highlight shell_session"><code>GET /person/:target_person_uuid/address/:target_address_uuid
2405</code></pre>
2406<ul>
2407<li>List all the person addresses by its <code>target_address_uuid</code> and corresponding to a <code>target_person_uuid</code>. Returns a <code>404 Not Found</code> status if person address does not exist. If user not logged in to perform this action, a <code>401 unauthorized</code> status is returned.</li>
2408</ul>
2409<h2 id='create-person-address-subresource'>Create person address subresource</h2><pre class="highlight shell_session"><code>POST person/:target_person_uuid/address
2410{
2411 "address1": "30, Vivekananda Layout, Munnekolal,Marathahalli",
2412 "cityVillage": "Bengaluru"
2413 "stateProvince": "Karnataka",
2414 "postalCode": "560037",
2415 "lattitude": "28.65033",
2416 "longitude": "77.304255"
2417}
2418</code></pre>
2419<ul>
2420<li><p>To create a person address subresource for a specific person resource you need to specify below properties in your request body.
2421If user not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2422<h4 id='attributes-4'>Attributes</h4>
2423<table><thead>
2424<tr>
2425<th>Parameter</th>
2426<th>Type</th>
2427<th>Description</th>
2428</tr>
2429</thead><tbody>
2430<tr>
2431<td><em>preferred</em></td>
2432<td><code>Boolean</code></td>
2433<td>true if this is the person's preferred address. If a person has multiple addresses, only one can be preferred.</td>
2434</tr>
2435<tr>
2436<td><em>address1</em></td>
2437<td><code>String</code></td>
2438<td>address of the person</td>
2439</tr>
2440<tr>
2441<td><em>address2</em></td>
2442<td><code>String</code></td>
2443<td>second address of the person</td>
2444</tr>
2445<tr>
2446<td><em>cityVillage</em></td>
2447<td><code>String</code></td>
2448<td>city/village of the person</td>
2449</tr>
2450<tr>
2451<td><em>stateProvince</em></td>
2452<td><code>String</code></td>
2453<td>name of the state of the person</td>
2454</tr>
2455<tr>
2456<td><em>country</em></td>
2457<td><code>String</code></td>
2458<td>country of the person</td>
2459</tr>
2460<tr>
2461<td><em>postalCode</em></td>
2462<td><code>String</code></td>
2463<td>pin code of the person</td>
2464</tr>
2465<tr>
2466<td><em>countyDistrict</em></td>
2467<td><code>String</code></td>
2468<td>county district of the person</td>
2469</tr>
2470<tr>
2471<td><em>address3</em></td>
2472<td><code>String</code></td>
2473<td>third address of the person</td>
2474</tr>
2475<tr>
2476<td><em>address4</em></td>
2477<td><code>String</code></td>
2478<td>fourth address of the person</td>
2479</tr>
2480<tr>
2481<td><em>address5</em></td>
2482<td><code>String</code></td>
2483<td>fifth address of the person</td>
2484</tr>
2485<tr>
2486<td><em>address6</em></td>
2487<td><code>String</code></td>
2488<td>sixth address of the person</td>
2489</tr>
2490<tr>
2491<td><em>startDate</em></td>
2492<td><code>String</code></td>
2493<td>date when the person began living at this address</td>
2494</tr>
2495<tr>
2496<td><em>endDate</em></td>
2497<td><code>String</code></td>
2498<td>date when the person stopped living at this address</td>
2499</tr>
2500<tr>
2501<td><em>lattitude</em></td>
2502<td><code>String</code></td>
2503<td>lattitude of the address</td>
2504</tr>
2505<tr>
2506<td><em>longitude</em></td>
2507<td><code>String</code></td>
2508<td>longitude of the address</td>
2509</tr>
2510</tbody></table></li>
2511</ul>
2512<h2 id='update-person-address-subresource'>Update person address subresource</h2><pre class="highlight shell_session"><code>POST person/:target_person_uuid/address
2513{
2514 "address1": "30, Vivekananda Layout, Munnekolal,Marathahalli",
2515 "cityVillage": "Bengaluru"
2516 "stateProvince": "Karnataka",
2517 "postalCode": "560037",
2518 "lattitude": "28.65033",
2519 "longitude": "77.304255"
2520}
2521</code></pre>
2522<ul>
2523<li><p>To update a person address with given UUID value for a specific person resource you need to specify below properties in your request body.
2524If user not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2525<h3 id='attributes-5'>Attributes</h3>
2526<table><thead>
2527<tr>
2528<th>Parameter</th>
2529<th>Type</th>
2530<th>Description</th>
2531</tr>
2532</thead><tbody>
2533<tr>
2534<td><em>preferred</em></td>
2535<td><code>Boolean</code></td>
2536<td>true if this is the person's preferred address. If a person has multiple addresses, only one can be preferred.</td>
2537</tr>
2538<tr>
2539<td><em>address1</em></td>
2540<td><code>String</code></td>
2541<td>address of the person</td>
2542</tr>
2543<tr>
2544<td><em>address2</em></td>
2545<td><code>String</code></td>
2546<td>second address of the person</td>
2547</tr>
2548<tr>
2549<td><em>cityVillage</em></td>
2550<td><code>String</code></td>
2551<td>city/village of the person</td>
2552</tr>
2553<tr>
2554<td><em>stateProvince</em></td>
2555<td><code>String</code></td>
2556<td>name of the state of the person</td>
2557</tr>
2558<tr>
2559<td><em>country</em></td>
2560<td><code>String</code></td>
2561<td>country of the person</td>
2562</tr>
2563<tr>
2564<td><em>postalCode</em></td>
2565<td><code>String</code></td>
2566<td>pin code of the person</td>
2567</tr>
2568<tr>
2569<td><em>countyDistrict</em></td>
2570<td><code>String</code></td>
2571<td>county district of the person</td>
2572</tr>
2573<tr>
2574<td><em>address3</em></td>
2575<td><code>String</code></td>
2576<td>third address of the person</td>
2577</tr>
2578<tr>
2579<td><em>address4</em></td>
2580<td><code>String</code></td>
2581<td>fourth address of the person</td>
2582</tr>
2583<tr>
2584<td><em>address5</em></td>
2585<td><code>String</code></td>
2586<td>fifth address of the person</td>
2587</tr>
2588<tr>
2589<td><em>address6</em></td>
2590<td><code>String</code></td>
2591<td>sixth address of the person</td>
2592</tr>
2593<tr>
2594<td><em>startDate</em></td>
2595<td><code>String</code></td>
2596<td>date when the person began living at this address</td>
2597</tr>
2598<tr>
2599<td><em>endDate</em></td>
2600<td><code>String</code></td>
2601<td>date when the person stopped living at this address</td>
2602</tr>
2603<tr>
2604<td><em>lattitude</em></td>
2605<td><code>String</code></td>
2606<td>lattitude of the address</td>
2607</tr>
2608<tr>
2609<td><em>longitude</em></td>
2610<td><code>String</code></td>
2611<td>longitude of the address</td>
2612</tr>
2613</tbody></table></li>
2614</ul>
2615<h2 id='delete-a-person-address-subresource'>Delete a person address subresource</h2><pre class="highlight shell_session"><code>DELETE /person/:target_person_uuid/person/:target_address_uuid
2616</code></pre>
2617<ul>
2618<li>Delete or void a target address subresource. Returns <code>404 Not Found</code> status if the person does not exist.
2619If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code>
2620status is returned.</li>
2621</ul>
2622<h2 id='list-person-attribute-subresource'>List person attribute subresource</h2><pre class="highlight shell_session"><code>GET /person/:target_person_uuid/attribute
2623</code></pre>
2624<ul>
2625<li>List all person attributes for a given person. Returns a <code>404 Not Found</code> if the person doesn't exist. If not authenticated or the authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</li>
2626</ul>
2627<pre class="highlight shell_session"><code>GET /person/:target_person_uuid/name/:target_attribute_uuid
2628</code></pre>
2629<ul>
2630<li>List all the person attributes by its <code>UUID</code> and corresponding to a <code>target_person_uuid</code>. Returns a <code>404 Not Found</code> status if person attribute does not exist. If user not logged in to perform this action, a <code>401 unauthorized</code> status is returned.</li>
2631</ul>
2632<h2 id='create-person-attribute-subresource'>Create person attribute subresource</h2><pre class="highlight shell_session"><code>POST person/:target_person_uuid/attribute
2633{
2634 "attributeType": "8d8718c2-c2cc-11de-8d13-0010c6dffd0f",
2635 "value": "Birthplace",
2636}
2637</code></pre>
2638<ul>
2639<li><p>To create a person attribute subresource for a specific person resource you need to specify below properties in your request body.
2640If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code>
2641status is returned.</p>
2642<h4 id='attributes-6'>Attributes</h4>
2643<table><thead>
2644<tr>
2645<th>Parameter</th>
2646<th>Type</th>
2647<th>Description</th>
2648</tr>
2649</thead><tbody>
2650<tr>
2651<td><em>attributeType</em></td>
2652<td><code>UUID</code></td>
2653<td>UUID of the attributeType</td>
2654</tr>
2655<tr>
2656<td><em>value</em></td>
2657<td><code>String</code></td>
2658<td>value associated with the attribute</td>
2659</tr>
2660</tbody></table></li>
2661</ul>
2662<h2 id='update-person-attribute-subresource'>Update person attribute subresource</h2><pre class="highlight shell_session"><code>POST person/:target_person_uuid/attribute
2663{
2664 "attributeType": "8d8718c2-c2cc-11de-8d13-0010c6dffd0f",
2665 "value": "Birthplace",
2666}
2667</code></pre>
2668<ul>
2669<li><p>To update a person attribute with given UUID value for a specific person resource you need to specify below properties in your request body.
2670If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
2671<h3 id='attributes-7'>Attributes</h3>
2672<table><thead>
2673<tr>
2674<th>Parameter</th>
2675<th>Type</th>
2676<th>Description</th>
2677</tr>
2678</thead><tbody>
2679<tr>
2680<td><em>attributeType</em></td>
2681<td><code>UUID</code></td>
2682<td>UUID of the attributeType</td>
2683</tr>
2684<tr>
2685<td><em>value</em></td>
2686<td><code>String</code></td>
2687<td>value associated with the attribute</td>
2688</tr>
2689</tbody></table></li>
2690</ul>
2691<h2 id='delete-person-attribute-subresource'>Delete person attribute subresource</h2><pre class="highlight shell_session"><code>DELETE /person/:target_person_uuid/person/:target_attribute_uuid
2692</code></pre>
2693<ul>
2694<li>Delete or void a target attribute. Returns <code>404 Not Found</code> status if the person does not exist.
2695If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code>
2696status is returned.</li>
2697</ul>
2698<h1 id='person-attribute-type'>Person Attribute Type</h1><h2 id='person-attribute-type-overview'>Person Attribute Type Overview</h2>
2699<ul>
2700<li><p>Person attributes provide a mechanism for implementations to add custom attributes to their person records. A Person Attribute Type defines one of these custom attributes, including its data type and search behavior.</p></li>
2701<li><p>For example, creating a Person Attribute Type for civil status (whether or not someone is single or married) would allow an implementation to record this information for each person in their system.</p></li>
2702</ul>
2703<h2 id='available-operations'>Available operations.</h2>
2704<ol>
2705<li><a href="#list-person-attribute-types">List person attribute types</a></li>
2706<li><a href="#create-a-person-attribute-type">Create a person attribute type</a></li>
2707<li><a href="#update-a-person-attribute-type">Update a person attribute type</a></li>
2708<li><a href="#delete-a-person-attribute-type">Delete a person attribute type</a></li>
2709</ol>
2710<h2 id='list-person-attribute-types'>List person attribute types</h2><h3 id='list-all-non-retired-person-attribute-types'>List all non-retired person attribute types.</h3><pre class="highlight shell_session"><code>GET /personattributetype?q=race
2711</code></pre>
2712<p>Quickly filter person attribute types with a given search query. If the request is not authenticated or the authenticated user does not have appropriate permissions, a <code>401 Unauthorized</code> status is returned.</p>
2713
2714<p>### Query Parameters</p>
2715
2716<table><thead>
2717<tr>
2718<th>Parameter</th>
2719<th>Type</th>
2720<th>Description</th>
2721</tr>
2722</thead><tbody>
2723<tr>
2724<td><em>q</em></td>
2725<td><code>Search Query</code></td>
2726<td>Query to filter person attributes by its name(partial search is not supported)</td>
2727</tr>
2728</tbody></table>
2729<h3 id='get-person-attribute-type-by-uuid'>Get person attribute type by UUID.</h3><pre class="highlight shell_session"><code>GET /personattributetype/:target_person_attribute_type_uuid
2730</code></pre>
2731<p>Retrieve a person attribute type by its UUID. Returns a <code>404 Not Found</code> status if the person attribute type does not exist. If the
2732 user not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2733<h2 id='create-a-person-attribute-type'>Create a person attribute type</h2><pre class="highlight shell_session"><code>POST /personattributetype
2734{
2735 "name": "Edit Civil Status",
2736 "description": "Able to manage the civil status of persons",
2737 "format": "org.openmrs.Concept",
2738 "foreignKey": 1054,
2739 "searchable": false,
2740 "editPrivilege": {
2741 "name": "Super User",
2742 "description": "Change and update the person attribute type"
2743 }
2744}
2745</code></pre>
2746<ul>
2747<li><p>To Create a person attribute type you need to specify below attributes in the request body. If the user is not logged in to perform this action,
2748a <code>401 Unauthorized</code> status is returned.</p>
2749<h3 id='attributes'>Attributes</h3>
2750<table><thead>
2751<tr>
2752<th>Parameter</th>
2753<th>Type</th>
2754<th>Description</th>
2755</tr>
2756</thead><tbody>
2757<tr>
2758<td><em>name</em></td>
2759<td><code>String</code></td>
2760<td>Name of the person attribute type (Required)</td>
2761</tr>
2762<tr>
2763<td><em>description</em></td>
2764<td><code>String</code></td>
2765<td>Description (Required)</td>
2766</tr>
2767<tr>
2768<td><em>format</em></td>
2769<td><code>Java Class</code></td>
2770<td>the Java class the PersonAttributeType</td>
2771</tr>
2772<tr>
2773<td><em>foreignKey</em></td>
2774<td><code>Number</code></td>
2775<td>the internal identifier (foreign key) to a Concept that defines the possible values for this attribute</td>
2776</tr>
2777<tr>
2778<td><em>sortWeight</em></td>
2779<td><code>Number</code></td>
2780<td>the order this PersonAttributeType will appear in when searched</td>
2781</tr>
2782<tr>
2783<td><em>searchable</em></td>
2784<td><code>Boolean</code></td>
2785<td>true if this person attributes should be used to find patients. The default is false</td>
2786</tr>
2787<tr>
2788<td><em>editPrivilege</em></td>
2789<td><code>JSON Object</code></td>
2790<td>the privilege required to make changes to this type</td>
2791</tr>
2792</tbody></table></li>
2793</ul>
2794<h2 id='update-a-person-attribute-type'>Update a person attribute type</h2><pre class="highlight shell_session"><code>POST /personattributetype
2795{
2796 "name": "Edit Civil Status",
2797 "description": "Able to manage the civil status of persons",
2798 "format": "org.openmrs.Concept",
2799 "foreignKey": 1054,
2800 "searchable": true,
2801 "editPrivilege": {
2802 "name": "Super User",
2803 "description": "Change and update the person attribute type"
2804 }
2805}
2806</code></pre>
2807<ul>
2808<li><p>Update a target person attribute type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
2809status if the person attribute does not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2810
2811<table><thead>
2812<tr>
2813<th>Parameter</th>
2814<th>Type</th>
2815<th>Description</th>
2816</tr>
2817</thead><tbody>
2818<tr>
2819<td><em>name</em></td>
2820<td><code>String</code></td>
2821<td>Name of the person attribute type (Required)</td>
2822</tr>
2823<tr>
2824<td><em>description</em></td>
2825<td><code>String</code></td>
2826<td>Description (Required)</td>
2827</tr>
2828<tr>
2829<td><em>format</em></td>
2830<td><code>Java Class</code></td>
2831<td>the Java class the PersonAttributeType</td>
2832</tr>
2833<tr>
2834<td><em>foreignKey</em></td>
2835<td><code>Number</code></td>
2836<td>the internal identifier (foreign key) to a Concept that defines the possible values for this attribute</td>
2837</tr>
2838<tr>
2839<td><em>sortWeight</em></td>
2840<td><code>Number</code></td>
2841<td>the order this PersonAttributeType will appear in when searched</td>
2842</tr>
2843<tr>
2844<td><em>searchable</em></td>
2845<td><code>Boolean</code></td>
2846<td>true if this person attributes should be used to find patients. The default is false</td>
2847</tr>
2848<tr>
2849<td><em>editPrivilege</em></td>
2850<td><code>JSON Object</code></td>
2851<td>the privilege required to make changes to this type</td>
2852</tr>
2853</tbody></table></li>
2854</ul>
2855<h2 id='delete-a-person-attribute-type'>Delete a person attribute type</h2><pre class="highlight shell_session"><code>DELETE /personattributetype/:target_person_attribute_type_uuid?purge=true
2856</code></pre>
2857<ul>
2858<li><p>Delete or Retire a person attribute type by its UUID. Returns a <code>404 Not Found</code> status if the person attribute type does not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2859<h3 id='query-parameters'>Query Parameters</h3>
2860<table><thead>
2861<tr>
2862<th>Parameter</th>
2863<th>Type</th>
2864<th>Description</th>
2865</tr>
2866</thead><tbody>
2867<tr>
2868<td><em>purge</em></td>
2869<td><code>Boolean</code></td>
2870<td>The resource will be retired unless purge = ‘true’.Purging will attempt to remove the attribute type from the system irreversibly. Attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
2871</tr>
2872</tbody></table></li>
2873</ul>
2874<h1 id='patients'>Patients</h1><h2 id='patients-overview'>Patients Overview</h2>
2875<ul>
2876<li><p>Anyone who receives care in OpenMRS must be a <strong>Patient</strong>.</p></li>
2877<li><p>Every Patient must have at least one Identifier, which is explained below. (for example,
2878Anyone who has an Encounter or who is enrolled in a Program is a Patient.)</p></li>
2879<li><p>A Patient is also a Person, meaning they must have at least one name, and they may have addresses.</p></li>
2880</ul>
2881<h2 id='subresource-types-of-patient'>Subresource types of Patient</h2><h3 id='patientidentifier-identifier'>PatientIdentifier (Identifier)</h3>
2882<ul>
2883<li>A PatientIdentifier is a medical record number assigned by your facility, used to identify and re-identify the patient on subsequent visits.</li>
2884</ul>
2885<h3 id='allergy'>Allergy</h3>
2886<ul>
2887<li>OpenMRS lets you manually maintain an <strong>Allergy List</strong> for a patient, including the allergen, reaction, severity, etc.</li>
2888</ul>
2889<h2 id='available-operations-for-patients'>Available operations for Patients</h2>
2890<ol>
2891<li> <a href="#search-patients">List Patients</a></li>
2892<li> <a href="#create-a-patient">Create a patient record</a></li>
2893<li> <a href="#update-a-patient">Update a patient record</a></li>
2894<li> <a href="#delete-a-patient">Delete a patient record</a></li>
2895<li> <a href="#list-patientIdentifier-sub-resources">List patientIdentifier sub resource</a></li>
2896<li> <a href="#create-a-patientIdentifier-sub-resource-with-properties">Create patientIdentifier sub resource with properties</a></li>
2897<li> <a href="#update-patientidentifier-sub-resource-with-properties">Update patientIdentifier sub resource</a></li>
2898<li> <a href="#delete-patientidentifier-sub-resource-with-properties">Delete patientIdentifier sub resource</a></li>
2899<li> <a href="#list-allergy-sub-resources">List allergy sub resource</a></li>
2900<li><a href="#">Create allergy sub resource with properties</a></li>
2901<li><a href="#update-allergy-sub-resource-with-properties">Update allergy sub resource</a></li>
2902<li><a href="#delete-allergy-sub-resource-with-properties">Delete allergy sub resource</a></li>
2903</ol>
2904<h2 id='search-patients'>Search patients</h2><h3 id='search-patients-2'>Search patients</h3><pre class="highlight shell_session"><code>GET /patient?
2905country=india
2906&gender=M
2907</code></pre>
2908<p>Fetch all non-retired patients that match any specified parameters otherwise fetch all non-retired patients. Returns a <code>200 OK</code> status with the patient response. </p>
2909<h3 id='query-parameters'>Query Parameters</h3>
2910<table><thead>
2911<tr>
2912<th>Parameter</th>
2913<th>Description</th>
2914</tr>
2915</thead><tbody>
2916<tr>
2917<td>matchSimilar</td>
2918<td>use this parameter to enter anything to match</td>
2919</tr>
2920<tr>
2921<td>country</td>
2922<td>Country where the patient is registered</td>
2923</tr>
2924<tr>
2925<td>birthDate</td>
2926<td>must be used with matchSimilar</td>
2927</tr>
2928<tr>
2929<td>Gender</td>
2930<td>Gender of the patient</td>
2931</tr>
2932<tr>
2933<td>city</td>
2934<td>City where the patient is registered</td>
2935</tr>
2936<tr>
2937<td>address</td>
2938<td>Address of the patients</td>
2939</tr>
2940<tr>
2941<td>familyName</td>
2942<td>must be used with matchSimilar</td>
2943</tr>
2944<tr>
2945<td>middleName</td>
2946<td>must be used with matchSimilar</td>
2947</tr>
2948<tr>
2949<td>postalCode</td>
2950<td>must be used with matchSimilar</td>
2951</tr>
2952<tr>
2953<td>givenname</td>
2954<td>must be used with matchSimilar</td>
2955</tr>
2956<tr>
2957<td>state</td>
2958<td>must be used with matchSimilar</td>
2959</tr>
2960</tbody></table>
2961<h3 id='list-patient-by-uuid'>List patient by UUID.</h3><pre class="highlight shell_session"><code>GET /patient/:target_patient_uuid
2962</code></pre>
2963<p>Retrieve a patient by its UUID. Returns a <code>404 Not Found</code> status if patient does not exist in the system. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2964<h2 id='create-a-patient'>Create a patient</h2><pre class="highlight shell_session"><code>POST /patient
2965{
2966 "person": "uuid",
2967 "identifiers": [
2968 {
2969 "identifier": "string",
2970 "identifierType": "uuid",
2971 "location": "uuid",
2972 "preferred": true
2973 }
2974 ]
2975}
2976</code></pre>
2977<ul>
2978<li><p>To create a patient you need to specify the below properties in the request. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
2979<h3 id='properties'>Properties</h3>
2980<table><thead>
2981<tr>
2982<th>Parameter</th>
2983<th>Type</th>
2984<th>Description</th>
2985</tr>
2986</thead><tbody>
2987<tr>
2988<td><em>person</em></td>
2989<td><code>PERSON_UUID</code></td>
2990<td>Person resource UUID</td>
2991</tr>
2992<tr>
2993<td><em>identifiers</em></td>
2994<td><code>Array[]: Identifiers</code></td>
2995<td>List of patientIdentifiers</td>
2996</tr>
2997</tbody></table></li>
2998</ul>
2999<h2 id='update-a-patient'>Update a patient</h2><pre class="highlight shell_session"><code> POST /patient/:target_patient_uuid
3000 -d modified_patient_object
3001</code></pre>
3002<ul>
3003<li><p>Update a target patient with given UUID, this method only modifies properties in the request.
3004Returns a <code>404 Not Found</code> status if patient not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized status returned</code>.</p>
3005<h3 id='query-parameters-2'>Query Parameters</h3>
3006<table><thead>
3007<tr>
3008<th>Parameter</th>
3009<th>Type</th>
3010<th>Description</th>
3011</tr>
3012</thead><tbody>
3013<tr>
3014<td><em>uuid</em></td>
3015<td><code>target_patient_uuid</code></td>
3016<td>Target patient resource UUID</td>
3017</tr>
3018</tbody></table>
3019<h3 id='properties-2'>Properties</h3>
3020<table><thead>
3021<tr>
3022<th>Parameter</th>
3023<th>Type</th>
3024<th>Description</th>
3025</tr>
3026</thead><tbody>
3027<tr>
3028<td><em>resource</em></td>
3029<td><code>Patient</code></td>
3030<td>Patient resource with updated properties</td>
3031</tr>
3032</tbody></table></li>
3033</ul>
3034<h2 id='delete-a-patient'>Delete a patient</h2><pre class="highlight shell_session"><code>DELETE /patient/:target_patient_uuid?purge=true
3035</code></pre>
3036<ul>
3037<li><p>Delete or retire a target patient by its UUID. Returns a <code>404 Not Found</code> status if patient not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3038<h3 id='query-parameters-3'>Query Parameters</h3>
3039<table><thead>
3040<tr>
3041<th>Parameter</th>
3042<th>Type</th>
3043<th>Description</th>
3044</tr>
3045</thead><tbody>
3046<tr>
3047<td><strong>uuid</strong></td>
3048<td><code>String</code></td>
3049<td>uuid to delete</td>
3050</tr>
3051<tr>
3052<td><em>purge</em></td>
3053<td><code>Boolean</code></td>
3054<td>The resource will be voided/retired unless purge = 'true'</td>
3055</tr>
3056</tbody></table></li>
3057</ul>
3058<h2 id='list-patientidentifier-sub-resources'>List patientIdentifier sub resources</h2>
3059<ul>
3060<li>### List all patientIdentifier sub resources for a patient.</li>
3061</ul>
3062<pre class="highlight shell_session"><code>GET /patient/:target_patient_uuid/identifier
3063</code></pre>
3064<p>Retrieve all <b>identifier</b> sub resources of a <b>patient</b> resource by <code>target_patient_uuid</code>.Returns a <code>404 Not Found</code> status if patientIdentifier not exists. If user not logged in to perform this action, a <code>401 unauthorized</code> status returned.</p>
3065
3066<ul>
3067<li>### List patientIdentifier sub resource by it's UUID and parent patient UUID.</li>
3068</ul>
3069<pre class="highlight shell_session"><code>GET /patient/:target_patient_uuid/identifier/:target_identifier_uuid
3070</code></pre>
3071<p>Retrieve a <b>patientIdentifier</b> sub resources of a <b>patient</b> resource. Returns a <code>404 Not Found</code> status if patientIdentifier not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned. </p>
3072<h2 id='create-a-patientidentifier-sub-resource-with-properties'>Create a patientIdentifier sub resource with properties</h2><pre class="highlight shell_session"><code>POST patient/:target_patient_uuid/identifier
3073{
3074 "identifier" : "string",
3075 "identifierType" : "target_identifer_uuid",
3076 "location" : "target_location_uuid",
3077 "preferred" : true/false
3078}
3079</code></pre>
3080<ul>
3081<li><p>To create a patientIdentifier subresource for a specific patient resource you need to specify below properties in your request body.
3082If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3083<h3 id='query-parameter'>Query parameter</h3>
3084<table><thead>
3085<tr>
3086<th>Parameter</th>
3087<th>Description</th>
3088</tr>
3089</thead><tbody>
3090<tr>
3091<td><code>target_patient_uuid</code></td>
3092<td>patient resource uuid</td>
3093</tr>
3094</tbody></table>
3095<h3 id='properties-for-resource'>Properties for resource</h3>
3096<table><thead>
3097<tr>
3098<th>Parameter</th>
3099<th>type</th>
3100<th>Description</th>
3101</tr>
3102</thead><tbody>
3103<tr>
3104<td><em>identifier</em></td>
3105<td><code>String</code></td>
3106<td>value of the identifier</td>
3107</tr>
3108<tr>
3109<td><em>identifierType</em></td>
3110<td><code>Identifier_Type_UUID</code></td>
3111<td>Create identifier from this Identifier_type</td>
3112</tr>
3113<tr>
3114<td><em>location</em></td>
3115<td><code>Location UUID</code></td>
3116<td>Get patients for this location</td>
3117</tr>
3118<tr>
3119<td><em>preferred</em></td>
3120<td><code>boolean</code></td>
3121<td>preferred/not preferred identifier</td>
3122</tr>
3123</tbody></table></li>
3124</ul>
3125<h2 id='update-patientidentifier-sub-resource-with-properties'>Update patientIdentifier sub resource with properties</h2><pre class="highlight shell_session"><code>POST patient/:target_patient_uuid/identifier/:target_identifier_uuid
3126{
3127"identifier" : "string",
3128"identifierType" : "target_identifer_uuid",
3129"location" : "target_location_uuid",
3130"preferred" : true/false
3131}
3132</code></pre>
3133<ul>
3134<li><p>Updates an patientIdentifier subresource value with given UUID, this method will only modify value of the subresource. Returns a <code>404 Not Found</code> status if attribute not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
3135returned.</p>
3136<h3 id='properties-3'>Properties</h3>
3137<table><thead>
3138<tr>
3139<th>Parameter</th>
3140<th>Type</th>
3141<th>Description</th>
3142</tr>
3143</thead><tbody>
3144<tr>
3145<td><em>identifier</em></td>
3146<td><code>String</code></td>
3147<td>updated value of the identifier</td>
3148</tr>
3149<tr>
3150<td><em>identifierType</em></td>
3151<td><code>Identifier_Type_UUID</code></td>
3152<td>Create identifier from this Identifier_type</td>
3153</tr>
3154<tr>
3155<td><em>location</em></td>
3156<td><code>Location UUID</code></td>
3157<td>updated location</td>
3158</tr>
3159<tr>
3160<td><em>preferred</em></td>
3161<td><code>boolean</code></td>
3162<td>updated status of preferred/not preferred identifier</td>
3163</tr>
3164</tbody></table></li>
3165</ul>
3166<h2 id='delete-patientidentifier-sub-resource-with-properties'>Delete patientIdentifier sub resource with properties</h2><pre class="highlight shell_session"><code>DELETE /patient/:target_patient_uuid/identifier/:target_identifier_uuid
3167</code></pre>
3168<ul>
3169<li><p>Delete or retire a target identifier subresource by its UUID. Returns a <code>404 Not Found</code> status if attribute not exists.
3170If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3171<h3 id='query-parameters-4'>Query Parameters</h3>
3172<table><thead>
3173<tr>
3174<th>Parameter</th>
3175<th>Type</th>
3176<th>Description</th>
3177</tr>
3178</thead><tbody>
3179<tr>
3180<td><em>purge</em></td>
3181<td><code>Boolean</code></td>
3182<td>The resource will be voided/retired unless purge = ‘true’</td>
3183</tr>
3184</tbody></table></li>
3185</ul>
3186<h2 id='list-allergy-subresources'>List allergy subresources</h2><pre class="highlight shell_session"><code>GET /patient/:target_patient_uuid/allergy/:target_allergy_uuid
3187</code></pre>
3188<ul>
3189<li><p>List allergy subresource by its UUID and parent patient UUID.</p>
3190
3191<p>Retrieve a <b>allergy</b> sub resources of a <b>patient</b> resource. Returns a <code>404 Not Found</code> status if allergy not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned. </p></li>
3192</ul>
3193<h2 id='create-a-allergy-sub-resource-with-properties'>Create a allergy sub resource with properties</h2><pre class="highlight shell_session"><code>POST patient/:target_patient_uuid/allergy
3194{
3195 "allergen": {},
3196 "severity": {
3197 "uuid": "string"
3198 },
3199 "comment": "string",
3200 "reactions": [
3201 {
3202 "allergy": {
3203 "uuid": "string"
3204 },
3205 "reaction": {
3206 "uuid": "string"
3207 }
3208 }
3209]
3210}
3211</code></pre>
3212<ul>
3213<li><p>To create an allergy subresource for a specific patient resource, you need to specify below properties in your request body.
3214If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3215<h3 id='query-parameter-2'>Query parameter</h3>
3216<table><thead>
3217<tr>
3218<th>Parameter</th>
3219<th>Description</th>
3220</tr>
3221</thead><tbody>
3222<tr>
3223<td><code>target_patient_uuid</code></td>
3224<td>patient resource uuid</td>
3225</tr>
3226</tbody></table>
3227<h3 id='properties-for-resource-2'>Properties for resource</h3>
3228<table><thead>
3229<tr>
3230<th>Parameter</th>
3231<th>type</th>
3232<th>Description</th>
3233</tr>
3234</thead><tbody>
3235<tr>
3236<td><em>allergen</em></td>
3237<td><code>String</code></td>
3238<td>value of the allergen</td>
3239</tr>
3240<tr>
3241<td><em>severity</em></td>
3242<td><code>Severity_UUID</code></td>
3243<td>Severity uuid</td>
3244</tr>
3245<tr>
3246<td><em>comment</em></td>
3247<td><code>String</code></td>
3248<td>comment for the allergy</td>
3249</tr>
3250<tr>
3251<td><em>allergy</em></td>
3252<td><code>allergy_UUID</code></td>
3253<td>allergy uuid</td>
3254</tr>
3255<tr>
3256<td><em>reaction</em></td>
3257<td><code>reaction_UUID</code></td>
3258<td>reaction uuid</td>
3259</tr>
3260</tbody></table></li>
3261</ul>
3262<h2 id='update-allergy-sub-resource-with-properties'>Update allergy sub resource with properties</h2><pre class="highlight shell_session"><code>POST patient/:target_patient_uuid/allergy/:target_allergy_uuid
3263{
3264"allergen": {},
3265"severity": {
3266 "uuid": "string"
3267},
3268"comment": "string",
3269"reactions": [
3270 {
3271 "allergy": {
3272 "uuid": "string"
3273 },
3274 "reaction": {
3275 "uuid": "string"
3276 }
3277}
3278]
3279}
3280</code></pre>
3281<ul>
3282<li><p>Updates an allergy subresource value with given UUID, this method will only modify value of the subresource. Returns a <code>404 Not Found</code> status if property not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
3283returned.</p>
3284<h3 id='query-parameter-3'>Query parameter</h3>
3285<table><thead>
3286<tr>
3287<th>Parameter</th>
3288<th>Description</th>
3289</tr>
3290</thead><tbody>
3291<tr>
3292<td><code>target_patient_uuid</code></td>
3293<td>patient resource uuid</td>
3294</tr>
3295<tr>
3296<td><code>target_allergy_uuid</code></td>
3297<td>allergy resource uuid</td>
3298</tr>
3299</tbody></table>
3300<h3 id='properties-for-resource-3'>Properties for resource</h3>
3301<table><thead>
3302<tr>
3303<th>Parameter</th>
3304<th>type</th>
3305<th>Description</th>
3306</tr>
3307</thead><tbody>
3308<tr>
3309<td><em>allergen</em></td>
3310<td><code>String</code></td>
3311<td>value of the allergen</td>
3312</tr>
3313<tr>
3314<td><em>severity</em></td>
3315<td><code>Severity_UUID</code></td>
3316<td>Severity uuid</td>
3317</tr>
3318<tr>
3319<td><em>comment</em></td>
3320<td><code>String</code></td>
3321<td>comment for the allergy</td>
3322</tr>
3323<tr>
3324<td><em>allergy</em></td>
3325<td><code>allergy_UUID</code></td>
3326<td>allergy uuid</td>
3327</tr>
3328<tr>
3329<td><em>reaction</em></td>
3330<td><code>reaction_UUID</code></td>
3331<td>reaction uuid</td>
3332</tr>
3333</tbody></table></li>
3334</ul>
3335<h2 id='delete-allergy-sub-resource-with-properties'>Delete allergy sub resource with properties</h2><pre class="highlight shell_session"><code>DELETE /patient/:target_patient_uuid/allergy/:target_allergy_uuid
3336</code></pre>
3337<ul>
3338<li><p>Delete or retire a target allergy subresource by its UUID. Returns a <code>404 Not Found</code> status if attribute not exists.
3339If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3340<h3 id='query-parameters-5'>Query Parameters</h3>
3341<table><thead>
3342<tr>
3343<th>Parameter</th>
3344<th>Type</th>
3345<th>Description</th>
3346</tr>
3347</thead><tbody>
3348<tr>
3349<td><em>purge</em></td>
3350<td><code>Boolean</code></td>
3351<td>The resource will be voided/retired unless purge = ‘true’</td>
3352</tr>
3353</tbody></table></li>
3354</ul>
3355<h1 id='patientidentifiertype'>PatientIdentifierType</h1><h2 id='patientidentifiertype-overview'>PatientIdentifierType Overview</h2>
3356<p>Administrators define what types of identifiers they will collect. These range from National ID numbers, to driver's license numbers, to per-hospital medical record numbers.</p>
3357<h2 id='properties-on-patientidentifiertype'>Properties on PatientIdentifierType:</h2>
3358<ul>
3359<li><p>format: a regular expression defining what the identifier text should contain</p></li>
3360<li><p>formatDescription: An optional description of the regular expression (used to explain the requirements of the regular expression in terms a user would understand). For example, a regular expression like <code>\d{4,8}</code> could have a description like "Must be a number between 4 and 8 digits in length."</p></li>
3361<li><p>required: a true/false whether every patient MUST have this type</p></li>
3362<li><p>checkDigit: a true/false whether this identifier has a checkDigit at the end</p></li>
3363<li><p>validator: full class name of an <a href="https://docs.openmrs.org/doc/org/openmrs/patient/IdentifierValidator.html">IdentifierValidator</a> (e.g., <a href="https://docs.openmrs.org/doc/org/openmrs/patient/impl/LuhnIdentifierValidator.html"><code>org.openmrs.patient.impl.LuhnIdentifierValidator</code></a>)</p></li>
3364<li><p>locationBehavior: "REQUIRED" if a location must be associated with the identifier; "NOT_USED" if the identifier does require a location</p></li>
3365</ul>
3366<h2 id='available-operations-for-patientidentifiertype'>Available operations for PatientIdentifierType</h2>
3367<ol>
3368<li><a href="#List-patientidentifierType-resource">List PatientIdentifierType resources</a></li>
3369<li><a href="#create-a-patientidentifierType">Create a patientIdentifierType record</a></li>
3370<li><a href="#update-a-patientIdentifierType">Update a patientIdentifierType record</a></li>
3371<li><a href="#delete-a-patientIdentifierType">Delete a patientIdentifierType record</a></li>
3372</ol>
3373<h2 id='list-patientidentifiertype-resource'>List PatientIdentifierType resource</h2><h3 id='list-patientidentifiertype'>List patientIdentifierType</h3><pre class="highlight shell_session"><code>GET /patientidentifiertype
3374</code></pre>
3375<p>Fetch all non-retired patientIdentifierTypes resources that match any specified parameters otherwise fetch all non-retired patients. Returns a <code>200 OK</code> status with the patientIdentifierType response. If the user is not logged in a <code>401 Unauthorized</code> status is returned.</p>
3376<h3 id='get-patientidentifiertype-by-uuid'>Get patientIdentifierType by UUID.</h3><pre class="highlight shell_session"><code>GET /patientidentifiertype/:target_patientIdentifierType_uuid
3377</code></pre>
3378<p>Retrieve a patientIdentifierType by its UUID. Returns a <code>404 Not Found</code> status if patientIdentifierType does not exist in the system. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
3379<h2 id='create-a-patientidentifiertype'>Create a patientIdentifierType</h2><pre class="highlight shell_session"><code>POST /patientidentifiertype
3380{
3381 "name": "Wilson Hosp MRN",
3382 "description": "Wilson Hospital Medical Record Number",
3383 "format": "\d{1,10}-\d",
3384 "formatDescription": "Up to ten digts followed by a hyphen and another digit",
3385 "required": true,
3386 "validator": "org.openmrs.patient.impl.LuhnIdentifierValidator",
3387 "checkDigit": true,
3388 "locationBehavior": "REQUIRED",
3389 "uniquenessBehavior": "Unique"
3390}
3391</code></pre>
3392<ul>
3393<li>To create a patientIdentifierType you need to specify the below properties in the request. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</li>
3394</ul>
3395<h3 id='properties'>Properties</h3>
3396<table><thead>
3397<tr>
3398<th>Parameter</th>
3399<th>Type</th>
3400<th>Description</th>
3401</tr>
3402</thead><tbody>
3403<tr>
3404<td><em>name</em></td>
3405<td>string</td>
3406<td>label for the identifier</td>
3407</tr>
3408<tr>
3409<td><em>description</em></td>
3410<td>string</td>
3411<td>a small description about the patientIdentifier</td>
3412</tr>
3413<tr>
3414<td><em>format</em></td>
3415<td>string</td>
3416<td>a regular expression defining what the identifier text should contain</td>
3417</tr>
3418<tr>
3419<td><em>formatDescription</em></td>
3420<td>string</td>
3421<td>an optional description of the regular expression</td>
3422</tr>
3423<tr>
3424<td><em>required</em></td>
3425<td>boolean</td>
3426<td>a true/false whether every patient MUST have this type</td>
3427</tr>
3428<tr>
3429<td><em>checkDigit</em></td>
3430<td>boolean</td>
3431<td>a true/false whether this identifier has a checkdigit at the end</td>
3432</tr>
3433<tr>
3434<td><em>validator</em></td>
3435<td>string</td>
3436<td><code>org.openmrs.patient.IdentifierValidator</code></td>
3437</tr>
3438<tr>
3439<td><em>locationBehavior</em></td>
3440<td>"REQUIRED" or "NOT USED"</td>
3441<td>behavior of the location with respect to the identifier</td>
3442</tr>
3443<tr>
3444<td><em>uniquenessBehavior</em></td>
3445<td>string</td>
3446<td>specify the uniqueness of the behaviour, it can be either Unique, Non Unique or Location.</td>
3447</tr>
3448</tbody></table>
3449<h2 id='update-a-patientidentifiertype'>Update a patientIdentifierType</h2><pre class="highlight shell_session"><code>POST /patientidentifertype/:target_patientidentifiertype_uuid
3450{
3451 "name": "Amani Identifier",
3452 "description": "Medical record number for Amani Health System",
3453 "format": "\\d{1,10}-\\d",
3454 "formatDescription": "Up to ten digts followed by a hyphen and another digit",
3455 "required": false,
3456 "validator": "org.openmrs.patient.impl.LuhnIdentifierValidator",
3457 "locationBehavior": "NOT_USED",
3458 "uniquenessBehavior": "UNIQUE"
3459}
3460</code></pre>
3461<ul>
3462<li>Update a target patientIdentifierType with given UUID, this method only modifies properties in the request.
3463Returns a <code>404 Not Found</code> status if patientIdentifierType not exists. If user not logged in to perform this action, a <code>401 Unauthorized status returned</code>.</li>
3464</ul>
3465<h2 id='delete-a-patientidentifiertype'>Delete a patientIdentifierType</h2><pre class="highlight shell_session"><code>DELETE /patientidentifiertype/:target_patientidentifiertype_uuid?purge=true
3466</code></pre>
3467<ul>
3468<li><p>Delete or retire a target patientIdentifierType by its UUID. Returns a <code>404 Not Found</code> status if patientIdentifierType not exists. If user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3469<h3 id='query-parameters'>Query Parameters</h3>
3470<table><thead>
3471<tr>
3472<th>Parameter</th>
3473<th>Type</th>
3474<th>Description</th>
3475</tr>
3476</thead><tbody>
3477<tr>
3478<td><em>purge</em></td>
3479<td><code>Boolean</code></td>
3480<td>The resource will be retired unless purge = 'true'</td>
3481</tr>
3482</tbody></table></li>
3483</ul>
3484<h1 id='visits'>Visits</h1><h2 id='visits-overview'>Visits Overview</h2>
3485<ul>
3486<li><p>A Visit in OpenMRS represents precisely what it sounds like: a time when a patient is actively interacting with the
3487the healthcare system, typically at a location.</p></li>
3488<li><p>The metadata differentiating different types of visits is a Visit Type. Visit Types displayed in the user interface, also can be searched against.</p></li>
3489<li><p>A visit contains encounters, which store more granular data about treatments or services.</p></li>
3490</ul>
3491<h2 id='let-39-s-look-at-an-example-of-visits'>Let's look at an example of Visits</h2>
3492<p>At the Amani Clinic, a patient might typically check-in at registration, be seen by a doctor, and receives medication
3493<b> dispensed </b> in the pharmacy. This would be recorded as one <b> visit </b> of <b> visit type of Outpatient </b>, and
3494contain <b> three encounters (Registration, Consultation, and Dispensing) </b>.</p>
3495<h2 id='visits-sub-resource-types'>Visits Sub Resource types</h2><h3 id='visits-attribute'>Visits Attribute</h3>
3496<ul>
3497<li><p>If you wish to record extra information about visits, you can create Visit Attributes and assign them to Visit Types.</p></li>
3498<li><p>Visit attributes exists specifically to allow implementations to extend the data model.</p></li>
3499</ul>
3500<h2 id='available-operations-for-visits'>Available operations for Visits</h2>
3501<ol>
3502<li><a href="#list-visits">List visits</a></li>
3503<li><a href="#create-visit">Create visit</a></li>
3504<li><a href="#update-visit">Update visit</a></li>
3505<li><a href="#delete-visit">Delete visit</a></li>
3506<li><a href="#list-attribute-subresources">List attribute subresource</a></li>
3507<li><a href="#create-an-attribute-subresource-with-properties">Create attribute subresource with properties</a></li>
3508<li><a href="#update-attribute-subresource">Update attribute subresource</a></li>
3509<li><a href="#delete-attribute-subresource">Delete attribute subresource</a></li>
3510</ol>
3511<h2 id='list-visits'>List visits</h2><pre class="highlight shell_session"><code>GET /visit?
3512includeInactive=true
3513&fromStartDate=2016-10-08T04:09:23.000Z
3514&patient=target_patient_uuid
3515&location=target_location_uuid
3516</code></pre>
3517<ul>
3518<li><h3 id='list-all-non-retired-visits'>List all non-retired visits.</h3>
3519<p>Quickly filter visits with given query parameters. Returns a <code>404 Not Found</code> status if visit not exists. If user not logged
3520in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
3521</ul>
3522<h3 id='query-parameters'>Query Parameters</h3>
3523<table><thead>
3524<tr>
3525<th>Parameter</th>
3526<th>Type</th>
3527<th>Description</th>
3528</tr>
3529</thead><tbody>
3530<tr>
3531<td><em>patient</em></td>
3532<td><code>Patient UUID</code></td>
3533<td>Get visits for this patient</td>
3534</tr>
3535<tr>
3536<td><em>location</em></td>
3537<td><code>Location UUID</code></td>
3538<td>Get visits for this location</td>
3539</tr>
3540<tr>
3541<td><em>includeInactive</em></td>
3542<td><code>Boolean</code></td>
3543<td>Active/Inactive status of visit</td>
3544</tr>
3545<tr>
3546<td><em>fromStartDate</em></td>
3547<td><code>Date (ISO8601 Long)</code></td>
3548<td>Start date of the visit</td>
3549</tr>
3550</tbody></table>
3551<pre class="highlight shell_session"><code>GET /visit/:target_visit_uuid
3552</code></pre>
3553<ul>
3554<li><h3 id='list-visit-by-uuid'>List visit by UUID.</h3>
3555<p>Retrieve a visit by its UUID. Returns a <code>404 Not Found</code> status if visit not exists. If user not logged
3556in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
3557</ul>
3558<h2 id='create-visit'>Create visit</h2><pre class="highlight shell_session"><code>POST /visit
3559{
3560 "patient": "target_patient_uuid",
3561 "visitType": "target_visitType_uuid",
3562 "startDatetime": "2016-10-08T04:09:25.000Z",
3563 "location": "target_location_uuid",
3564 "indication": null,
3565 "encounters": [
3566 "target_encounter_uuid"
3567 ],
3568 "attributes": [
3569 {
3570 "attributeType": "target_attributeType_uuid",
3571 "value": "value_for_attribute"
3572 }
3573 ]
3574}
3575</code></pre>
3576<ul>
3577<li><p>To Create a visit you need to specify below attributes in the request body. If you are not logged in to perform this action,
3578a <code>401 Unauthorized</code> status returned.</p>
3579<h3 id='attributes'>Attributes</h3>
3580<table><thead>
3581<tr>
3582<th>Parameter</th>
3583<th>Type</th>
3584<th>Description</th>
3585</tr>
3586</thead><tbody>
3587<tr>
3588<td><em>patient</em></td>
3589<td><code>Patient UUID</code></td>
3590<td>Patient resource UUID</td>
3591</tr>
3592<tr>
3593<td><em>visitType</em></td>
3594<td><code>Patient UUID</code></td>
3595<td>Visit type resource UUID</td>
3596</tr>
3597<tr>
3598<td><em>startDatetime</em></td>
3599<td><code>Date (ISO8601 Long)</code></td>
3600<td>Start date of the visit</td>
3601</tr>
3602<tr>
3603<td><em>location</em></td>
3604<td><code>Location UUID</code></td>
3605<td>Location resource UUID</td>
3606</tr>
3607<tr>
3608<td><em>indication</em></td>
3609<td><code>string</code></td>
3610<td>Any indication of the visit</td>
3611</tr>
3612<tr>
3613<td><em>stopDatetime</em></td>
3614<td><code>Date (ISO8601 Long)</code></td>
3615<td>End date of the vist</td>
3616</tr>
3617<tr>
3618<td><em>encounters</em></td>
3619<td><code>Array[]: Encounter UUID</code></td>
3620<td>Encounter resources UUID</td>
3621</tr>
3622<tr>
3623<td><em>attributes</em></td>
3624<td><code>Array[]: Attribute</code></td>
3625<td>List of visit attributes</td>
3626</tr>
3627</tbody></table></li>
3628</ul>
3629<h2 id='update-visit'>Update visit</h2><pre class="highlight shell_session"><code>POST /visit/:target_visit_uuid
3630-d modified_visit_object
3631</code></pre>
3632<ul>
3633<li><p>Update a target visit with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
3634status if visit not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3635<h3 id='query-parameters-2'>Query Parameters</h3>
3636<table><thead>
3637<tr>
3638<th>Parameter</th>
3639<th>Type</th>
3640<th>Description</th>
3641</tr>
3642</thead><tbody>
3643<tr>
3644<td><em>uuid</em></td>
3645<td><code>target_visit_uuid</code></td>
3646<td>Target visit resource UUID</td>
3647</tr>
3648</tbody></table>
3649<h3 id='attributes-2'>Attributes</h3>
3650<table><thead>
3651<tr>
3652<th>Parameter</th>
3653<th>Type</th>
3654<th>Description</th>
3655</tr>
3656</thead><tbody>
3657<tr>
3658<td><em>resource</em></td>
3659<td><code>Visit</code></td>
3660<td>Visit resource with updated properties.</td>
3661</tr>
3662</tbody></table></li>
3663</ul>
3664<h2 id='delete-visit'>Delete visit</h2><pre class="highlight shell_session"><code>DELETE /visit/:target_visit_uuid?purge=true
3665</code></pre>
3666<ul>
3667<li><p>Delete or Retire a target visit by its UUID. Returns a <code>404 Not Found</code> status if visit not exists. If the user is not logged
3668in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3669<h3 id='query-parameters-3'>Query Parameters</h3>
3670<table><thead>
3671<tr>
3672<th>Parameter</th>
3673<th>Type</th>
3674<th>Description</th>
3675</tr>
3676</thead><tbody>
3677<tr>
3678<td><em>purge</em></td>
3679<td><code>Boolean</code></td>
3680<td>The resource will be voided/retired unless purge = ‘true’</td>
3681</tr>
3682</tbody></table></li>
3683</ul>
3684<h2 id='list-attribute-subresources'>List attribute subresources</h2><pre class="highlight shell_session"><code>GET /visit/:target_visit_uuid/attribute
3685</code></pre>
3686<ul>
3687<li><h3 id='list-all-attribute-subresources-for-a-visit'>List all attribute subresources for a visit.</h3>
3688<p>Retrieve all <b>attribute</b> sub resources of a <b>visit</b> resource by target_visit_uuid.Returns a
3689<code>404 Not Found</code> status if attribute not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
3690returned.
3691<code>console
3692GET /visit/:target_visit_uuid/attribute/:target_attribute_uuid
3693</code></p></li>
3694<li><h3 id='list-attribute-subresources-by-it-39-s-uuid-and-parent-visit-uuid'>List attribute subresources by it's UUID and parent visit UUID.</h3>
3695<p>Retrieve an <b>attribute</b> sub resources of a <b>visit</b> resource.Returns a
3696 <code>404 Not Found</code> status if attribute not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status
3697 returned.</p></li>
3698</ul>
3699<h2 id='create-an-attribute-subresource-with-properties'>Create an attribute subresource with properties</h2><pre class="highlight shell_session"><code>POST visit/:target_visit_uuid/attribute
3700{
3701 "attributeType": "target_attribute_type_uuid",
3702 "value": "value_for_the_attriute"
3703}
3704</code></pre>
3705<ul>
3706<li><p>To Create an attribute subresource for a specific visit resource, you need to specify below attributes in the request body.
3707If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3708<h3 id='attributes-3'>Attributes</h3>
3709<table><thead>
3710<tr>
3711<th>Parameter</th>
3712<th>Type</th>
3713<th>Description</th>
3714</tr>
3715</thead><tbody>
3716<tr>
3717<td><em>attributeType</em></td>
3718<td><code>Attribute_Type UUID</code></td>
3719<td>Create Attribute from this Attribute_Type</td>
3720</tr>
3721<tr>
3722<td><em>value</em></td>
3723<td><code>Depends on Attribute_Type Selected</code></td>
3724<td>Value for the attribute</td>
3725</tr>
3726</tbody></table></li>
3727</ul>
3728<h2 id='update-attribute-subresource'>Update attribute subresource</h2><pre class="highlight shell_session"><code>POST visit/:target_visit_uuid/attribute/:target_attribute_uuid
3729{
3730 "attributeType": "target_attribute_type_uuid",
3731 "value": "modified_attriute_value"
3732}
3733</code></pre>
3734<ul>
3735<li><p>Updates an attribute subresource value with given UUID, this method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if attribute not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
3736returned.</p>
3737<h3 id='attributes-4'>Attributes</h3>
3738<table><thead>
3739<tr>
3740<th>Parameter</th>
3741<th>Type</th>
3742<th>Description</th>
3743</tr>
3744</thead><tbody>
3745<tr>
3746<td><em>attributeType</em></td>
3747<td><code>Attribute_Type UUID</code></td>
3748<td>Attribute_Type resource UUID</td>
3749</tr>
3750<tr>
3751<td><em>updated value</em></td>
3752<td><code>Depends on Attribute_Type Selected</code></td>
3753<td>Updated value for the attribute</td>
3754</tr>
3755</tbody></table></li>
3756</ul>
3757<h2 id='delete-attribute-subresource'>Delete attribute subresource</h2><pre class="highlight shell_session"><code>DELETE /visit/:target_visit_uuid/attribute/:target_attribute_uuid
3758</code></pre>
3759<ul>
3760<li><p>Delete or Retire a target attribute subresource by its UUID. Returns a <code>404 Not Found</code> status if attribute not exists.
3761If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3762<h3 id='query-parameters-4'>Query Parameters</h3>
3763<table><thead>
3764<tr>
3765<th>Parameter</th>
3766<th>Type</th>
3767<th>Description</th>
3768</tr>
3769</thead><tbody>
3770<tr>
3771<td><em>purge</em></td>
3772<td><code>Boolean</code></td>
3773<td>The resource will be voided/retired unless purge = ‘true’</td>
3774</tr>
3775</tbody></table></li>
3776</ul>
3777<h1 id='visits-type'>Visits Type</h1><h2 id='visits-type-overview'>Visits Type Overview</h2>
3778<ul>
3779<li><p>A Visit Type is a name and description of a kind of visit. </p></li>
3780<li><p>Every visit has a type. You should create visit types that match how your health site classifies visits, such as
3781"Outpatient," "Hospitalization," "Dental," "Patient Education," or "TB Clinic.".</p></li>
3782<li><p>It is mandatory to set up at least one visit type.</p></li>
3783<li><p>Visit types will be shown as dropdown options when creating or editing a patient in Registration. </p></li>
3784<li><p>Visit types can be added via the OpenMRS admin screen(Administration > Visits > Manage Visit Types) or via SQL scripts. </p></li>
3785</ul>
3786<h2 id='available-operations-for-visits-type'>Available operations for Visits Type</h2>
3787<ol>
3788<li><a href="#list-visits-types">List visits types</a></li>
3789<li><a href="#create-a-visit-type">Create a visit type</a></li>
3790<li><a href="#update-a-visit-type">Update a visit type</a></li>
3791<li><a href="#delete-a-visit-type">Delete a visit type</a></li>
3792</ol>
3793<pre class="highlight shell_session"><code>GET /visittype?q="Search Query"
3794</code></pre>
3795<ul>
3796<li><h3 id='list-all-non-retired-visits-types'>List all non-retired visits types.</h3>
3797<p>Quickly filter visit types with a given search query. Returns a <code>404 Not Found</code> status if visit type not exists.
3798If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
3799</ul>
3800<h3 id='query-parameters'>Query Parameters</h3>
3801<table><thead>
3802<tr>
3803<th>Parameter</th>
3804<th>Type</th>
3805<th>Description</th>
3806</tr>
3807</thead><tbody>
3808<tr>
3809<td><em>q</em></td>
3810<td><code>Search Query</code></td>
3811<td>Display Name of Visit Type.</td>
3812</tr>
3813</tbody></table>
3814<pre class="highlight shell_session"><code>GET /visittype/:target_visit_type_uuid
3815</code></pre>
3816<ul>
3817<li><h3 id='list-visit-type-by-uuid'>List visit type by UUID.</h3>
3818<p>Retrieve a visit type by its UUID. Returns a <code>404 Not Found</code> status if visit type not exists. If user not logged
3819in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
3820</ul>
3821<h2 id='create-a-visit-type'>Create a visit type</h2><pre class="highlight shell_session"><code>POST /visittype
3822{
3823 "name": "Name for the visit type",
3824 "description": "Description for the visit type"
3825}
3826</code></pre>
3827<ul>
3828<li><p>To Create a visit type, you need to specify below attributes in the request body. If you are not logged in to perform this action,
3829a <code>401 Unauthorized</code> status returned.</p>
3830<h3 id='attributes'>Attributes</h3>
3831<table><thead>
3832<tr>
3833<th>Parameter</th>
3834<th>Type</th>
3835<th>Description</th>
3836</tr>
3837</thead><tbody>
3838<tr>
3839<td><em>name</em></td>
3840<td><code>String</code></td>
3841<td>Name of the visit type (Required)</td>
3842</tr>
3843<tr>
3844<td><em>description</em></td>
3845<td><code>Patient UUID</code></td>
3846<td>Visit type resource UUID (Required)</td>
3847</tr>
3848</tbody></table></li>
3849</ul>
3850<h2 id='update-a-visit-type'>Update a visit type</h2><pre class="highlight shell_session"><code>POST /type/:target_visit_type_uuid
3851{
3852 "name": "Modified name for the visit type",
3853 "description": "Modified description for the visit type"
3854}
3855</code></pre>
3856<ul>
3857<li><p>Update a target visit type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
3858status if visit not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3859<h3 id='query-parameters-2'>Query Parameters</h3>
3860<table><thead>
3861<tr>
3862<th>Parameter</th>
3863<th>Type</th>
3864<th>Description</th>
3865</tr>
3866</thead><tbody>
3867<tr>
3868<td><em>uuid</em></td>
3869<td><code>target_visit_type_uuid</code></td>
3870<td>Target visit type resource UUID</td>
3871</tr>
3872</tbody></table>
3873<h3 id='attributes-2'>Attributes</h3>
3874<table><thead>
3875<tr>
3876<th>Parameter</th>
3877<th>Type</th>
3878<th>Description</th>
3879</tr>
3880</thead><tbody>
3881<tr>
3882<td><em>name</em></td>
3883<td><code>String</code></td>
3884<td>Name of the visit type (Required)</td>
3885</tr>
3886<tr>
3887<td><em>description</em></td>
3888<td><code>Patient UUID</code></td>
3889<td>Visit type resource UUID (Required)</td>
3890</tr>
3891</tbody></table></li>
3892</ul>
3893<h2 id='delete-a-visit-type'>Delete a visit type</h2><pre class="highlight shell_session"><code>DELETE /visittype/:target_visit_type_uuid?purge=true
3894</code></pre>
3895<ul>
3896<li><p>Delete or Retire a target visit type by its UUID. Returns a <code>404 Not Found</code> status if visit not exists. If user not logged
3897in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
3898<h3 id='query-parameters-3'>Query Parameters</h3>
3899<table><thead>
3900<tr>
3901<th>Parameter</th>
3902<th>Type</th>
3903<th>Description</th>
3904</tr>
3905</thead><tbody>
3906<tr>
3907<td><em>purge</em></td>
3908<td><code>Boolean</code></td>
3909<td>The resource will be voided/retired unless purge = ‘true’</td>
3910</tr>
3911</tbody></table></li>
3912</ul>
3913<h1 id='visits-attribute-type'>Visits Attribute Type</h1><h2 id='visits-attribute-type-overview'>Visits Attribute Type Overview</h2>
3914<ul>
3915<li><p>If you wish to record extra information about visits, you can create Visit Attributes and assign them to Visit Types. </p></li>
3916<li><p>For example, you might create attributes for "Followup Visit," or "Distance Patient Traveled."</p></li>
3917</ul>
3918<h2 id='available-operations-for-visits-attribute-type'>Available operations for Visits Attribute Type</h2>
3919<ol>
3920<li><a href="#list-visits-attribute-types">List visits attribute types</a></li>
3921<li><a href="#create-a-visit-attribute-type">Create a visit attribute type</a></li>
3922<li><a href="#update-a-visit-attribute-type">Update a visit attribute type</a></li>
3923<li><a href="#delete-a-visit-attribute-type">Delete a visit attribute type</a></li>
3924</ol>
3925<h2 id='list-visits-attribute-types'>List visits attribute types</h2><pre class="highlight shell_session"><code>GET /visitattributetype?q="Search Query"
3926</code></pre>
3927<ul>
3928<li><h3 id='list-all-non-retired-visits-attribute-types'>List all non-retired visits attribute types.</h3>
3929<p>Quickly filter visit attribute types with a given search query. Returns a <code>404 Not Found</code> status if the visit attribute type not exists.
3930 If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
3931</ul>
3932<h3 id='query-parameters'>Query Parameters</h3>
3933<table><thead>
3934<tr>
3935<th>Parameter</th>
3936<th>Type</th>
3937<th>Description</th>
3938</tr>
3939</thead><tbody>
3940<tr>
3941<td><em>q</em></td>
3942<td><code>Search Query</code></td>
3943<td>Display Name of Visit attribute type.</td>
3944</tr>
3945</tbody></table>
3946<pre class="highlight shell_session"><code>GET /visitattributetype/:target_visit_attribute_type_uuid
3947</code></pre>
3948<ul>
3949<li><h3 id='list-visit-attribute-type-by-uuid'>List visit attribute type by UUID.</h3>
3950<p>Retrieve a visit attribute type by its UUID. Returns a <code>404 Not Found</code> status if the visit attribute type not exists. If the
3951user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
3952</ul>
3953<h2 id='create-a-visit-attribute-type'>Create a visit attribute type</h2><pre class="highlight shell_session"><code>POST /visitattributetype
3954{
3955 "name": "Patient condition",
3956 "description": "This attribute type will record the health conditon of the patient",
3957 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
3958 "minOccurs": 0,
3959 "maxOccurs": 1,
3960 "datatypeConfig": "default",
3961 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
3962 "handlerConfig": "dafault"
3963}
3964</code></pre>
3965<ul>
3966<li><p>To Create a visit attribute type, you need to specify below attributes in the request body. If the user not logged in to perform this action,
3967a <code>401 Unauthorized</code> status returned.</p>
3968<h3 id='attributes'>Attributes</h3>
3969<table><thead>
3970<tr>
3971<th>Parameter</th>
3972<th>Type</th>
3973<th>Description</th>
3974</tr>
3975</thead><tbody>
3976<tr>
3977<td><em>name</em></td>
3978<td><code>String</code></td>
3979<td>Name of the visit attribute type (Required)</td>
3980</tr>
3981<tr>
3982<td><em>description</em></td>
3983<td><code>String</code></td>
3984<td>Description (Required)</td>
3985</tr>
3986<tr>
3987<td><em>datatypeClassname</em></td>
3988<td><code>CustomDataType Resource</code></td>
3989<td>Data type for the attribute type resource.OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
3990</tr>
3991<tr>
3992<td><em>minOccurs</em></td>
3993<td><code>Number</code></td>
3994<td>Minimum number of times this value can be specified for a single visit. Use <code>0</code> or <code>1</code> as the default value (Required)</td>
3995</tr>
3996<tr>
3997<td><em>maxOccurs</em></td>
3998<td><code>Number</code></td>
3999<td>Maximum number of times this value can be specified for a single visit (e.g., use 1 to prevent an attribute from being added to a visit multiple times)</td>
4000</tr>
4001<tr>
4002<td><em>preferredHandlerClassname</em></td>
4003<td><code>Handler</code></td>
4004<td>Handler subresource for the Custom Data Type used. Can optionally define a specific handler class wants to use (otherwise the framework will choose the best handler for the chosen DataType).To find which handlers to use for the Custom DataType, please refer here</td>
4005</tr>
4006<tr>
4007<td><em>datatypeConfig</em></td>
4008<td><code>String</code></td>
4009<td>Allow the data type have any name and config it wants/needs.</td>
4010</tr>
4011<tr>
4012<td><em>handlerConfig</em></td>
4013<td><code>String</code></td>
4014<td>Allow the handler have any name and config it wants/needs. This will help to identify the data type unambiguously which has been contained and will allow introspecting</td>
4015</tr>
4016</tbody></table></li>
4017</ul>
4018<h2 id='update-a-visit-attribute-type'>Update a visit attribute type</h2><pre class="highlight shell_session"><code>POST /visitattributetype/:target_visit_attribute_type_uuid
4019{
4020 "name": "Patient condition modified",
4021 "description": "This attribute type will record the health conditon of the patient",
4022 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
4023 "minOccurs": 0,
4024 "maxOccurs": 2,
4025 "datatypeConfig": "default",
4026 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
4027 "handlerConfig": "dafault"
4028}
4029</code></pre>
4030<ul>
4031<li><p>Update a target visit attribute type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
4032status if the visit attribute not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4033<h3 id='query-parameters-2'>Query Parameters</h3>
4034<table><thead>
4035<tr>
4036<th>Parameter</th>
4037<th>Type</th>
4038<th>Description</th>
4039</tr>
4040</thead><tbody>
4041<tr>
4042<td><em>uuid</em></td>
4043<td><code>target_visit_attribute_type_uuid</code></td>
4044<td>Target visit attribute type resource UUID</td>
4045</tr>
4046</tbody></table>
4047<h3 id='attributes-2'>Attributes</h3>
4048<table><thead>
4049<tr>
4050<th>Parameter</th>
4051<th>Type</th>
4052<th>Description</th>
4053</tr>
4054</thead><tbody>
4055<tr>
4056<td><em>name</em></td>
4057<td><code>String</code></td>
4058<td>Name of the visit attribute type (Required)</td>
4059</tr>
4060<tr>
4061<td><em>description</em></td>
4062<td><code>String</code></td>
4063<td>Description (Required)</td>
4064</tr>
4065<tr>
4066<td><em>datatypeClassname</em></td>
4067<td><code>CustomDataType Resource</code></td>
4068<td>Data type for the attribute type resource.OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
4069</tr>
4070<tr>
4071<td><em>minOccurs</em></td>
4072<td><code>Number</code></td>
4073<td>Minimum number of times this value can be specified for a single visit. Use <code>0</code> or <code>1</code> as the default value (Required) (Required)</td>
4074</tr>
4075<tr>
4076<td><em>maxOccurs</em></td>
4077<td><code>Number</code></td>
4078<td>Maximum number of times this value can be specified for a single visit (e.g., use 1 to prevent an attribute from being added to a visit multiple times)</td>
4079</tr>
4080<tr>
4081<td><em>preferredHandlerClassname</em></td>
4082<td><code>Handler</code></td>
4083<td>Handler subresource for the Custom Data Type used. Can optionally define a specific handler class wants to use (otherwise the framework will choose the best handler for the chosen DataType ).To find which handlers to use for the Custom DataType, please refer here</td>
4084</tr>
4085<tr>
4086<td><em>datatypeConfig</em></td>
4087<td><code>String</code></td>
4088<td>Allow the data type have any name and config it wants/needs.</td>
4089</tr>
4090<tr>
4091<td><em>handlerConfig</em></td>
4092<td><code>String</code></td>
4093<td>Allow the handler have any name and config it wants/needs. This will help to identify the data type unambiguously which has been contained and will allow introspecting</td>
4094</tr>
4095</tbody></table></li>
4096</ul>
4097<h2 id='delete-a-visit-attribute-type'>Delete a visit attribute type</h2><pre class="highlight shell_session"><code>DELETE /visitattributetype/:target_visit_attribute_type_uuid?purge=true
4098</code></pre>
4099<ul>
4100<li><p>Delete or Retire a target visit attribute type by its UUID. Returns a <code>404 Not Found</code> status if the visit attribute type not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4101<h3 id='query-parameters-3'>Query Parameters</h3>
4102<table><thead>
4103<tr>
4104<th>Parameter</th>
4105<th>Type</th>
4106<th>Description</th>
4107</tr>
4108</thead><tbody>
4109<tr>
4110<td><em>purge</em></td>
4111<td><code>Boolean</code></td>
4112<td>The resource will be voided/retired unless purge = ‘true’.Purging will attempt to remove the attribute type from the system irreversibly. Attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
4113</tr>
4114</tbody></table></li>
4115</ul>
4116<h1 id='location'>Location</h1><h2 id='location-overview'>Location Overview</h2>
4117<ul>
4118<li><p>A Location is a physical place where a patient may be seen, such as a hospital, a room, a clinic, or a district.</p></li>
4119<li><p><strong>Locations may have a hierarchy</strong>, such that each location may have one parent location.</p></li>
4120<li><p>Also a Location can have one or more Children location example Children's Ward might be a location within the location
4121Amani Clinic.</p></li>
4122<li><p>You might also store physical areas (for example, Eastern Province, or California) as Locations. </p></li>
4123<li><p>You should not use locations to represent logical ideas like All-District Hospitals. They should be modeled using LocationTags.</p></li>
4124</ul>
4125<h2 id='location-sub-resource-types'>Location Sub Resource types</h2><h3 id='location-attribute'>Location Attribute.</h3>
4126<ul>
4127<li><p>If you wish to record extra information about location, you can create Location Attributes and assign them to Location Types.</p></li>
4128<li><p>Location attributes exists specifically to allow implementations to extend the data model.</p></li>
4129</ul>
4130<h2 id='available-operations-for-location'>Available operations for location</h2>
4131<ol>
4132<li><a href="#list-location">List location</a></li>
4133<li><a href="#create-a-location">Create a location</a></li>
4134<li><a href="#update-a-location">Update a location</a></li>
4135<li><a href="#delete-a-location">Delete a location</a></li>
4136<li><a href="#list-location-attribute-subresources">List location attribute subresource</a></li>
4137<li><a href="#create-a-location-attribute-subresource-with-properties">Create location attribute subresource with properties</a></li>
4138<li><a href="#update-a-location-attribute-subresource">Update location attribute subresource</a></li>
4139<li><a href="#delete-a-location-attribute-subresource">Delete location attribute subresource</a></li>
4140</ol>
4141<h2 id='list-location'>List location</h2><pre class="highlight shell_session"><code>GET /location?
4142q="amani"
4143</code></pre><h3 id='list-all-non-retired-locations'>List all non-retired locations`.</h3>
4144<p>Quickly filter location with given query parameters. Returns a <code>404 Not Found</code> status if the location not exists. If the
4145 user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4146<h3 id='query-parameters'>Query Parameters</h3>
4147<table><thead>
4148<tr>
4149<th>Parameter</th>
4150<th>Type</th>
4151<th>Description</th>
4152</tr>
4153</thead><tbody>
4154<tr>
4155<td><em>q</em></td>
4156<td><code>Search Query</code></td>
4157<td>Display Name of Location object.</td>
4158</tr>
4159</tbody></table>
4160<h3 id='list-location-by-uuid'>List location by UUID.</h3><pre class="highlight shell_session"><code>GET /location/:target_location_uuid
4161</code></pre>
4162<p>Retrieve a location by its UUID. Returns a <code>404 Not Found</code> status if the location not exists. If the user not logged
4163 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4164<h2 id='create-a-location'>Create a location</h2><pre class="highlight shell_session"><code>POST /location
4165{
4166 "name": "Salzburg Hospital",
4167 "description": "Salzburg hospital location",
4168 "address1": "Mullner House 48",
4169 "address2": "",
4170 "cityVillage": "salzburg",
4171 "stateProvince": "salzburg",
4172 "country": "Austria",
4173 "postalCode": "5020",
4174 "latitude": "",
4175 "longitude": "",
4176 "countyDistrict": "salzburg",
4177 "tags": [
4178 "target_location_tag_uuid"
4179 ],
4180 "parentLocation": "target_parent_location_uuid",
4181 "childLocations": [
4182 "target_child_location_uuid"
4183 ],
4184 "attributes": [
4185 {
4186 "attributeType": "target_attributeType_uuid",
4187 "value": "value_for_attribute"
4188 }
4189 ]
4190}
4191</code></pre>
4192<ul>
4193<li><p>To Create a location you need to specify below attributes in the request body. If the user not logged in to perform this action,
4194a <code>401 Unauthorized</code> status returned.</p>
4195<h3 id='attributes'>Attributes</h3>
4196<table><thead>
4197<tr>
4198<th>Parameter</th>
4199<th>Type</th>
4200<th>Description</th>
4201</tr>
4202</thead><tbody>
4203<tr>
4204<td><em>name</em></td>
4205<td><code>String</code></td>
4206<td>Name of the location (Required)</td>
4207</tr>
4208<tr>
4209<td><em>address1</em></td>
4210<td><code>String</code></td>
4211<td>Address of the location (Required)</td>
4212</tr>
4213<tr>
4214<td><em>description</em></td>
4215<td><code>String</code></td>
4216<td>Description</td>
4217</tr>
4218<tr>
4219<td><em>cityVillage</em></td>
4220<td><code>String</code></td>
4221<td>City/village</td>
4222</tr>
4223<tr>
4224<td><em>stateProvince</em></td>
4225<td><code>String</code></td>
4226<td>State and province</td>
4227</tr>
4228<tr>
4229<td><em>country</em></td>
4230<td><code>String</code></td>
4231<td>Country</td>
4232</tr>
4233<tr>
4234<td><em>postalCode</em></td>
4235<td><code>String</code></td>
4236<td>Postal code of the location</td>
4237</tr>
4238<tr>
4239<td><em>latitude</em></td>
4240<td><code>String</code></td>
4241<td>Latitude</td>
4242</tr>
4243<tr>
4244<td><em>longitude</em></td>
4245<td><code>String</code></td>
4246<td>Longitude</td>
4247</tr>
4248<tr>
4249<td><em>countyDistrict</em></td>
4250<td><code>String</code></td>
4251<td>District or Country</td>
4252</tr>
4253<tr>
4254<td><em>tags</em></td>
4255<td><code>Array[]: LocationTag UUID</code></td>
4256<td>UUID's of the location tags</td>
4257</tr>
4258<tr>
4259<td><em>parentLocation</em></td>
4260<td><code>Parent Location UUID</code></td>
4261<td>UUID of the target parent location</td>
4262</tr>
4263<tr>
4264<td><em>childLocations</em></td>
4265<td><code>Array[]: Child Location UUID</code></td>
4266<td>UUID's of the target child locations</td>
4267</tr>
4268<tr>
4269<td><em>attributes</em></td>
4270<td><code>Array[]: Attribute UUID</code></td>
4271<td>UUID's of location attributes</td>
4272</tr>
4273</tbody></table></li>
4274</ul>
4275<h2 id='update-a-location'>Update a location</h2><pre class="highlight shell_session"><code>POST /location/:target_location_uuid
4276{
4277 "name": "Salzburg Hospital",
4278 "description": "Modified location of Salzburg hospital location",
4279 "address1": "Mullner House 48",
4280 "address2": "",
4281 "cityVillage": "salzburg",
4282 "stateProvince": "salzburg",
4283 "country": "Austria",
4284 "postalCode": "5020",
4285 "latitude": "47.811195",
4286 "longitude": "13.03322",
4287 "countyDistrict": "salzburg",
4288 "tags": [
4289 "target_location_tag_uuid"
4290 ],
4291 "parentLocation": "target_parent_location_uuid",
4292 "childLocations": [
4293 "target_child_location_uuid"
4294 ],
4295 "attributes": [
4296 {
4297 "attributeType": "target_attributeType_uuid",
4298 "value": "value_for_attribute"
4299 }
4300 ]
4301}
4302</code></pre>
4303<ul>
4304<li><p>Update a target location with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
4305status if the location not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4306<h3 id='query-parameters-2'>Query Parameters</h3>
4307<table><thead>
4308<tr>
4309<th>Parameter</th>
4310<th>Type</th>
4311<th>Description</th>
4312</tr>
4313</thead><tbody>
4314<tr>
4315<td><em>uuid</em></td>
4316<td><code>target_location_uuid</code></td>
4317<td>Target location resource UUID</td>
4318</tr>
4319</tbody></table>
4320<h3 id='attributes-2'>Attributes</h3>
4321<table><thead>
4322<tr>
4323<th>Parameter</th>
4324<th>Type</th>
4325<th>Description</th>
4326</tr>
4327</thead><tbody>
4328<tr>
4329<td><em>name</em></td>
4330<td><code>String</code></td>
4331<td>Name of the location (Required)</td>
4332</tr>
4333<tr>
4334<td><em>address1</em></td>
4335<td><code>String</code></td>
4336<td>Address of the location (Required)</td>
4337</tr>
4338<tr>
4339<td><em>description</em></td>
4340<td><code>String</code></td>
4341<td>Description</td>
4342</tr>
4343<tr>
4344<td><em>cityVillage</em></td>
4345<td><code>String</code></td>
4346<td>City/village</td>
4347</tr>
4348<tr>
4349<td><em>stateProvince</em></td>
4350<td><code>String</code></td>
4351<td>State and province</td>
4352</tr>
4353<tr>
4354<td><em>country</em></td>
4355<td><code>String</code></td>
4356<td>Country</td>
4357</tr>
4358<tr>
4359<td><em>postalCode</em></td>
4360<td><code>String</code></td>
4361<td>Postal code of the location</td>
4362</tr>
4363<tr>
4364<td><em>latitude</em></td>
4365<td><code>String</code></td>
4366<td>Latitude</td>
4367</tr>
4368<tr>
4369<td><em>longitude</em></td>
4370<td><code>String</code></td>
4371<td>Longitude</td>
4372</tr>
4373<tr>
4374<td><em>countyDistrict</em></td>
4375<td><code>String</code></td>
4376<td>District or Country</td>
4377</tr>
4378<tr>
4379<td><em>tags</em></td>
4380<td><code>Array[]: LocationTag UUID</code></td>
4381<td>UUID's of the location tags</td>
4382</tr>
4383<tr>
4384<td><em>parentLocation</em></td>
4385<td><code>Parent Location UUID</code></td>
4386<td>UUID of the target parent location</td>
4387</tr>
4388<tr>
4389<td><em>childLocations</em></td>
4390<td><code>Array[]: Child Location UUID</code></td>
4391<td>UUID's of the target child locations</td>
4392</tr>
4393<tr>
4394<td><em>attributes</em></td>
4395<td><code>Array[]: Attribute UUID</code></td>
4396<td>UUID's of location attributes</td>
4397</tr>
4398</tbody></table></li>
4399</ul>
4400<h2 id='delete-a-location'>Delete a location</h2><pre class="highlight shell_session"><code>DELETE /location/:target_location_uuid?purge=true
4401</code></pre>
4402<ul>
4403<li><p>Delete or Retire a target location by its UUID. Returns a <code>404 Not Found</code> status if the location not exists. If the user not logged
4404in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4405<h3 id='query-parameters-3'>Query Parameters</h3>
4406<table><thead>
4407<tr>
4408<th>Parameter</th>
4409<th>Type</th>
4410<th>Description</th>
4411</tr>
4412</thead><tbody>
4413<tr>
4414<td><em>purge</em></td>
4415<td><code>Boolean</code></td>
4416<td>The resource will be voided/retired unless purge = ‘true’</td>
4417</tr>
4418</tbody></table></li>
4419</ul>
4420<h2 id='list-location-attribute-subresources'>List location attribute subresources</h2><h3 id='list-all-location-attribute-subresources-for-a-location'>List all location attribute subresources for a location.</h3><pre class="highlight shell_session"><code>GET /location/:target_location_uuid/attribute
4421</code></pre>
4422<p>Retrieve all <b>attribute</b> sub resources of a <b>location</b> resource by target_location_uuid.Returns a
4423 <code>404 Not Found</code> status if the attribute not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status
4424 returned.</p>
4425<h3 id='list-location-attribute-subresources-by-own-uuid-and-parent-location-uuid'>List location attribute subresources by own UUID and parent location UUID.</h3><pre class="highlight shell_session"><code>GET /location/:target_location_uuid/attribute/:target_attribute_uuid
4426</code></pre>
4427<p>Retrieve an <b>attribute</b> sub resources of a <b>location</b> resource.Returns a
4428 <code>404 Not Found</code> status if the attribute not exists. If the user are not logged in to perform this action, a <code>401 Unauthorized</code> status
4429 returned.</p>
4430<h2 id='create-a-location-attribute-subresource-with-properties'>Create a location attribute subresource with properties</h2><pre class="highlight shell_session"><code>POST location/:target_location_uuid/attribute
4431{
4432 "attributeType": "target_location_attribute_type_uuid",
4433 "value": "value_for_the_attriute"
4434}
4435</code></pre>
4436<ul>
4437<li><p>To Create an attribute subresource for a specific location resource, you need to specify below attributes in the request body.
4438If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4439<h3 id='attributes-3'>Attributes</h3>
4440<table><thead>
4441<tr>
4442<th>Parameter</th>
4443<th>Type</th>
4444<th>Description</th>
4445</tr>
4446</thead><tbody>
4447<tr>
4448<td><em>attributeType</em></td>
4449<td><code>Attribute_Type UUID</code></td>
4450<td>Create Attribute from this Location Attribute_Type</td>
4451</tr>
4452<tr>
4453<td><em>value</em></td>
4454<td><code>Depends on Attribute_Type Selected</code></td>
4455<td>Value for the attribute</td>
4456</tr>
4457</tbody></table></li>
4458</ul>
4459<h2 id='update-a-location-attribute-subresource'>Update a location attribute subresource</h2><pre class="highlight shell_session"><code>POST location/:target_location_uuid/attribute/:target_location_attribute_uuid
4460{
4461 "attributeType": "target_attribute_type_uuid",
4462 "value": "modified_attriute_value"
4463}
4464</code></pre>
4465<ul>
4466<li><p>Updates a location attribute sub resource value with given UUID, this method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if the attribute not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status
4467returned.</p>
4468<h3 id='attributes-4'>Attributes</h3>
4469<table><thead>
4470<tr>
4471<th>Parameter</th>
4472<th>Type</th>
4473<th>Description</th>
4474</tr>
4475</thead><tbody>
4476<tr>
4477<td><em>attributeType</em></td>
4478<td><code>Attribute_Type UUID</code></td>
4479<td>Location Attribute_Type resource UUID</td>
4480</tr>
4481<tr>
4482<td><em>updated value</em></td>
4483<td><code>Depends on Attribute_Type Selected</code></td>
4484<td>Updated value for the attribute</td>
4485</tr>
4486</tbody></table></li>
4487</ul>
4488<h2 id='delete-a-location-attribute-subresource'>Delete a location attribute subresource</h2><pre class="highlight shell_session"><code>DELETE /location/:target_location_uuid/attribute/:target_location_attribute_uuid
4489</code></pre>
4490<ul>
4491<li><p>Delete or Retire a target location attribute subresource by its UUID. Returns a <code>404 Not Found</code> status if the attribute not exists.
4492If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4493<h3 id='query-parameters-4'>Query Parameters</h3>
4494<table><thead>
4495<tr>
4496<th>Parameter</th>
4497<th>Type</th>
4498<th>Description</th>
4499</tr>
4500</thead><tbody>
4501<tr>
4502<td><em>purge</em></td>
4503<td><code>Boolean</code></td>
4504<td>The resource will be voided/retired unless purge = ‘true’</td>
4505</tr>
4506</tbody></table></li>
4507</ul>
4508<h1 id='location-tag-type'>Location Tag Type</h1><h2 id='location-tag-overview'>Location Tag Overview</h2>
4509<ul>
4510<li><p>Tags are strings attached to an entity (like tagging of blog entries) to form a folksonomy and/or to categorize data. </p></li>
4511<li><p>Location Tags are being used to tag locations, which enables the system to act based on the presence of tags on specific locations. </p></li>
4512<li><p>You should not use locations to represent logical ideas like <code>All-District Hospitals</code>. They should be modeled using LocationTags.</p></li>
4513<li><p>For example, location tags may be used to control which locations are included in a choice list or to define which locations included in a report.</p></li>
4514</ul>
4515<h2 id='available-operations-for-location-tag'>Available operations for Location Tag</h2>
4516<ol>
4517<li><a href="#list-location-tags">List location tags</a></li>
4518<li><a href="#create-a-location-tag">Create a location tag</a></li>
4519<li><a href="#update-a-location-tag">Update a location tag</a></li>
4520<li><a href="#delete-a-location-tag">Delete a location tag</a></li>
4521</ol>
4522<h2 id='list-location-tags'>List location tags</h2><h3 id='list-all-non-retired-location-tags'>List all non-retired location tags.</h3><pre class="highlight shell_session"><code>GET /locationtag?q="visit"
4523</code></pre>
4524<p>Quickly filter location tags with a given search query. Returns a <code>404 Not Found</code> status if the location tag not exists.
4525 If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4526
4527<p>### Query Parameters</p>
4528
4529<table><thead>
4530<tr>
4531<th>Parameter</th>
4532<th>Type</th>
4533<th>Description</th>
4534</tr>
4535</thead><tbody>
4536<tr>
4537<td><em>q</em></td>
4538<td><code>Search Query</code></td>
4539<td>Display Name of Location location tag type.</td>
4540</tr>
4541</tbody></table>
4542<h3 id='list-location-tag-by-uuid'>List location tag by UUID.</h3><pre class="highlight shell_session"><code>GET /locationtag/:target_location_tag_uuid
4543</code></pre>
4544<p>Retrieve a location tag by its UUID. Returns a <code>404 Not Found</code> status if the location tag type not exists. If the
4545 user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4546<h2 id='create-a-location-tag'>Create a location tag</h2><pre class="highlight shell_session"><code>POST /locationtag
4547{
4548 "name": "Visit Location",
4549 "description": "Visits are only allowed to happen at locations tagged with this location tag.",
4550 "retired": false
4551}
4552</code></pre>
4553<ul>
4554<li><p>To Create a location tag, you need to specify below attributes in the request body. If the user not logged in to perform this action,
4555a <code>401 Unauthorized</code> status returned.</p>
4556<h3 id='attributes'>Attributes</h3>
4557<table><thead>
4558<tr>
4559<th>Parameter</th>
4560<th>Type</th>
4561<th>Description</th>
4562</tr>
4563</thead><tbody>
4564<tr>
4565<td><em>name</em></td>
4566<td><code>String</code></td>
4567<td>Name of the location tag (Required)</td>
4568</tr>
4569<tr>
4570<td><em>description</em></td>
4571<td><code>String</code></td>
4572<td>Description (Required)</td>
4573</tr>
4574<tr>
4575<td><em>retired</em></td>
4576<td><code>Boolean</code></td>
4577<td>Retired status of the location tag</td>
4578</tr>
4579<tr>
4580<td><em>retiredReason</em></td>
4581<td><code>String</code></td>
4582<td>For location tags that are retired, this may contain an explanation of why the location tag was retired.</td>
4583</tr>
4584</tbody></table></li>
4585</ul>
4586<h2 id='update-a-location-tag'>Update a location tag</h2><pre class="highlight shell_session"><code>POST /locationtag/:target_location_tag_uuid
4587{
4588 "name": "Visit Location",
4589 "description": "Visits are only allowed to happen at locations tagged with this location tag.",
4590 "retired": true,
4591 "retiredReason": "Not valid anymore"
4592}
4593</code></pre>
4594<ul>
4595<li><p>Update a target location tag with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
4596status if the location tag not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4597<h3 id='query-parameters'>Query Parameters</h3>
4598<table><thead>
4599<tr>
4600<th>Parameter</th>
4601<th>Type</th>
4602<th>Description</th>
4603</tr>
4604</thead><tbody>
4605<tr>
4606<td><em>uuid</em></td>
4607<td><code>target_location_tag_uuid</code></td>
4608<td>Target location tag resource UUID</td>
4609</tr>
4610</tbody></table>
4611<h3 id='attributes-2'>Attributes</h3>
4612<table><thead>
4613<tr>
4614<th>Parameter</th>
4615<th>Type</th>
4616<th>Description</th>
4617</tr>
4618</thead><tbody>
4619<tr>
4620<td><em>name</em></td>
4621<td><code>String</code></td>
4622<td>Name of the location tag type (Required)</td>
4623</tr>
4624<tr>
4625<td><em>description</em></td>
4626<td><code>String</code></td>
4627<td>Description (Required)</td>
4628</tr>
4629<tr>
4630<td><em>retired</em></td>
4631<td><code>Boolean</code></td>
4632<td>Retired status of the location tag</td>
4633</tr>
4634<tr>
4635<td><em>retiredReason</em></td>
4636<td><code>String</code></td>
4637<td>For location tags that are retired, this may contain an explanation of why the location tag was retired.</td>
4638</tr>
4639</tbody></table></li>
4640</ul>
4641<h2 id='delete-a-location-tag'>Delete a location tag</h2><pre class="highlight shell_session"><code>DELETE /locationtag/:target_location_tag_uuid?purge=true
4642</code></pre>
4643<ul>
4644<li><p>Delete or Retire a target location tag type by its UUID. Returns a <code>404 Not Found</code> status if the location tag not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4645<h3 id='query-parameters-2'>Query Parameters</h3>
4646<table><thead>
4647<tr>
4648<th>Parameter</th>
4649<th>Type</th>
4650<th>Description</th>
4651</tr>
4652</thead><tbody>
4653<tr>
4654<td><em>purge</em></td>
4655<td><code>Boolean</code></td>
4656<td>The resource will be voided/retired unless purge = ‘true’. Purging will attempt to remove the tag from the system irreversibly. Location tags types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
4657</tr>
4658</tbody></table></li>
4659</ul>
4660<h1 id='location-attribute-type'>Location Attribute Type</h1><h2 id='location-attribute-overview'>Location Attribute Overview</h2>
4661<ul>
4662<li>If you wish to record extra information about locations, you can create Location Attributes and assign them to Location Types. </li>
4663</ul>
4664<h2 id='available-operations-for-location-attribute'>Available operations for Location Attribute</h2>
4665<ol>
4666<li><a href="#list-location-attribute-types">List location attribute types</a></li>
4667<li><a href="#create-a-location-attribute-type">Create a location attribute type</a></li>
4668<li><a href="#update-a-location-attribute-type">Update a location attribute type</a></li>
4669<li><a href="#delete-a-location-attribute-type">Delete a location attribute type</a></li>
4670</ol>
4671<h3 id='list-location-attribute-types'>List location attribute types</h3><h3 id='list-all-non-retired-location-attribute-types'>List all non-retired location attribute types.</h3><pre class="highlight shell_session"><code>GET /locationattributetype?q="humidity"
4672</code></pre>
4673<p>Quickly filter location attribute types with a given search query. Returns a <code>404 Not Found</code> status if the location attribute type not exists.
4674 If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4675
4676<p>### Query Parameters</p>
4677
4678<table><thead>
4679<tr>
4680<th>Parameter</th>
4681<th>Type</th>
4682<th>Description</th>
4683</tr>
4684</thead><tbody>
4685<tr>
4686<td><em>q</em></td>
4687<td><code>Search Query</code></td>
4688<td>Display Name of Location attribute type.</td>
4689</tr>
4690</tbody></table>
4691<h3 id='list-location-attribute-type-by-uuid'>List location attribute type by UUID.</h3><pre class="highlight shell_session"><code>GET /locationattributetype/:target_location_attribute_type_uuid
4692</code></pre>
4693<p>Retrieve a location attribute type by its UUID. Returns a <code>404 Not Found</code> status if the location attribute type not exists. If the
4694 user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4695<h2 id='create-a-location-attribute-type'>Create a location attribute type</h2><pre class="highlight shell_session"><code>POST /locationattributetype
4696{
4697 "name": "humidity",
4698 "description": "This attribute type will record the humidity of the location",
4699 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
4700 "minOccurs": 0,
4701 "maxOccurs": 1,
4702 "datatypeConfig": "default",
4703 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
4704 "handlerConfig": "dafault"
4705}
4706</code></pre>
4707<ul>
4708<li><p>To Create a location attribute type, you need to specify below attributes in the request body. If the user not logged in to perform this action,
4709a <code>401 Unauthorized</code> status returned.</p>
4710<h3 id='attributes'>Attributes</h3>
4711<table><thead>
4712<tr>
4713<th>Parameter</th>
4714<th>Type</th>
4715<th>Description</th>
4716</tr>
4717</thead><tbody>
4718<tr>
4719<td><em>name</em></td>
4720<td><code>String</code></td>
4721<td>Name of the location attribute type (Required)</td>
4722</tr>
4723<tr>
4724<td><em>description</em></td>
4725<td><code>String</code></td>
4726<td>Description (Required)</td>
4727</tr>
4728<tr>
4729<td><em>datatypeClassname</em></td>
4730<td><code>CustomDataType Resource</code></td>
4731<td>Data type for the attribute type resource. OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
4732</tr>
4733<tr>
4734<td><em>minOccurs</em></td>
4735<td><code>Number</code></td>
4736<td>Minimum number of times this value can be specified for a single location. Use <code>0</code> or <code>1</code> as the default value (Required)</td>
4737</tr>
4738<tr>
4739<td><em>maxOccurs</em></td>
4740<td><code>Number</code></td>
4741<td>Maximum number of times this value can be specified for a single location (e.g., use 1 to prevent an attribute from being added to a location multiple times)</td>
4742</tr>
4743<tr>
4744<td><em>preferredHandlerClassname</em></td>
4745<td><code>Handler</code></td>
4746<td>Handler subresource for the Custom Data Type used. Can optionally define a specific handler class wants to use (otherwise the framework will choose the best handler for the chosen DataType,). To find which handlers to use for the Custom DataType, please refer here</td>
4747</tr>
4748<tr>
4749<td><em>datatypeConfig</em></td>
4750<td><code>String</code></td>
4751<td>Allow the data type have any name and config it wants/needs.</td>
4752</tr>
4753<tr>
4754<td><em>handlerConfig</em></td>
4755<td><code>String</code></td>
4756<td>Allow the handler have any name and config it wants/needs. This will help to identify the data type unambiguously which has been contained and will allow introspecting</td>
4757</tr>
4758</tbody></table></li>
4759</ul>
4760<h2 id='update-a-location-attribute-type'>Update a location attribute type</h2><pre class="highlight shell_session"><code>POST /locationattributetype/:target_location_attribute_type_uuid
4761{
4762 "name": "humidity",
4763 "description": "This attribute type will record the humidity of the location"",
4764 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
4765 "minOccurs": 0,
4766 "maxOccurs": 2,
4767 "datatypeConfig": "default",
4768 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
4769 "handlerConfig": "dafault"
4770}
4771</code></pre>
4772<ul>
4773<li><p>Update a target location attribute type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
4774status if the location attribute not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4775<h3 id='query-parameters'>Query Parameters</h3>
4776<table><thead>
4777<tr>
4778<th>Parameter</th>
4779<th>Type</th>
4780<th>Description</th>
4781</tr>
4782</thead><tbody>
4783<tr>
4784<td><em>uuid</em></td>
4785<td><code>target_location_attribute_type_uuid</code></td>
4786<td>Target location attribute type resource UUID</td>
4787</tr>
4788</tbody></table>
4789<h3 id='attributes-2'>Attributes</h3>
4790<table><thead>
4791<tr>
4792<th>Parameter</th>
4793<th>Type</th>
4794<th>Description</th>
4795</tr>
4796</thead><tbody>
4797<tr>
4798<td><em>name</em></td>
4799<td><code>String</code></td>
4800<td>Name of the location attribute type (Required)</td>
4801</tr>
4802<tr>
4803<td><em>description</em></td>
4804<td><code>String</code></td>
4805<td>Description (Required)</td>
4806</tr>
4807<tr>
4808<td><em>datatypeClassname</em></td>
4809<td><code>CustomDataType Resource</code></td>
4810<td>Data type for the attribute type resource. OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
4811</tr>
4812<tr>
4813<td><em>minOccurs</em></td>
4814<td><code>Number</code></td>
4815<td>Minimum number of times this value can be specified for a single location. Use <code>0</code> or <code>1</code> as the default value (Required)</td>
4816</tr>
4817<tr>
4818<td><em>maxOccurs</em></td>
4819<td><code>Number</code></td>
4820<td>Maximum number of times this value can be specified for a single location (e.g., use 1 to prevent an attribute from being added to a location multiple times)</td>
4821</tr>
4822<tr>
4823<td><em>preferredHandlerClassname</em></td>
4824<td><code>Handler</code></td>
4825<td>Handler subresource for the Custom Data Type used. Can optionally define a specific handler class want to use (otherwise the framework will choose the best handler for the chosen DataType). To find which handlers to use for the Custom DataType, please refer here</td>
4826</tr>
4827<tr>
4828<td><em>datatypeConfig</em></td>
4829<td><code>String</code></td>
4830<td>Allow the data type have any name and config it wants/needs.</td>
4831</tr>
4832<tr>
4833<td><em>handlerConfig</em></td>
4834<td><code>String</code></td>
4835<td>Allow the handler have any name and config it wants/needs. This will help to identify the data type unambiguously which has been contained and will allow introspecting</td>
4836</tr>
4837</tbody></table></li>
4838</ul>
4839<h2 id='delete-a-location-attribute-type'>Delete a location attribute type</h2><pre class="highlight shell_session"><code>DELETE /locationattributetype/:target_location_attribute_type_uuid?purge=true
4840</code></pre>
4841<ul>
4842<li><p>Delete or Retire a target location attribute type by its UUID. Returns a <code>404 Not Found</code> status if the location attribute type not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4843<h3 id='query-parameters-2'>Query Parameters</h3>
4844<table><thead>
4845<tr>
4846<th>Parameter</th>
4847<th>Type</th>
4848<th>Description</th>
4849</tr>
4850</thead><tbody>
4851<tr>
4852<td><em>purge</em></td>
4853<td><code>Boolean</code></td>
4854<td>The resource will be voided/retired unless purge = ‘true’. Purging will attempt to irreversibly remove the attribute type from the system. Attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
4855</tr>
4856</tbody></table></li>
4857</ul>
4858<h1 id='encounters'>Encounters</h1><h2 id='encounter-overview'>Encounter Overview</h2>
4859<ul>
4860<li><p>An encounter represents an interaction between a patient and the healthcare system at a single point in time.
4861Common examples would be a patient seeing a doctor during a clinic visit, a patient going to the lab to have blood drawn for
4862testing, or telephone call between a provider and the patient).</p></li>
4863<li><p>Each Encounter has an encounter type, date/time, location, and provider.</p></li>
4864<li><p>Encounters are classified into Encounter Types, which describe the type of interaction the Encounter represents – e.g.,
4865"HIV Initial", "Pediatric Follow Up", "Lab"). Implementations can define their own types of encounters.</p></li>
4866<li><p>One or more encounters may be grouped within a <strong>Visit</strong> (e.g., an outpatient clinic visit or a hospitalization).</p></li>
4867<li><p>Every Encounter can have 0 to n <strong>Observations</strong> associated with it.</p></li>
4868<li><p>Every Encounter can have 0 to n <strong>Orders</strong> associated with it.</p></li>
4869</ul>
4870<h2 id='let-39-s-look-at-an-example-of-encounter'>Let's look at an example of Encounter</h2>
4871<p>During a typical Amani Clinic Outpatient Visit, a patient checks in at registration is seen by a doctor and receives medicine dispensed in the pharmacy. This would be recorded as <strong>one visit</strong> containing three encounters, whose types are <strong>Registration,
4872Consultation and Dispensing</strong>.</p>
4873<h2 id='sub-resource-types-of-encounter'>Sub Resource types of Encounter</h2><h3 id='encounter-provider'>Encounter Provider</h3>
4874<ul>
4875<li><p>A Provider is a person who provides care or services to patients. </p></li>
4876<li><p>A provider may be a clinician like a doctor or a nurse, a social worker, or a lab tech. </p></li>
4877<li><p>Any healthcare worker that a patient can have an encounter with is a provider.</p></li>
4878</ul>
4879<h2 id='available-operations-for-encounter'>Available operations for Encounter</h2>
4880<ol>
4881<li><a href="#list-encounters">List encounters</a></li>
4882<li><a href="#create-a-encounters">Create an encounters</a></li>
4883<li><a href="#update-a-encounters">Update an encounters</a></li>
4884<li><a href="#delete-a-encounters">Delete an encounters</a></li>
4885<li><a href="#list-encounter-provider-sub-resources">List encounter provider sub resource</a></li>
4886<li><a href="#create-encounter-provider-sub-resource-with-properties">Create encounter provider sub resource with properties</a></li>
4887<li><a href="#update-encounter-provider-sub-resource">Update encounter provider sub resource</a></li>
4888<li><a href="#delete-encounter-provider-sub-resource">Delete encounter provider sub resource</a></li>
4889</ol>
4890<h2 id='list-encounters'>List encounters</h2><h3 id='list-all-non-voided-encounters'>List all non-voided encounters.</h3><pre class="highlight shell_session"><code>GET /encounter?
4891patient=96be32d2-9367-4d1d-a285-79a5e5db12b8
4892&fromdate=2016-10-08
4893</code></pre>
4894<p>Quickly filter encounters with given query parameters. Returns a <code>404 Not Found</code> status if Encounter not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4895<h3 id='query-parameters'>Query Parameters</h3>
4896<table><thead>
4897<tr>
4898<th>Parameter</th>
4899<th>Type</th>
4900<th>Description</th>
4901</tr>
4902</thead><tbody>
4903<tr>
4904<td><em>q</em></td>
4905<td><code>Search Query</code></td>
4906<td>Get encounter by Encounter UUID, Patient Identifier or name</td>
4907</tr>
4908<tr>
4909<td><em>patient</em></td>
4910<td><code>Patient UUID</code></td>
4911<td>Get encounter(s) for a patient</td>
4912</tr>
4913<tr>
4914<td><em>encounterType</em></td>
4915<td><code>Encounter_Type UUID</code></td>
4916<td>Filter by encounter type (must be used with patient)</td>
4917</tr>
4918<tr>
4919<td><em>order</em></td>
4920<td><code>Order UUID</code></td>
4921<td>Filter to encounter(s) containing the specified order (must be used with patient)</td>
4922</tr>
4923<tr>
4924<td><em>obsConcept</em></td>
4925<td><code>Concept UUID</code></td>
4926<td>Filter to encounter(s) containing observation(s) for the given concept (must be used with patient)</td>
4927</tr>
4928<tr>
4929<td><em>obsValues</em></td>
4930<td><code>String</code></td>
4931<td>Filter to encounter(s) containing an observations with the given value (must be used with patient & obsConcept)</td>
4932</tr>
4933<tr>
4934<td><em>fromdate</em></td>
4935<td><code>Date or Timestamp (ISO 8601)</code></td>
4936<td>Start date of the encounter (must be used with patient)</td>
4937</tr>
4938<tr>
4939<td><em>todate</em></td>
4940<td><code>Date or Timestamp (ISO 8601)</code></td>
4941<td>End date of the encounter (must be used with patient)</td>
4942</tr>
4943</tbody></table>
4944<h3 id='list-encounter-by-uuid'>List encounter by UUID.</h3><pre class="highlight shell_session"><code>GET /encounter/:target_encounter_uuid
4945</code></pre>
4946<p>Retrieve an encounter by its UUID. Returns a <code>404 Not Found</code> status if Encounter not exists. If user not logged
4947 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
4948<h2 id='create-an-encounter'>Create an encounter</h2><pre class="highlight shell_session"><code>POST /Encounter
4949{
4950 "encounterDatetime": "2019-10-16 12:08:43",
4951 "patient": "070f0120-0283-4858-885d-a20d967729cf",
4952 "encounterType": "e22e39fd-7db2-45e7-80f1-60fa0d5a4378",
4953 "location": "aff27d58-a15c-49a6-9beb-d30dcfc0c66e",
4954 "encounterProviders": [
4955 {
4956 "provider": "bb1a7781-7896-40be-aaca-7d1b41d843a6",
4957 "encounterRole": "240b26f9-dd88-4172-823d-4a8bfeb7841f"
4958 }
4959 ]
4960}
4961</code></pre>
4962<ul>
4963<li><p>To Create an encounter you need to specify below attributes in the request body. If you are not logged in to perform this action,
4964a <code>401 Unauthorized</code> status returned.</p>
4965<h3 id='attributes'>Attributes</h3>
4966<table><thead>
4967<tr>
4968<th>Parameter</th>
4969<th>Type</th>
4970<th>Description</th>
4971</tr>
4972</thead><tbody>
4973<tr>
4974<td><em>encounterDatetime</em></td>
4975<td><code>Date (ISO8601 Long)</code></td>
4976<td>The date and time the encounter was created (required)</td>
4977</tr>
4978<tr>
4979<td><em>patient</em></td>
4980<td><code>Patient UUID</code></td>
4981<td>The patient to whom the encounter applies</td>
4982</tr>
4983<tr>
4984<td><em>encounterType</em></td>
4985<td><code>EncounterType UUID</code></td>
4986<td>The type of encounter – e.g., Initial visit, Return visit, etc. (required)</td>
4987</tr>
4988<tr>
4989<td><em>location</em></td>
4990<td><code>Location UUID</code></td>
4991<td>The location at which the encounter occurred (required)</td>
4992</tr>
4993<tr>
4994<td><em>encounterProviders</em></td>
4995<td><code>Array of Provider UUID and associated Encounter Role UUID</code></td>
4996<td>An array of providers and their role within the encounter. At least one provider is required</td>
4997</tr>
4998<tr>
4999<td><em>obs</em></td>
5000<td><code>Array[]: Obs</code></td>
5001<td>Array of observations and values for the encounter</td>
5002</tr>
5003<tr>
5004<td><em>orders</em></td>
5005<td><code>Array[]: Order UUID</code></td>
5006<td>List of orders created during the encounter</td>
5007</tr>
5008<tr>
5009<td><em>form</em></td>
5010<td><code>Form UUID</code></td>
5011<td>Target Form UUID to be filled for the encounter</td>
5012</tr>
5013<tr>
5014<td><em>visit</em></td>
5015<td><code>Visit UUID</code></td>
5016<td>When creating an encounter for an existing visit, this specifies the visit</td>
5017</tr>
5018</tbody></table></li>
5019</ul>
5020<h2 id='update-an-encounter'>Update an encounter</h2><pre class="highlight shell_session"><code>POST /encounter/:target_encounter_uuid
5021{
5022 "encounterDatetime": "2019-10-16 12:08:43",
5023 "patient": "070f0120-0283-4858-885d-a20d967729cf",
5024 "encounterType": "e22e39fd-7db2-45e7-80f1-60fa0d5a4378",
5025 "location": "aff27d58-a15c-49a6-9beb-d30dcfc0c66e",
5026 "encounterProviders": [
5027 {
5028 "provider": "bb1a7781-7896-40be-aaca-7d1b41d843a6",
5029 "encounterRole": "240b26f9-dd88-4172-823d-4a8bfeb7841f"
5030 }
5031 ]
5032}
5033</code></pre>
5034<ul>
5035<li><p>Update a target encounter with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
5036status if Encounter not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5037<h3 id='attributes-2'>Attributes</h3>
5038<table><thead>
5039<tr>
5040<th>Parameter</th>
5041<th>Type</th>
5042<th>Description</th>
5043</tr>
5044</thead><tbody>
5045<tr>
5046<td><em>encounterDatetime</em></td>
5047<td><code>Date (ISO8601 Long)</code></td>
5048<td>The date and time the encounter was created</td>
5049</tr>
5050<tr>
5051<td><em>patient</em></td>
5052<td><code>Patient UUID</code></td>
5053<td>The patient to whom the encounter applies</td>
5054</tr>
5055<tr>
5056<td><em>encounterType</em></td>
5057<td><code>EncounterType UUID</code></td>
5058<td>The type of encounter – e.g., Initial visit, Return visit, etc.</td>
5059</tr>
5060<tr>
5061<td><em>location</em></td>
5062<td><code>Location UUID</code></td>
5063<td>The location at which the encounter occurred</td>
5064</tr>
5065<tr>
5066<td><em>encounterProviders</em></td>
5067<td><code>Array of Provider UUID and associated Encounter Role UUID</code></td>
5068<td>An array of providers and their role within the encounter. At least one provider is required</td>
5069</tr>
5070<tr>
5071<td><em>obs</em></td>
5072<td><code>Array[]: Obs</code></td>
5073<td>Array of observations and values for the encounter</td>
5074</tr>
5075<tr>
5076<td><em>orders</em></td>
5077<td><code>Array[]: Order UUID</code></td>
5078<td>List of orders created during the encounter</td>
5079</tr>
5080<tr>
5081<td><em>form</em></td>
5082<td><code>Form UUID</code></td>
5083<td>Target Form UUID to be filled for the encounter</td>
5084</tr>
5085<tr>
5086<td><em>visit</em></td>
5087<td><code>Visit UUID</code></td>
5088<td>When creating an encounter for an existing visit, this specifies the visit</td>
5089</tr>
5090</tbody></table></li>
5091</ul>
5092<h2 id='delete-an-encounter'>Delete an encounter</h2><pre class="highlight shell_session"><code> DELETE /encounter/:target_encounter_uuid?purge=true
5093</code></pre>
5094<ul>
5095<li><p>Delete or Void a target encounter by its UUID. Returns a <code>404 Not Found</code> status if Encounter not exists. If the user is not logged
5096in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5097<h3 id='query-parameters-2'>Query Parameters</h3>
5098<table><thead>
5099<tr>
5100<th>Parameter</th>
5101<th>Type</th>
5102<th>Description</th>
5103</tr>
5104</thead><tbody>
5105<tr>
5106<td><em>purge</em></td>
5107<td><code>Boolean</code></td>
5108<td>The resource will be voided unless purge = ‘true’</td>
5109</tr>
5110</tbody></table></li>
5111</ul>
5112<h2 id='list-encounter-provider-subresources'>List encounter provider subresources</h2><h3 id='list-all-encounter-provider-subresources-for-a-visit'>List all encounter provider subresources for a visit.</h3><pre class="highlight shell_session"><code>GET /encounter/:target_encounter_uuid/encounterprovider
5113</code></pre>
5114<p>Retrieve all <b>encounter provider</b> sub resources of an <b>encounter</b> resource by target_encounter_uuid. Returns a
5115 <code>404 Not Found</code> status if encounter provider not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
5116 returned.</p>
5117<h3 id='list-encounter-provider-subresources-by-it-39-s-uuid-and-parent-encounter-uuid'>List encounter provider subresources by it's UUID and parent encounter UUID.</h3><pre class="highlight shell_session"><code>GET /encounter/:target_encounter_uuid/encounterprovider/:target_encounter_provider_uuid
5118</code></pre>
5119<p>Retrieve an <b>encounter provider</b> sub resources of a <b>encounter</b> resource. Returns a
5120 <code>404 Not Found</code> status if encounter provider not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status
5121 returned.</p>
5122<h2 id='create-an-encounter-provider-sub-resource-with-properties'>Create an encounter provider sub resource with properties</h2><pre class="highlight shell_session"><code>POST encounter/:target_encounter_uuid/encounterprovider
5123{
5124 "provider": "bb1a7781-7896-40be-aaca-7d1b41d843a6",
5125 "encounterRole": "240b26f9-dd88-4172-823d-4a8bfeb7841f"
5126}
5127</code></pre>
5128<ul>
5129<li><p>To Create an attribute subresource for a specific visit resource, you need to specify below attributes in the request body.
5130If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5131<h3 id='attributes-3'>Attributes</h3>
5132<table><thead>
5133<tr>
5134<th>Parameter</th>
5135<th>Type</th>
5136<th>Description</th>
5137</tr>
5138</thead><tbody>
5139<tr>
5140<td><em>provider</em></td>
5141<td><code>Provider_Type UUID</code></td>
5142<td>UUID of a provider currently registered in OpenMRS (required)</td>
5143</tr>
5144<tr>
5145<td><em>encounterRole</em></td>
5146<td><code>Encounter_Role UUID</code></td>
5147<td>UUID of encounter role. This is the role provider will participate during this encounter (required)</td>
5148</tr>
5149</tbody></table></li>
5150</ul>
5151<h2 id='update-encounter-provider-subresource'>Update encounter provider subresource</h2><pre class="highlight shell_session"><code>POST encounter/:target_encounter_uuid/encounterprovider/:target_encounter_provider_uuid
5152{
5153 "provider": "bb1a7781-7896-40be-aaca-7d1b41d843a6",
5154 "encounterRole": "240b26f9-dd88-4172-823d-4a8bfeb7841f"
5155}
5156</code></pre>
5157<ul>
5158<li><p>Updates an encounter provider subresource value with given UUID, this method will only modify value of the subresource. Returns a <code>404 Not Found</code> status if encounter provider not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
5159returned.</p>
5160<h3 id='query-parameters-3'>Query Parameters</h3>
5161<table><thead>
5162<tr>
5163<th>Parameter</th>
5164<th>Type</th>
5165<th>Description</th>
5166</tr>
5167</thead><tbody>
5168<tr>
5169<td><em>parent_uuid</em></td>
5170<td><code>Encounter UUID</code></td>
5171<td>Target encounter resource UUID</td>
5172</tr>
5173<tr>
5174<td><em>uuid</em></td>
5175<td><code>Encounter_Provider UUID</code></td>
5176<td>Target encounter provider resource UUID</td>
5177</tr>
5178</tbody></table>
5179<h3 id='attributes-4'>Attributes</h3>
5180<table><thead>
5181<tr>
5182<th>Parameter</th>
5183<th>Type</th>
5184<th>Description</th>
5185</tr>
5186</thead><tbody>
5187<tr>
5188<td><em>provider</em></td>
5189<td><code>Provider UUID</code></td>
5190<td>UUID of a provider currently registered in OpenMRS (required)</td>
5191</tr>
5192<tr>
5193<td><em>encounterRole</em></td>
5194<td><code>Encounter_Role UUID</code></td>
5195<td>UUID of encounter role. This is the role provider will participate during this encounter (required)</td>
5196</tr>
5197</tbody></table></li>
5198</ul>
5199<h2 id='delete-encounter-provider-subresource'>Delete encounter provider subresource</h2><pre class="highlight shell_session"><code>DELETE /encounter/:target_encounter_uuid/encounterprovider/:target_encounter_provider_uuid
5200</code></pre>
5201<ul>
5202<li><p>Delete or Voided a target encounter provider subresource by its UUID. Returns a <code>404 Not Found</code> status if attribute not exists.
5203If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5204<h3 id='query-parameters-4'>Query Parameters</h3>
5205<table><thead>
5206<tr>
5207<th>Parameter</th>
5208<th>Type</th>
5209<th>Description</th>
5210</tr>
5211</thead><tbody>
5212<tr>
5213<td><em>purge</em></td>
5214<td><code>Boolean</code></td>
5215<td>The resource will be voided unless purge = 'true'. Purging will attempt to remove the encounter provider type from the system irreversibly. Encounter provider types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
5216</tr>
5217</tbody></table></li>
5218</ul>
5219<h1 id='encounter-type'>Encounter Type</h1><h2 id='encounter-type-overview'>Encounter Type Overview</h2>
5220<ul>
5221<li><p>Encounters represent an interaction between the patient and the healthcare system. Since there are a wide variety of ways in which these interactions may occur, OpenMRS allows you to categorize them by defining different types of encounter. For example,
5222"Adult Primary Care Initial Visit" and "In-Between Visit Documentation" could be different types of encounters.</p></li>
5223<li><p>You could define encounter type for locations such as Pharmacy, Lab, Consultation room, or for actions such as admission or discharge.</p></li>
5224</ul>
5225<h2 id='available-operations-for-encounter-type'>Available operations for Encounter Type</h2>
5226<ol>
5227<li><a href="#list-encounter-types">List encounter types</a></li>
5228<li><a href="#create-an-encounter-type">Create an encounter type</a></li>
5229<li><a href="#update-an-encounter-type">Update an encounter type</a></li>
5230<li><a href="#delete-an-encounter-type">Delete an encounter type</a></li>
5231</ol>
5232<h2 id='list-encounter-types'>List encounter types</h2><h3 id='list-all-not-retired-encounter-types'>List all not-retired encounter types.</h3><pre class="highlight shell_session"><code>GET /encountertype?
5233 q=Admission
5234</code></pre>
5235<p>Quickly filter encounter types with given query parameters. Returns a <code>404 Not Found</code> status if encounter types not exist.
5236 If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5237<h3 id='query-parameters'>Query Parameters</h3>
5238<table><thead>
5239<tr>
5240<th>Parameter</th>
5241<th>Type</th>
5242<th>Description</th>
5243</tr>
5244</thead><tbody>
5245<tr>
5246<td><em>q</em></td>
5247<td><code>Search Query</code></td>
5248<td>Query to filter encounter type by its name</td>
5249</tr>
5250</tbody></table>
5251<h3 id='get-encounter-type-by-uuid'>Get encounter type by UUID.</h3><pre class="highlight shell_session"><code>GET /encountertype/:target_encounter_type_uuid
5252</code></pre>
5253<p>Retrieve an encounter type by its UUID. Returns a <code>404 Not Found</code> status if encounter type not exists. If the user is not logged
5254 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5255<h2 id='create-an-encounter-type'>Create an encounter type</h2><pre class="highlight shell_session"><code>POST /encountertype
5256{
5257 "name": "Discharge",
5258 "description": "Attach encounters related to hospital dischargers"
5259}
5260</code></pre>
5261<ul>
5262<li><p>To create an encounter type, you need to specify below attributes in the request body. If you are not logged in to perform
5263this action, a <code>401 Unauthorized</code> status returned.</p>
5264<h4 id='attributes'>Attributes</h4>
5265<table><thead>
5266<tr>
5267<th>Parameter</th>
5268<th>Type</th>
5269<th>Description</th>
5270</tr>
5271</thead><tbody>
5272<tr>
5273<td><em>name</em></td>
5274<td><code>String</code></td>
5275<td>Name for the encounter type (required)</td>
5276</tr>
5277<tr>
5278<td><em>description</em></td>
5279<td><code>String</code></td>
5280<td>Description for the encounter type (required)</td>
5281</tr>
5282</tbody></table></li>
5283</ul>
5284<h2 id='update-an-encounter-type'>Update an encounter type</h2><pre class="highlight shell_session"><code>POST /encountertype/:target_encounter_type_uuid
5285{
5286 "name": "Discharge",
5287 "description": "Encounters related to hospital dischargers"
5288}
5289</code></pre>
5290<ul>
5291<li><p>Update a target encounter type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
5292status if encounter type not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5293<h3 id='attributes-2'>Attributes</h3>
5294<table><thead>
5295<tr>
5296<th>Parameter</th>
5297<th>Type</th>
5298<th>Description</th>
5299</tr>
5300</thead><tbody>
5301<tr>
5302<td><em>name</em></td>
5303<td><code>String</code></td>
5304<td>Name for the encounter type</td>
5305</tr>
5306<tr>
5307<td><em>description</em></td>
5308<td><code>String</code></td>
5309<td>Description for the encounter type</td>
5310</tr>
5311</tbody></table></li>
5312</ul>
5313<h2 id='delete-an-encounter-type'>Delete an encounter type</h2><pre class="highlight shell_session"><code>DELETE /encountertype/:target_encounter_type_uuid?purge=true
5314</code></pre>
5315<ul>
5316<li><p>Delete or retire a target encounter type by its UUID. Returns a <code>404 Not Found</code> status if encounter type not exists. If the user is
5317not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5318<h3 id='query-parameters-2'>Query Parameters</h3>
5319<table><thead>
5320<tr>
5321<th>Parameter</th>
5322<th>Type</th>
5323<th>Description</th>
5324</tr>
5325</thead><tbody>
5326<tr>
5327<td><em>purge</em></td>
5328<td><code>Boolean</code></td>
5329<td>The resource will be retired unless purge = ‘true’</td>
5330</tr>
5331</tbody></table></li>
5332</ul>
5333<h1 id='encounter-role'>Encounter Role</h1><h2 id='encounter-role-overview'>Encounter Role Overview</h2>
5334<ul>
5335<li>An Encounter role is specific to the <a href="encounter.md">encounter</a>. While these could match up to existing organizational roles (e.g., "Nurse"),
5336they don't have to (e.g., "Lead Surgeon").</li>
5337</ul>
5338<h2 id='available-operation-for-encounter-roles'>Available operation for Encounter Roles</h2>
5339<ol>
5340<li><a href="#list-encounter-roles">List encounter roles</a></li>
5341<li><a href="#create-a-encounter-role">Create an encounter role</a></li>
5342<li><a href="#update-a-encounters-role">Update an encounter role</a></li>
5343<li><a href="#delete-a-encounters-role">Delete an encounter role</a></li>
5344</ol>
5345<h2 id='list-encounter-roles'>List encounter roles</h2><h3 id='list-all-non-voided-encounter-roles'>List all non-voided encounter roles.</h3><pre class="highlight shell_session"><code>GET /encounterrole?
5346 q=Clinician
5347</code></pre>
5348<p>Quickly filter encounter roles with given query parameters. Returns a <code>404 Not Found</code> status if encounter roles not exist.
5349 If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5350<h3 id='query-parameters'>Query Parameters</h3>
5351<table><thead>
5352<tr>
5353<th>Parameter</th>
5354<th>Type</th>
5355<th>Description</th>
5356</tr>
5357</thead><tbody>
5358<tr>
5359<td><em>q</em></td>
5360<td><code>Search Query</code></td>
5361<td>Query to filter encounter role by its name</td>
5362</tr>
5363</tbody></table>
5364<h3 id='get-encounter-role-by-uuid'>Get encounter role by UUID.</h3><pre class="highlight shell_session"><code>GET /encounter/:target_encounter_role_uuid
5365</code></pre>
5366<p>Retrieve an encounter role by its UUID. Returns a <code>404 Not Found</code> status if encounter role not exists. If user not logged
5367 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5368<h2 id='create-an-encounter-role'>Create an encounter role</h2><pre class="highlight shell_session"><code>POST /encounterrole
5369{
5370 "name": "Clinician",
5371 "description": "A provider assisting the Lead Surgeon."
5372}
5373</code></pre>
5374<ul>
5375<li><p>To Create an encounter role, you need to specify below attributes in the request body. If you are not logged in to perform
5376this action, a <code>401 Unauthorized</code> status returned.</p>
5377<h3 id='attributes'>Attributes</h3>
5378<table><thead>
5379<tr>
5380<th>Parameter</th>
5381<th>Type</th>
5382<th>Description</th>
5383</tr>
5384</thead><tbody>
5385<tr>
5386<td><em>name</em></td>
5387<td><code>String</code></td>
5388<td>Name for the encounter role (required)</td>
5389</tr>
5390<tr>
5391<td><em>description</em></td>
5392<td>`String</td>
5393<td>Description for the encounter role (required)</td>
5394</tr>
5395</tbody></table></li>
5396</ul>
5397<h2 id='update-an-encounter-role'>Update an encounter role</h2><pre class="highlight shell_session"><code>POST /encounterrole/:target_encounter_role_uuid
5398{
5399 "name": "Assisting Surgeon"",
5400 "description": "A surgeon who assisted the Lead Surgeon"
5401}
5402</code></pre>
5403<ul>
5404<li><p>Update a target encounter role with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
5405status if encounter role not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5406<h3 id='attributes-2'>Attributes</h3>
5407<table><thead>
5408<tr>
5409<th>Parameter</th>
5410<th>Type</th>
5411<th>Description</th>
5412</tr>
5413</thead><tbody>
5414<tr>
5415<td><em>name</em></td>
5416<td><code>String</code></td>
5417<td>Name for the encounter role</td>
5418</tr>
5419<tr>
5420<td><em>description</em></td>
5421<td>`String</td>
5422<td>Description for the encounter role</td>
5423</tr>
5424</tbody></table></li>
5425</ul>
5426<h2 id='delete-an-encounter-role'>Delete an encounter role</h2><pre class="highlight shell_session"><code>DELETE /encounterrole/:target_encounter_role_uuid?purge=true
5427</code></pre>
5428<ul>
5429<li><p>Delete or Void a target encounter role by its UUID. Returns a <code>404 Not Found</code> status if encounter role not exists. If the user is
5430not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5431<h3 id='query-parameters-2'>Query Parameters</h3>
5432<table><thead>
5433<tr>
5434<th>Parameter</th>
5435<th>Type</th>
5436<th>Description</th>
5437</tr>
5438</thead><tbody>
5439<tr>
5440<td><em>purge</em></td>
5441<td><code>Boolean</code></td>
5442<td>The resource will be voided unless purge = ‘true’</td>
5443</tr>
5444</tbody></table></li>
5445</ul>
5446<h1 id='concepts'>Concepts</h1><h2 id='concepts-overview'>Concepts Overview</h2>
5447<ul>
5448<li><p>The concept is the basic element of flexibility in OpenMRS. Concepts are the individual data points collected from a
5449population of patients. Concepts include both questions and answers. </p></li>
5450<li><p>For example, blood type data is collected for a patient. The question is, "What is the blood type for the patient?", with a
5451set of discrete answers of "A, B, AB or O." We use concepts in OpenMRS to implement this. The question is a concept
5452("blood type") and each response ("A," "B," "AB" and "O") is also a concept. For this one question, a total of 5 concepts are required.</p></li>
5453<li><p>What about a question where the answer is not a discrete answer? If the question is "What is the name of your first pet?",
5454the answer would be expressed in a text box. It would not be possible to provide a complete list of every possible name for
5455your pet. In this example, there would be one concept -- "name of first pet."</p></li>
5456<li><p>The bottom-line is that if you need a medical word within your electronic records system, it needs to be defined within the concept dictionary, more details about all the possible concepts will be given in a later section.</p></li>
5457</ul>
5458<h2 id='sub-resource-types-of-concepts'>Sub Resource types of Concepts</h2><h3 id='concept-attribute'>Concept Attribute.</h3>
5459<ul>
5460<li><p>If you wish to record extra information about concept, you can create Concept Attributes and assign them to Concept Types.</p></li>
5461<li><p>Concept attributes exists specifically to allow implementations to extend the data model.</p></li>
5462</ul>
5463<h3 id='concept-name'>Concept Name.</h3>
5464<ul>
5465<li>ConceptNames are the words or phrases used to express the idea of a Concept within a particular locale since there can be many names for any concept.</li>
5466</ul>
5467<h3 id='concept-mapping'>Concept Mapping.</h3>
5468<ul>
5469<li><p>Concept Mappings are added to facilitate managing concept dictionaries and point to other concepts that have the same meaning.
5470Mappings are useful when you need to receive or send information to external systems, letting you define how your system's
5471concepts relate to external concepts such as standardized medical vocabularies (e.g., ICD, LOINC, SNOMED).</p></li>
5472<li><p>For example, add a mapping to a concept in the MCL dictionary. You can save the concept now and create some answers.</p></li>
5473</ul>
5474<h3 id='concept-description'>Concept Description.</h3>
5475<ul>
5476<li>A clear and concise description of the concept, as agreed upon by the organization's members or the most commonly
5477referenced source.<br></li>
5478</ul>
5479<h2 id='available-operations-for-concepts'>Available operations for Concepts</h2>
5480<ol>
5481<li> <a href="#list-concepts">List concepts</a></li>
5482<li> <a href="#create-a-concept">Create a concept</a></li>
5483<li> <a href="#update-a-concept">Update a concept</a></li>
5484<li> <a href="#delete-a-concept">Delete a concept</a></li>
5485<li> <a href="#list-concept-mapping">List concept mapping</a></li>
5486<li> <a href="#create-a-concept-mapping-with-properties">Create concept mapping with properties</a></li>
5487<li> <a href="#update-a-concept-mapping">Update concept mapping</a></li>
5488<li> <a href="#delete-a-concept-mapping">Delete concept mapping</a></li>
5489<li> <a href="#list-concept-name">List concept name</a></li>
5490<li><a href="#create-a-concept-name-with-properties">Create concept name with properties</a></li>
5491<li><a href="#update-concept-name">Update concept name</a></li>
5492<li><a href="#delete-concept-name">Delete concept name</a></li>
5493<li><a href="#list-concept-attribute">List concept attribute</a></li>
5494<li><a href="#create-a-concept-attribute-with-properties">Create concept attribute with properties</a></li>
5495<li><a href="#update-concept-attribute">Update concept attribute</a></li>
5496<li><a href="#delete-concept-attribute">Delete concept attribute</a></li>
5497<li><a href="#list-concept-descriptions">List concept description</a></li>
5498<li><a href="#create-a-concept-description-with-properties">Create concept description with properties</a></li>
5499<li><a href="#update-concept-description">Update concept description</a></li>
5500<li>[Delete concept description](#delete-concept-description</li>
5501</ol>
5502<h2 id='list-concepts'>List concepts</h2><h3 id='list-all-concepts'>List all concepts.</h3><pre class="highlight shell_session"><code>GET /concept?
5503 term=38341003
5504 &source=SNOMED%20CT
5505</code></pre>
5506<p>Quickly filter concepts with given query parameters. Returns a <code>404 Not Found</code> status if concepts not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5507<h3 id='query-parameters'>Query Parameters</h3>
5508<table><thead>
5509<tr>
5510<th>Parameter</th>
5511<th>Type</th>
5512<th>Description</th>
5513</tr>
5514</thead><tbody>
5515<tr>
5516<td><em>q</em></td>
5517<td><code>Search Query</code></td>
5518<td>Display Name of concept object</td>
5519</tr>
5520<tr>
5521<td><em>code</em></td>
5522<td><code>String</code></td>
5523<td>Represents a name from a standard medical code</td>
5524</tr>
5525<tr>
5526<td><em>name</em></td>
5527<td><code>String</code></td>
5528<td>ConceptNames are the words or phrases used to express the idea of a Concept within a particular locale</td>
5529</tr>
5530<tr>
5531<td><em>term</em></td>
5532<td><code>String</code></td>
5533<td>Medical coding term or OpenMRS concept dictionary term that could be mapped to a concept</td>
5534</tr>
5535<tr>
5536<td><em>source</em></td>
5537<td><code>String</code></td>
5538<td>A concept can have any number of mappings to any number of other vocabularies. Other vocabularies are called "concept sources" in OpenMRS (ie. LOINC, SNOMED, ICD-9, ICD10, RxNORM, etc), but the concept source can also be a custom (ie. org.openmrs.module.mdrtb, PIH, AMPATH, MVP, etc.). Every concept can define a string for its mapping in any "concept source" defined in the database</td>
5539</tr>
5540<tr>
5541<td><em>class</em></td>
5542<td><code>String</code></td>
5543<td>The concept's class provides a useful way to narrow down the scope of the information that the concept is intended to capture. In this way, the class is helpful for data extraction. This classification elaborates how a concept will be represented (i.e. as a question or an answer) when the information is stored. OpenMRS contains several default classes to use when defining concepts, but implementation sites may also create additional custom concept classes.</td>
5544</tr>
5545</tbody></table>
5546<h3 id='query-concept-by-uuid'>Query concept by UUID.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid
5547</code></pre>
5548<p>Retrieve a concept by its UUID. Returns a <code>404 Not Found</code> status if concepts not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5549<h2 id='create-a-concept'>Create a concept</h2><pre class="highlight shell_session"><code>POST /concept
5550{
5551 "names": [
5552 {
5553 "name": "What is the blood type for the patient?",
5554 "locale": "en",
5555 "localePreferred": true,
5556 "conceptNameType": "FULLY_SPECIFIED"
5557 }
5558 ],
5559 "datatype": "8d4a4c94-c2cc-11de-8d13-0010c6dffd0f",
5560 "version": "1.2.2",
5561 "conceptClass": "8d492774-c2cc-11de-8d13-0010c6dffd0f"
5562}
5563</code></pre>
5564<ul>
5565<li><p>To Create a concept, you need to specify below attributes in the request body. If you are not logged in to perform this action,
5566a <code>401 Unauthorized</code> status returned.</p>
5567<h3 id='attributes'>Attributes</h3>
5568<table><thead>
5569<tr>
5570<th>Parameter</th>
5571<th>Type</th>
5572<th>Description</th>
5573</tr>
5574</thead><tbody>
5575<tr>
5576<td><em>names</em></td>
5577<td><code>String</code></td>
5578<td>ConceptNames are the words or phrases used to express the idea of a Concept within a particular locale (required)</td>
5579</tr>
5580<tr>
5581<td><em>datatype</em></td>
5582<td><code>target_concept_datatype_uuid</code></td>
5583<td>A concept datatype prescribes the structured format by which you desire the data to be represented. In simple terms, the datatype defines the type of data that the concept is intended to collect (required)</td>
5584</tr>
5585<tr>
5586<td><em>version</em></td>
5587<td><code>String</code></td>
5588<td>A method to keep track of the number of updates applied to a specific concept (required)</td>
5589</tr>
5590<tr>
5591<td><em>answers</em></td>
5592<td><code>Array of Child Concepts</code></td>
5593<td>An array of concepts which are answers for the current concept</td>
5594</tr>
5595<tr>
5596<td><em>setMembers</em></td>
5597<td><code>Array of Child Concepts</code></td>
5598<td>Describes the questions contained by a concept set. Each set member is a question concept in and of itself</td>
5599</tr>
5600<tr>
5601<td><em>units</em></td>
5602<td><code>String</code></td>
5603<td>Standard unit used to measure the concept</td>
5604</tr>
5605<tr>
5606<td><em>allowDecimal</em></td>
5607<td><code>String</code></td>
5608<td>Allow to use decimals</td>
5609</tr>
5610<tr>
5611<td><em>conceptClass</em></td>
5612<td><code>target_concept_class_uuid</code></td>
5613<td>The classification of a concept. This classification details how a concept will be represented (i.e. as a question or an answer) (required)</td>
5614</tr>
5615<tr>
5616<td><em>descriptions</em></td>
5617<td><code>Array[] String</code></td>
5618<td>A concept map connects a concept term to a concept</td>
5619</tr>
5620<tr>
5621<td><em>mappings</em></td>
5622<td><code>Array[] String</code></td>
5623<td>Connects a concept term to a concept.</td>
5624</tr>
5625</tbody></table></li>
5626</ul>
5627<h2 id='update-a-concept'>Update a concept</h2><pre class="highlight shell_session"><code>POST /concept/:target_concept_uuid
5628{
5629 "names": [
5630 {
5631 "name": "What is the blood type for the sick patient?",
5632 "locale": "en",
5633 "localePreferred": true,
5634 "conceptNameType": "FULLY_SPECIFIED"
5635 }
5636 ],
5637 "datatype": "8d4a4c94-c2cc-11de-8d13-0010c6dffd0f",
5638 "version": "1.2.2",
5639 "conceptClass": "8d492774-c2cc-11de-8d13-0010c6dffd0f"
5640}
5641</code></pre>
5642<ul>
5643<li><p>Update a target concept with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
5644status if concept not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
5645<h3 id='attributes-2'>Attributes</h3>
5646<table><thead>
5647<tr>
5648<th>Parameter</th>
5649<th>Type</th>
5650<th>Description</th>
5651</tr>
5652</thead><tbody>
5653<tr>
5654<td><em>names</em></td>
5655<td><code>String</code></td>
5656<td>ConceptNames are the words or phrases used to express the idea of a Concept within a particular locale (required)</td>
5657</tr>
5658<tr>
5659<td><em>datatype</em></td>
5660<td><code>target_concept_datatype_uuid</code></td>
5661<td>A concept datatype prescribes the structured format by which you desire the data to be represented. In simple terms, the datatype defines the type of data that the concept is intended to collect (required)</td>
5662</tr>
5663<tr>
5664<td><em>version</em></td>
5665<td><code>String</code></td>
5666<td>A method to keep track of the number of updates applied to a specific concept (required)</td>
5667</tr>
5668<tr>
5669<td><em>answers</em></td>
5670<td><code>Array of Child Concepts</code></td>
5671<td>An array of concepts which are answers for the current concept</td>
5672</tr>
5673<tr>
5674<td><em>setMembers</em></td>
5675<td><code>Array of Child Concepts</code></td>
5676<td>Describes the questions contained by a concept set. Each set member is a question concept in and of itself</td>
5677</tr>
5678<tr>
5679<td><em>units</em></td>
5680<td><code>String</code></td>
5681<td>Standard unit used to measure the concept</td>
5682</tr>
5683<tr>
5684<td><em>allowDecimal</em></td>
5685<td><code>String</code></td>
5686<td>Allow to use decimals</td>
5687</tr>
5688<tr>
5689<td><em>conceptClass</em></td>
5690<td><code>target_concept_class_uuid</code></td>
5691<td>The classification of a concept. This classification details how a concept will be represented (i.e. as a question or an answer) (required)</td>
5692</tr>
5693<tr>
5694<td><em>descriptions</em></td>
5695<td><code>Array[] String</code></td>
5696<td>A concept map connects a concept term to a concept</td>
5697</tr>
5698<tr>
5699<td><em>mappings</em></td>
5700<td><code>Array[] String</code></td>
5701<td>Connects a concept term to a concept.</td>
5702</tr>
5703</tbody></table></li>
5704</ul>
5705<h2 id='delete-a-concept'>Delete a concept</h2><pre class="highlight shell_session"><code>DELETE /concept/:target_concept_uuid?purge=true
5706</code></pre>
5707<ul>
5708<li><p>Delete or retire a target concept by its UUID. Returns a <code>404 Not Found</code> status if concept not exists. If the user is not logged
5709in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5710<h3 id='query-parameters-2'>Query Parameters</h3>
5711<table><thead>
5712<tr>
5713<th>Parameter</th>
5714<th>Type</th>
5715<th>Description</th>
5716</tr>
5717</thead><tbody>
5718<tr>
5719<td><em>purge</em></td>
5720<td><code>Boolean</code></td>
5721<td>The resource will be retired unless purge = ‘true’</td>
5722</tr>
5723</tbody></table></li>
5724</ul>
5725<h2 id='list-concept-mapping'>List concept mapping</h2><h3 id='list-all-concept-mappings-for-a-concept'>List all concept mappings for a concept.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/mapping
5726</code></pre>
5727<p>Retrieve all <strong>concept mapping</strong> subresources of a <strong>concept</strong> resource by target_concept_uuid. Returns a
5728 <code>404 Not Found</code> status if concept mapping not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5729<h3 id='list-concept-mapping-by-its-uuid-and-parent-concept-uuid'>List concept mapping by its UUID and parent concept UUID.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/mapping/:target_concept_mapping_uuid
5730</code></pre>
5731<p>Retrieve a <strong>concept mapping</strong> subresources of a <strong>concept</strong> resource. Returns a
5732 <code>404 Not Found</code> status if concept mapping not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5733<h2 id='create-a-concept-mapping-with-properties'>Create a concept mapping with properties</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/mapping
5734{
5735 "conceptReferenceTerm": "21fb14d7-5cd9-3621-ac30-c9e57320e233",
5736 "conceptMapType": "35543629-7d8c-11e1-909d-c80aa9edcf4e"
5737}
5738</code></pre>
5739<ul>
5740<li>To Create a concept mapping subresource for a specific concept resource, you need to specify below attributes in the request body.
5741If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</li>
5742</ul>
5743<h3 id='attributes-3'>Attributes</h3>
5744<table><thead>
5745<tr>
5746<th>Parameter</th>
5747<th>Type</th>
5748<th>Description</th>
5749</tr>
5750</thead><tbody>
5751<tr>
5752<td><em>conceptReferenceTerm</em></td>
5753<td><code>target_concept_reference_term_type_uuid</code></td>
5754<td>A concept term defines a medical coding term or OpenMRS concept dictionary term that could be mapped to a concept (required)</td>
5755</tr>
5756<tr>
5757<td><em>conceptMapType</em></td>
5758<td><code>target_concept_map_type_uuid</code></td>
5759<td>A concept map connects a concept term to a concept (required)</td>
5760</tr>
5761</tbody></table>
5762<h2 id='update-a-concept-mapping'>Update a concept mapping</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/mapping
5763{
5764 "conceptReferenceTerm": "21fb14d7-5cd9-3621-ac30-c9e57320e233",
5765 "conceptMapType": "35543629-7d8c-11e1-909d-c80aa9edcf4e"
5766}
5767</code></pre>
5768<ul>
5769<li>Updates a concept mapping subresource value with given UUID, this method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if concept mapping not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status
5770returned.</li>
5771</ul>
5772<h3 id='attributes-4'>Attributes</h3>
5773<table><thead>
5774<tr>
5775<th>Parameter</th>
5776<th>Type</th>
5777<th>Description</th>
5778</tr>
5779</thead><tbody>
5780<tr>
5781<td><em>conceptReferenceTerm</em></td>
5782<td><code>target_concept_reference_term_type_uuid</code></td>
5783<td>A concept term defines a medical coding term or OpenMRS concept dictionary term that could be mapped to a concept (required)</td>
5784</tr>
5785<tr>
5786<td><em>conceptMapType</em></td>
5787<td><code>target_concept_map_type_uuid</code></td>
5788<td>A concept map connects a concept term to a concept (required)</td>
5789</tr>
5790</tbody></table>
5791<h2 id='delete-a-concept-mapping'>Delete a concept mapping</h2><pre class="highlight shell_session"><code>DELETE concept/:target_concept_uuid/mapping/:target_concept_mapping_uuid
5792</code></pre>
5793<ul>
5794<li>Delete or Voided a target concept mapping subresource by its UUID. Returns a <code>404 Not Found</code> status if concept mapping not exists.
5795If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</li>
5796</ul>
5797<h3 id='query-parameters-3'>Query Parameters</h3>
5798<table><thead>
5799<tr>
5800<th>Parameter</th>
5801<th>Type</th>
5802<th>Description</th>
5803</tr>
5804</thead><tbody>
5805<tr>
5806<td><em>purge</em></td>
5807<td><code>Boolean</code></td>
5808<td>The resource will be voided unless purge = ‘true’. Purging will attempt to remove the concept mapping type from the system irreversibly. Concept mapping types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
5809</tr>
5810</tbody></table>
5811<h2 id='list-concept-name'>List concept name</h2><h3 id='list-all-concept-names-for-a-concept'>List all concept names for a concept.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/name
5812</code></pre>
5813<p>Retrieve all <strong>concept name</strong> subresources of a <strong>concept</strong> resource by target_concept_uuid. Returns a
5814 <code>404 Not Found</code> status if concept name not exists. If the user isnot logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5815<h3 id='list-concept-name-it-39-s-uuid-and-parent-concept-uuid'>List concept name it's UUID and parent concept UUID.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/name/:target_concept_name_uuid
5816</code></pre>
5817<p>Retrieve a <strong>concept name</strong> subresources of a <strong>concept</strong> resource. Returns a
5818 <code>404 Not Found</code> status if concept name not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5819<h2 id='create-a-concept-name-with-properties'>Create a concept name with properties</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/name
5820{
5821 "name": "Bronchospasm",
5822 "locale": "en",
5823 "localePreferred": true,
5824 "conceptNameType": "FULLY_SPECIFIED"
5825}
5826</code></pre>
5827<ul>
5828<li><p>To Create a concept name subresource for a specific concept resource, you need to specify below attributes in the request body.
5829If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5830<h3 id='attributes-5'>Attributes</h3>
5831<table><thead>
5832<tr>
5833<th>Parameter</th>
5834<th>Type</th>
5835<th>Description</th>
5836</tr>
5837</thead><tbody>
5838<tr>
5839<td><em>name</em></td>
5840<td><code>String</code></td>
5841<td>Name for the concept (required)</td>
5842</tr>
5843<tr>
5844<td><em>locale</em></td>
5845<td><code>String</code></td>
5846<td>Language to record concept name (required)</td>
5847</tr>
5848<tr>
5849<td><em>localePreferred</em></td>
5850<td><code>String</code></td>
5851<td>This is the preferred name to use within a locale. By default, this is the fully-specified name; however, full-specified names are sometimes long and more detailed than necessary for day-to-day use. In those cases, a synonym can be defined to be the locale-preferred name. There can only be one preferred name within a locale. The primary term should be the word(s) used by those who will have access to the records to prevent duplication of concept creation.</td>
5852</tr>
5853<tr>
5854<td><em>conceptNameType</em></td>
5855<td><code>String</code></td>
5856<td>Type of the name to be specified.</td>
5857</tr>
5858</tbody></table></li>
5859</ul>
5860<h2 id='update-concept-name'>Update concept name</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/name
5861{
5862 "name": "Bronchospasm",
5863 "locale": "en",
5864 "localePreferred": true,
5865 "conceptNameType": "FULLY_SPECIFIED"
5866}
5867</code></pre>
5868<ul>
5869<li><p>Updates a concept name subresource value with given UUID, this method will only modify value of the subresource. Returns a <code>404 Not Found</code> status if concept name not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status
5870returned.</p>
5871<h3 id='attributes-6'>Attributes</h3>
5872<table><thead>
5873<tr>
5874<th>Parameter</th>
5875<th>Type</th>
5876<th>Description</th>
5877</tr>
5878</thead><tbody>
5879<tr>
5880<td><em>name</em></td>
5881<td><code>String</code></td>
5882<td>Name for the concept (required)</td>
5883</tr>
5884<tr>
5885<td><em>locale</em></td>
5886<td><code>String</code></td>
5887<td>Language to record concept name (required)</td>
5888</tr>
5889<tr>
5890<td><em>localePreferred</em></td>
5891<td><code>String</code></td>
5892<td>This is the preferred name to use within a locale. By default, this is the fully-specified name; however, full-specified names are sometimes long and more detailed than necessary for day-to-day use. In those cases, a synonym can be defined to be the locale-preferred name. There can only be one preferred name within a locale. The primary term should be the word(s) used most often by those who will have access to the records to prevent duplicate concept creation.</td>
5893</tr>
5894<tr>
5895<td><em>conceptNameType</em></td>
5896<td><code>String</code></td>
5897<td>Type of the name to be specified.</td>
5898</tr>
5899</tbody></table></li>
5900</ul>
5901<h2 id='delete-concept-name'>Delete concept name</h2><pre class="highlight shell_session"><code>DELETE concept/:target_concept_uuid/name/:target_concept_name_uuid
5902</code></pre>
5903<ul>
5904<li><p>Delete or retire a target concept name subresource by its UUID. Returns a <code>404 Not Found</code> status if concept name not exists.
5905If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5906<h3 id='query-parameters-4'>Query Parameters</h3>
5907<table><thead>
5908<tr>
5909<th>Parameter</th>
5910<th>Type</th>
5911<th>Description</th>
5912</tr>
5913</thead><tbody>
5914<tr>
5915<td><em>purge</em></td>
5916<td><code>Boolean</code></td>
5917<td>The resource will be voided unless purge = ‘true’. Purging will attempt to remove the concept name type from the system irreversibly. Concept name types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
5918</tr>
5919</tbody></table></li>
5920</ul>
5921<h2 id='list-concept-attribute'>List concept attribute</h2><h3 id='list-all-concept-attributes-for-a-concept'>List all concept attributes for a concept.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/attribute
5922</code></pre>
5923<p>Retrieve all <strong>concept attribute</strong> subresources of a <strong>concept</strong> resource by target_concept_uuid. Returns a
5924 <code>404 Not Found</code> status if a concept attribute not exists. If the user isnot logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5925<h3 id='list-concept-attribute-by-its-uuid-and-parent-concept-uuid'>List concept attribute by its UUID and parent concept UUID.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/attribute/:target_concept_attribute_uuid
5926</code></pre>
5927<p>Retrieve a <strong>concept attribute</strong> subresources of a <strong>concept</strong> resource. Returns a
5928 <code>404 Not Found</code> status if a concept attribute not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5929<h2 id='create-a-concept-attribute-with-properties'>Create a concept attribute with properties</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/attribute
5930{
5931 "attributeType": "target_concept_attribute_type_uuid",
5932 "value": "value_for_the_attriute"
5933}
5934</code></pre>
5935<ul>
5936<li><p>To Create a concept attribute subresource for a specific concept resource, you need to specify below attributes in the request body.
5937If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5938<h3 id='attributes-7'>Attributes</h3>
5939<table><thead>
5940<tr>
5941<th>Parameter</th>
5942<th>Type</th>
5943<th>Description</th>
5944</tr>
5945</thead><tbody>
5946<tr>
5947<td><em>attributeType</em></td>
5948<td><code>Attribute_Type UUID</code></td>
5949<td>Create Attribute from this Concept Attribute_Type (required)</td>
5950</tr>
5951<tr>
5952<td><em>value</em></td>
5953<td><code>Depends on Attribute_Type Selected</code></td>
5954<td>Value for the attribute (required)</td>
5955</tr>
5956</tbody></table></li>
5957</ul>
5958<h2 id='update-concept-attribute'>Update concept attribute</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/attribute
5959{
5960 "attributeType": "target_concept_attribute_type_uuid",
5961 "value": "value_for_the_attriute"
5962}
5963</code></pre>
5964<ul>
5965<li><p>Updates a concept attribute subresource value with given UUID, this method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if the concept attribute not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status
5966returned.</p>
5967<h3 id='attributes-8'>Attributes</h3>
5968<table><thead>
5969<tr>
5970<th>Parameter</th>
5971<th>Type</th>
5972<th>Description</th>
5973</tr>
5974</thead><tbody>
5975<tr>
5976<td><em>attributeType</em></td>
5977<td><code>Attribute_Type UUID</code></td>
5978<td>Create Attribute from this Concept Attribute_Type (required)</td>
5979</tr>
5980<tr>
5981<td><em>value</em></td>
5982<td><code>Depends on Attribute_Type Selected</code></td>
5983<td>Value for the attribute (required)</td>
5984</tr>
5985</tbody></table></li>
5986</ul>
5987<h2 id='delete-concept-attribute'>Delete concept attribute</h2><pre class="highlight shell_session"><code>DELETE concept/:target_concept_uuid/attribute/:target_concept_attribute_uuid
5988</code></pre>
5989<ul>
5990<li><p>Delete or retire a target concept attribute subresource by its UUID. Returns a <code>404 Not Found</code> status if concept attribute not exists.
5991If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
5992<h3 id='query-parameters-5'>Query Parameters</h3>
5993<table><thead>
5994<tr>
5995<th>Parameter</th>
5996<th>Type</th>
5997<th>Description</th>
5998</tr>
5999</thead><tbody>
6000<tr>
6001<td><em>purge</em></td>
6002<td><code>Boolean</code></td>
6003<td>The resource will be voided unless purge = ‘true’. Purging will attempt to remove the concept name type from the system irreversibly. Concept name types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
6004</tr>
6005</tbody></table></li>
6006</ul>
6007<h2 id='list-concept-descriptions'>List concept descriptions</h2><h3 id='list-all-concept-descriptions-for-a-concept'>List all concept descriptions for a concept.</h3><pre class="highlight shell_session"><code> GET /concept/:target_concept_uuid/description
6008</code></pre>
6009<p>Retrieve all <strong>concept description</strong> subresources of a <strong>concept</strong> resource by target_concept_uuid. Returns a
6010 <code>404 Not Found</code> status if concept description not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6011<h3 id='list-concept-description-by-its-uuid-and-parent-concept-uuid'>List concept description by its UUID and parent concept UUID.</h3><pre class="highlight shell_session"><code>GET /concept/:target_concept_uuid/description/:target_concept_description_uuid
6012</code></pre>
6013<p>Retrieve a <strong>concept description</strong> subresources of a <strong>concept</strong> resource. Returns a
6014 <code>404 Not Found</code> status if concept description not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6015<h2 id='create-a-concept-description-with-properties'>Create a concept description with properties</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/description
6016{
6017 "description": "Pregnancy terminated by spontaneous abortion.",
6018 "locale": "en"
6019}
6020</code></pre>
6021<ul>
6022<li><p>To Create a concept description subresource for a specific concept resource you need to specify below attributes in the request body.
6023If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6024<h3 id='attributes-9'>Attributes</h3>
6025<table><thead>
6026<tr>
6027<th>Parameter</th>
6028<th>Type</th>
6029<th>Description</th>
6030</tr>
6031</thead><tbody>
6032<tr>
6033<td><em>description</em></td>
6034<td><code>String</code></td>
6035<td>Description text to e provided for the concept (required)</td>
6036</tr>
6037<tr>
6038<td><em>locale</em></td>
6039<td><code>String</code></td>
6040<td>Language description provided by (required)</td>
6041</tr>
6042</tbody></table></li>
6043</ul>
6044<h2 id='update-concept-description'>Update concept description</h2><pre class="highlight shell_session"><code>POST concept/:target_concept_uuid/description
6045{
6046 "description": "Pregnancy terminated by spontaneous abortion.",
6047 "locale": "en"
6048}
6049</code></pre>
6050<ul>
6051<li><p>Updates a concept description subresource value with given UUID, this method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if concept description not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status
6052returned.</p>
6053<h3 id='attributes-10'>Attributes</h3>
6054<table><thead>
6055<tr>
6056<th>Parameter</th>
6057<th>Type</th>
6058<th>Description</th>
6059</tr>
6060</thead><tbody>
6061<tr>
6062<td><em>description</em></td>
6063<td><code>String</code></td>
6064<td>Description text to e provided for the concept (required)</td>
6065</tr>
6066<tr>
6067<td><em>locale</em></td>
6068<td><code>String</code></td>
6069<td>Language description provided by (required)</td>
6070</tr>
6071</tbody></table></li>
6072</ul>
6073<h2 id='delete-concept-description'>Delete concept description</h2><pre class="highlight shell_session"><code>DELETE concept/:target_concept_uuid/description/:target_concept_description_uuid
6074</code></pre>
6075<ul>
6076<li><p>Delete or retire a target concept description subresource by its UUID. Returns a <code>404 Not Found</code> status if concept description not exists.
6077If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6078<h3 id='query-parameters-6'>Query Parameters</h3>
6079<table><thead>
6080<tr>
6081<th>Parameter</th>
6082<th>Type</th>
6083<th>Description</th>
6084</tr>
6085</thead><tbody>
6086<tr>
6087<td><em>purge</em></td>
6088<td><code>Boolean</code></td>
6089<td>The resource will be voided unless purge = ‘true’. Purging will attempt to remove the concept description from the system irreversibly. Concept descriptions that have been used (i.e., are referenced from existing data) cannot be purged.</td>
6090</tr>
6091</tbody></table></li>
6092</ul>
6093<h1 id='concept-source'>Concept Source</h1><h2 id='concept-source-overview'>Concept Source Overview</h2>
6094<ul>
6095<li>Concepts are often managed within a dictionary (as a collection of concepts). While OpenMRS has, it's own dictionary of
6096concepts, other dictionaries may exist in other systems or as standardized reference terminologies (like LOINC or ICD).
6097The authorities who manage these other concept dictionaries represent "Concept Sources."</li>
6098</ul>
6099<h2 id='available-operations-for-concept-source'>Available operations for Concept Source.</h2>
6100<ol>
6101<li><a href="#list-concept-source">List concept_source types</a></li>
6102<li><a href="#create-a-concept-source">Create a concept_source</a></li>
6103<li><a href="#update-a-concept-source">Update a concept_source type</a></li>
6104<li><a href="#delete-a-concept-source">Delete a concept_source type</a></li>
6105</ol>
6106<h2 id='list-concept-source'>List concept source</h2><h3 id='list-all-non-retired-concept-source'>List all non-retired concept source.</h3><pre class="highlight shell_session"><code>GET /conceptsource?q="loinc"
6107</code></pre>
6108<p>Quickly filter concept source types with a given search query. Returns a <code>404 Not Found</code> status if concept source type not exists.
6109 If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6110
6111<p>#### Query Parameters</p>
6112
6113<table><thead>
6114<tr>
6115<th>Parameter</th>
6116<th>Type</th>
6117<th>Description</th>
6118</tr>
6119</thead><tbody>
6120<tr>
6121<td><em>q</em></td>
6122<td><code>String</code></td>
6123<td>Full or partial match to concept source name. Search is case-insensitive</td>
6124</tr>
6125</tbody></table>
6126<h3 id='query-concept-source-by-uuid'>Query concept source by UUID.</h3><pre class="highlight shell_session"><code>GET /conceptsource/:target_concept_source_type_uuid
6127</code></pre>
6128<p>Retrieve a concept source type by its UUID. Returns a <code>404 Not Found</code> status if concept source type not exists. If user not logged
6129 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6130<h2 id='create-a-concept-source'>Create a concept source</h2><pre class="highlight shell_session"><code>POST /conceptsource
6131{
6132 "name": "SNOMED CT",
6133 "description": "SNOMED Preferred mapping",
6134 "hl7Code": "SCT"
6135}
6136</code></pre>
6137<ul>
6138<li><p>To Create a concept source type you need to specify below attributes in the request body. If you are not logged in to perform this action,
6139a <code>401 Unauthorized</code> status returned.</p>
6140<h3 id='attributes'>Attributes</h3>
6141<table><thead>
6142<tr>
6143<th>Parameter</th>
6144<th>Type</th>
6145<th>Description</th>
6146</tr>
6147</thead><tbody>
6148<tr>
6149<td><em>name</em></td>
6150<td><code>String</code></td>
6151<td>Name of the concept source type (Required)</td>
6152</tr>
6153<tr>
6154<td><em>description</em></td>
6155<td><code>String</code></td>
6156<td>Description for the concept source type resource (Required)</td>
6157</tr>
6158<tr>
6159<td><em>hl7Code</em></td>
6160<td><code>String</code></td>
6161<td>A short code defined by governing bodies like HL7 (as in Vocabulary Table 0396). Alternatively, this could be the "Implementation Id" code used by another OpenMRS installation to define its concepts and forms</td>
6162</tr>
6163<tr>
6164<td><em>uniqueId</em></td>
6165<td><code>String</code></td>
6166<td>A globally unique id to for the concept source</td>
6167</tr>
6168</tbody></table></li>
6169</ul>
6170<h2 id='update-a-concept-source'>Update a concept source</h2><pre class="highlight shell_session"><code>POST /conceptsource
6171{
6172 "name": "SNOMED CTS",
6173 "description": "SNOMED Preferred mapping",
6174 "hl7Code": "SCT"
6175}
6176</code></pre>
6177<ul>
6178<li><p>Update a target concept source type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
6179status if concept source not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6180<h3 id='attributes-2'>Attributes</h3>
6181<table><thead>
6182<tr>
6183<th>Parameter</th>
6184<th>Type</th>
6185<th>Description</th>
6186</tr>
6187</thead><tbody>
6188<tr>
6189<td><em>name</em></td>
6190<td><code>String</code></td>
6191<td>Name of the concept source type</td>
6192</tr>
6193<tr>
6194<td><em>description</em></td>
6195<td><code>String</code></td>
6196<td>Description for the concept source type resource</td>
6197</tr>
6198<tr>
6199<td><em>hl7Code</em></td>
6200<td><code>String</code></td>
6201<td>The 5-20 character code defined for this source by governing bodies. Alternatively, this could be the "Implementation Id" code used by another OpenMRS installation to define its concepts and forms</td>
6202</tr>
6203<tr>
6204<td><em>uniqueId</em></td>
6205<td><code>String</code></td>
6206<td>A globally unique id to for the concept source</td>
6207</tr>
6208</tbody></table></li>
6209</ul>
6210<h2 id='delete-a-concept-source'>Delete a concept source</h2><pre class="highlight shell_session"><code>DELETE /conceptsource/:target_concept_source_type_uuid?purge=true
6211</code></pre>
6212<ul>
6213<li><p>Delete or Retire a target concept source type by its UUID. Returns a <code>404 Not Found</code> status if concept source not exists. If user not logged
6214in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6215<h3 id='query-parameters'>Query Parameters</h3>
6216<table><thead>
6217<tr>
6218<th>Parameter</th>
6219<th>Type</th>
6220<th>Description</th>
6221</tr>
6222</thead><tbody>
6223<tr>
6224<td><em>purge</em></td>
6225<td><code>Boolean</code></td>
6226<td>The resource will be voided/retired unless purge = ‘true’</td>
6227</tr>
6228</tbody></table></li>
6229</ul>
6230<h1 id='concept-attribute-type'>Concept Attribute Type</h1><h2 id='concept-attribute-type-overview'>Concept Attribute Type Overview</h2>
6231<ul>
6232<li>If you wish to record extra information about concept, you can create Concept Attributes and assign them to Concept Attribute Types. </li>
6233</ul>
6234<h2 id='available-operations-for-concept-attribute-type'>Available operations for Concept Attribute Type.</h2>
6235<ol>
6236<li><a href="#list-concept-attribute-types">List concept_attribute types</a></li>
6237<li><a href="#create-a-concept-attribute-type">Create a concept_attribute_type</a></li>
6238<li><a href="#update-a-concept-attribute-type">Update a concept_attribute type</a></li>
6239<li><a href="#delete-a-concept-attribute-type">Delete a concept_attribute type</a></li>
6240</ol>
6241<h2 id='list-concept-attribute-types'>List concept attribute types</h2><h3 id='list-all-non-retired-concept-attribute-types'>List all non-retired concept attribute types.</h3><pre class="highlight shell_session"><code>GET /conceptattributetype?q=time
6242</code></pre>
6243<p>Quickly filter concept attribute types with a given search query. Returns a <code>404 Not Found</code> status if concept attribute type not exists.
6244 If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6245
6246<p>#### Query Parameters</p>
6247
6248<table><thead>
6249<tr>
6250<th>Parameter</th>
6251<th>Type</th>
6252<th>Description</th>
6253</tr>
6254</thead><tbody>
6255<tr>
6256<td><em>q</em></td>
6257<td><code>String</code></td>
6258<td>Full or partial display name of concept source</td>
6259</tr>
6260</tbody></table>
6261<h3 id='list-concept-attribute-type-by-uuid'>List concept attribute type by UUID.</h3><pre class="highlight shell_session"><code>GET /conceptattributetype/:target_concept_attribute_type_uuid
6262</code></pre>
6263<p>Retrieve a concept attribute type by its UUID. Returns a <code>404 Not Found</code> status if concept attribute type not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6264<h2 id='create-a-concept-attribute-type'>Create a concept attribute type</h2><pre class="highlight shell_session"><code>POST /conceptattributetype
6265{
6266 "name": "Time Span",
6267 "description": "This attribute type will record the time span for the concept",
6268 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
6269 "minOccurs": 0,
6270 "maxOccurs": 1,
6271 "datatypeConfig": "default",
6272 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
6273 "handlerConfig": "dafault"
6274}
6275</code></pre>
6276<ul>
6277<li>To Create a concept attribute type, you need to specify below attributes in the request body. If you are not logged in to perform this action,
6278a <code>401 Unauthorized</code> status returned.</li>
6279</ul>
6280<h3 id='attributes'>Attributes</h3>
6281<table><thead>
6282<tr>
6283<th>Parameter</th>
6284<th>Type</th>
6285<th>Description</th>
6286</tr>
6287</thead><tbody>
6288<tr>
6289<td><em>name</em></td>
6290<td><code>String</code></td>
6291<td>Name of the concept attribute type (Required)</td>
6292</tr>
6293<tr>
6294<td><em>description</em></td>
6295<td><code>String</code></td>
6296<td>Description (Required)</td>
6297</tr>
6298<tr>
6299<td><em>datatypeClassname</em></td>
6300<td><code>CustomDataType Resource</code></td>
6301<td>Data type for the attribute type resource. OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
6302</tr>
6303<tr>
6304<td><em>minOccurs</em></td>
6305<td><code>Number</code></td>
6306<td>Minimum number of times this value can be specified for a single concept. Use <code>0</code> or <code>1</code> as the default value (Required)</td>
6307</tr>
6308<tr>
6309<td><em>maxOccurs</em></td>
6310<td><code>Number</code></td>
6311<td>Maximum number of times this value can be specified for a single concept (e.g., use 1 to prevent an attribute from being added to a concept multiple times)</td>
6312</tr>
6313<tr>
6314<td><em>preferredHandlerClassname</em></td>
6315<td><code>Handler</code></td>
6316<td>Specifies the Java class to be used when handling this concept attribute type. The java class must implement [<code>CustomDataTypeHandler</code>(https://docs.openmrs.org/doc/org/openmrs/customdatatype/CustomDatatypeHandler.html). If not specified, the system will try to choose the best handler for the chosen datatype</td>
6317</tr>
6318<tr>
6319<td><em>datatypeConfig</em></td>
6320<td><code>String</code></td>
6321<td>Provides ability to define custom data types configuration for OpenMRS</td>
6322</tr>
6323<tr>
6324<td><em>handlerConfig</em></td>
6325<td><code>String</code></td>
6326<td>Allow handler to be used for more than one attribute type. The actual configuration depends on the needs of the specified handler. For example, a "Pre-defined List" handler could be made to implement a simple selection list, and this configuration would tell the handler the possible choices in the list for this specific attribute type</td>
6327</tr>
6328</tbody></table>
6329<h2 id='update-a-concept-attribute-type'>Update a concept attribute type</h2><pre class="highlight shell_session"><code>POST /conceptattributetype
6330{
6331 "name": "Time Span",
6332 "description": "This attribute type will record the time span for the concept",
6333 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
6334 "minOccurs": 0,
6335 "maxOccurs": 1,
6336 "datatypeConfig": "default",
6337 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
6338 "handlerConfig": "dafault"
6339}
6340</code></pre>
6341<ul>
6342<li> Update a target concept attribute type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
6343status if concept attribute not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</li>
6344</ul>
6345<h3 id='attributes-2'>Attributes</h3>
6346<table><thead>
6347<tr>
6348<th>Parameter</th>
6349<th>Type</th>
6350<th>Description</th>
6351</tr>
6352</thead><tbody>
6353<tr>
6354<td><em>name</em></td>
6355<td><code>String</code></td>
6356<td>Name of the concept attribute type</td>
6357</tr>
6358<tr>
6359<td><em>description</em></td>
6360<td><code>String</code></td>
6361<td>Description (Required)</td>
6362</tr>
6363<tr>
6364<td><em>datatypeClassname</em></td>
6365<td><code>CustomDataType Resource</code></td>
6366<td>Data type for the attribute type resource. OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly</td>
6367</tr>
6368<tr>
6369<td><em>minOccurs</em></td>
6370<td><code>Number</code></td>
6371<td>Minimum number of times this value can be specified for a single concept. Use <code>0</code> or <code>1</code> as the default value</td>
6372</tr>
6373<tr>
6374<td><em>maxOccurs</em></td>
6375<td><code>Number</code></td>
6376<td>Maximum number of times this value can be specified for a single concept (e.g., use 1 to prevent an attribute from being added to a concept multiple times)</td>
6377</tr>
6378<tr>
6379<td><em>preferredHandlerClassname</em></td>
6380<td><code>Handler</code></td>
6381<td>Specifies the Java class to be used when handling this concept attribute type. The java class must implement [<code>CustomDataTypeHandler</code>(https://docs.openmrs.org/doc/org/openmrs/customdatatype/CustomDatatypeHandler.html). If not specified, the system will try to choose the best handler for the chosen datatype</td>
6382</tr>
6383<tr>
6384<td><em>datatypeConfig</em></td>
6385<td><code>String</code></td>
6386<td>Provides ability to define custom data types configuration for OpenMRS</td>
6387</tr>
6388<tr>
6389<td><em>handlerConfig</em></td>
6390<td><code>String</code></td>
6391<td>Allow handler to be used for more than one attribute type. The actual configuration depends on the needs of the specified handler. For example, a "Pre-defined List" handler could be made to implement a simple selection list, and this configuration would tell the handler the possible choices in the list for this specific attribute type</td>
6392</tr>
6393</tbody></table>
6394<h2 id='delete-a-concept-attribute-type'>Delete a concept attribute type</h2><pre class="highlight shell_session"><code>DELETE /conceptattributetype/:target_concept_attribute_type_uuid?purge=true
6395</code></pre>
6396<ul>
6397<li><p>Delete or retire a target concept attribute type by its UUID. Returns
6398<code>404 Not Found</code> status if concept attribute does not exist. If not
6399authenticated or user does not have sufficient privilege, a
6400<code>401 Unauthorized</code> status is returned.</p>
6401<h3 id='query-parameters'>Query Parameters</h3>
6402<table><thead>
6403<tr>
6404<th>Parameter</th>
6405<th>Type</th>
6406<th>Description</th>
6407</tr>
6408</thead><tbody>
6409<tr>
6410<td><em>purge</em></td>
6411<td><code>Boolean</code></td>
6412<td>The resource will be retired unless purge = "true"</td>
6413</tr>
6414</tbody></table></li>
6415</ul>
6416<h1 id='concept-data-type'>Concept Data Type</h1><h2 id='concept-data-type-overview'>Concept Data Type Overview</h2>
6417<ul>
6418<li><p>Concept Data type defines the structured format you desired the data to be represented.</p></li>
6419<li><p>The current types are as follows:</p></li>
6420</ul>
6421
6422<p>1. Numeric – any data represented numerically, also allows you to classify critical values and units, e.g., age, height, and liters consumed per day
6423 2. Coded – allows answers to be only those provided, e.g., blood type can only be “A,” “B,” "AB," or “O.”
6424 3. Text – Open-ended responses
6425 4. N/A – the standard datatype for any non-query-like concepts (answers or things), e.g., symptoms, diagnoses, findings, anatomy, misc
6426 5. Document
6427 6. Date – structured day, month, and year
6428 7. Time – structured time response
6429 8. DateTime – structured response including both the date and the time
6430 9. Boolean – checkbox response, e.g., yes or no queries
6431 10. Rule
6432 11. Structured </p>
6433<h2 id='available-operations-for-concept-data-type'>Available operations for Concept Data Type.</h2>
6434<ol>
6435<li><a href="#list-concept-data-types">List concept_data types</a></li>
6436<li><a href="#delete-a-concept_data-type">Delete a concept_data type</a></li>
6437</ol>
6438<h2 id='list-concept-data-types'>List concept data types</h2><h3 id='list-all-non-retired-concept-data-types'>List all non-retired concept data types.</h3><pre class="highlight shell_session"><code>GET /conceptdatatype"
6439</code></pre>
6440<p>Get concept data types. Returns a <code>404 Not Found</code> status if concept data type not exists.
6441 If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned. </p>
6442<h3 id='get-concept-data-type-by-uuid'>Get concept data type by UUID.</h3><pre class="highlight shell_session"><code>GET /conceptdatatype/:target_concept_data_type_uuid
6443</code></pre>
6444<p>Retrieve a concept data type by its UUID. Returns a <code>404 Not Found</code> status if concept data type not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6445<h2 id='delete-a-concept-data-type'>Delete a concept data type</h2><pre class="highlight shell_session"><code>DELETE /conceptdatatype/:target_concept_data_type_uuid?purge=true
6446</code></pre>
6447<ul>
6448<li><p>Delete or retire a target concept data type by its UUID. Returns a <code>404 Not Found</code>
6449status if concept data not exists. If the user is not logged in to perform this action,
6450a <code>401 Unauthorized</code> status returned.</p>
6451<h3 id='query-parameters'>Query Parameters</h3>
6452<table><thead>
6453<tr>
6454<th>Parameter</th>
6455<th>Type</th>
6456<th>Description</th>
6457</tr>
6458</thead><tbody>
6459<tr>
6460<td><em>purge</em></td>
6461<td><code>Boolean</code></td>
6462<td>The resource will be voided/retired unless purge = ‘true’</td>
6463</tr>
6464</tbody></table></li>
6465</ul>
6466<h1 id='concept-map-type'>Concept Map Type</h1><h2 id='overview'>Overview</h2>
6467<ul>
6468<li><p>Concept Mappings are added to facilitate managing concept dictionaries and point to other concepts that have the same meaning.
6469Mappings are useful when you need to receive or send information to external systems, letting you define how your system's
6470concepts relate to external concepts such as standardized medical vocabularies (e.g., ICD, LOINC, SNOMED). </p></li>
6471<li><p>For example, add a mapping to a concept in the MCL dictionary. You can save the concept now and create some answers.</p></li>
6472<li><p>Repeat the steps and create the concepts PLANNING PREGNANCY and CURRENTLY PREGNANT of Class Finding and Datatype Boolean.
6473The last possible answer will be the OTHER of Class Misc and Datatype N/A. After creating three new concepts, you can edit
6474ANTENATAL VISIT REASON and add them as answers.</p></li>
6475</ul>
6476<h2 id='available-operations'>Available operations.</h2>
6477<ol>
6478<li><a href="#list-concept-map-types">List concept mapping types</a></li>
6479<li><a href="#create-a-concept-map-type">Create a concept mapping type</a></li>
6480<li><a href="#update-a-concept-map-type">Update a concept mapping typee</a></li>
6481<li><a href="#delete-a-concept-map-type">Delete a concept mapping type</a></li>
6482</ol>
6483<h3 id='list-concept-map-types'>List concept map types</h3><h3 id='list-all-non-retired-concept-map-types'>List all non-retired concept map types.</h3><pre class="highlight shell_session"><code> GET /conceptmaptype?q="same"
6484</code></pre>
6485<p>Quickly filter concept map types with a given search query. Returns a <code>404 Not Found</code> status if concept map type not exists.
6486 If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6487
6488<p>##### Query Parameters</p>
6489
6490<table><thead>
6491<tr>
6492<th>Parameter</th>
6493<th>Type</th>
6494<th>Description</th>
6495</tr>
6496</thead><tbody>
6497<tr>
6498<td><em>q</em></td>
6499<td><code>String</code></td>
6500<td>Full or partial name search term. Search is case insensitive.</td>
6501</tr>
6502</tbody></table>
6503<h3 id='list-concept-map-type-by-uuid'>List concept map type by UUID.</h3><pre class="highlight shell_session"><code> GET /conceptmaptype/:target_concept_map_type_uuid
6504</code></pre>
6505<p>Retrieve a concept map type by its UUID. Returns a <code>404 Not Found</code> status if concept map type not exists. If user not logged
6506 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6507<h3 id='create-a-concept-map-type'>Create a concept map type</h3>
6508<p><code>console
6509 POST /conceptmaptype
6510 {
6511 "name": "SAME-AS",
6512 "isHidden": false
6513 }
6514</code></p>
6515
6516<ul>
6517<li>To Create a concept map type, you need to specify below attributes in the request body. If you are not logged in to perform this action,
6518a <code>401 Unauthorized</code> status returned.</li>
6519</ul>
6520<h3 id='attributes'>Attributes</h3>
6521<table><thead>
6522<tr>
6523<th>Parameter</th>
6524<th>Type</th>
6525<th>Description</th>
6526</tr>
6527</thead><tbody>
6528<tr>
6529<td><em>name</em></td>
6530<td><code>String</code></td>
6531<td>Name of the concept mapping type (Required)</td>
6532</tr>
6533<tr>
6534<td><em>description</em></td>
6535<td><code>String</code></td>
6536<td>A brief description of the concept mapping type</td>
6537</tr>
6538<tr>
6539<td><em>isHidden</em></td>
6540<td><code>Boolean</code></td>
6541<td>State to record concept map is hidden or not</td>
6542</tr>
6543</tbody></table>
6544<h3 id='update-a-concept-map-type'>Update a concept map type</h3><pre class="highlight shell_session"><code> POST /conceptmaptype
6545 {
6546 "name": "SAME-AS",
6547 "isHidden": true
6548 }
6549 ```
6550* Update a target concept map type with given UUID, this method only modifies properties in the request. Returns a `404 Not Found`
6551status if concept map not exists. If the user is not logged in to perform this action, a `401 Unauthorized` status returned.
6552
6553 #### Attributes
6554
6555 Parameter | Type | Description
6556 --- | --- | ---
6557 *name* | `String` | Name of the concept mapping type (Required)
6558 *description* | `String` | A brief description of the concept mapping type
6559 *isHidden* | `Boolean` | State to record concept map is hidden or not
6560
6561
6562<span class="ni">### </span><span class="nc">Delete</span><span class="kv"> a concept map type
6563</span>
6564
6565 ```console
6566 DELETE /conceptmaptype/:target_concept_map_type_uuid?purge=true
6567 ```
6568
6569* Delete or Retire a target concept map type by its UUID. Returns a `404 Not Found` status if concept map not exists. If user not logged in to perform this action, a `401 Unauthorized` status returned.
6570
6571 #### Query Parameters
6572
6573 Parameter | Type | Description
6574 --- | --- | ---
6575 *purge* | `Boolean` | The resource will be voided/retired unless purge = ‘true’
6576
6577</code></pre><h1 id='concept-reference-term'>Concept Reference Term</h1><h2 id='overview'>Overview</h2>
6578<ul>
6579<li>Concept reference terms represent terms within external vocabularies (typically standardized terminologies like SNOMED, ICD, LOINC, etc.). OpenMRS concept can be mapped to these reference terms through <a href="concept_mapping.md">concept mappings</a>. </li>
6580</ul>
6581<h2 id='available-operations'>Available operations.</h2>
6582<ol>
6583<li> <a href="#list-concept-reference-terms">List concept reference terms</a></li>
6584<li> <a href="#create-a-concept-reference-term">Create a concept reference term</a></li>
6585<li> <a href="#update-a-concept-reference-term">Update a concept reference term</a></li>
6586<li> <a href="#delete-a-concept-reference-term">Delete a concept reference term</a></li>
6587</ol>
6588<h3 id='list-concept-reference-terms'>List concept reference terms</h3><h3 id='list-all-concepts-reference-terms'>List all concepts reference terms.</h3><pre class="highlight shell_session"><code> GET /conceptreferenceterm?
6589 codeOrName=274663001
6590</code></pre>
6591<p>Quickly filter concept reference term with given query parameters. Returns a <code>404 Not Found</code> status if concept reference term type not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6592<h3 id='query-parameters'>Query Parameters</h3>
6593<table><thead>
6594<tr>
6595<th>Parameter</th>
6596<th>Type</th>
6597<th>Description</th>
6598</tr>
6599</thead><tbody>
6600<tr>
6601<td><em>codeOrName</em></td>
6602<td><code>String</code></td>
6603<td>Represents a name from a standard medical code</td>
6604</tr>
6605<tr>
6606<td><em>source</em></td>
6607<td><code>String</code></td>
6608<td>A concept can have any number of mappings to any number of other vocabularies. Other vocabularies are called "concept sources" in OpenMRS (i.e., LOINC, SNOMED, ICD-9, ICD10, RxNORM, etc.), but the concept source can also be a custom (i.e., org.openmrs.module.mdrtb, PIH, AMPATH, MVP, etc.). Every concept can define a string for its mapping in any "concept source" defined in the database</td>
6609</tr>
6610</tbody></table>
6611<h3 id='query-concept-reference-term-by-uuid'>Query concept reference term by UUID.</h3>
6612<p><code>console
6613 GET /conceptreferenceterm/:target_concept_reference_term_type_uuid
6614</code></p>
6615
6616<p>Retrieve a concept reference term by its UUID. Returns a <code>404 Not Found</code> status if concept reference term not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6617<h3 id='create-a-concept-reference-term'>Create a concept reference term</h3><pre class="highlight shell_session"><code> POST /conceptreferenceterm
6618 {
6619 "code": "274663001",
6620 "conceptSource": "1ADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD",
6621 "version": "1.0.0"
6622 }
6623</code></pre>
6624<ul>
6625<li>To Create an concept reference term, you need to specify below attributes in the request body. If you are not logged in to perform this action,
6626a <code>401 Unauthorized</code> status returned.</li>
6627</ul>
6628<h3 id='attributes'>Attributes</h3>
6629<table><thead>
6630<tr>
6631<th>Parameter</th>
6632<th>Type</th>
6633<th>Description</th>
6634</tr>
6635</thead><tbody>
6636<tr>
6637<td><em>names</em></td>
6638<td><code>String</code></td>
6639<td>Name for the concept reference term</td>
6640</tr>
6641<tr>
6642<td><em>description</em></td>
6643<td><code>String</code></td>
6644<td>A concept datatype prescribes the structured format by which you desire the data to be represented. In simple terms, the data type defines the type of data that the concept is intended to collect</td>
6645</tr>
6646<tr>
6647<td><em>code</em></td>
6648<td><code>String</code></td>
6649<td>Represents a name from a standard medical code (required)</td>
6650</tr>
6651<tr>
6652<td><em>conceptSource</em></td>
6653<td><code>target_concept_source_UUID</code></td>
6654<td>A concept can have any number of mappings to any number of other vocabularies. Other vocabularies are called "concept sources" in OpenMRS (i.e., LOINC, SNOMED, ICD-9, ICD10, RxNORM, etc.), but the concept source can also be a custom (i.e., org.openmrs.module.mdrtb, PIH, AMPATH, MVP, etc.). Every concept can define a string for its mapping in any "concept source" defined in the database (required)</td>
6655</tr>
6656<tr>
6657<td><em>version</em></td>
6658<td><code>String</code></td>
6659<td>A method to keep track of the number of updates applied to a specific concept reference term type</td>
6660</tr>
6661</tbody></table>
6662<h3 id='update-a-concept-reference-term'>Update a concept reference term</h3><pre class="highlight shell_session"><code> POST /conceptreferenceterm/:target_concept_reference_term_type_uuid
6663 {
6664 "code": "274663001",
6665 "conceptSource": "1ADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD",
6666 "version": "1.0.1"
6667 }
6668</code></pre>
6669<ul>
6670<li><p>Update a target concept reference term with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
6671status if concept reference term not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6672<h3 id='attributes-2'>Attributes</h3>
6673<table><thead>
6674<tr>
6675<th>Parameter</th>
6676<th>Type</th>
6677<th>Description</th>
6678</tr>
6679</thead><tbody>
6680<tr>
6681<td><em>names</em></td>
6682<td><code>String</code></td>
6683<td>Name for the concept reference term</td>
6684</tr>
6685<tr>
6686<td><em>description</em></td>
6687<td><code>String</code></td>
6688<td>A concept datatype prescribes the structured format by which you desire the data to be represented. In simple terms, the datatype defines the type of data that the concept is intended to collect</td>
6689</tr>
6690<tr>
6691<td><em>code</em></td>
6692<td><code>String</code></td>
6693<td>Represents a name from a standard medical code (required)</td>
6694</tr>
6695<tr>
6696<td><em>conceptSource</em></td>
6697<td><code>target_concept_source_UUID</code></td>
6698<td>A concept can have any number of mappings to any number of other vocabularies. Other vocabularies are called "concept sources" in OpenMRS (i.e., LOINC, SNOMED, ICD-9, ICD10, RxNORM, etc.), but the concept source can also be a custom (i.e., org.openmrs.module.mdrtb, PIH, AMPATH, MVP, etc.). Every concept can define a string for its mapping in any "concept source" defined in the database (required)</td>
6699</tr>
6700<tr>
6701<td><em>version</em></td>
6702<td><code>String</code></td>
6703<td>A method to keep track of the number of updates applied to a specific concept reference term type</td>
6704</tr>
6705</tbody></table></li>
6706</ul>
6707<h3 id='delete-a-concept-reference-term'>Delete a concept reference term</h3><pre class="highlight shell_session"><code> DELETE /conceptreferenceterm/:target_concept_reference_term_type_uuid?purge=true ```
6708
6709* Delete or retire a target concept reference term by its UUID. Returns a `404 Not Found` status if concept reference term not exists. If the user not logged in to perform this action, a `401 Unauthorized` status returned.
6710
6711 #### Query Parameters
6712
6713 Parameter | Type | Description
6714 --- | --- | ---
6715 *purge* | `Boolean` | The resource will be retired unless purge = ‘true’
6716
6717</code></pre><h1 id='concept-class'>Concept Class</h1><h2 id='overview'>Overview</h2>
6718<ul>
6719<li>The concept's class provides a useful way to narrow down the scope of the information that the concept is intended to capture.<br>
6720In this way, the class is helpful for data extraction. This classification details how a concept will be represented
6721(i.e. as a question or an answer) when the information is stored. OpenMRS contains several default classes to use when defining concepts, but implementation sites may also create additional custom concept classes for use. </li>
6722</ul>
6723<h2 id='available-operations'>Available operations.</h2>
6724<ol>
6725<li><a href="#list-concept-classes">List concept classes</a></li>
6726<li><a href="#create-a-concept-class">Create a concept class</a></li>
6727<li><a href="#update-a-concept-class">Update a concept class</a></li>
6728<li><a href="#delete-a-concept-class">Delete a concept class</a></li>
6729</ol>
6730<h3 id='list-concept-classes'>List concept classes</h3><h3 id='list-all-non-retired-concept-classes'>List all non-retired concept classes.</h3>
6731<p><code>console
6732 GET /conceptclass"
6733</code></p>
6734
6735<p>List all concept classes with a given search query. Returns a <code>404 Not Found</code> status if concept classes not exist.
6736 If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6737<h3 id='list-concept-class-type-by-uuid'>List concept class type by UUID.</h3>
6738<p><code>console
6739 GET /conceptclass/:target_concept_class_uuid
6740</code></p>
6741
6742<p>Retrieve a concept class by its UUID. Returns a <code>404 Not Found</code> status if concept class type not exists. If user not logged
6743 in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6744<h3 id='create-a-concept-class'>Create a concept class</h3><pre class="highlight shell_session"><code> POST /conceptclass
6745 {
6746 "name": "Procedure",
6747 "description": "Describes a clinical procedure"
6748 }
6749</code></pre>
6750<ul>
6751<li><p>To Create a concept class, you need to specify below attributes in the request body. If you are not logged in to perform this action,
6752a <code>401 Unauthorized</code> status returned.</p>
6753<h4 id='attributes'>Attributes</h4>
6754<table><thead>
6755<tr>
6756<th>Parameter</th>
6757<th>Type</th>
6758<th>Description</th>
6759</tr>
6760</thead><tbody>
6761<tr>
6762<td><em>name</em></td>
6763<td><code>String</code></td>
6764<td>Name of the concept class (Required)</td>
6765</tr>
6766<tr>
6767<td><em>description</em></td>
6768<td><code>String</code></td>
6769<td>Description</td>
6770</tr>
6771</tbody></table></li>
6772</ul>
6773<h3 id='update-a-concept-class'>Update a concept class</h3><pre class="highlight shell_session"><code> POST /conceptclass
6774 {
6775 "name": "Procedure",
6776 "description": "Describes a clinical procedure"
6777 }
6778</code></pre>
6779<ul>
6780<li><p>Update a target concept class with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
6781status if concept class not exists. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6782<h4 id='attributes-2'>Attributes</h4>
6783<table><thead>
6784<tr>
6785<th>Parameter</th>
6786<th>Type</th>
6787<th>Description</th>
6788</tr>
6789</thead><tbody>
6790<tr>
6791<td><em>name</em></td>
6792<td><code>String</code></td>
6793<td>Name of the concept class (Required)</td>
6794</tr>
6795<tr>
6796<td><em>description</em></td>
6797<td><code>String</code></td>
6798<td>Description</td>
6799</tr>
6800</tbody></table></li>
6801</ul>
6802<h3 id='delete-a-concept-class'>Delete a concept class</h3><pre class="highlight shell_session"><code> DELETE /conceptclass/:target_concept_class_uuid?purge=true
6803</code></pre>
6804<ul>
6805<li><p>Delete or Retire a target concept class by its UUID. Returns a <code>404 Not Found</code> status if concept class not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6806<h4 id='query-parameters'>Query Parameters</h4>
6807<table><thead>
6808<tr>
6809<th>Parameter</th>
6810<th>Type</th>
6811<th>Description</th>
6812</tr>
6813</thead><tbody>
6814<tr>
6815<td><em>purge</em></td>
6816<td><code>Boolean</code></td>
6817<td>The resource will be voided/retired unless purge = ‘true’</td>
6818</tr>
6819</tbody></table></li>
6820</ul>
6821<h1 id='providers'>Providers</h1><h2 id='provider-overview'>Provider Overview</h2>
6822<ul>
6823<li><p>A Provider is a person who provides care or services to patients. A provider may be a clinician like a doctor or a nurse,
6824a social worker, or a lab tech. Generally speaking, any healthcare worker that a patient can have an encounter with is a provider.</p></li>
6825<li><p>Providers may have full records in OpenMRS as persons, or they may just be a simple name and ID number.</p></li>
6826</ul>
6827<h2 id='sub-resource-types-of-provider'>Sub Resource types of Provider</h2><h2 id='provider-attribute'>Provider Attribute.</h2>
6828<ul>
6829<li><p>If you wish to record extra information about providers, you can create Provider Attributes.</p></li>
6830<li><p>Provider attributes exist specifically to allow implementations to extend the data model.</p></li>
6831</ul>
6832<h2 id='available-operations-for-provider'>Available operations for Provider.</h2>
6833<ol>
6834<li><a href="#list-providers">List providers</a></li>
6835<li><a href="#create-a-provider">Create a provider</a></li>
6836<li><a href="#update-a-provider">Update a provider</a></li>
6837<li><a href="#delete-a-provider">Delete a provider</a></li>
6838<li><a href="#list-provider-attribute-sub-resources">List provider attribute sub resource</a></li>
6839<li><a href="#create-provider-attribute-sub-resource-with-properties">Create provider attribute sub resource with properties</a></li>
6840<li><a href="#update-provider-attribute-sub-resource">Update provider attribute sub resource</a></li>
6841<li><a href="#delete-provider-attribute-sub-resource">Delete provider attribute sub resource</a></li>
6842</ol>
6843<h2 id='list-providers'>List providers</h2>
6844<ul>
6845<li><h3 id='list-all-non-retired-providers'>List all non-retired providers.</h3>
6846<p>Quickly filter providers with given query parameters. Returns a <code>404 Not Found</code> status if provider not exists. If user not logged
6847in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6848<h5 id='query-parameters'>Query Parameters</h5>
6849<table><thead>
6850<tr>
6851<th>Parameter</th>
6852<th>Type</th>
6853<th>Description</th>
6854</tr>
6855</thead><tbody>
6856<tr>
6857<td><em>q</em></td>
6858<td><code>Search Query</code></td>
6859<td>Get provider by name</td>
6860</tr>
6861</tbody></table></li>
6862</ul>
6863<pre class="highlight shell_session"><code>GET /provider?
6864q=clerk
6865</code></pre>
6866<ul>
6867<li><h3 id='query-provider-by-uuid'>Query provider by UUID.</h3>
6868<p>Retrieve a provider by its UUID. Returns a <code>404 Not Found</code> status if provider not exists. If user not logged
6869in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
6870</ul>
6871<pre class="highlight shell_session"><code>GET /provider/:target_provider_uuid
6872</code></pre><h2 id='create-a-provider'>Create a provider</h2>
6873<ul>
6874<li><p>To Create a provider, you need to specify below attributes in the request body. If you are not logged in to perform this action,
6875a <code>401 Unauthorized</code> status returned.</p>
6876<h3 id='attributes'>Attributes</h3>
6877<table><thead>
6878<tr>
6879<th>Parameter</th>
6880<th>Type</th>
6881<th>Description</th>
6882</tr>
6883</thead><tbody>
6884<tr>
6885<td><em>person</em></td>
6886<td><code>Person UUID</code></td>
6887<td>Target person who will be a provider for OpenMRS (required)</td>
6888</tr>
6889<tr>
6890<td><em>identifier</em></td>
6891<td><code>String</code></td>
6892<td>Value of the identifier.Identifier is used to virtually group providers in to groups (required)</td>
6893</tr>
6894<tr>
6895<td><em>attributes</em></td>
6896<td><code>Array[]: Attribute</code></td>
6897<td>List of provider attributes</td>
6898</tr>
6899<tr>
6900<td><em>retired</em></td>
6901<td><code>Boolean</code></td>
6902<td>Retired status for the provider.</td>
6903</tr>
6904</tbody></table></li>
6905</ul>
6906<pre class="highlight shell_session"><code>POST /provider
6907{
6908 "person": "007037a0-0500-11e3-8ffd-0800200c9a66",
6909 "identifier": "doctor",
6910 "attributes": [
6911 {
6912 "attributeType": "target_attributeType_uuid",
6913 "value": "value_for_attribute"
6914 }
6915 ],
6916 "retired": false
6917}
6918</code></pre><h2 id='update-a-provider'>Update a provider</h2>
6919<ul>
6920<li><p>Update a target provider with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
6921status if provider not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6922<h3 id='attributes-2'>Attributes</h3>
6923<table><thead>
6924<tr>
6925<th>Parameter</th>
6926<th>Type</th>
6927<th>Description</th>
6928</tr>
6929</thead><tbody>
6930<tr>
6931<td><em>person</em></td>
6932<td><code>Person UUID</code></td>
6933<td>Target person who will be a provider for OpenMRS (required)</td>
6934</tr>
6935<tr>
6936<td><em>identifier</em></td>
6937<td><code>String</code></td>
6938<td>Value of the identifier.Identifier is used to virtually group providers in to groups (required)</td>
6939</tr>
6940<tr>
6941<td><em>attributes</em></td>
6942<td><code>Array[]: Attribute</code></td>
6943<td>List of provider attributes</td>
6944</tr>
6945<tr>
6946<td><em>retired</em></td>
6947<td><code>Boolean</code></td>
6948<td>Retired status for the provider.</td>
6949</tr>
6950</tbody></table></li>
6951</ul>
6952<pre class="highlight shell_session"><code>POST /provider/:target_provider_uuid
6953{
6954 "person": "007037a0-0500-11e3-8ffd-0800200c9a66",
6955 "identifier": "doctor",
6956 "attributes": [
6957 {
6958 "attributeType": "target_attributeType_uuid",
6959 "value": "value_for_attribute"
6960 }
6961 ],
6962 "retired": false
6963}
6964</code></pre><h2 id='delete-a-provider'>Delete a provider</h2>
6965<ul>
6966<li><p>Delete or retire a target provider by its UUID. Returns a <code>404 Not Found</code> status if provider not exists. If the user is logged
6967in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
6968<h3 id='query-parameters-2'>Query Parameters</h3>
6969<table><thead>
6970<tr>
6971<th>Parameter</th>
6972<th>Type</th>
6973<th>Description</th>
6974</tr>
6975</thead><tbody>
6976<tr>
6977<td><em>purge</em></td>
6978<td><code>Boolean</code></td>
6979<td>The resource will be retired unless purge = ‘true’</td>
6980</tr>
6981</tbody></table></li>
6982</ul>
6983<pre class="highlight shell_session"><code>DELETE /provider/:target_provider_uuid?purge=true
6984</code></pre><h2 id='list-provider-attribute-subresources'>List provider attribute subresources</h2>
6985<ul>
6986<li><h3 id='list-all-provider-attribute-subresources-for-a-provider'>List all provider attribute subresources for a provider.</h3>
6987<p>Retrieve all <strong>provider attribute</strong> subresources of a <strong>provider</strong> resource by target_provider_uuid. Returns a
6988<code>404 Not Found</code> status if provider attribute not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
6989</ul>
6990<pre class="highlight shell_session"><code>GET /provider/:target_provider_uuid/attribute
6991</code></pre>
6992<ul>
6993<li><h3 id='list-provider-attribute-subresources-by-it-39-s-uuid-and-parent-provider-uuid'>List provider attribute subresources by it's UUID and parent provider UUID.</h3>
6994<p>Retrieve a <strong>provider attribute</strong> subresources of a <strong>provider</strong> resource. Returns a <code>404 Not Found</code> status if the provider attribute not exists. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p></li>
6995</ul>
6996<pre class="highlight shell_session"><code>GET /provider/:target_provider_uuid/attribute/:target_provider_attribute_uuid
6997</code></pre><h2 id='create-a-provider-attribute-sub-resource-with-properties'>Create a provider attribute sub resource with properties</h2>
6998<ul>
6999<li><p>To Create an attribute subresource for a specific provider resource, you need to specify below attributes in the request body.
7000If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
7001<h3 id='attributes-3'>Attributes</h3>
7002<table><thead>
7003<tr>
7004<th>Parameter</th>
7005<th>Type</th>
7006<th>Description</th>
7007</tr>
7008</thead><tbody>
7009<tr>
7010<td><em>attributeType</em></td>
7011<td><code>Attribute_Type UUID</code></td>
7012<td>Create Attribute from this Attribute_Type (required)</td>
7013</tr>
7014<tr>
7015<td><em>value</em></td>
7016<td><code>Depends on Attribute_Type Selected</code></td>
7017<td>Value for the attribute (required)</td>
7018</tr>
7019</tbody></table></li>
7020</ul>
7021<pre class="highlight shell_session"><code>POST provider/:target_provider_uuid/attribute
7022{
7023 "attributeType": "target_provider_attribute_type_uuid",
7024 "value": "New provider"
7025}
7026</code></pre><h2 id='update-provider-attribute-subresource'>Update provider attribute subresource</h2>
7027<ul>
7028<li><p>Updates a provider attribute subresource value with given UUID, this method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if the provider attribute not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
7029returned.</p>
7030<h3 id='query-parameters-3'>Query Parameters</h3>
7031<table><thead>
7032<tr>
7033<th>Parameter</th>
7034<th>Type</th>
7035<th>Description</th>
7036</tr>
7037</thead><tbody>
7038<tr>
7039<td><em>parent_uuid</em></td>
7040<td><code>Provider UUID</code></td>
7041<td>Target provider resource UUID</td>
7042</tr>
7043<tr>
7044<td><em>uuid</em></td>
7045<td><code>Provider_Attribute UUID</code></td>
7046<td>Target provider attribute resource UUID</td>
7047</tr>
7048</tbody></table>
7049<h4 id='attributes-4'>Attributes</h4>
7050<table><thead>
7051<tr>
7052<th>Parameter</th>
7053<th>Type</th>
7054<th>Description</th>
7055</tr>
7056</thead><tbody>
7057<tr>
7058<td><em>attributeType</em></td>
7059<td><code>Attribute_Type UUID</code></td>
7060<td>Create Attribute from this Attribute_Type</td>
7061</tr>
7062<tr>
7063<td><em>value</em></td>
7064<td><code>Depends on Attribute_Type Selected</code></td>
7065<td>Value for the attribute</td>
7066</tr>
7067</tbody></table></li>
7068</ul>
7069<pre class="highlight shell_session"><code>POST provider/:target_provider_uuid/attribute/:target_provider_attribute_uuid
7070{
7071 "attributeType": "target_provider_attribute_type_uuid",
7072 "value": "New provider"
7073}
7074</code></pre><h2 id='delete-provider-attribute-subresource'>Delete provider attribute subresource</h2>
7075<ul>
7076<li><p>Delete or Retire a target provider attribute subresource by its UUID. Returns a <code>404 Not Found</code> status if attribute not exists.
7077If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
7078<h3 id='query-parameters-4'>Query Parameters</h3>
7079<table><thead>
7080<tr>
7081<th>Parameter</th>
7082<th>Type</th>
7083<th>Description</th>
7084</tr>
7085</thead><tbody>
7086<tr>
7087<td><em>purge</em></td>
7088<td><code>Boolean</code></td>
7089<td>The resource will be retired unless purge = ‘true’. Purging will attempt to remove the provider attribute type from the system irreversibly. Provider attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
7090</tr>
7091</tbody></table></li>
7092</ul>
7093<pre class="highlight shell_session"><code>DELETE /provider/:target_provider_uuid/attribute/:target_provider_attribute_uuid
7094</code></pre><h1 id='provider-attribute-type'>Provider Attribute Type</h1><h2 id='provider-attribute-overview'>Provider Attribute Overview</h2>
7095<ul>
7096<li>If you wish to record extra information about providers, you can create Provider Attributes and assign them to Provider Types.</li>
7097</ul>
7098<h2 id='available-operations-for-provider-attribute-type'>Available operations for Provider Attribute type.</h2>
7099<ol>
7100<li><a href="#list-provider-attribute-types">List provider attribute types</a></li>
7101<li><a href="#create-a-provider-attribute-type">Create a provider attribute type</a></li>
7102<li><a href="#update-a-provider-attribute-type">Update a provider attribute type</a></li>
7103<li><a href="#delete-a-provider-attribute-type">Delete a provider attribute type</a></li>
7104</ol>
7105<h2 id='list-provider-attribute-types'>List provider attribute types</h2><h3 id='list-all-non-retired-provider-attribute-types'>List all non-retired provider attribute types.</h3><pre class="highlight shell_session"><code>GET /providerattributetype?q="Search Query"
7106</code></pre>
7107<p>Quickly filter provider attribute types with a given search query. Returns a <code>404 Not Found</code> status if the provider attribute type not exists.
7108 If the user is not authenticated or the authenticated user does not have appropriate permissions, a 401 Unauthorized status is returned.</p>
7109<h3 id='query-parameters'>Query Parameters</h3>
7110<table><thead>
7111<tr>
7112<th>Parameter</th>
7113<th>Type</th>
7114<th>Description</th>
7115</tr>
7116</thead><tbody>
7117<tr>
7118<td><em>q</em></td>
7119<td><code>Search Query</code></td>
7120<td>Display Name of provider attribute type.</td>
7121</tr>
7122</tbody></table>
7123<h3 id='list-provider-attribute-type-by-uuid'>List provider attribute type by UUID.</h3><pre class="highlight shell_session"><code>GET /providerattributetype/:target_provider_attribute_type_uuid
7124</code></pre>
7125<p>Retrieve a provider attribute type by its UUID. Returns a <code>404 Not Found</code> status if the provider attribute type not exists.
7126 If the user is not authenticated or the authenticated user does not have appropriate permissions, a 401 Unauthorized status is returned.</p>
7127<h2 id='create-a-provider-attribute-type'>Create a provider attribute type</h2><pre class="highlight shell_session"><code>POST /providerattributetype
7128{
7129 "name": "Provider Location",
7130 "description": "This attribute type will record the loication of the provider",
7131 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
7132 "minOccurs": 0,
7133 "maxOccurs": 1,
7134 "datatypeConfig": "default",
7135 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
7136 "handlerConfig": "dafault"
7137}
7138</code></pre>
7139<ul>
7140<li>To Create a provider attribute type, you need to specify below attributes in the request body. If user not authenticated or
7141the authenticated user does not have appropriate permissions, a 401 Unauthorized status is returned.</li>
7142</ul>
7143<h3 id='attributes'>Attributes</h3>
7144<table><thead>
7145<tr>
7146<th>Parameter</th>
7147<th>Type</th>
7148<th>Description</th>
7149</tr>
7150</thead><tbody>
7151<tr>
7152<td><em>name</em></td>
7153<td><code>String</code></td>
7154<td>Name of the provider attribute type (Required)</td>
7155</tr>
7156<tr>
7157<td><em>description</em></td>
7158<td><code>String</code></td>
7159<td>Description (Required)</td>
7160</tr>
7161<tr>
7162<td><em>datatypeClassname</em></td>
7163<td><code>CustomDataType Resource</code></td>
7164<td>Data type for the attribute type resource. OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
7165</tr>
7166<tr>
7167<td><em>minOccurs</em></td>
7168<td><code>Number</code></td>
7169<td>Minimum number of times this value can be specified for a single provider. Use <code>0</code> or <code>1</code> as the default value (Required)</td>
7170</tr>
7171<tr>
7172<td><em>maxOccurs</em></td>
7173<td><code>Number</code></td>
7174<td>Maximum number of times this value can be specified for a single provider (e.g., use 1 to prevent an attribute from being added to a provider multiple times)</td>
7175</tr>
7176<tr>
7177<td><em>preferredHandlerClassname</em></td>
7178<td><code>Handler</code></td>
7179<td>Specifies the Java class to be used when handling this provider attribute type. The java class must implement [<code>CustomDataTypeHandler</code>(https://docs.openmrs.org/doc/org/openmrs/customdatatype/CustomDatatypeHandler.html). If not specified, the system will try to choose the best handler for the chosen datatype.</td>
7180</tr>
7181<tr>
7182<td><em>datatypeConfig</em></td>
7183<td><code>String</code></td>
7184<td>Provides ability to define custom data types configuration for OpenMRS</td>
7185</tr>
7186<tr>
7187<td><em>handlerConfig</em></td>
7188<td><code>String</code></td>
7189<td>Allow handler to be used for more than one attribute type. The actual configuration depends on the needs of the specified handler. For example, a "Pre-defined List" handler could be made to implement a simple selection list, and this configuration would tell the handler the possible choices in the list for this specific attribute type</td>
7190</tr>
7191</tbody></table>
7192<h2 id='update-a-provider-attribute-type'>Update a provider attribute type</h2><pre class="highlight shell_session"><code>POST /providerattributetype/:target_provider_attribute_type_uuid
7193{
7194 "name": "Provider Location",
7195 "description": "This attribute type will record the loication of the provider",
7196 "datatypeClassname": "org.openmrs.customdatatype.datatype.LongFreeTextDatatype",
7197 "minOccurs": 0,
7198 "maxOccurs": 2,
7199 "datatypeConfig": "default",
7200 "preferredHandlerClassname": "org.openmrs.web.attribute.handler.LongFreeTextTextareaHandler",
7201 "handlerConfig": "dafault"
7202}
7203</code></pre>
7204<ul>
7205<li> Update a target provider attribute type with given UUID, this method only modifies properties in the request. Returns a <code>404 Not Found</code>
7206status if the provider attribute not exists. If the user is not authenticated or the authenticated user does not have appropriate permissions, a 401 Unauthorized status is returned.</li>
7207</ul>
7208<h3 id='attributes-2'>Attributes</h3>
7209<table><thead>
7210<tr>
7211<th>Parameter</th>
7212<th>Type</th>
7213<th>Description</th>
7214</tr>
7215</thead><tbody>
7216<tr>
7217<td><em>name</em></td>
7218<td><code>String</code></td>
7219<td>Name of the provider attribute type</td>
7220</tr>
7221<tr>
7222<td><em>description</em></td>
7223<td><code>String</code></td>
7224<td>Description (Required)</td>
7225</tr>
7226<tr>
7227<td><em>datatypeClassname</em></td>
7228<td><code>CustomDataType Resource</code></td>
7229<td>Data type for the attribute type resource. OpenMRS provides <strong>Custom data type resource</strong> which gives flexibility to select the data type accordingly (Required)</td>
7230</tr>
7231<tr>
7232<td><em>minOccurs</em></td>
7233<td><code>Number</code></td>
7234<td>Minimum number of times this value can be specified for a single provider. Use <code>0</code> or <code>1</code> as the default value (Required)</td>
7235</tr>
7236<tr>
7237<td><em>maxOccurs</em></td>
7238<td><code>Number</code></td>
7239<td>Maximum number of times this value can be specified for a single provider (e.g., use 1 to prevent an attribute from being added to a provider multiple times)</td>
7240</tr>
7241<tr>
7242<td><em>preferredHandlerClassname</em></td>
7243<td><code>Handler</code></td>
7244<td>Specifies the Java class to be used when handling this provider attribute type. The java class must implement [<code>CustomDataTypeHandler</code>(https://docs.openmrs.org/doc/org/openmrs/customdatatype/CustomDatatypeHandler.html). If not specified, the system will try to choose the best handler for the chosen datatype.</td>
7245</tr>
7246<tr>
7247<td><em>datatypeConfig</em></td>
7248<td><code>String</code></td>
7249<td>Provides ability to define custom data types configuration for openMRS</td>
7250</tr>
7251<tr>
7252<td><em>handlerConfig</em></td>
7253<td><code>String</code></td>
7254<td>Allow handler to be used for more than one attribute type. The actual configuration depends on the needs of the specified handler. For example, a "Pre-defined List" handler could be made to implement a simple selection list, and this configuration would tell the handler the possible choices in the list for this specific attribute type</td>
7255</tr>
7256</tbody></table>
7257<h2 id='delete-a-provider-attribute-type'>Delete a provider attribute type</h2><pre class="highlight shell_session"><code>DELETE /providerattributetype/:target_provider_attribute_type_uuid?purge=true
7258</code></pre>
7259<ul>
7260<li><p>Delete or Retire a provider attribute type by its UUID. Returns a <code>404 Not Found</code> status if the provider attribute type not exists. If the user is not authenticated or the authenticated user does not have appropriate permissions, a 401 Unauthorized status is returned.</p>
7261<h3 id='query-parameters-2'>Query Parameters</h3>
7262<table><thead>
7263<tr>
7264<th>Parameter</th>
7265<th>Type</th>
7266<th>Description</th>
7267</tr>
7268</thead><tbody>
7269<tr>
7270<td><em>purge</em></td>
7271<td><code>Boolean</code></td>
7272<td>The resource will be retired unless purge = ‘true’.Purging will attempt to remove the attribute type from the system irreversibly. Attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
7273</tr>
7274</tbody></table></li>
7275</ul>
7276<h1 id='observations'>Observations</h1><h2 id='observations-overview'>Observations Overview</h2>
7277<p>Observation is one piece of information recorded about a person at the moment in time.</p>
7278
7279<p>Every observation has a Concept as its question and depending on the datatype of the concept, it has a value that is a number, date, text, Concept, etc.</p>
7280
7281<p>Most of the information you store in OpenMRS is in the form of Observations, and most Observations happen in an Encounter. When you enter a form in OpenMRS, typically one Encounter is created with anywhere between tens or hundreds of Observations.</p>
7282
7283<p>Note that individual Observation is valid only at one moment in time, and it does not carry forward. You may query the system for the last observation for pregnancy status, but this does not tell you whether or not the patient is pregnant at any point after the moment of that observation.</p>
7284
7285<p>Examples of observations include Serum Creatinine of 0.9mg/dL or a Review of the cardiopulmonary system is normal.</p>
7286<h2 id='available-operations-for-observations'>Available operations for Observations.</h2>
7287<ol>
7288<li><a href="#list-observations">List observations</a></li>
7289<li><a href="#create-an-observation">Create an observation</a></li>
7290<li><a href="#update-an-observation">Update an observation</a></li>
7291<li><a href="#delete-an-observation">Delete an observation</a></li>
7292</ol>
7293<h2 id='list-observations'>List observations</h2><h3 id='list-all-observations'>List all observations.</h3><pre class="highlight shell_session"><code>GET /obs?patient=070f0120-0283-4858-885d-a20d967729cf"
7294</code></pre>
7295<p>Quickly filter observations with given query parameters.
7296If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7297<h3 id='query-parameters'>Query Parameters</h3>
7298<table><thead>
7299<tr>
7300<th>Parameter</th>
7301<th>Type</th>
7302<th>Description</th>
7303</tr>
7304</thead><tbody>
7305<tr>
7306<td><em>patient</em></td>
7307<td><code>target_patient_uuid</code></td>
7308<td>patient resource UUID</td>
7309</tr>
7310<tr>
7311<td><em>concept</em></td>
7312<td><code>target_concept_uuid</code></td>
7313<td>concept resource UUID (this parameter to be used with patient)</td>
7314</tr>
7315</tbody></table>
7316<h3 id='query-observations-by-uuid'>Query observations by UUID.</h3><pre class="highlight shell_session"><code>GET /obs/:target_observation_uuid
7317</code></pre>
7318<p>Retrieve an observation by its UUID.
7319If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7320<h2 id='create-an-observation'>Create an observation</h2><pre class="highlight shell_session"><code>POST /obs
7321{
7322 "person": "070f0120-0283-4858-885d-a20d967729cf",
7323 "concept": "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
7324 "obsDatetime": "2019-11-14T07:37:31.000+0000",
7325 "value": 70
7326}
7327</code></pre>
7328<ul>
7329<li><p>To Create an observation, you need to specify below attributes in the request body. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7330<h3 id='attributes'>Attributes</h3>
7331<table><thead>
7332<tr>
7333<th>Parameter</th>
7334<th>Type</th>
7335<th>Description</th>
7336</tr>
7337</thead><tbody>
7338<tr>
7339<td><em>person</em></td>
7340<td><code>Person UUID</code></td>
7341<td>the Person this Obs is acting on.</td>
7342</tr>
7343<tr>
7344<td><em>obsDateTime</em></td>
7345<td><code>String</code></td>
7346<td>The type of <code>obsDateTime</code> is an "ISO 8601 timestamp"</td>
7347</tr>
7348<tr>
7349<td><em>concept</em></td>
7350<td><code>Concept UUID</code></td>
7351<td>the coded value/name given to an obs when it is made.</td>
7352</tr>
7353<tr>
7354<td><em>location</em></td>
7355<td><code>Location UUID</code></td>
7356<td>the location this Obs took place (was taken).</td>
7357</tr>
7358<tr>
7359<td><em>order</em></td>
7360<td><code>String</code></td>
7361<td>the order of an Obs.</td>
7362</tr>
7363<tr>
7364<td><em>encounter</em></td>
7365<td><code>Encounter UUID</code></td>
7366<td>what obs are collected and grouped together into. An encounter is a visit.</td>
7367</tr>
7368<tr>
7369<td><em>accessionNumber</em></td>
7370<td><code>String</code></td>
7371<td>An identifier used by the fulfiller (e.g., the lab) to identify the specimen or requisition used to produce this observation.</td>
7372</tr>
7373<tr>
7374<td><em>groupMembers</em></td>
7375<td><code>Array[]: Obs</code></td>
7376<td>a list of Obs grouped under this Obs</td>
7377</tr>
7378<tr>
7379<td><em>comment</em></td>
7380<td><code>String</code></td>
7381<td>An option free text comment about the observation.</td>
7382</tr>
7383<tr>
7384<td><em>value</em></td>
7385<td><code>String</code></td>
7386<td>The value for the observation (e.g., the answer to a question or the result of a lab test).</td>
7387</tr>
7388<tr>
7389<td><em>status</em></td>
7390<td><code>String</code></td>
7391<td><code>PRELIMINARY</code>, <code>FINAL</code>, <code>AMENDED</code></td>
7392</tr>
7393<tr>
7394<td><em>interpretation</em></td>
7395<td><code>String</code></td>
7396<td><code>NORMAL</code>, <code>ABNORMAL</code>, <code>CRITICALLY_ABNORMAL</code>, <code>NEGATIVE</code>, <code>POSITIVE</code>,<code>CRITICALLY_LOW</code>, <code>LOW</code>, <code>HIGH</code>, <code>CRITICALLY_HIGH</code>, <code>VERY_SUSCEPTIBLE</code>, <code>SUSCEPTIBLE</code>, <code>INTERMEDIATE</code>, <code>RESISTANT</code>, <code>SIGNIFICANT_CHANGE_DOWN</code>, <code>SIGNIFICANT_CHANGE_UP</code>, <code>OFF_SCALE_LOW</code>, <code>OFF_SCALE_HIGH</code></td>
7397</tr>
7398<tr>
7399<td><em>voided</em></td>
7400<td><code>Boolean</code></td>
7401<td>true if the observation is voided</td>
7402</tr>
7403</tbody></table></li>
7404</ul>
7405<h2 id='update-an-observation'>Update an observation</h2><pre class="highlight shell_session"><code>POST /obs/:uuid_of_obs_to_be_updated
7406{
7407 "value": 71
7408}
7409</code></pre>
7410<ul>
7411<li><p>Update a target obs, this method only modifies properties in the request. Returns <code>404 Not Found</code> status if the observation does not exist.
7412If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7413<h3 id='attributes-2'>Attributes</h3>
7414<table><thead>
7415<tr>
7416<th>Parameter</th>
7417<th>Type</th>
7418<th>Description</th>
7419</tr>
7420</thead><tbody>
7421<tr>
7422<td><em>person</em></td>
7423<td><code>Person UUID</code></td>
7424<td>the Person this Obs is acting on.</td>
7425</tr>
7426<tr>
7427<td><em>obsDateTime</em></td>
7428<td><code>String</code></td>
7429<td>The type of <code>obsDateTime</code> is an "ISO 8601 timestamp"</td>
7430</tr>
7431<tr>
7432<td><em>concept</em></td>
7433<td><code>Concept UUID</code></td>
7434<td>the coded value/name given to an obs when it is made.</td>
7435</tr>
7436<tr>
7437<td><em>location</em></td>
7438<td><code>Location UUID</code></td>
7439<td>the location this Obs took place (was taken).</td>
7440</tr>
7441<tr>
7442<td><em>order</em></td>
7443<td><code>String</code></td>
7444<td>the order of an Obs.</td>
7445</tr>
7446<tr>
7447<td><em>encounter</em></td>
7448<td><code>Encounter UUID</code></td>
7449<td>what obs are collected and grouped together into. An encounter is a visit.</td>
7450</tr>
7451<tr>
7452<td><em>accessionNumber</em></td>
7453<td><code>String</code></td>
7454<td>An identifier used by the fulfiller (e.g., the lab) to identify the specimen or requisition used to produce this observation.</td>
7455</tr>
7456<tr>
7457<td><em>groupMembers</em></td>
7458<td><code>Array[]: Obs</code></td>
7459<td>a list of Obs grouped under this Obs</td>
7460</tr>
7461<tr>
7462<td><em>comment</em></td>
7463<td><code>String</code></td>
7464<td>An option free text comment about the observation.</td>
7465</tr>
7466<tr>
7467<td><em>value</em></td>
7468<td><code>String</code></td>
7469<td>The value for the observation (e.g., the answer to a question or the result of a lab test).</td>
7470</tr>
7471<tr>
7472<td><em>status</em></td>
7473<td><code>String</code></td>
7474<td><code>PRELIMINARY</code>, <code>FINAL</code>, <code>AMENDED</code></td>
7475</tr>
7476<tr>
7477<td><em>interpretation</em></td>
7478<td><code>String</code></td>
7479<td><code>NORMAL</code>, <code>ABNORMAL</code>, <code>CRITICALLY_ABNORMAL</code>, <code>NEGATIVE</code>, <code>POSITIVE</code>,<code>CRITICALLY_LOW</code>, <code>LOW</code>, <code>HIGH</code>, <code>CRITICALLY_HIGH</code>, <code>VERY_SUSCEPTIBLE</code>, <code>SUSCEPTIBLE</code>, <code>INTERMEDIATE</code>, <code>RESISTANT</code>, <code>SIGNIFICANT_CHANGE_DOWN</code>, <code>SIGNIFICANT_CHANGE_UP</code>, <code>OFF_SCALE_LOW</code>, <code>OFF_SCALE_HIGH</code></td>
7480</tr>
7481<tr>
7482<td><em>voided</em></td>
7483<td><code>Boolean</code></td>
7484<td>true if the observation is voided</td>
7485</tr>
7486</tbody></table></li>
7487</ul>
7488<h2 id='delete-an-observation'>Delete an observation</h2><pre class="highlight shell_session"><code>DELETE /obs/:target_obs_uuid?purge=true
7489</code></pre>
7490<ul>
7491<li><p>Delete or void a target observation. Returns <code>404 Not Found</code> status if the observation does not exist.
7492If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7493<h3 id='query-parameters-2'>Query Parameters</h3>
7494<table><thead>
7495<tr>
7496<th>Parameter</th>
7497<th>Type</th>
7498<th>Description</th>
7499</tr>
7500</thead><tbody>
7501<tr>
7502<td><em>purge</em></td>
7503<td><code>Boolean</code></td>
7504<td>The resource will be voided unless purge = ‘true’</td>
7505</tr>
7506</tbody></table></li>
7507</ul>
7508<h1 id='order'>Order</h1><h2 id='order-overview'>Order Overview</h2>
7509<p>An <strong>Order</strong> represents a request from a provider such as a lab test, procedure, referral, etc.</p>
7510
7511<p>For example, a provider could order a Complete Blood Count laboratory panel for a patient.</p>
7512
7513<p>An Order only records an intention, not whether or not the action is carried out. The results of an Order are typically recorded later as Observations.</p>
7514<h2 id='available-operations-for-order-type'>Available operations for Order type.</h2>
7515<ol>
7516<li><a href="#list-orders">List orders</a></li>
7517<li><a href="#create-an-order">Create an order</a></li>
7518<li><a href="#update-an-order">Update an order</a></li>
7519<li><a href="#delete-an-order">Delete an order</a></li>
7520</ol>
7521<h2 id='list-orders'>List orders</h2><pre class="highlight shell_session"><code>GET /order?q=penicillin
7522</code></pre>
7523<ul>
7524<li>Fetch all non-retired orders that match any specified parameters otherwise fetch all non-retired orders.
7525If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</li>
7526</ul>
7527<h3 id='query-parameters'>Query Parameters</h3>
7528<table><thead>
7529<tr>
7530<th>Parameter</th>
7531<th>Type</th>
7532<th>Description</th>
7533</tr>
7534</thead><tbody>
7535<tr>
7536<td><em>q</em></td>
7537<td><code>String</code></td>
7538<td>Full or partial display name of order</td>
7539</tr>
7540</tbody></table>
7541<h3 id='get-a-particular-order'>Get a particular order</h3><pre class="highlight shell_session"><code>GET /order/:target_order_uuid
7542</code></pre>
7543<p>Retrieve a particular order. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7544<h2 id='create-an-order'>Create an order</h2><pre class="highlight shell_session"><code>POST /order
7545{
7546 "encounter": "69f83020-caf2-4c9e-bca7-89b8e62b52e1",
7547 "action": "new",
7548 "urgency": "ROUTINE",
7549 "patient": "070f0120-0283-4858-885d-a20d967729cf",
7550 "dateActivated": "2018-10-16 12:08:43"
7551}
7552</code></pre>
7553<ul>
7554<li><p>To create a role, you need to specify below attributes in the request body. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7555<h3 id='attributes'>Attributes</h3>
7556<table><thead>
7557<tr>
7558<th>Parameter</th>
7559<th>Type</th>
7560<th>Description</th>
7561</tr>
7562</thead><tbody>
7563<tr>
7564<td><em>encounter</em></td>
7565<td><code>Encounter UUID</code></td>
7566<td>the encounter for this order</td>
7567</tr>
7568<tr>
7569<td><em>orderType</em></td>
7570<td><code>OrderType UUID</code></td>
7571<td>the type of the order</td>
7572</tr>
7573<tr>
7574<td><em>action</em></td>
7575<td><code>String</code></td>
7576<td>Possible actions are <code>NEW</code> (placing a new order), <code>REVISE</code> (revising an existing order), <code>DISCONTINUE</code> (request an active order to be stopped),<code>RENEW</code> (resume a prior order).</td>
7577</tr>
7578<tr>
7579<td><em>accessionNumber</em></td>
7580<td><code>String</code></td>
7581<td>An optional identifier from the fulfiller (e.g., lab system) for the specimen or record associated with the order.</td>
7582</tr>
7583<tr>
7584<td><em>patient</em></td>
7585<td><code>Patient UUID</code></td>
7586<td>the patient for the order</td>
7587</tr>
7588<tr>
7589<td><em>concept</em></td>
7590<td><code>Concept UUID</code></td>
7591<td>UUID for the concept of the order; the item being requested (e.g., "serum creatinine")</td>
7592</tr>
7593<tr>
7594<td><em>previousNumber</em></td>
7595<td><code>String</code></td>
7596<td>when orders are revised, this links to the previous revision of the order</td>
7597</tr>
7598<tr>
7599<td><em>instructions</em></td>
7600<td><code>String</code></td>
7601<td>the instructions for the order</td>
7602</tr>
7603<tr>
7604<td><em>urgency</em></td>
7605<td><code>Urgency</code></td>
7606<td><code>ROUTINE</code> (carry out order according to standard procedures),</td>
7607</tr>
7608</tbody></table>
7609
7610<p><code>STAT</code> (carry out order immediately), <code>ON_SCHEDULED_DATE</code>
7611(carry out order at a specific time)
7612<em>dateActivated</em> | <code>Date</code> | the start date of the order
7613<em>dateStopped</em> | <code>Date</code> | the date of discontinuation</p></li>
7614</ul>
7615<h2 id='update-an-order'>Update an order</h2><pre class="highlight shell_session"><code>POST /order/:target_order_uuid
7616{
7617 "encounter": "69f83020-caf2-4c9e-bca7-89b8e62b52e1",
7618 "action": "new",
7619 "urgency": "ROUTINE",
7620 "patient": "070f0120-0283-4858-885d-a20d967729cf",
7621 "dateStopped": "2019-03-12 11:48:23"
7622}
7623</code></pre>
7624<ul>
7625<li><p>Update an order with given UUID, this method only modifies properties in the request. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
7626<h3 id='attributes-2'>Attributes</h3>
7627<table><thead>
7628<tr>
7629<th>Parameter</th>
7630<th>Type</th>
7631<th>Description</th>
7632</tr>
7633</thead><tbody>
7634<tr>
7635<td><em>encounter</em></td>
7636<td><code>Encounter UUID</code></td>
7637<td>the encounter for this order</td>
7638</tr>
7639<tr>
7640<td><em>orderType</em></td>
7641<td><code>OrderType UUID</code></td>
7642<td>the type of the order</td>
7643</tr>
7644<tr>
7645<td><em>action</em></td>
7646<td><code>String</code></td>
7647<td>Possible actions are <code>NEW</code> (placing a new order), <code>REVISE</code> (revising an existing order), <code>DISCONTINUE</code> (request an active order to be stopped),<code>RENEW</code> (resume a prior order).</td>
7648</tr>
7649<tr>
7650<td><em>accessionNumber</em></td>
7651<td><code>String</code></td>
7652<td>An optional identifier from the fulfiller (e.g., lab system) for the specimen or record associated with the order.</td>
7653</tr>
7654<tr>
7655<td><em>patient</em></td>
7656<td><code>Patient UUID</code></td>
7657<td>the patient for the order</td>
7658</tr>
7659<tr>
7660<td><em>concept</em></td>
7661<td><code>Concept UUID</code></td>
7662<td>UUID for the concept of the order; the item being requested (e.g., "serum creatinine")</td>
7663</tr>
7664<tr>
7665<td><em>previousNumber</em></td>
7666<td><code>String</code></td>
7667<td>when orders are revised, this links to the previous revision of the order</td>
7668</tr>
7669<tr>
7670<td><em>instructions</em></td>
7671<td><code>String</code></td>
7672<td>the instructions for the order</td>
7673</tr>
7674<tr>
7675<td><em>urgency</em></td>
7676<td><code>Urgency</code></td>
7677<td><code>ROUTINE</code> (carry out order according to standard procedures),</td>
7678</tr>
7679</tbody></table>
7680
7681<p><code>STAT</code> (carry out order immediately), <code>ON_SCHEDULED_DATE</code>
7682(carry out order at a specific time)
7683<em>dateActivated</em> | <code>Date</code> | the start date of the order
7684<em>dateStopped</em> | <code>Date</code> | the date of discontinuation</p></li>
7685</ul>
7686<h2 id='delete-an-order'>Delete an order</h2><pre class="highlight shell_session"><code>DELETE /order/:target_order_uuid?purge=true
7687</code></pre>
7688<ul>
7689<li><p>Delete or void an order by its UUID. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7690<h3 id='query-parameters-2'>Query Parameters</h3>
7691<table><thead>
7692<tr>
7693<th>Parameter</th>
7694<th>Type</th>
7695<th>Description</th>
7696</tr>
7697</thead><tbody>
7698<tr>
7699<td><em>purge</em></td>
7700<td><code>Boolean</code></td>
7701<td>The resource will be voided unless purge = ‘true’.Purging will attempt to remove the attribute type from the system irreversibly. Attribute types that have been used (i.e., are referenced from existing data) cannot be purged.</td>
7702</tr>
7703</tbody></table></li>
7704</ul>
7705<h1 id='order-type'>Order type</h1><h2 id='order-type-overview'>Order type Overview</h2>
7706<ul>
7707<li><p>Orders represent requests from providers for some action to care for a patient.
7708Common types of orders are prescriptions (drug orders), lab tests, radiology tests,
7709procedures and referrals.</p></li>
7710<li><p>In nearly all cases, handling different types of orders requires specific behavior of the application. The OpenMRS platform is designed to handle certain types of orders.
7711Adding new order types will usually only happen when new features to handle the
7712new order type are also being added to the system (using a module or app).</p></li>
7713</ul>
7714<h2 id='available-operations-for-order-type'>Available operations for Order type.</h2>
7715<ol>
7716<li><a href="#list-orders">List orders</a></li>
7717<li><a href="#create-an-order">Create an order</a></li>
7718<li><a href="#update-an-order">Update an order</a></li>
7719<li><a href="#delete-an-order">Delete an order</a></li>
7720</ol>
7721<h2 id='list-orders'>List orders</h2><pre class="highlight shell_session"><code>GET /ordertype
7722</code></pre>
7723<ul>
7724<li>Fetch all non-retired order types that match any specified parameters otherwise fetch all non-retired order types. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</li>
7725</ul>
7726<h3 id='get-a-particular-order-type'>Get a particular order type</h3><pre class="highlight shell_session"><code>GET /ordertype/:target_ordertype_uuid
7727</code></pre>
7728<p>Retrieve a particular order.
7729If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</p>
7730<h2 id='create-an-order-type'>Create an order type</h2><pre class="highlight shell_session"><code>POST /ordertype
7731{
7732 "name": "drug order",
7733 "description": "One 500mg tablet of Ciprofloxacin, twice a day",
7734 "parent": "070f0120-0283-4858-885d-a20d967729cf",
7735}
7736</code></pre>
7737<ul>
7738<li><p>Order types depend on code within the application to properly handle them, so it would be unusual to create a new order type unless some new code (e.g., a module) has been added to the system to handle the new order type.</p>
7739<h4 id='attributes'>Attributes</h4>
7740<table><thead>
7741<tr>
7742<th>Parameter</th>
7743<th>Type</th>
7744<th>Description</th>
7745</tr>
7746</thead><tbody>
7747<tr>
7748<td><em>name</em></td>
7749<td><code>String</code></td>
7750<td>the name of the order type</td>
7751</tr>
7752<tr>
7753<td><em>description</em></td>
7754<td><code>String</code></td>
7755<td>the description of the order type</td>
7756</tr>
7757<tr>
7758<td><em>javaClassName</em></td>
7759<td><code>Java Class</code></td>
7760<td>the java class</td>
7761</tr>
7762<tr>
7763<td><em>parent</em></td>
7764<td><code>Order UUID</code></td>
7765<td>the order uuid</td>
7766</tr>
7767<tr>
7768<td><em>conceptClasses</em></td>
7769<td><code>Array[] : Concept UUID</code></td>
7770<td>classes of concepts that can be used to generate an order of this type</td>
7771</tr>
7772</tbody></table></li>
7773</ul>
7774<h2 id='update-an-order-type'>Update an order type</h2><pre class="highlight shell_session"><code>POST /ordertype/:target_ordertype_uuid
7775{
7776 "name": "drug order",
7777 "description": "One 400mg tablet of Ciprofloxacin, twice a day"
7778}
7779</code></pre>
7780<ul>
7781<li><p>Update an order type with given UUID, this method only modifies properties in the request. If the user not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
7782<h3 id='attributes-2'>Attributes</h3>
7783<table><thead>
7784<tr>
7785<th>Parameter</th>
7786<th>Type</th>
7787<th>Description</th>
7788</tr>
7789</thead><tbody>
7790<tr>
7791<td><em>name</em></td>
7792<td><code>String</code></td>
7793<td>the name of the order type</td>
7794</tr>
7795<tr>
7796<td><em>description</em></td>
7797<td><code>String</code></td>
7798<td>the description of the order type</td>
7799</tr>
7800<tr>
7801<td><em>javaClassName</em></td>
7802<td><code>Java Class</code></td>
7803<td>the java class</td>
7804</tr>
7805<tr>
7806<td><em>parent</em></td>
7807<td><code>Order UUID</code></td>
7808<td>the order uuid</td>
7809</tr>
7810<tr>
7811<td><em>conceptClasses</em></td>
7812<td><code>Array[] : Concept UUID</code></td>
7813<td>classes of concepts that can be used to generate an order of this type</td>
7814</tr>
7815</tbody></table></li>
7816</ul>
7817<h2 id='delete-an-order-type'>Delete an order type</h2><pre class="highlight shell_session"><code>DELETE /ordertype/:target_ordertype_uuid
7818</code></pre>
7819<ul>
7820<li>Delete or retire an order type by its UUID. If not authenticated or authenticated user does not have sufficient privileges, a <code>401 Unauthorized</code> status is returned.</li>
7821</ul>
7822<h1 id='forms'>Forms</h1><h2 id='forms-overview'>Forms Overview</h2>
7823<ul>
7824<li>Forms in OpenMRS can be thought of as data collecting tools, which help in collecting patient data during an encounter with the patient (sometimes even after the encounter is over).</li>
7825<li>The concept dictionary is a central part of OpenMRS. Concepts can commonly be thought of as questions and possible answers which are present on forms.</li>
7826<li>Forms in OpenMRS can be of many types, e.g.,In almost all the instances observation forms which help in capturing observations during an encounter (like admission,Vitals e.t.c)</li>
7827</ul>
7828<h2 id='subresource-types-of-forms'>Subresource types of Forms</h2><h3 id='formfields'>formFields</h3>
7829<ul>
7830<li>The FormField relates to the fields present on a form. A form can have many 0 or more fields associated with it in a hierarchical manner.</li>
7831<li>formFields can be used for persisting concepts like the date of collection, patient demographics, medications, allergies, and clinical observations</li>
7832</ul>
7833<h2 id='available-operations-for-forms'>Available operations for Forms</h2>
7834<ol>
7835<li> <a href="#search-forms">List Forms</a></li>
7836<li> <a href="#create-a-form">Create a form</a> </li>
7837<li> <a href="#update-a-form">Update a form</a></li>
7838<li> <a href="#delete-a-form">Delete a form</a></li>
7839<li> <a href="#list-formfields">List formfields</a></li>
7840<li> <a href="#create-formfield-subresource-with-properties">Create formFields subresource with properties</a></li>
7841<li> <a href="#update-formfields-subresource-with-properties">Update formFields subresource with properties</a></li>
7842<li> <a href="#delete-formfields-subresource-with-properties">Delete formFields subresource with properties</a></li>
7843</ol>
7844<h2 id='list-forms'>List Forms</h2><h3 id='search-forms'>search-forms</h3><pre class="highlight shell_session"><code>GET /form?
7845</code></pre>
7846<p>Fetch all non-retired Forms that match any specified parameters otherwise fetch all non-retired forms. Returns a <code>200 OK</code> status with the form response,
7847 and returns a <code>401</code> response when the user is not logged in. </p>
7848<h3 id='query-parameters'>Query Parameters</h3>
7849<table><thead>
7850<tr>
7851<th>Parameter</th>
7852<th>Description</th>
7853</tr>
7854</thead><tbody>
7855<tr>
7856<td><em>limit</em></td>
7857<td>use this parameter to limit the number of results to be returned</td>
7858</tr>
7859<tr>
7860<td><em>startIndex</em></td>
7861<td>the offset where to start the query</td>
7862</tr>
7863<tr>
7864<td><em>v</em></td>
7865<td>the required representation to return (i.e., ref, default, full or custom )</td>
7866</tr>
7867<tr>
7868<td><em>q</em></td>
7869<td>the search query</td>
7870</tr>
7871</tbody></table>
7872<h3 id='list-forms-by-uuid'>List forms by UUID</h3><pre class="highlight shell_session"><code>GET /form/:target_form_uuid
7873</code></pre>
7874<p>Retrieve a form by its UUID. Returns a <code>404 Not Found</code> status if the form does not exist in the system. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
7875<h3 id='query-parameters-2'>Query Parameters</h3>
7876<table><thead>
7877<tr>
7878<th>Parameter</th>
7879<th>Description</th>
7880</tr>
7881</thead><tbody>
7882<tr>
7883<td><em>v</em></td>
7884<td>the required representation to return (i.e. ref, default, full or custom )</td>
7885</tr>
7886<tr>
7887<td><em>uuid</em></td>
7888<td>the target form UUID</td>
7889</tr>
7890</tbody></table>
7891<h2 id='create-a-form'>Create-a-form</h2><pre class="highlight shell_session"><code>POST /form
7892{
7893 "name": "Admission",
7894 "description": "dummy description",
7895 "version": "1.0",
7896 "encounterType": "Vitals",
7897 "published": true,
7898 "formFields": [
7899 "medication","allergies"
7900 ],
7901 "xslt": "xslt specification for this form",
7902 "template": "dummy template"
7903}
7904</code></pre>
7905<ul>
7906<li><p>To create a Form, you need to specify the below properties in the request. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status is returned.</p>
7907<h3 id='properties'>Properties</h3>
7908<table><thead>
7909<tr>
7910<th>Parameter</th>
7911<th>Type</th>
7912<th>Description</th>
7913</tr>
7914</thead><tbody>
7915<tr>
7916<td><em>name</em></td>
7917<td><code>String</code></td>
7918<td>name of the form resource to be created</td>
7919</tr>
7920<tr>
7921<td><em>description</em></td>
7922<td><code>String</code></td>
7923<td>description of the form resource to be created</td>
7924</tr>
7925<tr>
7926<td><em>version</em></td>
7927<td><code>String</code></td>
7928<td>current version of the form resource to be created</td>
7929</tr>
7930<tr>
7931<td><em>encouterType</em></td>
7932<td><code>String</code></td>
7933<td>the specific encounter type where this form is designed to collect data</td>
7934</tr>
7935<tr>
7936<td><em>published</em></td>
7937<td><code>boolean</code></td>
7938<td>whether the form has been published or not</td>
7939</tr>
7940<tr>
7941<td><em>formFields</em></td>
7942<td><code>Array[]: formFields</code></td>
7943<td>list of formFields associated with this form</td>
7944</tr>
7945<tr>
7946<td><em>xslt</em></td>
7947<td><code>String</code></td>
7948<td>specifying XSLT description for the form if it supports XSLT transformations</td>
7949</tr>
7950<tr>
7951<td><em>template</em></td>
7952<td><code>String</code></td>
7953<td>template of the form to be created</td>
7954</tr>
7955</tbody></table></li>
7956</ul>
7957<h2 id='update-a-form'>Update a form</h2><pre class="highlight shell_session"><code>POST /form/:target_form_uuid
7958{
7959 "name": "Admission",
7960 "description": "dummy description",
7961 "version": "1.0",
7962 "encounterType": "Vitals",
7963 "published": true,
7964 "formFields": [
7965 "medication","allergies"
7966 ],
7967 "xslt": "xslt specification for this form",
7968 "template": "dummy template"
7969}
7970</code></pre>
7971<ul>
7972<li><p>Update a target Form with given UUID, this method only modifies properties in the request.
7973Returns a <code>404 Not Found</code> status if form not exists. If the user is not logged in to perform this action, a <code>401 Unauthorized status returned</code>.</p>
7974<h3 id='query-parameters-3'>Query Parameters</h3>
7975<table><thead>
7976<tr>
7977<th>Parameter</th>
7978<th>Type</th>
7979<th>Description</th>
7980</tr>
7981</thead><tbody>
7982<tr>
7983<td><em>uuid</em></td>
7984<td><code>target_form_uuid</code></td>
7985<td>Target form resource UUID</td>
7986</tr>
7987</tbody></table>
7988<h3 id='properties-2'>Properties</h3>
7989<table><thead>
7990<tr>
7991<th>Parameter</th>
7992<th>Type</th>
7993<th>Description</th>
7994</tr>
7995</thead><tbody>
7996<tr>
7997<td><em>name</em></td>
7998<td><code>String</code></td>
7999<td>name of the form resource to be created</td>
8000</tr>
8001<tr>
8002<td><em>description</em></td>
8003<td><code>String</code></td>
8004<td>description of the form resource to be created</td>
8005</tr>
8006<tr>
8007<td><em>version</em></td>
8008<td><code>String</code></td>
8009<td>current version of the form resource to be created</td>
8010</tr>
8011<tr>
8012<td><em>encouterType</em></td>
8013<td><code>String</code></td>
8014<td>the specific encounter type where this form is designed to collect data</td>
8015</tr>
8016<tr>
8017<td><em>published</em></td>
8018<td><code>boolean</code></td>
8019<td>whether the form has been published or not</td>
8020</tr>
8021<tr>
8022<td><em>formFields</em></td>
8023<td><code>Array[]: formFields</code></td>
8024<td>list of formFields associated with this form</td>
8025</tr>
8026<tr>
8027<td><em>xslt</em></td>
8028<td><code>String</code></td>
8029<td>specifying XSLT description for the form if it supports XSLT transformations</td>
8030</tr>
8031<tr>
8032<td><em>template</em></td>
8033<td><code>String</code></td>
8034<td>template of the form to be created</td>
8035</tr>
8036</tbody></table></li>
8037</ul>
8038<h2 id='delete-a-form'>Delete a form</h2><pre class="highlight shell_session"><code>DELETE /form/:target_form_uuid?purge=true
8039</code></pre>
8040<ul>
8041<li><p>Delete or retire a target form by its UUID. Returns a <code>404 Not Found</code> status if the form does not exist. If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
8042<h3 id='query-parameters-4'>Query Parameters</h3>
8043<table><thead>
8044<tr>
8045<th>Parameter</th>
8046<th>Type</th>
8047<th>Description</th>
8048</tr>
8049</thead><tbody>
8050<tr>
8051<td><strong>uuid</strong></td>
8052<td><code>String</code></td>
8053<td>uuid to delete</td>
8054</tr>
8055<tr>
8056<td><em>purge</em></td>
8057<td><code>Boolean</code></td>
8058<td>The form will be voided/retired unless purge = 'true'</td>
8059</tr>
8060</tbody></table></li>
8061</ul>
8062<h2 id='list-formfields'>List formfields</h2><h3 id='list-all-formfields-subresources-for-a-form'>List all formFields subresources for a form.</h3><pre class="highlight shell_session"><code>GET /form/:target_form_uuid/formFields
8063</code></pre>
8064<p>Retrieve all formFields subresources of a form resource by <code>target_form_uuid</code>. Returns a <code>404 Not Found</code> status if formFields not exist. If the user is not logged in to perform this action, a <code>401 unauthorized</code> status returned.</p>
8065<h3 id='list-formfields-subresource-by-its-uuid-and-parent-form-uuid'>List formFields subresource by its UUID and parent form UUID.</h3><pre class="highlight shell_session"><code>GET /form/:target_form_uuid/formFields/:target_formFields_uuid
8066</code></pre>
8067<p>Retrieve a formFields subresources of a form resource. Returns a <code>404 Not Found</code> status if formFields does not exist. If you are not logged in to perform this action, a <code>401 Unauthorized</code> status returned. </p>
8068<h2 id='create-formfield-subresource-with-properties'>create formfield subresource with properties</h2><pre class="highlight shell_session"><code>POST form/:target_form_uuid/formFields
8069{
8070 form: "UUID",
8071 field: "UUID",
8072 required: false,
8073 parent: "UUID",
8074 fieldNumber: 2,
8075 fieldPart: "4",
8076 pageNumber: 1,
8077 minOccurs: 0,
8078 maxOccurs: 1,
8079 sortWeight: false
8080}
8081</code></pre>
8082<ul>
8083<li><p>To create a formFields subresource for a specific form resource, you need to specify below properties in your request body.
8084If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
8085<h3 id='query-parameter'>Query parameter</h3>
8086<table><thead>
8087<tr>
8088<th>Parameter</th>
8089<th>Description</th>
8090</tr>
8091</thead><tbody>
8092<tr>
8093<td><code>target_form_uuid</code></td>
8094<td>form resource uuid</td>
8095</tr>
8096</tbody></table>
8097<h3 id='properties-for-resource'>Properties for resource</h3>
8098<table><thead>
8099<tr>
8100<th>Parameter</th>
8101<th>Type</th>
8102<th>Description</th>
8103</tr>
8104</thead><tbody>
8105<tr>
8106<td><em>form</em></td>
8107<td><code>String</code></td>
8108<td>UUID of the parent form resource</td>
8109</tr>
8110<tr>
8111<td><em>field</em></td>
8112<td><code>String</code></td>
8113<td>UUID of the formField to be created for the parent form</td>
8114</tr>
8115<tr>
8116<td><em>required</em></td>
8117<td><code>String</code></td>
8118<td>if this field is required for the form to be submitted or not</td>
8119</tr>
8120<tr>
8121<td><em>parent</em></td>
8122<td><code>String</code></td>
8123<td>parent form of this formField</td>
8124</tr>
8125<tr>
8126<td><em>fieldNumber</em></td>
8127<td><code>integer</code></td>
8128<td>the number specified to this field in form</td>
8129</tr>
8130<tr>
8131<td><em>fieldPart</em></td>
8132<td><code>String</code></td>
8133<td>the part specified to this field (like 1.4) here 4 is the field part and 1 is the field number.</td>
8134</tr>
8135<tr>
8136<td><em>PageNumber</em></td>
8137<td><code>String</code></td>
8138<td>the page number where this field appears on the form</td>
8139</tr>
8140<tr>
8141<td><em>minOccurs</em></td>
8142<td><code>integer</code></td>
8143<td>the minimum number of times this field appears on the form</td>
8144</tr>
8145<tr>
8146<td><em>maxOccurs</em></td>
8147<td><code>integer</code></td>
8148<td>the maximum number of times this field appears on the form</td>
8149</tr>
8150<tr>
8151<td><em>sortWeight</em></td>
8152<td><code>boolean</code></td>
8153<td>do we order this field or not, when this field will be searched for</td>
8154</tr>
8155</tbody></table></li>
8156</ul>
8157<h2 id='update-formfields-subresource-with-properties'>Update formFields subresource with properties</h2><pre class="highlight shell_session"><code>POST form/:target_form_uuid/formFields/:target_formFields_uuid
8158{
8159 form: "UUID",
8160 field: "UUID",
8161 required: false,
8162 parent: "UUID",
8163 fieldNumber: 2,
8164 fieldPart: "4",
8165 pageNumber: 1,
8166 minOccurs: 0,
8167 maxOccurs: 1,
8168 sortWeight: false
8169}
8170</code></pre>
8171<ul>
8172<li><p>Updates a formFields subresource value with given UUID. This method will only modify the value of the subresource. Returns a <code>404 Not Found</code> status if attribute not exists. If user not logged in to perform this action, a <code>401 Unauthorized</code> status
8173returned.</p>
8174<h3 id='query-parameter-2'>Query parameter</h3>
8175<table><thead>
8176<tr>
8177<th>Parameter</th>
8178<th>Description</th>
8179</tr>
8180</thead><tbody>
8181<tr>
8182<td><code>target_form_uuid</code></td>
8183<td>form resource uuid</td>
8184</tr>
8185<tr>
8186<td><code>target_formFields_uuid</code></td>
8187<td>formFields subresource uuid</td>
8188</tr>
8189</tbody></table>
8190<h3 id='properties-3'>Properties</h3>
8191<table><thead>
8192<tr>
8193<th>Parameter</th>
8194<th>Type</th>
8195<th>Description</th>
8196</tr>
8197</thead><tbody>
8198<tr>
8199<td><em>form</em></td>
8200<td><code>String</code></td>
8201<td>UUID of the parent form resource</td>
8202</tr>
8203<tr>
8204<td><em>field</em></td>
8205<td><code>String</code></td>
8206<td>UUID of the formField to be created for the parent form</td>
8207</tr>
8208<tr>
8209<td><em>required</em></td>
8210<td><code>String</code></td>
8211<td>if this field is required for the form to be submitted or not</td>
8212</tr>
8213<tr>
8214<td><em>parent</em></td>
8215<td><code>String</code></td>
8216<td>parent form of this formField</td>
8217</tr>
8218<tr>
8219<td><em>fieldNumber</em></td>
8220<td><code>integer</code></td>
8221<td>the number specified to this field in form</td>
8222</tr>
8223<tr>
8224<td><em>fieldPart</em></td>
8225<td><code>String</code></td>
8226<td>the part specified to this field (like 1.4) here 4 is the field part and 1 is the field number.</td>
8227</tr>
8228<tr>
8229<td><em>PageNumber</em></td>
8230<td><code>String</code></td>
8231<td>the page number where this field appears on the form</td>
8232</tr>
8233<tr>
8234<td><em>minOccurs</em></td>
8235<td><code>integer</code></td>
8236<td>the minimum number of times this field appears on the form</td>
8237</tr>
8238<tr>
8239<td><em>maxOccurs</em></td>
8240<td><code>integer</code></td>
8241<td>the maximum number of times this field appears on the form</td>
8242</tr>
8243<tr>
8244<td><em>sortWeight</em></td>
8245<td><code>boolean</code></td>
8246<td>do we order this field or not, when this field will be searched for</td>
8247</tr>
8248</tbody></table></li>
8249</ul>
8250<h2 id='delete-formfields-subresource-with-properties'>Delete formFields subresource with properties</h2><pre class="highlight shell_session"><code>DELETE /form/:target_form_uuid/formFields/:target_formFields_uuid
8251</code></pre>
8252<ul>
8253<li><p>Delete or retire a target formFields subresource by its UUID. Returns a <code>404 Not Found</code> status if attribute not exists.
8254If the user is not logged in to perform this action, a <code>401 Unauthorized</code> status returned.</p>
8255<h3 id='query-parameters-5'>Query Parameters</h3>
8256<table><thead>
8257<tr>
8258<th>Parameter</th>
8259<th>Type</th>
8260<th>Description</th>
8261</tr>
8262</thead><tbody>
8263<tr>
8264<td><strong>uuid</strong></td>
8265<td><code>String</code></td>
8266<td>uuid of parent form to delete</td>
8267</tr>
8268<tr>
8269<td><strong>uuid</strong></td>
8270<td><code>String</code></td>
8271<td>uuid of formFields to delete</td>
8272</tr>
8273<tr>
8274<td><em>purge</em></td>
8275<td><code>Boolean</code></td>
8276<td>The resource will be voided/retired unless purge = ‘true’</td>
8277</tr>
8278</tbody></table></li>
8279</ul>
8280<h1 id='contributing'>Contributing</h1>
8281<p>Help us keep this documentation up to date by forking
8282<a href="https://github.com/openmrs/openmrs-contrib-rest-api-docs">this repository</a>
8283and submitting pull requests with improvements or corrections. The quality of our documentation depends on the collective contributions of persons just like you. Thank you for your contributions!</p>
8284
8285<p>Our documentation is written in simple
8286<a href="https://guides.github.com/features/mastering-markdown/">markdown</a>. The markdown pages can be found in the repository under in the subfolder
8287<code>source/includes/</code>. We use <a href="https://github.com/slatedocs/slate">Slate</a> to convert our markdown into a friendly and searchable format. More details on contributing may be found in the README of our
8288<a href="https://github.com/openmrs/openmrs-contrib-rest-api-docs">repository</a>.</p>
8289
8290 </div>
8291 <div class="dark-box">
8292 <div class="lang-selector">
8293 <a href="#" data-language-name="shell">shell</a>
8294 <a href="#" data-language-name="java">java</a>
8295 </div>
8296 </div>
8297 </div>
8298<div id="swagger-ui"></div>
8299
8300<script src="swagger-ui-bundle.js"></script>
8301<script src="swagger-ui-standalone-preset.js"></script>
8302
8303<script>
8304window.onload = function() {
8305 const ui = SwaggerUIBundle({
8306 url: "https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/swagger.json",
8307 dom_id: '#swagger-ui',
8308 presets: [
8309 SwaggerUIBundle.presets.apis,
8310 SwaggerUIStandalonePreset
8311 ]
8312 })
8313
8314 window.ui = ui
8315}
8316</script>
8317
8318 </body>
8319</html>