I am currently working on a JIRA issue that involves making a post request to the /order api endpoint to create a new test-order resource on the system and I have been experiencing some difficulties.
The current issue I am experiencing is that the server responds with a status code of 400(client side error) with a fieldError message;
encounter cannot be null or empty
I am guessing it has to do with the id I am trying to use to create it because if I remove the encounter field, I get a different error message, but If I change the type in the request payload to drugorder, it works, and that makes it a little more confusing. please I would love to hear ideas on how I could resolve this blocker.
Can we create a ticket in the REST WS module for this bug? The minimum steps you have to reproduce are fine for now?
When you create the ticket, flag me, and I will see if there’s an easy fix… yes, this is definitely a blocker we should fix ASAP, as saving an order by putting it’s JSON rep within the description field of an order-type is definitely not a sustainable solution!
@efosa ah, thanks for the clarification… I should have thought of this earlier, but there is a test order resource, which is what lab orders fall under, so you’d want to be posting to this endpoint:
It still seems strange, however, that you’d be getting an error around encounter, because Order, DrugOrder and TestOrder should all support encounters. How are you creating the encounter to link the order to?
For the sake of clarity, I currently post to the /order endpoint and I specify the type in the request payload as test order, I believe that should make the endpoint you are referring to handle the request.
is there anything you think I am doing wrong that way? @mogoodrich
Sorry, my mistake, @efosa! I thought that there would be a specific “testorder” endpoint, but it looks like you are correct, I believe you post to the /order endpoint with the type “testorder”. Sorry for the confusion!
Give me a heads up when you create the ticket and I can explore further!