I created some allergies via GUI and I tried to fetch allergies for given patient using REST api
Unfortunately only 2 links below that discuss the problem were not enough to figure out the way to do
for my version of the code 1.11 without downloading java source.
Most probably i will but can someone just maybe exceptionally say how to use patient parameter instead of q parameter for the research of allergies ?
Unfortunately the documentation of how to search on different resources is non-existent. See this post for how you can explore the code and find out what is supported without too much pain: https://wiki.openmrs.org/questions/80380259/answers/8038026213
Peeking quickly, both the problem and allergy resources expect a “patient” parameter, not a “q” parameter.
Unknown resource: v1/patient/allergy
org.openmrs.module.webservices.rest.web.api.impl.RestServiceImpl:415
org.openmrs.api.APIException: Unknown resource: v1/patient/allergy at org.openmrs.module.webservices.rest.web.api.impl.RestServiceImpl.getResourceByName(RestServiceImpl.java:415)
we do not require very advanced allergy handling at present, i wanted just to retrieve the basic allergy for the patient information captured in the ref app GUI by API
is this necessary to migrate to v2.0.0 ?
Thanks it worked, but it shows only allergy captured in patient dashboard and not in the ref application patient page… Thank you anyway it helps a lot.
Is there any chance to find a sample of drug order in some uat environment just to retrieve and to see it’s structure ? I am getting the error messages that are probably because of naive input :
/openmrs/ws/rest/v1/order
‘{
“patient”: “efaab948-b3fa-4553-9c84-81594c91617e”, // patient uuid
“type”: “drugorder”, as per spec
“concept”: “71617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, aspirine concept
“encounter”: “cf8b6e9d-fced-4a1b-82b9-de356679f6a2”, visit manually created
“careSetting”: “6f0c9a92-6f24-11e3-af88-005056821db0”, Outpatient caresetting uid
“drug”: “74322f5c-7881-44e4-a053-48258e685923”, Aspirine created by api
“orderer”: “8f87f4ca-8f71-4ee3-a100-112c9945a937”, Provider uuid
“dose”: “1”,
“doseUnits”: “tablette”,
“route”: “Oral” ,
“frequency”: “daily”,
“quantity”: “3”,
“numRefills”: “2”
}’
Response Body
{
“error”: {
“message”: “Invalid Submission”,
“code”: “webservices.rest.error.invalid.submission”,
“globalErrors”: ,
“fieldErrors”: {
“drug”: [
{
“code”: “error.general”,
“message”: “Error while submitting form”
}
],
“concept”: [
{
“code”: “error.concept”,
“message”: “Invalid concept”
}
],
“doseUnits”: [
{
“code”: “DrugOrder.error.doseUnitsIsNullForDosingTypeSimple”,
“message”: “Dose units is required for simple dosing type”
},
{
“code”: “DrugOrder.error.doseUnitsRequiredWithDose”,
“message”: “Dose Units is required when dose is specified”
}
],
“route”: [
{
“code”: “DrugOrder.error.routeIsNullForDosingTypeSimple”,
“message”: “Route is required for simple dosing type”
}
],
“frequency”: [
{
“code”: “DrugOrder.error.frequencyIsNullForDosingTypeSimple”,
“message”: “Frequency is required for simple dosing type”
}
],
“quantityUnits”: [
{
“code”: “DrugOrder.error.quantityUnitsRequiredWithQuantity”,
“message”: “Quantity units is required when quantity is specified”
}
]
}
}
}
very good, thanks for the 1 st url, the second one i use always, but the question is about right values for parameteres, can not figure out the values for doses etc. aparently
Thank you this is helpful, that said i am unable to create any dose unit nor retrieve existing from my installation. Nor routes , frequency nor quantity units either. At least it’s not possible via REST api. this test is for v.2 It would be great to see the same test for the v11. Or what i want is impossible and i have to use Java Api ? Or maybe i gan find the module that will permit capturing all of this via GUI ?
How people using v1.11 create and order drugs ? Please help, if possible before migration to the v2+ if nothing helps. But i would really like to avoid it for now.
Thank you so Much Darius. Downloaded and built the module, now
/openmrs/ws/rest/v1/orderentryconfig?v=full
shows meaningful information for routes dosing units and duration units
now i can enter prescriptions with free text instructions
Alas it’s still impossible with standard dosing instruction because (only !!! )frequencies are missing amongs required pqrqmeters. How we are supposed to configure frequencies (the api aparently either shows or updates order frequency object no way to use creation… ) ? i thing as soon as we enter these values we are ok for api order creation as well.
Thanks but i have small troubles to use java classes like these. I can build the module with maven of course but it appears uneasy yet at present to create custom tool based on java API to create configuration objects which uuid i require for order creation.
Still the values in the tests are very helpful to get the working sample at least