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); String system = define.getSystemElement().getValueAsString(); for (CodeSystemConcept nextConcept : define.getConcept()) { addDefinedConcept(vs, system, nextConcept);
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; }
/** * Adds a given new value for <b>concept</b> () * * <p> * <b>Definition:</b> * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are * </p> * @param theValue The concept to add (must not be <code>null</code>) */ public CodeSystem addConcept(CodeSystemConcept theValue) { if (theValue == null) { throw new NullPointerException("theValue must not be null"); } getConcept().add(theValue); return this; }
/** * Gets the value(s) for <b>codeSystem</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * A definition of a code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to its (codeSystem.system) directly * </p> */ public CodeSystem getCodeSystem() { if (myCodeSystem == null) { myCodeSystem = new CodeSystem(); } return myCodeSystem; }
/** * Gets the first repetition for <b>concept</b> (), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are * </p> */ public CodeSystemConcept getConceptFirstRep() { if (getConcept().isEmpty()) { return addConcept(); } return getConcept().get(0); }
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); } }
/** * Adds and returns a new value for <b>concept</b> () * * <p> * <b>Definition:</b> * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are * </p> */ public CodeSystemConcept addConcept() { CodeSystemConcept newType = new CodeSystemConcept(); getConcept().add(newType); return newType; }
/** * Gets the value(s) for <b>version</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked * </p> */ public String getVersion() { return getVersionElement().getValue(); }
/** * Gets the value(s) for <b>system</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system * </p> */ public String getSystem() { return getSystemElement().getValue(); }
/** * Gets the value(s) for <b>caseSensitive</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * If code comparison is case sensitive when codes within this system are compared to each other * </p> */ public Boolean getCaseSensitive() { return getCaseSensitiveElement().getValue(); }
@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 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); } }