001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.Child;
038import ca.uhn.fhir.model.api.annotation.ChildOrder;
039import ca.uhn.fhir.model.api.annotation.Description;
040import ca.uhn.fhir.model.api.annotation.DatatypeDef;
041import ca.uhn.fhir.model.api.annotation.Block;
042import org.hl7.fhir.instance.model.api.*;
043import org.hl7.fhir.exceptions.FHIRException;
044/**
045 * The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.
046 */
047@DatatypeDef(name="ProdCharacteristic")
048public class ProdCharacteristic extends BackboneType implements ICompositeType {
049
050    /**
051     * Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
052     */
053    @Child(name = "height", type = {Quantity.class}, order=0, min=0, max=1, modifier=false, summary=true)
054    @Description(shortDefinition="Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." )
055    protected Quantity height;
056
057    /**
058     * Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
059     */
060    @Child(name = "width", type = {Quantity.class}, order=1, min=0, max=1, modifier=false, summary=true)
061    @Description(shortDefinition="Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." )
062    protected Quantity width;
063
064    /**
065     * Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
066     */
067    @Child(name = "depth", type = {Quantity.class}, order=2, min=0, max=1, modifier=false, summary=true)
068    @Description(shortDefinition="Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." )
069    protected Quantity depth;
070
071    /**
072     * Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
073     */
074    @Child(name = "weight", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true)
075    @Description(shortDefinition="Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." )
076    protected Quantity weight;
077
078    /**
079     * Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
080     */
081    @Child(name = "nominalVolume", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true)
082    @Description(shortDefinition="Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." )
083    protected Quantity nominalVolume;
084
085    /**
086     * Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
087     */
088    @Child(name = "externalDiameter", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
089    @Description(shortDefinition="Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." )
090    protected Quantity externalDiameter;
091
092    /**
093     * Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.
094     */
095    @Child(name = "shape", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
096    @Description(shortDefinition="Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used", formalDefinition="Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used." )
097    protected StringType shape;
098
099    /**
100     * Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.
101     */
102    @Child(name = "color", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
103    @Description(shortDefinition="Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used", formalDefinition="Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used." )
104    protected List<StringType> color;
105
106    /**
107     * Where applicable, the imprint can be specified as text.
108     */
109    @Child(name = "imprint", type = {StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
110    @Description(shortDefinition="Where applicable, the imprint can be specified as text", formalDefinition="Where applicable, the imprint can be specified as text." )
111    protected List<StringType> imprint;
112
113    /**
114     * Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.
115     */
116    @Child(name = "image", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
117    @Description(shortDefinition="Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations", formalDefinition="Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations." )
118    protected List<Attachment> image;
119
120    /**
121     * Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.
122     */
123    @Child(name = "scoring", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
124    @Description(shortDefinition="Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used", formalDefinition="Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used." )
125    protected CodeableConcept scoring;
126
127    private static final long serialVersionUID = 1521671432L;
128
129  /**
130   * Constructor
131   */
132    public ProdCharacteristic() {
133      super();
134    }
135
136    /**
137     * @return {@link #height} (Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
138     */
139    public Quantity getHeight() { 
140      if (this.height == null)
141        if (Configuration.errorOnAutoCreate())
142          throw new Error("Attempt to auto-create ProdCharacteristic.height");
143        else if (Configuration.doAutoCreate())
144          this.height = new Quantity(); // cc
145      return this.height;
146    }
147
148    public boolean hasHeight() { 
149      return this.height != null && !this.height.isEmpty();
150    }
151
152    /**
153     * @param value {@link #height} (Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
154     */
155    public ProdCharacteristic setHeight(Quantity value) { 
156      this.height = value;
157      return this;
158    }
159
160    /**
161     * @return {@link #width} (Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
162     */
163    public Quantity getWidth() { 
164      if (this.width == null)
165        if (Configuration.errorOnAutoCreate())
166          throw new Error("Attempt to auto-create ProdCharacteristic.width");
167        else if (Configuration.doAutoCreate())
168          this.width = new Quantity(); // cc
169      return this.width;
170    }
171
172    public boolean hasWidth() { 
173      return this.width != null && !this.width.isEmpty();
174    }
175
176    /**
177     * @param value {@link #width} (Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
178     */
179    public ProdCharacteristic setWidth(Quantity value) { 
180      this.width = value;
181      return this;
182    }
183
184    /**
185     * @return {@link #depth} (Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
186     */
187    public Quantity getDepth() { 
188      if (this.depth == null)
189        if (Configuration.errorOnAutoCreate())
190          throw new Error("Attempt to auto-create ProdCharacteristic.depth");
191        else if (Configuration.doAutoCreate())
192          this.depth = new Quantity(); // cc
193      return this.depth;
194    }
195
196    public boolean hasDepth() { 
197      return this.depth != null && !this.depth.isEmpty();
198    }
199
200    /**
201     * @param value {@link #depth} (Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
202     */
203    public ProdCharacteristic setDepth(Quantity value) { 
204      this.depth = value;
205      return this;
206    }
207
208    /**
209     * @return {@link #weight} (Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
210     */
211    public Quantity getWeight() { 
212      if (this.weight == null)
213        if (Configuration.errorOnAutoCreate())
214          throw new Error("Attempt to auto-create ProdCharacteristic.weight");
215        else if (Configuration.doAutoCreate())
216          this.weight = new Quantity(); // cc
217      return this.weight;
218    }
219
220    public boolean hasWeight() { 
221      return this.weight != null && !this.weight.isEmpty();
222    }
223
224    /**
225     * @param value {@link #weight} (Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
226     */
227    public ProdCharacteristic setWeight(Quantity value) { 
228      this.weight = value;
229      return this;
230    }
231
232    /**
233     * @return {@link #nominalVolume} (Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
234     */
235    public Quantity getNominalVolume() { 
236      if (this.nominalVolume == null)
237        if (Configuration.errorOnAutoCreate())
238          throw new Error("Attempt to auto-create ProdCharacteristic.nominalVolume");
239        else if (Configuration.doAutoCreate())
240          this.nominalVolume = new Quantity(); // cc
241      return this.nominalVolume;
242    }
243
244    public boolean hasNominalVolume() { 
245      return this.nominalVolume != null && !this.nominalVolume.isEmpty();
246    }
247
248    /**
249     * @param value {@link #nominalVolume} (Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
250     */
251    public ProdCharacteristic setNominalVolume(Quantity value) { 
252      this.nominalVolume = value;
253      return this;
254    }
255
256    /**
257     * @return {@link #externalDiameter} (Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
258     */
259    public Quantity getExternalDiameter() { 
260      if (this.externalDiameter == null)
261        if (Configuration.errorOnAutoCreate())
262          throw new Error("Attempt to auto-create ProdCharacteristic.externalDiameter");
263        else if (Configuration.doAutoCreate())
264          this.externalDiameter = new Quantity(); // cc
265      return this.externalDiameter;
266    }
267
268    public boolean hasExternalDiameter() { 
269      return this.externalDiameter != null && !this.externalDiameter.isEmpty();
270    }
271
272    /**
273     * @param value {@link #externalDiameter} (Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.)
274     */
275    public ProdCharacteristic setExternalDiameter(Quantity value) { 
276      this.externalDiameter = value;
277      return this;
278    }
279
280    /**
281     * @return {@link #shape} (Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.). This is the underlying object with id, value and extensions. The accessor "getShape" gives direct access to the value
282     */
283    public StringType getShapeElement() { 
284      if (this.shape == null)
285        if (Configuration.errorOnAutoCreate())
286          throw new Error("Attempt to auto-create ProdCharacteristic.shape");
287        else if (Configuration.doAutoCreate())
288          this.shape = new StringType(); // bb
289      return this.shape;
290    }
291
292    public boolean hasShapeElement() { 
293      return this.shape != null && !this.shape.isEmpty();
294    }
295
296    public boolean hasShape() { 
297      return this.shape != null && !this.shape.isEmpty();
298    }
299
300    /**
301     * @param value {@link #shape} (Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.). This is the underlying object with id, value and extensions. The accessor "getShape" gives direct access to the value
302     */
303    public ProdCharacteristic setShapeElement(StringType value) { 
304      this.shape = value;
305      return this;
306    }
307
308    /**
309     * @return Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.
310     */
311    public String getShape() { 
312      return this.shape == null ? null : this.shape.getValue();
313    }
314
315    /**
316     * @param value Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.
317     */
318    public ProdCharacteristic setShape(String value) { 
319      if (Utilities.noString(value))
320        this.shape = null;
321      else {
322        if (this.shape == null)
323          this.shape = new StringType();
324        this.shape.setValue(value);
325      }
326      return this;
327    }
328
329    /**
330     * @return {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.)
331     */
332    public List<StringType> getColor() { 
333      if (this.color == null)
334        this.color = new ArrayList<StringType>();
335      return this.color;
336    }
337
338    /**
339     * @return Returns a reference to <code>this</code> for easy method chaining
340     */
341    public ProdCharacteristic setColor(List<StringType> theColor) { 
342      this.color = theColor;
343      return this;
344    }
345
346    public boolean hasColor() { 
347      if (this.color == null)
348        return false;
349      for (StringType item : this.color)
350        if (!item.isEmpty())
351          return true;
352      return false;
353    }
354
355    /**
356     * @return {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.)
357     */
358    public StringType addColorElement() {//2 
359      StringType t = new StringType();
360      if (this.color == null)
361        this.color = new ArrayList<StringType>();
362      this.color.add(t);
363      return t;
364    }
365
366    /**
367     * @param value {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.)
368     */
369    public ProdCharacteristic addColor(String value) { //1
370      StringType t = new StringType();
371      t.setValue(value);
372      if (this.color == null)
373        this.color = new ArrayList<StringType>();
374      this.color.add(t);
375      return this;
376    }
377
378    /**
379     * @param value {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.)
380     */
381    public boolean hasColor(String value) { 
382      if (this.color == null)
383        return false;
384      for (StringType v : this.color)
385        if (v.getValue().equals(value)) // string
386          return true;
387      return false;
388    }
389
390    /**
391     * @return {@link #imprint} (Where applicable, the imprint can be specified as text.)
392     */
393    public List<StringType> getImprint() { 
394      if (this.imprint == null)
395        this.imprint = new ArrayList<StringType>();
396      return this.imprint;
397    }
398
399    /**
400     * @return Returns a reference to <code>this</code> for easy method chaining
401     */
402    public ProdCharacteristic setImprint(List<StringType> theImprint) { 
403      this.imprint = theImprint;
404      return this;
405    }
406
407    public boolean hasImprint() { 
408      if (this.imprint == null)
409        return false;
410      for (StringType item : this.imprint)
411        if (!item.isEmpty())
412          return true;
413      return false;
414    }
415
416    /**
417     * @return {@link #imprint} (Where applicable, the imprint can be specified as text.)
418     */
419    public StringType addImprintElement() {//2 
420      StringType t = new StringType();
421      if (this.imprint == null)
422        this.imprint = new ArrayList<StringType>();
423      this.imprint.add(t);
424      return t;
425    }
426
427    /**
428     * @param value {@link #imprint} (Where applicable, the imprint can be specified as text.)
429     */
430    public ProdCharacteristic addImprint(String value) { //1
431      StringType t = new StringType();
432      t.setValue(value);
433      if (this.imprint == null)
434        this.imprint = new ArrayList<StringType>();
435      this.imprint.add(t);
436      return this;
437    }
438
439    /**
440     * @param value {@link #imprint} (Where applicable, the imprint can be specified as text.)
441     */
442    public boolean hasImprint(String value) { 
443      if (this.imprint == null)
444        return false;
445      for (StringType v : this.imprint)
446        if (v.getValue().equals(value)) // string
447          return true;
448      return false;
449    }
450
451    /**
452     * @return {@link #image} (Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.)
453     */
454    public List<Attachment> getImage() { 
455      if (this.image == null)
456        this.image = new ArrayList<Attachment>();
457      return this.image;
458    }
459
460    /**
461     * @return Returns a reference to <code>this</code> for easy method chaining
462     */
463    public ProdCharacteristic setImage(List<Attachment> theImage) { 
464      this.image = theImage;
465      return this;
466    }
467
468    public boolean hasImage() { 
469      if (this.image == null)
470        return false;
471      for (Attachment item : this.image)
472        if (!item.isEmpty())
473          return true;
474      return false;
475    }
476
477    public Attachment addImage() { //3
478      Attachment t = new Attachment();
479      if (this.image == null)
480        this.image = new ArrayList<Attachment>();
481      this.image.add(t);
482      return t;
483    }
484
485    public ProdCharacteristic addImage(Attachment t) { //3
486      if (t == null)
487        return this;
488      if (this.image == null)
489        this.image = new ArrayList<Attachment>();
490      this.image.add(t);
491      return this;
492    }
493
494    /**
495     * @return The first repetition of repeating field {@link #image}, creating it if it does not already exist
496     */
497    public Attachment getImageFirstRep() { 
498      if (getImage().isEmpty()) {
499        addImage();
500      }
501      return getImage().get(0);
502    }
503
504    /**
505     * @return {@link #scoring} (Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.)
506     */
507    public CodeableConcept getScoring() { 
508      if (this.scoring == null)
509        if (Configuration.errorOnAutoCreate())
510          throw new Error("Attempt to auto-create ProdCharacteristic.scoring");
511        else if (Configuration.doAutoCreate())
512          this.scoring = new CodeableConcept(); // cc
513      return this.scoring;
514    }
515
516    public boolean hasScoring() { 
517      return this.scoring != null && !this.scoring.isEmpty();
518    }
519
520    /**
521     * @param value {@link #scoring} (Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.)
522     */
523    public ProdCharacteristic setScoring(CodeableConcept value) { 
524      this.scoring = value;
525      return this;
526    }
527
528      protected void listChildren(List<Property> children) {
529        super.listChildren(children);
530        children.add(new Property("height", "Quantity", "Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, height));
531        children.add(new Property("width", "Quantity", "Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, width));
532        children.add(new Property("depth", "Quantity", "Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, depth));
533        children.add(new Property("weight", "Quantity", "Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, weight));
534        children.add(new Property("nominalVolume", "Quantity", "Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, nominalVolume));
535        children.add(new Property("externalDiameter", "Quantity", "Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, externalDiameter));
536        children.add(new Property("shape", "string", "Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, shape));
537        children.add(new Property("color", "string", "Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, java.lang.Integer.MAX_VALUE, color));
538        children.add(new Property("imprint", "string", "Where applicable, the imprint can be specified as text.", 0, java.lang.Integer.MAX_VALUE, imprint));
539        children.add(new Property("image", "Attachment", "Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.", 0, java.lang.Integer.MAX_VALUE, image));
540        children.add(new Property("scoring", "CodeableConcept", "Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, scoring));
541      }
542
543      @Override
544      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
545        switch (_hash) {
546        case -1221029593: /*height*/  return new Property("height", "Quantity", "Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, height);
547        case 113126854: /*width*/  return new Property("width", "Quantity", "Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, width);
548        case 95472323: /*depth*/  return new Property("depth", "Quantity", "Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, depth);
549        case -791592328: /*weight*/  return new Property("weight", "Quantity", "Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, weight);
550        case 1706919702: /*nominalVolume*/  return new Property("nominalVolume", "Quantity", "Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, nominalVolume);
551        case 161374584: /*externalDiameter*/  return new Property("externalDiameter", "Quantity", "Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, externalDiameter);
552        case 109399969: /*shape*/  return new Property("shape", "string", "Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, shape);
553        case 94842723: /*color*/  return new Property("color", "string", "Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, java.lang.Integer.MAX_VALUE, color);
554        case 1926118409: /*imprint*/  return new Property("imprint", "string", "Where applicable, the imprint can be specified as text.", 0, java.lang.Integer.MAX_VALUE, imprint);
555        case 100313435: /*image*/  return new Property("image", "Attachment", "Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.", 0, java.lang.Integer.MAX_VALUE, image);
556        case 1924005583: /*scoring*/  return new Property("scoring", "CodeableConcept", "Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, scoring);
557        default: return super.getNamedProperty(_hash, _name, _checkValid);
558        }
559
560      }
561
562      @Override
563      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
564        switch (hash) {
565        case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // Quantity
566        case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // Quantity
567        case 95472323: /*depth*/ return this.depth == null ? new Base[0] : new Base[] {this.depth}; // Quantity
568        case -791592328: /*weight*/ return this.weight == null ? new Base[0] : new Base[] {this.weight}; // Quantity
569        case 1706919702: /*nominalVolume*/ return this.nominalVolume == null ? new Base[0] : new Base[] {this.nominalVolume}; // Quantity
570        case 161374584: /*externalDiameter*/ return this.externalDiameter == null ? new Base[0] : new Base[] {this.externalDiameter}; // Quantity
571        case 109399969: /*shape*/ return this.shape == null ? new Base[0] : new Base[] {this.shape}; // StringType
572        case 94842723: /*color*/ return this.color == null ? new Base[0] : this.color.toArray(new Base[this.color.size()]); // StringType
573        case 1926118409: /*imprint*/ return this.imprint == null ? new Base[0] : this.imprint.toArray(new Base[this.imprint.size()]); // StringType
574        case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // Attachment
575        case 1924005583: /*scoring*/ return this.scoring == null ? new Base[0] : new Base[] {this.scoring}; // CodeableConcept
576        default: return super.getProperty(hash, name, checkValid);
577        }
578
579      }
580
581      @Override
582      public Base setProperty(int hash, String name, Base value) throws FHIRException {
583        switch (hash) {
584        case -1221029593: // height
585          this.height = castToQuantity(value); // Quantity
586          return value;
587        case 113126854: // width
588          this.width = castToQuantity(value); // Quantity
589          return value;
590        case 95472323: // depth
591          this.depth = castToQuantity(value); // Quantity
592          return value;
593        case -791592328: // weight
594          this.weight = castToQuantity(value); // Quantity
595          return value;
596        case 1706919702: // nominalVolume
597          this.nominalVolume = castToQuantity(value); // Quantity
598          return value;
599        case 161374584: // externalDiameter
600          this.externalDiameter = castToQuantity(value); // Quantity
601          return value;
602        case 109399969: // shape
603          this.shape = castToString(value); // StringType
604          return value;
605        case 94842723: // color
606          this.getColor().add(castToString(value)); // StringType
607          return value;
608        case 1926118409: // imprint
609          this.getImprint().add(castToString(value)); // StringType
610          return value;
611        case 100313435: // image
612          this.getImage().add(castToAttachment(value)); // Attachment
613          return value;
614        case 1924005583: // scoring
615          this.scoring = castToCodeableConcept(value); // CodeableConcept
616          return value;
617        default: return super.setProperty(hash, name, value);
618        }
619
620      }
621
622      @Override
623      public Base setProperty(String name, Base value) throws FHIRException {
624        if (name.equals("height")) {
625          this.height = castToQuantity(value); // Quantity
626        } else if (name.equals("width")) {
627          this.width = castToQuantity(value); // Quantity
628        } else if (name.equals("depth")) {
629          this.depth = castToQuantity(value); // Quantity
630        } else if (name.equals("weight")) {
631          this.weight = castToQuantity(value); // Quantity
632        } else if (name.equals("nominalVolume")) {
633          this.nominalVolume = castToQuantity(value); // Quantity
634        } else if (name.equals("externalDiameter")) {
635          this.externalDiameter = castToQuantity(value); // Quantity
636        } else if (name.equals("shape")) {
637          this.shape = castToString(value); // StringType
638        } else if (name.equals("color")) {
639          this.getColor().add(castToString(value));
640        } else if (name.equals("imprint")) {
641          this.getImprint().add(castToString(value));
642        } else if (name.equals("image")) {
643          this.getImage().add(castToAttachment(value));
644        } else if (name.equals("scoring")) {
645          this.scoring = castToCodeableConcept(value); // CodeableConcept
646        } else
647          return super.setProperty(name, value);
648        return value;
649      }
650
651      @Override
652      public Base makeProperty(int hash, String name) throws FHIRException {
653        switch (hash) {
654        case -1221029593:  return getHeight(); 
655        case 113126854:  return getWidth(); 
656        case 95472323:  return getDepth(); 
657        case -791592328:  return getWeight(); 
658        case 1706919702:  return getNominalVolume(); 
659        case 161374584:  return getExternalDiameter(); 
660        case 109399969:  return getShapeElement();
661        case 94842723:  return addColorElement();
662        case 1926118409:  return addImprintElement();
663        case 100313435:  return addImage(); 
664        case 1924005583:  return getScoring(); 
665        default: return super.makeProperty(hash, name);
666        }
667
668      }
669
670      @Override
671      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
672        switch (hash) {
673        case -1221029593: /*height*/ return new String[] {"Quantity"};
674        case 113126854: /*width*/ return new String[] {"Quantity"};
675        case 95472323: /*depth*/ return new String[] {"Quantity"};
676        case -791592328: /*weight*/ return new String[] {"Quantity"};
677        case 1706919702: /*nominalVolume*/ return new String[] {"Quantity"};
678        case 161374584: /*externalDiameter*/ return new String[] {"Quantity"};
679        case 109399969: /*shape*/ return new String[] {"string"};
680        case 94842723: /*color*/ return new String[] {"string"};
681        case 1926118409: /*imprint*/ return new String[] {"string"};
682        case 100313435: /*image*/ return new String[] {"Attachment"};
683        case 1924005583: /*scoring*/ return new String[] {"CodeableConcept"};
684        default: return super.getTypesForProperty(hash, name);
685        }
686
687      }
688
689      @Override
690      public Base addChild(String name) throws FHIRException {
691        if (name.equals("height")) {
692          this.height = new Quantity();
693          return this.height;
694        }
695        else if (name.equals("width")) {
696          this.width = new Quantity();
697          return this.width;
698        }
699        else if (name.equals("depth")) {
700          this.depth = new Quantity();
701          return this.depth;
702        }
703        else if (name.equals("weight")) {
704          this.weight = new Quantity();
705          return this.weight;
706        }
707        else if (name.equals("nominalVolume")) {
708          this.nominalVolume = new Quantity();
709          return this.nominalVolume;
710        }
711        else if (name.equals("externalDiameter")) {
712          this.externalDiameter = new Quantity();
713          return this.externalDiameter;
714        }
715        else if (name.equals("shape")) {
716          throw new FHIRException("Cannot call addChild on a primitive type ProdCharacteristic.shape");
717        }
718        else if (name.equals("color")) {
719          throw new FHIRException("Cannot call addChild on a primitive type ProdCharacteristic.color");
720        }
721        else if (name.equals("imprint")) {
722          throw new FHIRException("Cannot call addChild on a primitive type ProdCharacteristic.imprint");
723        }
724        else if (name.equals("image")) {
725          return addImage();
726        }
727        else if (name.equals("scoring")) {
728          this.scoring = new CodeableConcept();
729          return this.scoring;
730        }
731        else
732          return super.addChild(name);
733      }
734
735  public String fhirType() {
736    return "ProdCharacteristic";
737
738  }
739
740      public ProdCharacteristic copy() {
741        ProdCharacteristic dst = new ProdCharacteristic();
742        copyValues(dst);
743        dst.height = height == null ? null : height.copy();
744        dst.width = width == null ? null : width.copy();
745        dst.depth = depth == null ? null : depth.copy();
746        dst.weight = weight == null ? null : weight.copy();
747        dst.nominalVolume = nominalVolume == null ? null : nominalVolume.copy();
748        dst.externalDiameter = externalDiameter == null ? null : externalDiameter.copy();
749        dst.shape = shape == null ? null : shape.copy();
750        if (color != null) {
751          dst.color = new ArrayList<StringType>();
752          for (StringType i : color)
753            dst.color.add(i.copy());
754        };
755        if (imprint != null) {
756          dst.imprint = new ArrayList<StringType>();
757          for (StringType i : imprint)
758            dst.imprint.add(i.copy());
759        };
760        if (image != null) {
761          dst.image = new ArrayList<Attachment>();
762          for (Attachment i : image)
763            dst.image.add(i.copy());
764        };
765        dst.scoring = scoring == null ? null : scoring.copy();
766        return dst;
767      }
768
769      protected ProdCharacteristic typedCopy() {
770        return copy();
771      }
772
773      @Override
774      public boolean equalsDeep(Base other_) {
775        if (!super.equalsDeep(other_))
776          return false;
777        if (!(other_ instanceof ProdCharacteristic))
778          return false;
779        ProdCharacteristic o = (ProdCharacteristic) other_;
780        return compareDeep(height, o.height, true) && compareDeep(width, o.width, true) && compareDeep(depth, o.depth, true)
781           && compareDeep(weight, o.weight, true) && compareDeep(nominalVolume, o.nominalVolume, true) && compareDeep(externalDiameter, o.externalDiameter, true)
782           && compareDeep(shape, o.shape, true) && compareDeep(color, o.color, true) && compareDeep(imprint, o.imprint, true)
783           && compareDeep(image, o.image, true) && compareDeep(scoring, o.scoring, true);
784      }
785
786      @Override
787      public boolean equalsShallow(Base other_) {
788        if (!super.equalsShallow(other_))
789          return false;
790        if (!(other_ instanceof ProdCharacteristic))
791          return false;
792        ProdCharacteristic o = (ProdCharacteristic) other_;
793        return compareValues(shape, o.shape, true) && compareValues(color, o.color, true) && compareValues(imprint, o.imprint, true)
794          ;
795      }
796
797      public boolean isEmpty() {
798        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(height, width, depth, weight
799          , nominalVolume, externalDiameter, shape, color, imprint, image, scoring);
800      }
801
802
803}
804