private void addFilterIfPresent(String theFilter, ConceptSetComponent include) { if (ElementUtil.isEmpty(include.getConcept())) { if (isNotBlank(theFilter)) { include.addFilter().setProperty("display").setOp(FilterOperator.EQUAL).setValue(theFilter); } } }
@Override public ValueSet expandByIdentifier(String theUri, String theFilter) { if (isBlank(theUri)) { throw new InvalidRequestException("URI must not be blank or missing"); } ValueSet source = new ValueSet(); source.getCompose().addInclude().addValueSet(theUri); if (isNotBlank(theFilter)) { ConceptSetComponent include = source.getCompose().addInclude(); ConceptSetFilterComponent filter = include.addFilter(); filter.setProperty("display"); filter.setOp(FilterOperator.EQUAL); filter.setValue(theFilter); } ValueSet retVal = doExpand(source); return retVal; // if (defaultValueSet != null) { // source = getContext().newJsonParser().parseResource(ValueSet.class, getContext().newJsonParser().encodeResourceToString(defaultValueSet)); // } else { // IBundleProvider ids = search(ValueSet.SP_URL, new UriParam(theUri)); // if (ids.size() == 0) { // throw new InvalidRequestException("Unknown ValueSet URI: " + theUri); // } // source = (ValueSet) ids.getResources(0, 1).get(0); // } // // return expand(defaultValueSet, theFilter); }
/** * @return The first repetition of repeating field {@link #filter}, creating it if it does not already exist */ public ConceptSetFilterComponent getFilterFirstRep() { if (getFilter().isEmpty()) { addFilter(); } return getFilter().get(0); }
@Override public ValueSet expandByIdentifier(String theUri, String theFilter) { if (isBlank(theUri)) { throw new InvalidRequestException("URI must not be blank or missing"); } ValueSet source = new ValueSet(); source.getCompose().addInclude().addValueSet(theUri); if (isNotBlank(theFilter)) { ConceptSetComponent include = source.getCompose().addInclude(); ConceptSetFilterComponent filter = include.addFilter(); filter.setProperty("display"); filter.setOp(FilterOperator.EQUAL); filter.setValue(theFilter); } ValueSet retVal = doExpand(source); return retVal; // if (defaultValueSet != null) { // source = getContext().newJsonParser().parseResource(ValueSet.class, getContext().newJsonParser().encodeResourceToString(defaultValueSet)); // } else { // IBundleProvider ids = search(ValueSet.SP_URL, new UriParam(theUri)); // if (ids.size() == 0) { // throw new InvalidRequestException("Unknown ValueSet URI: " + theUri); // } // source = (ValueSet) ids.getResources(0, 1).get(0); // } // // return expand(defaultValueSet, theFilter); }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("system")) { throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system"); } else if (name.equals("version")) { throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); } else if (name.equals("concept")) { return addConcept(); } else if (name.equals("filter")) { return addFilter(); } else if (name.equals("valueSet")) { throw new FHIRException("Cannot call addChild on a primitive type ValueSet.valueSet"); } else return super.addChild(name); }
public static org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); return tgt; }
private void addFilterIfPresent(String theFilter, ConceptSetComponent include) { if (ElementUtil.isEmpty(include.getConcept())) { if (isNotBlank(theFilter)) { include.addFilter().setProperty("display").setOp(FilterOperator.EQUAL).setValue(theFilter); } } }
public org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.instance.model.ValueSet.ConceptSetComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); tgt.setVersion(src.getVersion()); for (org.hl7.fhir.instance.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); for (org.hl7.fhir.instance.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); return tgt; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -887328209: return getSystemElement(); case 351608024: return getVersionElement(); case 951024232: return addConcept(); case -1274492040: return addFilter(); case -1410174671: return addValueSetElement(); default: return super.makeProperty(hash, name); } }
public static org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); return tgt; }
public org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.instance.model.ValueSet.ConceptSetComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); tgt.setVersion(src.getVersion()); for (org.hl7.fhir.instance.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); for (org.hl7.fhir.instance.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); return tgt; }