public SubstanceIngredientComponent addIngredient() { //3 SubstanceIngredientComponent t = new SubstanceIngredientComponent(); if (this.ingredient == null) this.ingredient = new ArrayList<SubstanceIngredientComponent>(); this.ingredient.add(t); return t; }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("quantity")) { this.quantity = castToRatio(value); // Ratio } else if (name.equals("substance[x]")) { this.substance = castToType(value); // Type } else return super.setProperty(name, value); return value; }
public Substance copy() { Substance dst = new Substance(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); if (category != null) { dst.category = new ArrayList<CodeableConcept>(); for (CodeableConcept i : category) dst.category.add(i.copy()); }; dst.code = code == null ? null : code.copy(); dst.description = description == null ? null : description.copy(); if (instance != null) { dst.instance = new ArrayList<SubstanceInstanceComponent>(); for (SubstanceInstanceComponent i : instance) dst.instance.add(i.copy()); }; if (ingredient != null) { dst.ingredient = new ArrayList<SubstanceIngredientComponent>(); for (SubstanceIngredientComponent i : ingredient) dst.ingredient.add(i.copy()); }; return dst; }
public Substance copy() { Substance dst = new Substance(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); if (category != null) { dst.category = new ArrayList<CodeableConcept>(); for (CodeableConcept i : category) dst.category.add(i.copy()); }; dst.code = code == null ? null : code.copy(); dst.description = description == null ? null : description.copy(); if (instance != null) { dst.instance = new ArrayList<SubstanceInstanceComponent>(); for (SubstanceInstanceComponent i : instance) dst.instance.add(i.copy()); }; if (ingredient != null) { dst.ingredient = new ArrayList<SubstanceIngredientComponent>(); for (SubstanceIngredientComponent i : ingredient) dst.ingredient.add(i.copy()); }; return dst; }
public org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent(); copyElement(src, tgt); tgt.setQuantity(convertRatio(src.getQuantity())); tgt.setSubstance(convertReference(src.getSubstance())); return tgt; }
public org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent(); copyElement(src, tgt); tgt.setQuantity(convertRatio(src.getQuantity())); // tgt.setSubstance(convertReference(src.getSubstance())); return tgt; }
public SubstanceIngredientComponent copy() { SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); copyValues(dst); dst.quantity = quantity == null ? null : quantity.copy(); dst.substance = substance == null ? null : substance.copy(); return dst; }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("quantity")) { this.quantity = castToRatio(value); // Ratio } else if (name.equals("substance[x]")) { this.substance = castToType(value); // Type } else return super.setProperty(name, value); return value; }
public boolean hasIngredient() { if (this.ingredient == null) return false; for (SubstanceIngredientComponent item : this.ingredient) if (!item.isEmpty()) return true; return false; }
@Override public boolean equalsDeep(Base other_) { if (!super.equalsDeep(other_)) return false; if (!(other_ instanceof SubstanceIngredientComponent)) return false; SubstanceIngredientComponent o = (SubstanceIngredientComponent) other_; return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -1285004149: // quantity this.quantity = castToRatio(value); // Ratio return value; case 530040176: // substance this.substance = castToType(value); // Type return value; default: return super.setProperty(hash, name, value); } }
public SubstanceIngredientComponent addIngredient() { //3 SubstanceIngredientComponent t = new SubstanceIngredientComponent(); if (this.ingredient == null) this.ingredient = new ArrayList<SubstanceIngredientComponent>(); this.ingredient.add(t); return t; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1285004149: return getQuantity(); case 2127194384: return getSubstance(); case 530040176: return getSubstance(); default: return super.makeProperty(hash, name); } }
public SubstanceIngredientComponent copy() { SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); copyValues(dst); dst.quantity = quantity == null ? null : quantity.copy(); dst.substance = substance == null ? null : substance.copy(); return dst; }
@Override public boolean equalsDeep(Base other_) { if (!super.equalsDeep(other_)) return false; if (!(other_ instanceof SubstanceIngredientComponent)) return false; SubstanceIngredientComponent o = (SubstanceIngredientComponent) other_; return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); }
public org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent(); copyElement(src, tgt); tgt.setQuantity(convertRatio(src.getQuantity())); // tgt.setSubstance(convertReference(src.getSubstance())); return tgt; }
public boolean hasIngredient() { if (this.ingredient == null) return false; for (SubstanceIngredientComponent item : this.ingredient) if (!item.isEmpty()) return true; return false; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1285004149: return getQuantity(); case 2127194384: return getSubstance(); case 530040176: return getSubstance(); default: return super.makeProperty(hash, name); } }
public org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.instance.model.Substance.SubstanceIngredientComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent(); copyElement(src, tgt); tgt.setQuantity(convertRatio(src.getQuantity())); tgt.setSubstance(convertReference(src.getSubstance())); return tgt; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -1285004149: // quantity this.quantity = castToRatio(value); // Ratio return value; case 530040176: // substance this.substance = castToType(value); // Type return value; default: return super.setProperty(hash, name, value); } }