private Predicate createResourceLinkPathPredicate(FhirContext theContext, String theParamName, From<?, ? extends ResourceLink> theFrom, String theResourceType) { RuntimeResourceDefinition resourceDef = theContext.getResourceDefinition(theResourceType); RuntimeSearchParam param = mySearchParamRegistry.getSearchParamByName(resourceDef, theParamName); List<String> path = param.getPathsSplit(); /* * SearchParameters can declare paths on multiple resources * types. Here we only want the ones that actually apply. */ path = new ArrayList<>(path); for (int i = 0; i < path.size(); i++) { String nextPath = trim(path.get(i)); if (!nextPath.contains(theResourceType + ".")) { path.remove(i); i--; } } return theFrom.get("mySourcePath").in(path); }
public boolean matchesInclude(Include theInclude) { if (theInclude.getValue().equals("*")) { return true; } int colonIndex = theInclude.getValue().indexOf(':'); if (colonIndex != -1) { // DSTU2+ style String resourceName = theInclude.getValue().substring(0, colonIndex); String paramName = theInclude.getValue().substring(colonIndex + 1); RuntimeResourceDefinition resourceDef = myContext.getResourceDefinition(resourceName); if (resourceDef != null) { RuntimeSearchParam searchParamDef = resourceDef.getSearchParam(paramName); if (searchParamDef!=null) { final String completeName = myOwningResource + "." + myName; boolean matched = false; for (String s : searchParamDef.getPathsSplit()) { if (s.equals(completeName) || s.startsWith(completeName + ".")) { matched = true; break; } } return matched; } } return false; } // DSTU1 style return (theInclude.getValue().equals(myOwningResource + '.' + myName)); } }
private String determineSystemIfMissing(String theParamName, String code, String theSystem) { String retVal = theSystem; if (retVal == null) { RuntimeResourceDefinition resourceDef = myContext.getResourceDefinition(myResourceName); RuntimeSearchParam param = mySearchParamRegistry.getSearchParamByName(resourceDef, theParamName); if (param != null) { Set<String> valueSetUris = Sets.newHashSet(); for (String nextPath : param.getPathsSplit()) { BaseRuntimeChildDefinition def = myContext.newTerser().getDefinition(myResourceType, nextPath); if (def instanceof BaseRuntimeDeclaredChildDefinition) { String valueSet = ((BaseRuntimeDeclaredChildDefinition) def).getBindingValueSet(); if (isNotBlank(valueSet)) { valueSetUris.add(valueSet); } } } if (valueSetUris.size() == 1) { String valueSet = valueSetUris.iterator().next(); List<VersionIndependentConcept> candidateCodes = myTerminologySvc.expandValueSet(valueSet); for (VersionIndependentConcept nextCandidate : candidateCodes) { if (nextCandidate.getCode().equals(code)) { retVal = nextCandidate.getSystem(); break; } } } } } return retVal; }
paths = param.getPathsSplit();
linksForCompositePart = theParams.links; linksForCompositePartWantPaths = new HashSet<>(); linksForCompositePartWantPaths.addAll(nextCompositeOf.getPathsSplit()); break; case QUANTITY:
for (String nextPath : nextParam.getPathsSplit()) {
thePredicates.add(join.get("mySourcePath").as(String.class).in(param.getPathsSplit())); } else { if (myDontUseHashesForSearch) {
private Predicate createResourceLinkPathPredicate(FhirContext theContext, String theParamName, From<?, ? extends ResourceLink> theFrom, String theResourceType) { RuntimeResourceDefinition resourceDef = theContext.getResourceDefinition(theResourceType); RuntimeSearchParam param = mySearchParamRegistry.getSearchParamByName(resourceDef, theParamName); List<String> path = param.getPathsSplit(); /* * SearchParameters can declare paths on multiple resources * types. Here we only want the ones that actually apply. */ path = new ArrayList<>(path); for (int i = 0; i < path.size(); i++) { String nextPath = trim(path.get(i)); if (!nextPath.contains(theResourceType + ".")) { path.remove(i); i--; } } return theFrom.get("mySourcePath").in(path); }
public boolean matchesInclude(Include theInclude) { if (theInclude.getValue().equals("*")) { return true; } int colonIndex = theInclude.getValue().indexOf(':'); if (colonIndex != -1) { // DSTU2+ style String resourceName = theInclude.getValue().substring(0, colonIndex); String paramName = theInclude.getValue().substring(colonIndex + 1); RuntimeResourceDefinition resourceDef = myContext.getResourceDefinition(resourceName); if (resourceDef != null) { RuntimeSearchParam searchParamDef = resourceDef.getSearchParam(paramName); if (searchParamDef!=null) { final String completeName = myOwningResource + "." + myName; boolean matched = false; for (String s : searchParamDef.getPathsSplit()) { if (s.equals(completeName) || s.startsWith(completeName + ".")) { matched = true; break; } } return matched; } } return false; } // DSTU1 style return (theInclude.getValue().equals(myOwningResource + '.' + myName)); } }
private String determineSystemIfMissing(String theParamName, String code, String theSystem) { String retVal = theSystem; if (retVal == null) { RuntimeResourceDefinition resourceDef = myContext.getResourceDefinition(myResourceName); RuntimeSearchParam param = mySearchParamRegistry.getSearchParamByName(resourceDef, theParamName); if (param != null) { Set<String> valueSetUris = Sets.newHashSet(); for (String nextPath : param.getPathsSplit()) { BaseRuntimeChildDefinition def = myContext.newTerser().getDefinition(myResourceType, nextPath); if (def instanceof BaseRuntimeDeclaredChildDefinition) { String valueSet = ((BaseRuntimeDeclaredChildDefinition) def).getBindingValueSet(); if (isNotBlank(valueSet)) { valueSetUris.add(valueSet); } } } if (valueSetUris.size() == 1) { String valueSet = valueSetUris.iterator().next(); List<VersionIndependentConcept> candidateCodes = myTerminologySvc.expandValueSet(valueSet); for (VersionIndependentConcept nextCandidate : candidateCodes) { if (nextCandidate.getCode().equals(code)) { retVal = nextCandidate.getSystem(); break; } } } } } return retVal; }
paths = param.getPathsSplit();
linksForCompositePart = theParams.links; linksForCompositePartWantPaths = new HashSet<>(); linksForCompositePartWantPaths.addAll(nextCompositeOf.getPathsSplit()); break; case QUANTITY:
for (String nextPath : nextParam.getPathsSplit()) {
thePredicates.add(join.get("mySourcePath").as(String.class).in(param.getPathsSplit())); } else { if (myDontUseHashesForSearch) {