@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("identifier")) { this.identifier = castToUri(value); // UriType } else if (name.equals("timestamp")) { this.timestamp = castToDateTime(value); // DateTimeType } else if (name.equals("total")) { this.total = castToInteger(value); // IntegerType } else if (name.equals("offset")) { this.offset = castToInteger(value); // IntegerType } else if (name.equals("parameter")) { this.getParameter().add((ValueSetExpansionParameterComponent) value); } else if (name.equals("contains")) { this.getContains().add((ValueSetExpansionContainsComponent) value); } else return super.setProperty(name, value); return value; }
/** * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist */ public ValueSetExpansionParameterComponent getParameterFirstRep() { if (getParameter().isEmpty()) { addParameter(); } return getParameter().get(0); }
private void addCodes(ValueSetExpansionComponent expand, List<ValueSetExpansionParameterComponent> params, ExpansionProfile profile, List<ValueSet> filters) throws ETooCostly { if (expand.getContains().size() > maxExpansionSize) throw new ETooCostly("Too many codes to display (>" + Integer.toString(expand.getContains().size()) + ")"); for (ValueSetExpansionParameterComponent p : expand.getParameter()) { if (!existsInParams(params, p.getName(), p.getValue())) params.add(p); } copyImportContains(expand.getContains(), null, profile, filters); }
handleCompose(source.getCompose(), focus.getExpansion().getParameter(), profile);
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -1618432855: // identifier this.identifier = castToUri(value); // UriType return value; case 55126294: // timestamp this.timestamp = castToDateTime(value); // DateTimeType return value; case 110549828: // total this.total = castToInteger(value); // IntegerType return value; case -1019779949: // offset this.offset = castToInteger(value); // IntegerType return value; case 1954460585: // parameter this.getParameter().add((ValueSetExpansionParameterComponent) value); // ValueSetExpansionParameterComponent return value; case -567445985: // contains this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent return value; default: return super.setProperty(hash, name, value); } }
private ValueSet importValueSet(String value, List<ValueSetExpansionParameterComponent> params, ExpansionProfile profile) throws ETooCostly, TerminologyServiceException, FileNotFoundException, IOException, FHIRFormatError { if (value == null) throw new TerminologyServiceException("unable to find value set with no identity"); ValueSet vs = context.fetchResource(ValueSet.class, value); if (vs == null) throw new TerminologyServiceException("Unable to find imported value set " + value); ValueSetExpansionOutcome vso = factory.getExpander().expand(vs, profile); if (vso.getError() != null) throw new TerminologyServiceException("Unable to expand imported value set: " + vso.getError()); if (vso.getService() != null) throw new TerminologyServiceException("Unable to expand imported value set " + value); if (vs.hasVersion()) if (!existsInParams(params, "version", new UriType(vs.getUrl() + "|" + vs.getVersion()))) params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(vs.getUrl() + "|" + vs.getVersion()))); for (ValueSetExpansionParameterComponent p : vso.getValueset().getExpansion().getParameter()) { if (!existsInParams(params, p.getName(), p.getValue())) params.add(p); } canBeHeirarchy = false; // if we're importing a value set, we have to be combining, so we won't try for a heirarchy return vso.getValueset(); }
public static org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent(); copyElement(src, tgt); tgt.setIdentifier(src.getIdentifier()); tgt.setTimestamp(src.getTimestamp()); if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }
public org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionComponent(); copyElement(src, tgt); tgt.setIdentifier(src.getIdentifier()); tgt.setTimestamp(src.getTimestamp()); tgt.setTotal(src.getTotal()); tgt.setOffset(src.getOffset()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }
public static org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent(); copyElement(src, tgt); tgt.setIdentifier(src.getIdentifier()); tgt.setTimestamp(src.getTimestamp()); if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }
public org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionComponent(); copyElement(src, tgt); tgt.setIdentifier(src.getIdentifier()); tgt.setTimestamp(src.getTimestamp()); tgt.setTotal(src.getTotal()); tgt.setOffset(src.getOffset()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }