Skip to content
This repository was archived by the owner on Mar 25, 2022. It is now read-only.

FM-276: Update DiagnosticReport to retrieved by accession number #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ibacher
Copy link
Member

@ibacher ibacher commented Dec 5, 2019

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 and
    added 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.

@dkayiwa
Copy link
Member

dkayiwa commented Dec 8, 2019

@ibacher thanks for working on this. 😊
There are quite a number of changes in this pull request. Would it be possible to separate the retrieval by accession number changes from those that deal with refactoring, cleanup, and others that i see in this same pull request?

@ibacher ibacher force-pushed the FM-276 branch 2 times, most recently from a568d75 to 0699910 Compare December 8, 2019 08:22
@ibacher
Copy link
Member Author

ibacher commented Dec 8, 2019

@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();
Copy link
Member

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?

Copy link
Member Author

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.

@dkayiwa
Copy link
Member

dkayiwa commented Dec 8, 2019

@dkayiwa
Copy link
Member

dkayiwa commented Dec 8, 2019

Thanks @ibacher for responding to this faster than i expected. 😊
I still see quite a number of changes that are not necessary for what is required by the ticket.
They are good changes though, but make the pull request bigger and hence harder to review.
In order not to delay the merging of this asked for functionality, do you mind doing them in a separate pull request?

Adding some unit tests would also not be a bad idea. 😊

@ibacher ibacher force-pushed the FM-276 branch 4 times, most recently from e41ccc3 to e322d6e Compare December 9, 2019 10:17
@ibacher
Copy link
Member Author

ibacher commented Dec 9, 2019

@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., Context.get...Service() and I'm primarily focusing my energy on a re-imagined version of this module that's fully unit testable 😄.

@dkayiwa
Copy link
Member

dkayiwa commented Dec 9, 2019

@corneliouzbett do you mind reviewing this pull request? 😊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants