private boolean codeinExpansion(ValueSetExpansionContainsComponent cnt, String system, String code) { for (ValueSetExpansionContainsComponent c : cnt.getContains()) { if (code.equals(c.getCode()) && system.equals(c.getSystem().toString())) return true; if (codeinExpansion(c, system, code)) return true; } return false; }
private void applyFilter(IntegerType theTotalElement, List<ValueSetExpansionContainsComponent> theContains, String theFilter) { for (int idx = 0; idx < theContains.size(); idx++) { ValueSetExpansionContainsComponent next = theContains.get(idx); if (isBlank(next.getDisplay()) || !org.apache.commons.lang3.StringUtils.containsIgnoreCase(next.getDisplay(), theFilter)) { theContains.remove(idx); idx--; if (theTotalElement.getValue() != null) { theTotalElement.setValue(theTotalElement.getValue() - 1); } } applyFilter(theTotalElement, next.getContains(), theFilter); } }
private ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCodeIsInContains(List<ValueSetExpansionContainsComponent> contains, String theSystem, String theCode, Coding theCoding, CodeableConcept theCodeableConcept) { for (ValueSetExpansionContainsComponent nextCode : contains) { ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult result = validateCodeIsInContains(nextCode.getContains(), theSystem, theCode, theCoding, theCodeableConcept); if (result != null) { return result; } String system = nextCode.getSystem(); String code = nextCode.getCode(); if (isNotBlank(theCode)) { if (theCode.equals(code) && (isBlank(theSystem) || theSystem.equals(system))) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } else if (theCoding != null) { if (StringUtils.equals(system, theCoding.getSystem()) && StringUtils.equals(code, theCoding.getCode())) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } else { for (Coding next : theCodeableConcept.getCoding()) { if (StringUtils.equals(system, next.getSystem()) && StringUtils.equals(code, next.getCode())) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } } } return null; }
if (map.containsKey(key(c)) && !c.getAbstract()) { // we may have added abstract codes earlier while we still thought it might be heirarchical, but later we gave up, so now ignore them focus.getExpansion().getContains().add(c); c.getContains().clear(); // make sure any heirarchy is wiped
parent.getContains().add(n); } else { roots.add(n);
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -887328209: // system this.system = castToUri(value); // UriType return value; case 1732898850: // abstract this.abstract_ = castToBoolean(value); // BooleanType return value; case 24665195: // inactive this.inactive = castToBoolean(value); // BooleanType return value; case 351608024: // version this.version = castToString(value); // StringType return value; case 3059181: // code this.code = castToCode(value); // CodeType return value; case 1671764162: // display this.display = castToString(value); // StringType return value; case -900931593: // designation this.getDesignation().add((ConceptReferenceDesignationComponent) value); // ConceptReferenceDesignationComponent return value; case -567445985: // contains this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent return value; default: return super.setProperty(hash, name, value); } }
private ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCodeIsInContains(List<ValueSetExpansionContainsComponent> contains, String theSystem, String theCode, Coding theCoding, CodeableConcept theCodeableConcept) { for (ValueSetExpansionContainsComponent nextCode : contains) { ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult result = validateCodeIsInContains(nextCode.getContains(), theSystem, theCode, theCoding, theCodeableConcept); if (result != null) { return result; } String system = nextCode.getSystem(); String code = nextCode.getCode(); if (isNotBlank(theCode)) { if (theCode.equals(code) && (isBlank(theSystem) || theSystem.equals(system))) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } else if (theCoding != null) { if (StringUtils.equals(system, theCoding.getSystem()) && StringUtils.equals(code, theCoding.getCode())) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } else { for (Coding next : theCodeableConcept.getCoding()) { if (StringUtils.equals(system, next.getSystem()) && StringUtils.equals(code, next.getCode())) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } } } return null; }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("system")) { this.system = castToUri(value); // UriType } else if (name.equals("abstract")) { this.abstract_ = castToBoolean(value); // BooleanType } else if (name.equals("inactive")) { this.inactive = castToBoolean(value); // BooleanType } else if (name.equals("version")) { this.version = castToString(value); // StringType } else if (name.equals("code")) { this.code = castToCode(value); // CodeType } else if (name.equals("display")) { this.display = castToString(value); // StringType } else if (name.equals("designation")) { this.getDesignation().add((ConceptReferenceDesignationComponent) value); } else if (name.equals("contains")) { this.getContains().add((ValueSetExpansionContainsComponent) value); } else return super.setProperty(name, value); return value; }
public static org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasAbstract()) tgt.setAbstract(src.getAbstract()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasCode()) tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }
private void applyFilter(IntegerType theTotalElement, List<ValueSetExpansionContainsComponent> theContains, String theFilter) { for (int idx = 0; idx < theContains.size(); idx++) { ValueSetExpansionContainsComponent next = theContains.get(idx); if (isBlank(next.getDisplay()) || !org.apache.commons.lang3.StringUtils.containsIgnoreCase(next.getDisplay(), theFilter)) { theContains.remove(idx); idx--; if (theTotalElement.getValue() != null) { theTotalElement.setValue(theTotalElement.getValue() - 1); } } applyFilter(theTotalElement, next.getContains(), theFilter); } }
private boolean inExpansion(ValueSetExpansionContainsComponent cc, List<ValueSetExpansionContainsComponent> contains) { for (ValueSetExpansionContainsComponent cc1 : contains) { if (cc.getSystem().equals(cc1.getSystem()) && cc.getCode().equals(cc1.getCode())) return true; if (inExpansion(cc, cc1.getContains())) return true; } return false; }
private boolean codesInExpansion(List<ValueSetExpansionContainsComponent> contains, ValueSetExpansionComponent expansion) { for (ValueSetExpansionContainsComponent cc : contains) { if (!inExpansion(cc, expansion.getContains())) return false; if (!codesInExpansion(cc.getContains(), expansion)) return false; } return true; }
public org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionContainsComponent(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); tgt.setAbstract(src.getAbstract()); tgt.setVersion(src.getVersion()); tgt.setCode(src.getCode()); tgt.setDisplay(src.getDisplay()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }
private boolean codeinExpansion(ValueSetExpansionContainsComponent cnt, String system, String code) { for (ValueSetExpansionContainsComponent c : cnt.getContains()) { if (code.equals(c.getCode()) && system.equals(c.getSystem().toString())) return true; if (codeinExpansion(c, system, code)) return true; } return false; }
private boolean codeinExpansion(ValueSetExpansionContainsComponent cnt, String system, String code) { for (ValueSetExpansionContainsComponent c : cnt.getContains()) { if (code.equals(c.getCode()) && system.equals(c.getSystem().toString())) return true; if (codeinExpansion(c, system, code)) return true; } return false; }
private void copyImportContains(List<ValueSetExpansionContainsComponent> list, ValueSetExpansionContainsComponent parent, ExpansionProfile profile, List<ValueSet> filter) { for (ValueSetExpansionContainsComponent c : list) { ValueSetExpansionContainsComponent np = addCode(c.getSystem(), c.getCode(), c.getDisplay(), parent, null, profile, c.getAbstract(), c.getInactive(), filter); copyImportContains(c.getContains(), np, profile, filter); } }
/** * @return The first repetition of repeating field {@link #contains}, creating it if it does not already exist */ public ValueSetExpansionContainsComponent getContainsFirstRep() { if (getContains().isEmpty()) { addContains(); } return getContains().get(0); }
private boolean expansionContainsCode(List<ValueSetExpansionContainsComponent> contains, String system, String code) { for (ValueSetExpansionContainsComponent cc : contains) { if (system.equals(cc.getSystem()) && code.equals(cc.getCode())) return true; if (expansionContainsCode(cc.getContains(), system, code)) return true; } return false; }
public static org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasAbstract()) tgt.setAbstract(src.getAbstract()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasCode()) tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }
public org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.instance.model.ValueSet.ValueSetExpansionContainsComponent(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); tgt.setAbstract(src.getAbstract()); tgt.setVersion(src.getVersion()); tgt.setCode(src.getCode()); tgt.setDisplay(src.getDisplay()); for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); return tgt; }