예제 #1
0
 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());
   }
   ;
   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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 public boolean hasIngredient() {
   if (this.ingredient == null) return false;
   for (SubstanceIngredientComponent item : this.ingredient) if (!item.isEmpty()) return true;
   return false;
 }