Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d113906

Browse filesBrowse files
author
Ken Stevens
committed
remove bundle merge changes from this branch (will revert in new branch)
1 parent 306d426 commit d113906
Copy full SHA for d113906

File tree

Expand file treeCollapse file tree

8 files changed

+15
-90
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+15
-90
lines changed

‎hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleBuilder.java

Copy file name to clipboardExpand all lines: hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleBuilder.java
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,6 @@ public void addDocumentEntry(IBaseResource theResource) {
473473
addEntryAndReturnRequest(theResource);
474474
}
475475

476-
public void addDocumentEntry(IBaseResource theResource, String theFullUrl) {
477-
setType("document");
478-
addEntryAndReturnRequest(theResource, theFullUrl);
479-
}
480-
481476
/**
482477
* Creates new entry and adds it to the bundle
483478
*

‎hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/config/MdmConsumerConfig.java

Copy file name to clipboardExpand all lines: hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/config/MdmConsumerConfig.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ FindCandidateByExampleSvc findCandidateByScoreSvc() {
164164
}
165165

166166
@Bean
167-
protected MdmProviderLoader mdmProviderLoader() {
167+
MdmProviderLoader mdmProviderLoader() {
168168
return new MdmProviderLoader();
169169
}
170170

‎hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmMatchFinderSvcImpl.java

Copy file name to clipboardExpand all lines: hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmMatchFinderSvcImpl.java
-66Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -20,68 +20,40 @@
2020
package ca.uhn.fhir.jpa.mdm.svc;
2121

2222
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
23-
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
24-
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
2523
import ca.uhn.fhir.jpa.mdm.svc.candidate.MdmCandidateSearchSvc;
26-
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
2724
import ca.uhn.fhir.mdm.api.IMdmMatchFinderSvc;
28-
import ca.uhn.fhir.mdm.api.IMdmSettings;
2925
import ca.uhn.fhir.mdm.api.MatchedTarget;
30-
import ca.uhn.fhir.mdm.api.MdmMatchOutcome;
3126
import ca.uhn.fhir.mdm.log.Logs;
32-
import ca.uhn.fhir.mdm.model.CanonicalEID;
3327
import ca.uhn.fhir.mdm.rules.svc.MdmResourceMatcherSvc;
34-
import ca.uhn.fhir.mdm.util.EIDHelper;
35-
import ca.uhn.fhir.rest.api.server.IBundleProvider;
36-
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
37-
import ca.uhn.fhir.rest.param.TokenParam;
3828
import jakarta.annotation.Nonnull;
3929
import org.hl7.fhir.instance.model.api.IAnyResource;
40-
import org.hl7.fhir.instance.model.api.IIdType;
4130
import org.slf4j.Logger;
4231
import org.springframework.beans.factory.annotation.Autowired;
4332
import org.springframework.stereotype.Service;
4433
import org.springframework.transaction.annotation.Transactional;
4534

46-
import java.util.ArrayList;
4735
import java.util.Collection;
4836
import java.util.List;
4937
import java.util.stream.Collectors;
5038

5139
import static ca.uhn.fhir.jpa.mdm.svc.candidate.CandidateSearcher.idOrType;
52-
import static org.hl7.fhir.dstu2016may.model.Basic.SP_IDENTIFIER;
5340

5441
@Service
5542
public class MdmMatchFinderSvcImpl implements IMdmMatchFinderSvc {
5643

5744
private static final Logger ourLog = Logs.getMdmTroubleshootingLog();
5845

59-
@Autowired
60-
private DaoRegistry myDaoRegistry;
61-
6246
@Autowired
6347
private MdmCandidateSearchSvc myMdmCandidateSearchSvc;
6448

6549
@Autowired
6650
private MdmResourceMatcherSvc myMdmResourceMatcherSvc;
6751

68-
@Autowired
69-
private EIDHelper myEIDHelper;
70-
71-
@Autowired
72-
IMdmSettings myMdmSettings;
73-
7452
@Override
7553
@Nonnull
7654
@Transactional
7755
public List<MatchedTarget> getMatchedTargets(
7856
String theResourceType, IAnyResource theResource, RequestPartitionId theRequestPartitionId) {
79-
80-
List<MatchedTarget> retval = matchBasedOnEid(theResourceType, theResource, theRequestPartitionId);
81-
if (!retval.isEmpty()) {
82-
return retval;
83-
}
84-
8557
Collection<IAnyResource> targetCandidates =
8658
myMdmCandidateSearchSvc.findCandidates(theResourceType, theResource, theRequestPartitionId);
8759

@@ -93,42 +65,4 @@ public List<MatchedTarget> getMatchedTargets(
9365
ourLog.trace("Found {} matched targets for {}.", matches.size(), idOrType(theResource, theResourceType));
9466
return matches;
9567
}
96-
97-
private List<MatchedTarget> matchBasedOnEid(
98-
String theResourceType, IAnyResource theResource, RequestPartitionId theRequestPartitionId) {
99-
List<CanonicalEID> eidFromResource = myEIDHelper.getExternalEid(theResource);
100-
List<MatchedTarget> retval = new ArrayList<>();
101-
for (CanonicalEID eid : eidFromResource) {
102-
retval.addAll(searchForResourceByEID(
103-
theResource.getIdElement().toUnqualifiedVersionless(),
104-
eid.getValue(),
105-
theResourceType,
106-
theRequestPartitionId));
107-
}
108-
return retval;
109-
}
110-
111-
private Collection<? extends MatchedTarget> searchForResourceByEID(
112-
IIdType theResourceIdToExclude,
113-
String theEid,
114-
String theResourceType,
115-
RequestPartitionId theRequestPartitionId) {
116-
SearchParameterMap map = SearchParameterMap.newSynchronous();
117-
map.add(
118-
SP_IDENTIFIER,
119-
new TokenParam(
120-
myMdmSettings.getMdmRules().getEnterpriseEIDSystemForResourceType(theResourceType), theEid));
121-
122-
IFhirResourceDao<?> resourceDao = myDaoRegistry.getResourceDao(theResourceType);
123-
SystemRequestDetails systemRequestDetails = new SystemRequestDetails();
124-
systemRequestDetails.setRequestPartitionId(theRequestPartitionId);
125-
IBundleProvider search = resourceDao.search(map, systemRequestDetails);
126-
return search.getAllResources().stream()
127-
.map(IAnyResource.class::cast)
128-
// Exclude the incoming resource from the matched results
129-
.filter(resource ->
130-
!theResourceIdToExclude.equals(resource.getIdElement().toUnqualifiedVersionless()))
131-
.map(resource -> new MatchedTarget(resource, MdmMatchOutcome.EID_MATCH))
132-
.toList();
133-
}
13468
}

‎hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/MdmMatchOutcome.java

Copy file name to clipboardExpand all lines: hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/MdmMatchOutcome.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public MdmMatchOutcome(Long theVector, Double theScore) {
7676
}
7777

7878
public boolean isMatch() {
79-
return isEidMatch() || myMatchResultEnum == MdmMatchResultEnum.MATCH;
79+
return myMatchResultEnum == MdmMatchResultEnum.MATCH;
8080
}
8181

8282
public boolean isPossibleMatch() {

‎hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderLoader.java

Copy file name to clipboardExpand all lines: hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderLoader.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
@Service
3838
public class MdmProviderLoader {
3939
@Autowired
40-
protected FhirContext myFhirContext;
40+
private FhirContext myFhirContext;
4141

4242
@Autowired
43-
protected ResourceProviderFactory myResourceProviderFactory;
43+
private ResourceProviderFactory myResourceProviderFactory;
4444

4545
@Autowired
4646
private MdmControllerHelper myMdmControllerHelper;
@@ -60,7 +60,7 @@ public class MdmProviderLoader {
6060
@Autowired
6161
private IInterceptorBroadcaster myInterceptorBroadcaster;
6262

63-
protected Supplier<Object> myMdmProviderSupplier;
63+
private Supplier<Object> myMdmProviderSupplier;
6464
private Supplier<Object> myPatientMatchProviderSupplier;
6565
private Supplier<Object> myMdmHistoryProviderSupplier;
6666

‎hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmSearchParamBuildingUtils.java

Copy file name to clipboardExpand all lines: hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmSearchParamBuildingUtils.java
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
import ca.uhn.fhir.rest.param.TokenAndListParam;
2626
import ca.uhn.fhir.rest.param.TokenParam;
2727

28-
import static ca.uhn.fhir.rest.api.Constants.PARAM_TAG;
29-
import static org.hl7.fhir.dstu2016may.model.Basic.SP_IDENTIFIER;
30-
3128
public class MdmSearchParamBuildingUtils {
3229

30+
private static final String IDENTIFIER = "identifier";
31+
32+
private static final String TAG = "_tag";
33+
3334
/**
3435
* Builds a search parameter map that can be used to find the
3536
* golden resources associated with MDM blocked resources (ie, those
@@ -42,7 +43,7 @@ public static SearchParameterMap buildSearchParameterForBlockedResourceCount(Str
4243
tagsToSearch.addAnd(new TokenParam(MdmConstants.SYSTEM_GOLDEN_RECORD_STATUS, MdmConstants.CODE_GOLDEN_RECORD));
4344
tagsToSearch.addAnd(new TokenParam(MdmConstants.SYSTEM_GOLDEN_RECORD_STATUS, MdmConstants.CODE_BLOCKED));
4445

45-
map.add(PARAM_TAG, tagsToSearch);
46+
map.add(TAG, tagsToSearch);
4647
return map;
4748
}
4849

@@ -53,9 +54,7 @@ public static SearchParameterMap buildSearchParameterForBlockedResourceCount(Str
5354
public static SearchParameterMap buildEidSearchParameterMap(
5455
String theEid, String theResourceType, MdmRulesJson theMdmRules) {
5556
SearchParameterMap map = buildBasicGoldenResourceSearchParameterMap(theEid);
56-
map.add(
57-
SP_IDENTIFIER,
58-
new TokenParam(theMdmRules.getEnterpriseEIDSystemForResourceType(theResourceType), theEid));
57+
map.add(IDENTIFIER, new TokenParam(theMdmRules.getEnterpriseEIDSystemForResourceType(theResourceType), theEid));
5958
return map;
6059
}
6160

@@ -65,7 +64,7 @@ public static SearchParameterMap buildEidSearchParameterMap(
6564
public static SearchParameterMap buildBasicGoldenResourceSearchParameterMap(String theResourceType) {
6665
SearchParameterMap map = new SearchParameterMap();
6766
map.setLoadSynchronous(true);
68-
map.add(PARAM_TAG, new TokenParam(MdmConstants.SYSTEM_GOLDEN_RECORD_STATUS, MdmConstants.CODE_GOLDEN_RECORD));
67+
map.add(TAG, new TokenParam(MdmConstants.SYSTEM_GOLDEN_RECORD_STATUS, MdmConstants.CODE_GOLDEN_RECORD));
6968
return map;
7069
}
7170
}

‎hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ProviderConstants.java

Copy file name to clipboardExpand all lines: hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ProviderConstants.java
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,4 @@ public class ProviderConstants {
299299
public static final String OPERATION_REPLACE_REFERENCES_RESOURCE_LIMIT_DEFAULT_STRING = "512";
300300
public static final Integer OPERATION_REPLACE_REFERENCES_RESOURCE_LIMIT_DEFAULT =
301301
Integer.parseInt(OPERATION_REPLACE_REFERENCES_RESOURCE_LIMIT_DEFAULT_STRING);
302-
303-
public static final String OPERATION_MDM_BUNDLE_MATCH = "$mdm-bundle-match";
304-
public static final String MDM_BUNDLE_MATCH_PARAM_INPUT_BUNDLE = "bundle";
305302
}

‎hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java

Copy file name to clipboardExpand all lines: hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ public void register(IFhirResourceDao theResourceDao) {
188188
myResourceNameToResourceDao.put(resourceName, theResourceDao);
189189
}
190190

191-
public <T extends IBaseResource> IFhirResourceDao<T> getDaoOrThrowException(Class<T> theClass) {
192-
IFhirResourceDao<T> retVal = getResourceDao(theClass);
191+
public IFhirResourceDao getDaoOrThrowException(Class<? extends IBaseResource> theClass) {
192+
IFhirResourceDao retVal = getResourceDao(theClass);
193193
if (retVal == null) {
194194
List<String> supportedResourceNames = myResourceNameToResourceDao.keySet().stream()
195195
.map(t -> myFhirContext.getResourceType(t))
196196
.sorted()
197-
.toList();
197+
.collect(Collectors.toList());
198198
throw new InvalidRequestException(Msg.code(573)
199199
+ "Unable to process request, this server does not know how to handle resources of type "
200200
+ myFhirContext.getResourceType(theClass) + " - Can handle: " + supportedResourceNames);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.