-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Describe the bug
I read the hl7 specification : patient-operation-match and found here should support more parameters, such as the count, I found not take effect at the time of use, and track the source code, find here is not to read the specified parameters, Is this a bug or is it unnecessary to deal with? (As far as I know, all matches were read and the data possible_match was possible_match. Is it necessary to apply count?)
Code
The code snippet in question:
public IBaseBundle getMatchesAndPossibleMatchesForResource(
IAnyResource theResource, String theResourceType, RequestDetails theRequestDetails) {
RequestPartitionId requestPartitionId;
if (myMdmSettings.getSearchAllPartitionForMatch()) {
requestPartitionId = RequestPartitionId.allPartitions();
} else {
requestPartitionId = myRequestPartitionHelperSvc.determineReadPartitionForRequestForSearchType(
theRequestDetails, theResourceType);
}
List<MatchedTarget> matches =
myMdmMatchFinderSvc.getMatchedTargets(theResourceType, theResource, requestPartitionId);
matches.sort(
Comparator.comparing((MatchedTarget m) -> m.getMatchResult().getNormalizedScore())
.reversed());
BundleBuilder builder = new BundleBuilder(myFhirContext);
builder.setBundleField("type", "searchset");
builder.setBundleField("id", UUID.randomUUID().toString());
builder.setMetaField("lastUpdated", builder.newPrimitive("instant", new Date()));
IBaseBundle retVal = builder.getBundle();
for (MatchedTarget next : matches) {
boolean shouldKeepThisEntry = next.isMatch() || next.isPossibleMatch();
if (!shouldKeepThisEntry) {
continue;
}
IBase entry = builder.addEntry();
builder.addToEntry(entry, "resource", next.getTarget());
IBaseBackboneElement search = builder.addSearch(entry);
toBundleEntrySearchComponent(builder, search, next);
}
return retVal;
}code reference:
hapi-fhir/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmControllerHelper.java
Line 142 in 41c2e49
| public IBaseBundle getMatchesAndPossibleMatchesForResource( |
To Reproduce
- custom mdm-setting
- call {baseUrl}/Patient/$match, and use complete parameter :
resource,count,onlyCertainMatches - observe the number of matches returned
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels