Hi all I am working on a feature on AMPATH Point Of Care to allow a clinician to prescribe drugs to a patient. I’m using the order entry API. I tried to submit a drug order and I got some errors:
So this is the payload I am trying to submit
{
"patient": "eec087c0-8d33-4381-944a-1f8889be2872",
"concept": "a890c3aa-1350-11df-a1f1-0026b9348838",
"careSetting": "6f0c9a92-6f24-11e3-af88-005056821db0",
"orderer": "pb6e58ea-1359-11df-a1f1-0026b9348838",
"encounter": "ff277dc1-832a-46e8-b9e2-ed1feb13c78c",
"drug": "b41c22a2-2496-4588-93e4-435ac5896156",
"dose": "2",
"doseUnits": "a8a07f8e-1350-11df-a1f1-0026b9348838",
"route": "db0c5937-3874-4eae-9566-9a645ad7ac65",
"frequency": "a8a05dc4-1350-11df-a1f1-0026b9348838",
"duration": 7,
"durationUnits": "a899baaa-1350-11df-a1f1-0026b9348838",
"asNeeded": false,
"numRefills": 3,
"type": "drugorder",
"action": "NEW"
}
And the response I get is:
{
"error": {
"message": "Invalid Submission",
"code": "webservices.rest.error.invalid.submission",
"globalErrors": [],
"fieldErrors": {
"frequency": [
{
"code": "DrugOrder.error.frequencyIsNullForDosingTypeSimple",
"message": "Frequency is required for simple dosing type"
}
],
"durationUnits": [
{
"code": "DrugOrder.error.durationUnitsNotMappedToSnomedCtDurationCode",
"message": "Duration units must be mapped to SNOMED CT duration code with the map type set to SAME-AS"
},
{
"code": "DrugOrder.error.notAmongAllowedConcepts",
"message": "The units concept must be among allowed concepts"
},
{
"code": "DrugOrder.error.durationUnitsNotMappedToSnomedCtDurationCode",
"message": "Duration units must be mapped to SNOMED CT duration code with the map type set to SAME-AS"
}
],
"doseUnits": [
{
"code": "DrugOrder.error.notAmongAllowedConcepts",
"message": "The units concept must be among allowed concepts"
}
],
"route": [
{
"code": "DrugOrder.error.routeNotAmongAllowedConcepts",
"message": "The route concept must be among allowed concepts as specified by the order.drugRoutesConceptUuid global property"
}
]
}
}
}
We are using OpenMRS version 1.11.
I will be grateful if someone could take a look at it and tell me what the problem could be. Thanks in advance.