private void extractTokensFromCoding(List<String> theSystems, List<String> theCodes, ResourceTable theEntity, Set<BaseResourceIndexedSearchParam> theListToPopulate, RuntimeSearchParam theParameterDef, Coding nextCoding) { if (nextCoding != null && !nextCoding.isEmpty()) { String nextSystem = nextCoding.getSystemElement().getValueAsString(); String nextCode = nextCoding.getCodeElement().getValue(); if (isNotBlank(nextSystem) || isNotBlank(nextCode)) { theSystems.add(nextSystem); theCodes.add(nextCode); } if (!nextCoding.getDisplayElement().isEmpty()) { addStringParam(theEntity, theListToPopulate, theParameterDef, nextCoding.getDisplayElement().getValue()); } } }
private void addQuantity(ResourceTable theEntity, HashSet<ResourceIndexedSearchParamQuantity> retVal, String resourceName, Quantity nextValue) { if (!nextValue.getValueElement().isEmpty()) { BigDecimal nextValueValue = nextValue.getValueElement().getValue(); String nextValueString = nextValue.getSystemElement().getValueAsString(); String nextValueCode = nextValue.getCode(); ResourceIndexedSearchParamQuantity nextEntity = new ResourceIndexedSearchParamQuantity(resourceName, nextValueValue, nextValueString, nextValueCode); nextEntity.setResource(theEntity); retVal.add(nextEntity); } }
@Override public ValueSetExpansionComponent expandValueSet(FhirContext theContext, ConceptSetComponent theInclude) { ValueSetExpansionComponent retVal = new ValueSetExpansionComponent(); Set<String> wantCodes = new HashSet<>(); for (ConceptReferenceComponent next : theInclude.getConcept()) { wantCodes.add(next.getCode()); } CodeSystem system = fetchCodeSystem(theContext, theInclude.getSystem()); if (system != null) { List<ConceptDefinitionComponent> concepts = system.getConcept(); addConcepts(theInclude, retVal, wantCodes, concepts); } for (UriType next: theInclude.getValueSet()) { ValueSet vs = myValueSets.get(defaultString(next.getValueAsString())); if (vs != null) { for (ConceptSetComponent nextInclude : vs.getCompose().getInclude()) { ValueSetExpansionComponent contents = expandValueSet(theContext, nextInclude); retVal.getContains().addAll(contents.getContains()); } } } return retVal; }
continue; String system = StringUtils.defaultIfBlank(nextValue.getSystemElement().getValueAsString(), null); String value = nextValue.getValueElement().getValue(); if (isNotBlank(value)) {
/** * Compares the given string to the string representation of this URI. In many cases it is preferable to use this * instead of the standard {@link #equals(Object)} method, since that method returns <code>false</code> unless it is * passed an instance of {@link UriType} */ public boolean equals(String theString) { return StringUtils.equals(getValueAsString(), theString); }
/** * Creates an ID based on a given URL */ public IdType(UriType theUrl) { setValue(theUrl.getValueAsString()); }
@Override public ValueSetExpansionComponent expandValueSet(FhirContext theContext, ConceptSetComponent theInclude) { ValueSetExpansionComponent retVal = new ValueSetExpansionComponent(); Set<String> wantCodes = new HashSet<>(); for (ConceptReferenceComponent next : theInclude.getConcept()) { wantCodes.add(next.getCode()); } CodeSystem system = fetchCodeSystem(theContext, theInclude.getSystem()); if (system != null) { List<ConceptDefinitionComponent> concepts = system.getConcept(); addConcepts(theInclude, retVal, wantCodes, concepts); } for (UriType next: theInclude.getValueSet()) { ValueSet vs = myValueSets.get(defaultString(next.getValueAsString())); if (vs != null) { for (ConceptSetComponent nextInclude : vs.getCompose().getInclude()) { ValueSetExpansionComponent contents = expandValueSet(theContext, nextInclude); retVal.getContains().addAll(contents.getContains()); } } } return retVal; }