custom fields for Orders

Anyone using custom fields on orders, i just noticed Order.java doesn’t support adding fields as attributes, it probably needs to perhaps extend BaseCustomizableData not BaseOpenmrsData so that it can accept attributes otherwise, its now tied up.

I have a requirement to track down the date when the test order sample was taken, has anyone done this before else see it fit adding this to openmrs core.

CC: @burke, @darius, @dkayiwa

1 Like

Hi Joseph,

Tracking things like date when the order sample was taken is a fulfillment detail which is technically not supposed to be handled by the order entry API. You would probably need to implement a mechanism to handle fulfillment in a custom module, possibly someone has already written one, I would guess Bahmni has done so, therefore, you might want to reach out to them, see how they did it and determine if you can reuse it.

One way to do it is to use Observations to record the test results, Obs class has an order field which would point back to the order that was placed, the tricky decision to make with this approach would be to determine what the obs datetime stands for i.e. whether it is the date when the test was taken, or the date the results came back, in case of the former, it would then be that date you are trying to capture and problem would be solved otherwise, you would need to capture and bake in extra details to take care of the date when the test was performed.

1 Like