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