-
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 and _has:...:not for ServiceRequest and … #335
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #335 +/- ##
============================================
- Coverage 80.22% 79.74% -0.48%
- Complexity 2214 2219 +5
============================================
Files 204 204
Lines 5941 5993 +52
Branches 704 707 +3
============================================
+ Hits 4766 4779 +13
- Misses 768 806 +38
- Partials 407 408 +1
Continue to review full report at Codecov.
|
api/src/main/java/org/openmrs/module/fhir2/api/FhirServiceRequestService.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/impl/FhirServiceRequestServiceImpl.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openmrs/module/fhir2/providers/r3/ProcedureRequestFhirResourceProvider.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/providers/r4/ServiceRequestFhirResourceProvider.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/providers/r4/ServiceRequestFhirResourceProvider.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/providers/r4/ServiceRequestFhirResourceProvider.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/providers/r4/ServiceRequestFhirResourceProvider.java
Outdated
Show resolved
Hide resolved
ca1f34e
to
453e3cd
Compare
@ibacher kindly review |
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/BaseDao.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/BaseDao.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/BaseDao.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/BaseDao.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/BaseDao.java
Outdated
Show resolved
Hide resolved
PS I think the handling of the private void handleHasAndParam(Criteria criteria, HasAndListParam hasAndListParam) {
if (hasAndListParam == null) {
return;
}
DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Obs.class);
hasAndListParam.getValuesAsQueryTokens().stream().map(this::handleHasOrParam).filter(Optional::isPresent)
.flatMap(Optional::get).forEach(detachedCriteria::add);
criteria.add(Subqueries.exists(detachedCriteria));
}
private Optional<Stream<Criterion>> handleHasOrParam(HasOrListParam hasOrListParam) {
if (hasOrListParam == null) {
return Optional.empty();
}
return Optional.of(hasOrListParam.getValuesAsQueryTokens().stream().map(this::handleHasParam).filter(
Optional::isPresent).map(Optional::get));
}
private Optional<Criterion> handleHasParam(HasParam hasParam) {
if (hasParam == null) {
return Optional.empty();
}
if (!FhirConstants.OBSERVATION.equals(hasParam.getTargetResourceType())) {
return Optional.empty();
}
} (I've left out the mapping of the fields to the right criteria, but hopefully this outline is useful). |
@ibacher thanks for the outline ,,, |
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.
@gitcliff Sorry it took me so long to add some comments here. I've tried to do so, if you're willing to take another look. One thing that's clearly missing here is some tests for the methods in question, which would be ideal.
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirObservationDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirObservationDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirObservationDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirObservationDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirServiceRequestDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirServiceRequestDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirServiceRequestDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirServiceRequestDaoImpl.java
Outdated
Show resolved
Hide resolved
44ae398
to
02ffea8
Compare
hello @ibacher,,, i added some unit tests |
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.
@gitcliff Thanks for the update on this. I've provided some updated thoughts on the central function to this account. Weirdly, the unit tests still don't seem to be actually using this new code. Maybe a good idea to look into why that is. Anyway, thanks a lot! 😁
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirServiceRequestDaoImpl.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirServiceRequestDaoImpl.java
Outdated
Show resolved
Hide resolved
For details on why this change is happening see this Talk post: https://talk.openmrs.org/t/maven-3-8-1-and-http-repositories/33364 If this commit causes issues, please feel free to revert
LINK:https://issues.openmrs.org/browse/FM2-347