Raxacore REST resources
FAQ:
- Headers
- Getting started
- Why aren't resources showing up?
List of Resources available on raxacore OpenMRS module:
- Billing
- Drug
- DrugGroup
- DrugInventory
- Encounter
- Image
- Location
- Login
- Obs
- Order
- Patient
- PatientAccess
- PatientList
- Provider
- RaxaAlert
- User
Drug
URLs
url | description |
---|---|
GET /ws/rest/v1/raxacore/drug?q=aspirin | Search by brand name or drug name |
GET /ws/rest/v1/raxacore/drug/\{uuid\} | Fetch by unique uuid |
GET /ws/rest/v1/raxacore/drug/\{uuid\}&v=full | Fetch by unique uuid, GET full |
POST /ws/rest/v1/raxacore/drug | Create with properties in request |
POST /ws/rest/v1/raxacore/drug/\{uuid\} | Edit with given uuid, only modifying properties in request |
GET drug
Parameter | Description | Example |
---|---|---|
fullName | Brand name, dose strength, units, dosage form, generic name | Acetyl Salicylic Acid 50 mg Tablet Aspirin |
name | Brand name | Aspirin |
genericName | Generic name | Acetyl Salicylic Acid |
dosageForm | Form of drug | Tablet |
doseStrength | Dose strength in double | 50 |
route | Route of administration | (not yet in database) |
uuid | Unique id for drug | raxa0000000000000000000000000003000218 |
conceptUuid | Unique | 10000000000000000000000000000000000747 |
GET drug full
Parameters |
---|
uuid |
POST/update drug
Parameter | Description | Example |
---|---|---|
name | Brand name | Aspirin |
description | Description | Used for headache |
genericName | Generic Name | Acetyl Salicylic Acid |
dosageForm | Unique id of dosage form concept | <uuid> |
strength | Strength as double | 200 |
units | Units | mg |
price | Sale price as double | 14.02 |
cost | Cost price from manufacturer as double | 15.80 |
Encounter
URLs
url | description |
---|---|
GET /ws/rest/v1/raxacore/encounter?provider= | Fetch encounters by provider |
GET /ws/rest/v1/raxacore/encounter?patient= | Fetch encounters by patient |
GET /ws/rest/v1/raxacore/encounter/\{uuid\} | Fetch by unique uuid |
POST /ws/rest/v1/raxacore/encounter | Create encounter and save alerts for any orders |
GET Encounter
Parameter | Description | Example |
---|---|---|
uuid | Unique id for encounter | <uuid> |
display | Name of encounter | [2013-04-24 20:05:34.0 OUTPATIENT (no Location) num Obs: 0 num Orders: 1 ] |
encounterDatetime | Java time of encounter | Apr 24, 2013 8:05:34 PM |
patient | \{ uuid, display \} of patient | <uuid>, "John Smith" |
location | \{ uuid, display \} of location | <uuid>, "Varun Family Clinic" |
encounterType | \{ uuid, display \} of encounter type | <uuid>, "OUTPATIENT" |
obs | \{ uuid, obsDatetime, value, comment | [{ |
orders | \{ uuid, orderType: \{ uuid \}, display, | [{ |
images | \{ uuid, title, tags \} | \[\{ "uuid: <uuid>, "title": "My Image", "tags": "profile, photo" \}\] |
POST Encounter
Parameter | Description | Example | |
---|---|---|---|
encounterDatetime | Java time of encounter | 2013-06-11T11:28:20Z | |
patient | uuid of patient | <uuid> | |
encounterType | uuid of encounter type | raxa00000-0000-0000-0000-000000000005 | |
provider | uuid of provider | <uuid> | |
location | uuid of location | <uuid> | |
obs | (see below) | ||
concept | uuid for obs concept | <uuid> | |
value | boolean, text, etc | 35 | |
comment | determined through patient history | ||
orders |
| (see below) | |
concept | concept uuid | <uuid> | |
instructions | instructions for prescription | Take with food | |
drug | drug uuid | <uuid> | |
frequency | List of frequencies | q.a.d. | |
units | units for prescription | mg | |
quantity | total pills/units | 12 | |
dose | double | 125.00 | |
startDate | java start date of prescription | 2013-06-11T19:13:00Z | |
autoExpireDate | java end date of prescription | 2013-06-13T19:13:00Z | |
images | (see below) | ||
dataURI | base 64 encoded bytes of image | data:image/jpeg;base64,/9j/4AAzS0.... | |
title | Image title | Knee Lesion | |
tags | Image tags separated by comma | lesion, knee, dermatology | |
description | Image description | image of lesion | |
imageIndex | index within encounter, starting with 0 | 0 |
Example POST call for encounter:
{"patient":"a4c80c53-b281-4cdf-8cd8-3c084cfadde3","encounterType":"raxa00000-0000-0000-0000-000000000005","encounterDatetime":"2013-06-11T11:28:20Z","obs":[{"obsDatetime":"2013-06-11T11:29:31Z","person":"a4c80c53-b281-4cdf-8cd8-3c084cfadde3","concept":"57AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},{"obsDatetime":"2013-06-11T11:29:31Z","person":"a4c80c53-b281-4cdf-8cd8-3c084cfadde3","concept":"raxa00000-0000-0000-0000-000000000023","value":"data:image/jpeg;base64,/9j/4AAzS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFACZozS0UAJmjNLRQAmaM0tFAH/9k="},{"obsDatetime":"2013-06-11T11:29:31Z","person":"a4c80c53-b281-4cdf-8cd8-3c084cfadde3","concept":"raxa00000-0000-0000-0000-000000000025","value"valueForObsHere"]}],"location":null,"orders":[{"type":"drugorder","patient":"a4c80c53-b281-4cdf-8cd8-3c084cfadde3","concept":"10000000000000000000000000000000000138","drug":"raxa0000000000000000000000000003000023","startDate":"2013-06-11T19:13:00Z","autoExpireDate":"2013-06-13T19:13:00Z","instructions":"Take with food","quantity":8,"dose":"125.00","units":"","frequency":"q.d.s.","orderer":"5c806564-86d7-40ee-9769-b4eb7796c217"}],"images":[{"patient":"a4c80c53-b281-4cdf-8cd8-3c084cfadde3","dataURI":"data:image/png;base64,iVBORAASUVORK5CYII=","title":"My picture","description":"picture for record","imageIndex":1}]}
Image
URLs
url | description |
---|---|
GET /ws/rest/v1/raxacore/image?patient=__ | Fetch images belonging to patient |
GET /ws/rest/v1/raxacore/image?provider=__&tag=__ | Fetch images belonging to patient tagged by tag |
GET /ws/rest/v1/raxacore/image?provider=__ | Fetch images created by provider |
GET /ws/rest/v1/raxacore/image?location=__ | Fetch images belonging to a location |
GET /ws/rest/v1/raxacore/image?encounter=__ | Fetch images in an encounter |
GET /ws/rest/v1/raxacore/image/__ | Fetch image by uuid |
GET image
Parameter | Description | Example |
---|---|---|
uuid | unique id of image | <uuid> |
fileName | file name of image | <fileName> |
tags | tags separated by commas | knee, lesion, dermatology |
dataURI | base64 encoded bytecode of image | data:image/jpeg;base64,/9j/4AAzS0.... |
provider | uuid, display of provider | <uuid>, Dr. Varun |
location | uuid, display of location | <uuid>, Varun Family Clinic |
patient | uuid, display of patient | <uuid>, John Smith |
imageIndex | index within an encounter | 0 |
title | image title | KneeLesion |
description | image description | Photo of patient lesion on knee |
PatientList
URLs
url | description |
---|---|
GET /ws/rest/v1/raxacore/patientlist?q | Fetch all non-retired that match this parameter |
GET /ws/rest/v1/raxacore/patientlist/{uuid} | Fetch by unique uuid |
GET /ws/rest/v1/raxacore/patientlist | Fetch all non-retired |
POST /ws/rest/v1/raxacore/patientlist | Create with properties in request |
POST /ws/rest/v1/raxacore/patientlist | Edit with given uuid, only modifying properties in request |
DELETE /ws/rest/v1/raxacore/patientlist/{uuid}?!purge | Delete this object from the database |
DELETE /ws/rest/v1/raxacore/patientlist/{uuid\}?purge | Delete this object from the database |
Representations
GET ref | GET default | GET full | POST create | POST update |
---|---|---|---|---|
uuid name description | uuid name description searchQuery patients --- uuid --- display --- gender --- age --- encounters ------- uuid ------- display ------- encounterType ------- encounterDatetime ------- obs ------------ uuid ------------ display ------------ obsDatetime ------------ value resourceVersion | uuid name description searchQuery patients --- uuid --- display --- gender --- age --- encounters ------- uuid ------- display ------- encounterType ------- encounterDatetime ------- provider ------- obs ------------ uuid ------------ display ------------ obsDatetime ------------ value ------------ comment ------------ order resourceVersion | name description searchQuery | name description searchQuery |
Examples from Unit tests:
On-the-fly generation of patient list
GET ---> http://raxaemr.jelastic.tsukaeru.net/ws/rest/v1/raxacore/patientlist?startDate=2008-01-01T00:00:00.0&endDate=2012-01-02T00:00:00.0&encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1&provider=61ae96f4-6afe-4351-b6f8-cd4fc383cc65
(the uuid of provider is provider uuid & the uuid given below in encounter is the person uuid)This REST call is for generating on-the-fly patient lists based on encounterTypes (uuid), startDate and endDate (both in ISO8601 format with or without timezone)
JSON Received{ "uuid" : null, "name" : null, "description" : null, "searchQuery" : "?startDate=2008-01-01T00:00:00.0&endDate=2012-01-02T00:00:00.0&encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1", "patients" : [ { "uuid" : "8adf539e-4b5a-47aa-80c0-ba1025c957fa", "display" : "Anet Test Oloo", "gender" : "F", "age" : null, "encounters" : [ { "uuid" : "6519d653-34gg-43ef-9c83-a3715b82d4ac", "display" : "Scheduled - 2008-08-01 00:00:00.0", "encounterType" : "61ae96f4-6afe-4351-b6f8-cd4fc383cce1", "encounterDatetime" : "2008-08-01T00:00:00.000+0530", "provider" : "341b4e41-790c-484f-b6ed-71dc8da222de", "obs" : [ { "uuid" : "39fb7f47-e80a-4056-9285-bd798be13c63", "display" : "WEIGHT (KG) = 50.0", "obsDatetime" : "2008-07-01T00:00:00.000+0530", "value" : "50.0", "comment" : "", "order" : null }, { "uuid" : "be48cdcb-6a76-47e3-9f2e-2635032f3a9a", "display" : "CD4 COUNT = 150.0", "obsDatetime" : "2008-08-01T00:00:00.000+0530", "value" : "150.0", "comment" : "", "order" : null } ] } ] }, { "uuid" : "5946f880-b197-400b-9caa-a3c661d23041", "display" : "Collet Test Chebaskwony", "gender" : "F", "age" : 35, "encounters" : [ { "uuid" : "eec646cb-c847-45a7-98bc-91c8c4f70add", "display" : "Scheduled - 2008-08-15 00:00:00.0", "encounterType" : "61ae96f4-6afe-4351-b6f8-cd4fc383cce1", "encounterDatetime" : "2008-08-15T00:00:00.000+0530", "provider" : "341b4e41-790c-484f-b6ed-71dc8da222de", "obs" : [ { "uuid" : "2f616900-5e7c-4667-9a7f-dcb260abf1de", "display" : "WEIGHT (KG) = 55.0", "obsDatetime" : "2008-08-15T00:00:00.000+0530", "value" : "55.0", "comment" : "", "order" : null }, { "uuid" : "f6ec1267-8eac-415f-a3f0-e47be2c8bb67", "display" : "CD4 COUNT = 175.0", "obsDatetime" : "2008-08-15T00:00:00.000+0530", "value" : "175.0", "comment" : "", "order" : null }, { "uuid" : "e26cea2c-1b9f-4afe-b211-f3ef6c88af6f", "display" : "FAVORITE FOOD, NON-CODED = PB and J", "obsDatetime" : "2008-08-15T00:00:00.000+0530", "value" : "PB and J", "comment" : "", "order" : null }, { "uuid" : "b6521c32-47b6-47da-9c6f-3673ddfb74f9", "display" : "FOOD ASSISTANCE = true", "obsDatetime" : "2008-08-15T00:00:00.000+0530", "value" : "true", "comment" : "", "order" : null }, { "uuid" : "99b92980-db62-40cd-8bca-733357c48126", "display" : "DATE OF FOOD ASSISTANCE = August 14, 2008 12:00:00 AM IST", "obsDatetime" : "2008-08-15T00:00:00.000+0530", "value" : "August 14, 2008 12:00:00 AM IST", "comment" : "", "order" : null }, { "uuid" : "1ce473c8-3fac-440d-9f92-e10facab194f", "display" : "FOOD ASSISTANCE FOR ENTIRE FAMILY = ", "obsDatetime" : "2008-08-15T00:00:00.000+0530", "value" : "", "comment" : "", "order" : null } ] }, { "uuid" : "e403fafb-e5e4-42d0-9d11-4f52e89d148c", "display" : "Scheduled - 2008-08-19 00:00:00.0", "encounterType" : "61ae96f4-6afe-4351-b6f8-cd4fc383cce1", "encounterDatetime" : "2008-08-19T00:00:00.000+0530", "provider" : "341b4e41-790c-484f-b6ed-71dc8da222de", "obs" : [ { "uuid" : "2ed1e57d-9f18-41d3-b067-2eeaf4b30fb0", "display" : "WEIGHT (KG) = 61.0", "obsDatetime" : "2008-08-19T00:00:00.000+0530", "value" : "61.0", "comment" : "", "order" : null } ] } ] } ] }
Updating a patient list ---> POST --> http://raxaemr.jelastic.tsukaeru.net/ws/rest/v1/raxacore/patientlist/68547121-1b70-465d-99ee-c9dfd95e7d30
JSON Sent/ReceivedRequest Body- { "name" : "Test PatientList", "description" : "Test List of Patients" } --------------------------------------------------------------- GET search- { "uuid" : "68547121-1b70-465d-99ee-c9dfd95e7d30", "name" : "Test PatientList", "description" : "Test List of Patients", "patients" : [ ] }
Created patient list --> http://raxaemr.jelastic.tsukaeru.net/ws/rest/v1/raxacore/patientlist
JSON Sent/ReceivedRequest Body- { "name" : "Test PatientList", "description" : "Test List of Patients" } --------------------------------------------------------------- Response- { "uuid" : "2f30cc04-6437-487a-9297-b387eee50048", "name" : "Test PatientList", "description" : "Test List of Patients" }
Search patient list by name ---> GET http://raxaemr.jelastic.tsukaeru.net/ws/rest/v1/raxacore/patientlist?q=TestList2
JSON ReceivedFound PatientList(s): { "uuid" : "68547121-1b70-465e-99ee-c9dfd95e7d30", "name" : "TestList2", "description" : "Second Test List" }
RaxaAlert
URLs
url | description |
---|---|
GET /ws/rest/v1/raxacore/raxaalert?patient=__ | Fetch images belonging to patient |
GET /ws/rest/v1/raxacore/image?provider=__&tag=__ | Fetch images belonging to patient tagged by tag |
GET /ws/rest/v1/raxacore/image?provider=__ | Fetch images created by provider |
GET /ws/rest/v1/raxacore/image?location=__ | Fetch images belonging to a location |
GET /ws/rest/v1/raxacore/image?encounter=__ | Fetch images in an encounter |
GET /ws/rest/v1/raxacore/image/__ | Fetch image by uuid |
GET raxaalert
Parameter | Description | Example |
---|---|---|
uuid | unique id for raxa alert | <uuid> |
name | message | Prescription reminder: take your Paracetamol |
description | description of raxa alert | Alert created |
providerRecipient | uuid, display | <uuid>, Dr. Varun |
providerSent | uuid, display | <uuid>, Dr. Madan |
toLocation | uuid, display | <uuid>, Madan Family Clinic |
fromLocation | uuid, display | <uuid>, Varun Family Clinic |
patient | uuid, display | <uuid>, John Smith |
alertType | type of alert (string) | PrescriptionReminder |
defaultTask | task to perform (string) | Photo of patient lesion on knee |
seen | seen by patient (boolean) | false |
time | time of alert | 2013-06-11T11:28:20Z |
POST raxaalert
Parameter | Description | Example |
---|---|---|
providerRecipient | provider uuid of recipient | <uuid> |
providerSent | provider uuid of sender | <uuid> |
toLocation | location of recipient | <uuid> |
fromLocation | location of sender | <uuid> |
patient | uuid of patient | <uuid> |
name | message | Take prescribed medication of paracetamol |
description | index within an encounter | 0 |
alertType | type of alert (string) | PrescriptionReminder |
defaultTask | task to perform (string) | Photo of patient lesion on knee |
seen | seen by patient (boolean) | false |
time | time of alert | 2013-06-11T11:28:20Z |
Appendix
Prescription Frequencies
Frequency | Description |
---|---|
q.h. | every hour |
qqh | every 4 hours |
q.d.s. | 4x per day |
t.d.s. | 3x per day |
b.d \[sic\] | 2x per day |
q.d., q1d | every day |
q.a.m. | every day before noon |
q.p.m. | every day after noon |
q4PM | every day at 4 PM |
q.h.s. | every night at bedtime |
q.a.d. | every other day |
t.i.w. | 3x per week |
QWK | once per week |
p.r.n | as needed |
q.s. | sufficient quantity |
ad lib | as needed |