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