private void addCompose(String theFilter, ValueSet theValueSetToPopulate, ValueSet theSourceValueSet, CodeSystemConcept theConcept) { if (isBlank(theFilter)) { addCompose(theValueSetToPopulate, theSourceValueSet.getCodeSystem().getSystem(), theConcept.getCode(), theConcept.getDisplay()); } else { String filter = theFilter.toLowerCase(); if (theConcept.getDisplay().toLowerCase().contains(filter) || theConcept.getCode().toLowerCase().contains(filter)) { addCompose(theValueSetToPopulate, theSourceValueSet.getCodeSystem().getSystem(), theConcept.getCode(), theConcept.getDisplay()); } } for (CodeSystemConcept nextChild : theConcept.getConcept()) { addCompose(theFilter, theValueSetToPopulate, theSourceValueSet, nextChild); } }
if (theResource instanceof ValueSet) { ValueSet vs = (ValueSet) theResource; useSystem = vs.getCodeSystem().getSystem();
@Override public ValueSet expand(ValueSet source, String theFilter) { ValueSet retVal = new ValueSet(); retVal.setDate(DateTimeDt.withCurrentTime()); /* * Add composed concepts */ for (ComposeInclude nextInclude : source.getCompose().getInclude()) { for (ComposeIncludeConcept next : nextInclude.getConcept()) { if (isBlank(theFilter)) { addCompose(retVal, nextInclude.getSystem(), next.getCode(), next.getDisplay()); } else { String filter = theFilter.toLowerCase(); if (next.getDisplay().toLowerCase().contains(filter) || next.getCode().toLowerCase().contains(filter)) { addCompose(retVal, nextInclude.getSystem(), next.getCode(), next.getDisplay()); } } } } /* * Add defined concepts */ for (CodeSystemConcept next : source.getCodeSystem().getConcept()) { addCompose(theFilter, retVal, source, next); } return retVal; }
private ValueSetTm parseValueSet(ca.uhn.fhir.model.dstu2.resource.ValueSet nextVs) { myConceptCount += nextVs.getCodeSystem().getConcept().size(); ourLog.debug("Parsing ValueSetTm #{} - {} - {} concepts total", myValueSetCount++, nextVs.getName(), myConceptCount); CodeSystem define = nextVs.getCodeSystem(); String system = define.getSystemElement().getValueAsString(); for (CodeSystemConcept nextConcept : define.getConcept()) {
private void addCompose(String theFilter, ValueSet theValueSetToPopulate, ValueSet theSourceValueSet, CodeSystemConcept theConcept) { if (isBlank(theFilter)) { addCompose(theValueSetToPopulate, theSourceValueSet.getCodeSystem().getSystem(), theConcept.getCode(), theConcept.getDisplay()); } else { String filter = theFilter.toLowerCase(); if (theConcept.getDisplay().toLowerCase().contains(filter) || theConcept.getCode().toLowerCase().contains(filter)) { addCompose(theValueSetToPopulate, theSourceValueSet.getCodeSystem().getSystem(), theConcept.getCode(), theConcept.getDisplay()); } } for (CodeSystemConcept nextChild : theConcept.getConcept()) { addCompose(theFilter, theValueSetToPopulate, theSourceValueSet, nextChild); } }
@Override public ValueSet expand(ValueSet source, String theFilter) { ValueSet retVal = new ValueSet(); retVal.setDate(DateTimeDt.withCurrentTime()); /* * Add composed concepts */ for (ComposeInclude nextInclude : source.getCompose().getInclude()) { for (ComposeIncludeConcept next : nextInclude.getConcept()) { if (isBlank(theFilter)) { addCompose(retVal, nextInclude.getSystem(), next.getCode(), next.getDisplay()); } else { String filter = theFilter.toLowerCase(); if (next.getDisplay().toLowerCase().contains(filter) || next.getCode().toLowerCase().contains(filter)) { addCompose(retVal, nextInclude.getSystem(), next.getCode(), next.getDisplay()); } } } } /* * Add defined concepts */ for (CodeSystemConcept next : source.getCodeSystem().getConcept()) { addCompose(theFilter, retVal, source, next); } return retVal; }