-
Notifications
You must be signed in to change notification settings - Fork 116
FM-276: Update DiagnosticReport to retrieved by accession number #221
base: master
Are you sure you want to change the base?
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. |
api/src/main/java/org/openmrs/module/fhir/api/impl/DiagnosticReportServiceImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir/api/impl/DiagnosticReportServiceImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir/api/impl/DiagnosticReportServiceImpl.java
Outdated
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility of orders
having more than one item?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
api/src/main/java/org/openmrs/module/fhir/api/impl/DiagnosticReportServiceImpl.java
Outdated
Show resolved
Hide resolved
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 package
right 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.