FM-276: Update DiagnosticReport to retrieved by accession number#221
FM-276: Update DiagnosticReport to retrieved by accession number#221ibacher wants to merge 1 commit intoopenmrs:masterfrom
Conversation
|
@ibacher thanks for working on this. 😊 |
a568d75 to
0699910
Compare
|
@dkayiwa Thanks for taking the time to look this over. I've tried to separate out the different concerns. |
| List<Order> orders = dao.getOrdersByAccessionNumber(reportId); | ||
| int orderId = 0; | ||
| if ((orders != null) && !orders.isEmpty()) { | ||
| orderId = orders.get(0).getOrderId(); |
There was a problem hiding this comment.
Is there a possibility of orders having more than one item?
There was a problem hiding this comment.
@dkayiwa: Yes, but that's out of scope for what we're currently trying to do. At a future point, we're probably going to have to look at adding a model for DiagnosticReport directly, since multiple orders can correspond to a single accession number and multiple diagnostic reports can also correspond to a single accession number, but this is something to be solved when we get the interface to create and update accession numbers working. For right now, we're just trying to get some sensible data returned.
|
Thanks @ibacher for responding to this faster than i expected. 😊 Adding some unit tests would also not be a bad idea. 😊 |
e41ccc3 to
e322d6e
Compare
|
@dkayiwa Thanks for taking the time to review this again! I think I've minimized the change surface for now. On the unit tests, I agree they would be a good idea, but the current state is pretty tightly coupled to, e.g., |
|
@corneliouzbett do you mind reviewing this pull request? 😊 |
Description of what I changed
These changes allow the FHIR module to identify DiagnosticReports by the accession number, since this is a better identifier for orders than the encounter ID
Issue I worked on
see https://issues.openmrs.org/browse/FM-276
Checklist: I completed these to help reviewers :)
My pull request only contains ONE single commit (not done to provide proper credit to Angshuman
My IDE is configured to follow the code style of this project.
I have added tests to cover my changes.
I ran
mvn clean packageright before creating this pull request andadded all formatting changes to my commit.
All new and existing tests passed.
My pull request is based on the latest changes of the master branch.