gcliff
(CLIFF GITA)
February 18, 2021, 2:08pm
1
hello folks
Am trying to create a patient via postman and with this url http://localhost:8099/openmrs/ws/rest/v1/patient and body
> {
> "person": "db3a0ef7-0da8-4cd8-8580-4b90e0400386",
> "identifiers": [
> {
> "identifier": "14433",
> "identifierType": "05a29f94-c0ed-11e2-94be-8c13b969e334",
> "location": "aff27d58-a15c-49a6-9beb-d30dcfc0c66e",
> "preferred": true
> }
> ]
>
> }
However am having issues with the patient identifierType uuid in the payload, i have used all the identifier types queried from openmrs on this GET end point http://localhost:8099/openmrs/ws/rest/v1/patientidentifiertype?v=default&limit=4 but still not yet able to post the patient
@mozzy @k.joseph @dkayiwa
tendomart
(tendo kiiza Martyn)
February 18, 2021, 2:37pm
2
What do you have in the Response payload after doing the Post ?
and what is your document type flag in postman ?
gcliff
(CLIFF GITA)
February 18, 2021, 2:44pm
3
saurabh
(Saurabh Kumar)
February 18, 2021, 3:07pm
4
https://rest.openmrs.org/#create-a-patientidentifier-sub-resource-with-properties
@gcliff I think you can create a new patientIdentifier and then pass it person UUID to create a new Patient, this worked for me while documenting.
1 Like
gcliff
(CLIFF GITA)
February 18, 2021, 3:26pm
5
sounds interesting ,thanks
1 Like
mozzy
(Moses Mutesasira)
February 18, 2021, 3:47pm
6
and besides , @gcliff , in our use case , i think you would want to use the FHIR API
mozzy
(Moses Mutesasira)
February 18, 2021, 4:09pm
7
@saurabh how do you create a new patient Identifier when the patient doesnt exist yet ??
1 Like
saurabh
(Saurabh Kumar)
February 18, 2021, 4:26pm
8
Creating a new *PatientIdentifier Type, sorry. Then passing in a patientIdentifier based on that type while creating a new patient.
because sometimes the UUID’s I used in examples might not be present on the server for the moment, so Its better to create a new one and then use it.
1 Like
mozzy
(Moses Mutesasira)
February 18, 2021, 4:51pm
9
@gcliff ,
ideally this works.
{
"person": "bee56eed-53e9-4243-bf0d-0562ac79e622",
"identifiers": [
{
"identifier": "123AT",
"identifierType": "7c28d370-08af-4f38-b23a-48a7951cad2d",
"location": "b1a8b05e-3542-4037-bbd3-998ee9c40574",
"preferred": true
}
]
}
, But most probably what is causing error on your side is the Identifier Type Validator.
you either post a valid identifier as per the identifier type you referenced , or create a new Identifier Type without a validator .
And even when you create a new Identifier Type , some identifier Types are already marked as Required , so you would want to first mark the other Identifier types as not required
gcliff
(CLIFF GITA)
February 18, 2021, 6:06pm
10
mozzy:
, But most probably what is causing error on your side is the Identifier Type Validator.
you either post a valid identifier as per the identifier type you referenced , or create a new Identifier Type without a validator .
And even when you create a new Identifier Type , some identifier Types are already marked as Required , so you would want to first mark the other Identifier types as not required
yeah i see they are using the org.openmrs.patient.impl.LuhnIdentifierValidator
.
As you said either create a new identifier type with a validator or edit the validator in openmrs , editing the validator has worked with
{
"person": "db3a0ef7-0da8-4cd8-8580-4b90e0400386",
"identifiers": [
{
"identifier": "12345",
"identifierType": "05a29f94-c0ed-11e2-94be-8c13b969e334",
"location": "aff27d58-a15c-49a6-9beb-d30dcfc0c66e",
"preferred": true
}
]
}
2 Likes
gael
(gael caamal)
February 25, 2021, 5:34pm
11
quetal yo tambien estoy teniendo el mismo problema para crear al paciente como lograste solucionar ese problema
mozzy
(Moses Mutesasira)
February 25, 2021, 6:00pm
12
that I am also having the same problem to create the patient as you managed to solve that problem .
Used Google Translater to understand what you where saying
2 Likes
gael
(gael caamal)
February 25, 2021, 6:10pm
13
I have the same problem when trying to create the patient I tested the uuid of the person and I did not create the patient