sajankos
(Sajan George)
April 4, 2019, 6:27am
1
OpenMRS application version 2.2.0
Hi,
I installed the latest version of OpenMRS 2.2.0 . My requirement is to add patient,visit,encounter and obs with uuid passed from the client.I have seen mentioned in OpenMRS that this feature is now provided.However when I go to the swagger documentation , I don’t see the model containing the uuid from the device for eg post visit model is as below.
{
“patient”: “uuid”,
“visitType”: “uuid”,
“startDatetime”: “2019-04-03”,
“location”: “uuid”,
“indication”: “string”,
“stopDatetime”: “2019-04-03”,
“encounters”: [
“uuid”
],
“attributes”: [
{
“attributeType”: “uuid”,
“value”: “string”
}
]
}.
I can’t see an option to create visit with the uuid from the client.This would help me a lot in taking care of offline data.
dkayiwa
(Daniel Kayiwa)
April 4, 2019, 8:07am
2
Are you creating a visit from an existing or new patient?
sajankos
(Sajan George)
April 4, 2019, 10:26am
3
I wish to create from an existing patient.
sajankos
(Sajan George)
April 4, 2019, 10:28am
4
Rather than letting openmrs create the visit uuid in the backend.I would like to pass the uuid from the device with which the visit should get created
dkayiwa
(Daniel Kayiwa)
April 4, 2019, 1:32pm
5
It looks like that should be possible, basing on this: https://issues.openmrs.org/browse/RESTWS-729
sajankos
(Sajan George)
April 5, 2019, 5:59am
6
Is there anyway that I can get the updated swagger documentation for this so that I will be able to proceed with using this feature ?.
dkayiwa
(Daniel Kayiwa)
April 5, 2019, 6:31am
7
You do not need swagger to make REST calls. Did you take a look at this? https://wiki.openmrs.org/display/docs/REST+Web+Services+API+For+Clients
sajankos
(Sajan George)
April 5, 2019, 6:56am
8
Tried it, passed uuid value also.It seems to be working .Thanks
Please find a better-formatted JSON body for an Encounter including a visit.
{
“encounterDatetime”: “currentdatetime”,
“patient”: “patient_uuid”,
“encounterType”: “encounterType_uuid”,
“location”: “location_uus”,
“visit”: {
“patient”: “patient_uuid”,
“visitType”: “visittype_uuid”,
“startDatetime”: “currentdatetime”
},
“encounterProviders”: [
{
“provider”: “provider_uuid”,
“encounterRole”: “240b26f9-dd88-4172-823d-4a8bfeb7841f”
}
],
“obs”: [
{
“person”: “patient_uuid”,
“concept”: “concept_uuid”,
“obsDatetime”: “currentdatetime”,
“value”: 30
},
{
“person”: “patient_uuid”,
“concept”: “concept_uuid”,
“obsDatetime”: “currentdatetime”,
“value”: 30
},
{
“person”: “patient_uuid”,
“concept”: “concent_uuid”,
“obsDatetime”: “currentdatetime”,
“valueCodedName”: “Current Regimen”,
“value”: “coded_concept_uuid”
}
]
}