-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FM2-347: Add support for _has for ServiceRequest and Observation #529
Conversation
…operations for _has search
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.
it's better to use this format we have used for other search params. i.e https://github.com/openmrs/openmrs-module-fhir2/blob/master/api/src/main/java/org/openmrs/module/fhir2/api/search/param/RelatedPersonSearchParams.java
We use this class here to contain shared search (and search result) parameters that apply to all resources.
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.
Thank you for the hint. I tried to make my changes analogous to another has PR and didn't notice that a base class has been introduced in the meantime.
I updated the SearchParams and updated the setters and getters for the old uuid
property to use the id property of the base class.
observationQuery.add(propertyIn("encounter", encounterProviderQuery)); | ||
break; | ||
|
||
// TODO: add explanation on why these values are not implemented |
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.
i would add this explanation in the method javadoc
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.
I was unable to determine why these properties couldn't be represented, but added the information to the javadoc.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #529 +/- ##
============================================
- Coverage 77.79% 77.78% -0.01%
- Complexity 2679 2722 +43
============================================
Files 239 240 +1
Lines 7430 7607 +177
Branches 897 906 +9
============================================
+ Hits 5780 5917 +137
- Misses 1114 1145 +31
- Partials 536 545 +9 ☔ View full report in Codecov by Sentry. |
I added additional tests to check failure cases. Would you kindly run the workflow again? |
Thanks for this pull request! It addresses a valuable functionality gap in the OpenMRS FHIR2 module by implementing the _has parameter for reverse chaining related to ServiceRequest and Observation resources. The description clearly outlines the problem and the proposed solution using the HAPI HasParam class. The inclusion of unit tests demonstrates a commitment to code quality and ensures the functionality works as expected. Here are some additional points to consider: Logging: While the core functionality seems sound, consider if there's a benefit to adding logging statements for _has parameter usage. These logs could help with debugging and monitoring potential issues related to this specific search parameter. Documentation: Double-check if the pull request includes comprehensive documentation for the implemented _has functionality. This documentation should be clear for developers who might use this functionality in the future. It could include code comments or an update to the FHIR2 module documentation. Future Considerations: The pull request currently focuses on _has for ServiceRequest and Observation. Could there be potential future enhancements to support _has for other resource types within the OpenMRS FHIR2 module? Mentioning this as a future consideration could spark further discussion. Overall, this pull request effectively addresses the identified issue and represents a positive contribution to the OpenMRS FHIR2 module. The inclusion of unit tests and clear descriptions strengthen the quality of this contribution. |
Thank you for the feedback Tanany, glad to hear this feature is valued and that the effort towards quality is noticeable! Regarding future considerations: As this is my first PR in the OpenMRS project we decided to cut the scope of the PR to have an achievable goal. In addition to extending the _has Parameter to more Searches, the current implementation of the _has Parameter does not allow for all the options described in the FHIR spec. For example, the implementation of a _has...:not was something that was explored early during this Tickets development but then removed from the scope. I totally agree that this functionality could be expended much further! |
Description of what I changed
This PR adds the reverse chaining operator (_has) for TestOrders given the restrictions laid out in the ticket.
Issue I worked on
see https://issues.openmrs.org/browse/FM2-347
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)
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.