Are you developing a custom user interface for this sorting of orders? You could take advantage of Order Attributes, which is how we extends domain objects with extra data.
Yes, we are developing a custom user interface. you mean to say i can put the expected sequence in orderattribute and using that front end could sort it and display the orderās in that sequence. I am using platform 2.5.10, where I can get rest APIās for orderattribute and orderattributetype? I tried this
GET /openmrs/ws/rest/v1/orderattribute
response
{
"error": {
"message": "Resource does not exist. Please check documentation for implemented resources and their paths [Unknown resource: v1/orderattribute]",
"code": "org.openmrs.module.webservices.rest.web.api.impl.RestServiceImpl:416",
GET /openmrs/ws/rest/v1/orderattributetype
{
"error": {
"message": "Resource does not exist. Please check documentation for implemented resources and their paths [Unknown resource: v1/orderattributetype]",
"code": "org.openmrs.module.webservices.rest.web.api.impl.RestServiceImpl:416",
I have noticed that when we added attributes to orders, we did not update the REST API to include them. Feel free to create a JIRA ticket for this under the webservices rest JIRA project.
Thanks @dkayiwa, I have JIRA requested access, so that I can create ticket, just trying to understand, this must have been added based on some use-case, but if there is no rest API, how it is being used, is it internally some other function within core is using this?
Another question, the provider is looking to get a snapshot(in OPD setting, when visit is closed) of captured observations, active orders at that point of time to see what complaints were there and what medications were taken at that point of time. Any specific API we can use to get that.
* **Visit-Wise Snapshot**: At any point in the future, we want to retrieve a snapshot of all active medications a patient was taking after each visit in OPD scenerio. This includes drugs ordered in the current visit and those from previous visits that were still active at that time. The snapshot should reflect the providerās preferred sequence. For example:
* **Visit 1 Snapshot**: [Med1, Med2, Med3].
* **Visit 2 Snapshot**: [Med1, Med4, Med2] (since Med3 is stopped, and Med4 is inserted).
* Even later in future after multiple visits, provider should be able to fetch and see these exact snapshots.
Most Java-based modules use the Java API for core, so these features exist even if they werenāt exposed through the REST API.
@dkayiwa I am waiting for Jira access to create ticket, once I have access, would create ticket and share here.
Youāll almost certainly have to write some custom code to grab the snapshot, but you could ensure that is triggered when the visit closes, depending on what that means for your implementation. This type of thing, though, is usually only possible via a custom Java module.
@dkayiwa I have created the task
Ok thanks. I have made it ready for work and added it to the list of community priorities.
Hey everyone, Iāve started working on the OrderAttribute-related issue and could use some clarification. Iāve already implemented CRUD support for OrderAttributeType locally.
-
While working on
OrderAttributeResource#save, I noticed there doesnāt seem to be a DAO method in core to persistOrderAttribute. How is its lifecycle typically managed? -
Iām also running into a
ConversionExceptionduring serialization/deserialization of transient object values ā specifically while testing withFreeTextDatatype. Iām working on RefApp 3.x ā could this be due to a missing module, or should I be handling this via guards in the@PropertyGetter/@PropertySettermethods?
Any insights would be appreciated ā thanks!
Hey @dkayiwa , could you please help me out on this? Thanks.
You can take a look at these examples: ProgramEnrollmentResource2_2, ConceptResource2_0, LocationResource1_9
I would need to look at the full stack trace.
All the classes like ProgramEnrollmentResource2_2, ConceptResource2_0, and LocationResource1_9 have mutable parent entities. But Order is immutable once created right? So adding support for POST/PUT by extending the latest OrderResource2_2 leads to a ResourceDoesNotSupportOperationException.
What would be the recommended approach to work around this?
Also, when an Order is revised, what happens to the OrderAttribute(s) attached to the original? Are they automatically carried over to the new order, or do I need to manually copy them?
(That conversion exception earlier was a mistake on my end , please ignore it.)
Thank you.
Do you have a draft pull request that i can look at?
I have created a draft PR here.
I have put a comment on github.