public BaseRuntimeChildDefinition getDefinition(Class<? extends IBaseResource> theResourceType, String thePath) { RuntimeResourceDefinition def = myContext.getResourceDefinition(theResourceType); BaseRuntimeElementCompositeDefinition<?> currentDef = def; List<String> parts = Arrays.asList(thePath.split("\\.")); List<String> subList = parts.subList(1, parts.size()); if (subList.size() < 1) { throw new ConfigurationException("Invalid path: " + thePath); } return getDefinition(currentDef, subList); }
private BaseRuntimeChildDefinition getDefinition(BaseRuntimeElementCompositeDefinition<?> theCurrentDef, List<String> theSubList) { BaseRuntimeChildDefinition nextDef = theCurrentDef.getChildByNameOrThrowDataFormatException(theSubList.get(0)); if (theSubList.size() == 1) { return nextDef; } BaseRuntimeElementCompositeDefinition<?> cmp = (BaseRuntimeElementCompositeDefinition<?>) nextDef.getChildByName(theSubList.get(0)); return getDefinition(cmp, theSubList.subList(1, theSubList.size())); }
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; }
BaseRuntimeChildDefinition def = myContext.newTerser().getDefinition(myResourceType, paramPath); if (def instanceof RuntimeChildChoiceDefinition) { RuntimeChildChoiceDefinition choiceDef = (RuntimeChildChoiceDefinition) def;
private BaseRuntimeChildDefinition getDefinition(BaseRuntimeElementCompositeDefinition<?> theCurrentDef, List<String> theSubList) { BaseRuntimeChildDefinition nextDef = theCurrentDef.getChildByNameOrThrowDataFormatException(theSubList.get(0)); if (theSubList.size() == 1) { return nextDef; } BaseRuntimeElementCompositeDefinition<?> cmp = (BaseRuntimeElementCompositeDefinition<?>) nextDef.getChildByName(theSubList.get(0)); return getDefinition(cmp, theSubList.subList(1, theSubList.size())); }
public BaseRuntimeChildDefinition getDefinition(Class<? extends IBaseResource> theResourceType, String thePath) { RuntimeResourceDefinition def = myContext.getResourceDefinition(theResourceType); BaseRuntimeElementCompositeDefinition<?> currentDef = def; List<String> parts = Arrays.asList(thePath.split("\\.")); List<String> subList = parts.subList(1, parts.size()); if (subList.size() < 1) { throw new ConfigurationException("Invalid path: " + thePath); } return getDefinition(currentDef, subList); }
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; }
BaseRuntimeChildDefinition def = myContext.newTerser().getDefinition(myResourceType, paramPath); if (def instanceof RuntimeChildChoiceDefinition) { RuntimeChildChoiceDefinition choiceDef = (RuntimeChildChoiceDefinition) def;