001package org.hl7.fhir.r5.openehr;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.openehr.Enumerations.*;
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.r5.model.*;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.DatatypeDef;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047
048/**
049 * A specialisation of DV_ENCAPSULATED for audiovisual and bio-signal types. Includes further metadata relating to multimedia types which are not applicable to other subtypes of DV_ENCAPSULATED.
050 */
051@DatatypeDef(name="DV_MULTIMEDIA")
052public class DV_MULTIMEDIA extends DV_ENCAPSULATED implements ICompositeType {
053
054    /**
055     * Text to display in lieu of multimedia display/replay.
056     */
057    @Child(name = "alternate_text", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=false)
058    @Description(shortDefinition="Text to display in lieu of multimedia display/replay", formalDefinition="Text to display in lieu of multimedia display/replay." )
059    protected StringType alternate_text;
060
061    /**
062     * URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference.
063     */
064    @Child(name = "uri", type = {DV_URI.class}, order=1, min=0, max=1, modifier=false, summary=false)
065    @Description(shortDefinition="URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference", formalDefinition="URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference." )
066    protected DV_URI uri;
067
068    /**
069     * The actual data found at uri, if supplied inline.
070     */
071    @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false)
072    @Description(shortDefinition="The actual data found at uri, if supplied inline", formalDefinition="The actual data found at uri, if supplied inline." )
073    protected Base64BinaryType data;
074
075    /**
076     * Data media type coded from openEHR code set media types (interface for the IANA MIME types code set).
077     */
078    @Child(name = "media_type", type = {CODE_PHRASE.class}, order=3, min=1, max=1, modifier=false, summary=false)
079    @Description(shortDefinition="Data media type coded from openEHR code set media types: IANA MIME types", formalDefinition="Data media type coded from openEHR code set media types (interface for the IANA MIME types code set)." )
080    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes")
081    protected CODE_PHRASE media_type;
082
083    /**
084     * Compression type, a coded value from the openEHR Integrity check code set. Void means no compression.
085     */
086    @Child(name = "compression_algorithm", type = {CODE_PHRASE.class}, order=4, min=0, max=1, modifier=false, summary=false)
087    @Description(shortDefinition="Compression type, a coded value from the openEHR Integrity check code set. Absence means no compression", formalDefinition="Compression type, a coded value from the openEHR Integrity check code set. Void means no compression." )
088    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="https://specifications.openehr.org/fhir/valueset-compression_algorithms")
089    protected CODE_PHRASE compression_algorithm;
090
091    /**
092     * Binary cryptographic integrity checksum.
093     */
094    @Child(name = "integrity_check", type = {Base64BinaryType.class}, order=5, min=0, max=1, modifier=false, summary=false)
095    @Description(shortDefinition="Binary cryptographic integrity checksum", formalDefinition="Binary cryptographic integrity checksum." )
096    protected Base64BinaryType integrity_check;
097
098    /**
099     * Type of integrity check, a coded value from the openEHR Integrity check code set.
100     */
101    @Child(name = "integrity_check_algorithm", type = {CODE_PHRASE.class}, order=6, min=0, max=1, modifier=false, summary=false)
102    @Description(shortDefinition="Type of integrity check, a coded value from the openEHR Integrity check code set", formalDefinition="Type of integrity check, a coded value from the openEHR Integrity check code set." )
103    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="https://specifications.openehr.org/fhir/valueset-integrity_check_algorithms")
104    protected CODE_PHRASE integrity_check_algorithm;
105
106    /**
107     * The thumbnail for this item, if one exists; mainly for graphics formats.
108     */
109    @Child(name = "thumbnail", type = {DV_MULTIMEDIA.class}, order=7, min=0, max=1, modifier=false, summary=false)
110    @Description(shortDefinition="The thumbnail for this item, if one exists; mainly for graphics formats", formalDefinition="The thumbnail for this item, if one exists; mainly for graphics formats." )
111    protected DV_MULTIMEDIA thumbnail;
112
113    /**
114     * Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.
115     */
116    @Child(name = "size", type = {IntegerType.class}, order=8, min=1, max=1, modifier=false, summary=false)
117    @Description(shortDefinition="Original size in bytes of unencoded encapsulated data", formalDefinition="Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute." )
118    protected IntegerType size;
119
120    private static final long serialVersionUID = 271994043L;
121
122  /**
123   * Constructor
124   */
125    public DV_MULTIMEDIA() {
126      super();
127    }
128
129  /**
130   * Constructor
131   */
132    public DV_MULTIMEDIA(String alternate_text, CODE_PHRASE media_type, int size) {
133      super();
134      this.setAlternate_text(alternate_text);
135      this.setMedia_type(media_type);
136      this.setSize(size);
137    }
138
139    /**
140     * @return {@link #alternate_text} (Text to display in lieu of multimedia display/replay.). This is the underlying object with id, value and extensions. The accessor "getAlternate_text" gives direct access to the value
141     */
142    public StringType getAlternate_textElement() { 
143      if (this.alternate_text == null)
144        if (Configuration.errorOnAutoCreate())
145          throw new Error("Attempt to auto-create DV_MULTIMEDIA.alternate_text");
146        else if (Configuration.doAutoCreate())
147          this.alternate_text = new StringType(); // bb
148      return this.alternate_text;
149    }
150
151    public boolean hasAlternate_textElement() { 
152      return this.alternate_text != null && !this.alternate_text.isEmpty();
153    }
154
155    public boolean hasAlternate_text() { 
156      return this.alternate_text != null && !this.alternate_text.isEmpty();
157    }
158
159    /**
160     * @param value {@link #alternate_text} (Text to display in lieu of multimedia display/replay.). This is the underlying object with id, value and extensions. The accessor "getAlternate_text" gives direct access to the value
161     */
162    public DV_MULTIMEDIA setAlternate_textElement(StringType value) { 
163      this.alternate_text = value;
164      return this;
165    }
166
167    /**
168     * @return Text to display in lieu of multimedia display/replay.
169     */
170    public String getAlternate_text() { 
171      return this.alternate_text == null ? null : this.alternate_text.getValue();
172    }
173
174    /**
175     * @param value Text to display in lieu of multimedia display/replay.
176     */
177    public DV_MULTIMEDIA setAlternate_text(String value) { 
178        if (this.alternate_text == null)
179          this.alternate_text = new StringType();
180        this.alternate_text.setValue(value);
181      return this;
182    }
183
184    /**
185     * @return {@link #uri} (URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference.)
186     */
187    public DV_URI getUri() { 
188      if (this.uri == null)
189        if (Configuration.errorOnAutoCreate())
190          throw new Error("Attempt to auto-create DV_MULTIMEDIA.uri");
191        else if (Configuration.doAutoCreate())
192          this.uri = new DV_URI(); // cc
193      return this.uri;
194    }
195
196    public boolean hasUri() { 
197      return this.uri != null && !this.uri.isEmpty();
198    }
199
200    /**
201     * @param value {@link #uri} (URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference.)
202     */
203    public DV_MULTIMEDIA setUri(DV_URI value) { 
204      this.uri = value;
205      return this;
206    }
207
208    /**
209     * @return {@link #data} (The actual data found at uri, if supplied inline.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value
210     */
211    public Base64BinaryType getDataElement() { 
212      if (this.data == null)
213        if (Configuration.errorOnAutoCreate())
214          throw new Error("Attempt to auto-create DV_MULTIMEDIA.data");
215        else if (Configuration.doAutoCreate())
216          this.data = new Base64BinaryType(); // bb
217      return this.data;
218    }
219
220    public boolean hasDataElement() { 
221      return this.data != null && !this.data.isEmpty();
222    }
223
224    public boolean hasData() { 
225      return this.data != null && !this.data.isEmpty();
226    }
227
228    /**
229     * @param value {@link #data} (The actual data found at uri, if supplied inline.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value
230     */
231    public DV_MULTIMEDIA setDataElement(Base64BinaryType value) { 
232      this.data = value;
233      return this;
234    }
235
236    /**
237     * @return The actual data found at uri, if supplied inline.
238     */
239    public byte[] getData() { 
240      return this.data == null ? null : this.data.getValue();
241    }
242
243    /**
244     * @param value The actual data found at uri, if supplied inline.
245     */
246    public DV_MULTIMEDIA setData(byte[] value) { 
247      if (value == null)
248        this.data = null;
249      else {
250        if (this.data == null)
251          this.data = new Base64BinaryType();
252        this.data.setValue(value);
253      }
254      return this;
255    }
256
257    /**
258     * @return {@link #media_type} (Data media type coded from openEHR code set media types (interface for the IANA MIME types code set).)
259     */
260    public CODE_PHRASE getMedia_type() { 
261      if (this.media_type == null)
262        if (Configuration.errorOnAutoCreate())
263          throw new Error("Attempt to auto-create DV_MULTIMEDIA.media_type");
264        else if (Configuration.doAutoCreate())
265          this.media_type = new CODE_PHRASE(); // cc
266      return this.media_type;
267    }
268
269    public boolean hasMedia_type() { 
270      return this.media_type != null && !this.media_type.isEmpty();
271    }
272
273    /**
274     * @param value {@link #media_type} (Data media type coded from openEHR code set media types (interface for the IANA MIME types code set).)
275     */
276    public DV_MULTIMEDIA setMedia_type(CODE_PHRASE value) { 
277      this.media_type = value;
278      return this;
279    }
280
281    /**
282     * @return {@link #compression_algorithm} (Compression type, a coded value from the openEHR Integrity check code set. Void means no compression.)
283     */
284    public CODE_PHRASE getCompression_algorithm() { 
285      if (this.compression_algorithm == null)
286        if (Configuration.errorOnAutoCreate())
287          throw new Error("Attempt to auto-create DV_MULTIMEDIA.compression_algorithm");
288        else if (Configuration.doAutoCreate())
289          this.compression_algorithm = new CODE_PHRASE(); // cc
290      return this.compression_algorithm;
291    }
292
293    public boolean hasCompression_algorithm() { 
294      return this.compression_algorithm != null && !this.compression_algorithm.isEmpty();
295    }
296
297    /**
298     * @param value {@link #compression_algorithm} (Compression type, a coded value from the openEHR Integrity check code set. Void means no compression.)
299     */
300    public DV_MULTIMEDIA setCompression_algorithm(CODE_PHRASE value) { 
301      this.compression_algorithm = value;
302      return this;
303    }
304
305    /**
306     * @return {@link #integrity_check} (Binary cryptographic integrity checksum.). This is the underlying object with id, value and extensions. The accessor "getIntegrity_check" gives direct access to the value
307     */
308    public Base64BinaryType getIntegrity_checkElement() { 
309      if (this.integrity_check == null)
310        if (Configuration.errorOnAutoCreate())
311          throw new Error("Attempt to auto-create DV_MULTIMEDIA.integrity_check");
312        else if (Configuration.doAutoCreate())
313          this.integrity_check = new Base64BinaryType(); // bb
314      return this.integrity_check;
315    }
316
317    public boolean hasIntegrity_checkElement() { 
318      return this.integrity_check != null && !this.integrity_check.isEmpty();
319    }
320
321    public boolean hasIntegrity_check() { 
322      return this.integrity_check != null && !this.integrity_check.isEmpty();
323    }
324
325    /**
326     * @param value {@link #integrity_check} (Binary cryptographic integrity checksum.). This is the underlying object with id, value and extensions. The accessor "getIntegrity_check" gives direct access to the value
327     */
328    public DV_MULTIMEDIA setIntegrity_checkElement(Base64BinaryType value) { 
329      this.integrity_check = value;
330      return this;
331    }
332
333    /**
334     * @return Binary cryptographic integrity checksum.
335     */
336    public byte[] getIntegrity_check() { 
337      return this.integrity_check == null ? null : this.integrity_check.getValue();
338    }
339
340    /**
341     * @param value Binary cryptographic integrity checksum.
342     */
343    public DV_MULTIMEDIA setIntegrity_check(byte[] value) { 
344      if (value == null)
345        this.integrity_check = null;
346      else {
347        if (this.integrity_check == null)
348          this.integrity_check = new Base64BinaryType();
349        this.integrity_check.setValue(value);
350      }
351      return this;
352    }
353
354    /**
355     * @return {@link #integrity_check_algorithm} (Type of integrity check, a coded value from the openEHR Integrity check code set.)
356     */
357    public CODE_PHRASE getIntegrity_check_algorithm() { 
358      if (this.integrity_check_algorithm == null)
359        if (Configuration.errorOnAutoCreate())
360          throw new Error("Attempt to auto-create DV_MULTIMEDIA.integrity_check_algorithm");
361        else if (Configuration.doAutoCreate())
362          this.integrity_check_algorithm = new CODE_PHRASE(); // cc
363      return this.integrity_check_algorithm;
364    }
365
366    public boolean hasIntegrity_check_algorithm() { 
367      return this.integrity_check_algorithm != null && !this.integrity_check_algorithm.isEmpty();
368    }
369
370    /**
371     * @param value {@link #integrity_check_algorithm} (Type of integrity check, a coded value from the openEHR Integrity check code set.)
372     */
373    public DV_MULTIMEDIA setIntegrity_check_algorithm(CODE_PHRASE value) { 
374      this.integrity_check_algorithm = value;
375      return this;
376    }
377
378    /**
379     * @return {@link #thumbnail} (The thumbnail for this item, if one exists; mainly for graphics formats.)
380     */
381    public DV_MULTIMEDIA getThumbnail() { 
382      if (this.thumbnail == null)
383        if (Configuration.errorOnAutoCreate())
384          throw new Error("Attempt to auto-create DV_MULTIMEDIA.thumbnail");
385        else if (Configuration.doAutoCreate())
386          this.thumbnail = new DV_MULTIMEDIA(); // cc
387      return this.thumbnail;
388    }
389
390    public boolean hasThumbnail() { 
391      return this.thumbnail != null && !this.thumbnail.isEmpty();
392    }
393
394    /**
395     * @param value {@link #thumbnail} (The thumbnail for this item, if one exists; mainly for graphics formats.)
396     */
397    public DV_MULTIMEDIA setThumbnail(DV_MULTIMEDIA value) { 
398      this.thumbnail = value;
399      return this;
400    }
401
402    /**
403     * @return {@link #size} (Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value
404     */
405    public IntegerType getSizeElement() { 
406      if (this.size == null)
407        if (Configuration.errorOnAutoCreate())
408          throw new Error("Attempt to auto-create DV_MULTIMEDIA.size");
409        else if (Configuration.doAutoCreate())
410          this.size = new IntegerType(); // bb
411      return this.size;
412    }
413
414    public boolean hasSizeElement() { 
415      return this.size != null && !this.size.isEmpty();
416    }
417
418    public boolean hasSize() { 
419      return this.size != null && !this.size.isEmpty();
420    }
421
422    /**
423     * @param value {@link #size} (Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value
424     */
425    public DV_MULTIMEDIA setSizeElement(IntegerType value) { 
426      this.size = value;
427      return this;
428    }
429
430    /**
431     * @return Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.
432     */
433    public int getSize() { 
434      return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue();
435    }
436
437    /**
438     * @param value Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.
439     */
440    public DV_MULTIMEDIA setSize(int value) { 
441        if (this.size == null)
442          this.size = new IntegerType();
443        this.size.setValue(value);
444      return this;
445    }
446
447      protected void listChildren(List<Property> children) {
448        super.listChildren(children);
449        children.add(new Property("alternate_text", "string", "Text to display in lieu of multimedia display/replay.", 0, 1, alternate_text));
450        children.add(new Property("uri", "http://openehr.org/fhir/StructureDefinition/DV-URI", "URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference.", 0, 1, uri));
451        children.add(new Property("data", "base64Binary", "The actual data found at uri, if supplied inline.", 0, 1, data));
452        children.add(new Property("media_type", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "Data media type coded from openEHR code set media types (interface for the IANA MIME types code set).", 0, 1, media_type));
453        children.add(new Property("compression_algorithm", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "Compression type, a coded value from the openEHR Integrity check code set. Void means no compression.", 0, 1, compression_algorithm));
454        children.add(new Property("integrity_check", "base64Binary", "Binary cryptographic integrity checksum.", 0, 1, integrity_check));
455        children.add(new Property("integrity_check_algorithm", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "Type of integrity check, a coded value from the openEHR Integrity check code set.", 0, 1, integrity_check_algorithm));
456        children.add(new Property("thumbnail", "http://openehr.org/fhir/StructureDefinition/DV-MULTIMEDIA", "The thumbnail for this item, if one exists; mainly for graphics formats.", 0, 1, thumbnail));
457        children.add(new Property("size", "integer", "Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.", 0, 1, size));
458      }
459
460      @Override
461      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
462        switch (_hash) {
463        case -208340526: /*alternate_text*/  return new Property("alternate_text", "string", "Text to display in lieu of multimedia display/replay.", 0, 1, alternate_text);
464        case 116076: /*uri*/  return new Property("uri", "http://openehr.org/fhir/StructureDefinition/DV-URI", "URI reference to electronic information stored outside the record as a file, database entry etc, if supplied as a reference.", 0, 1, uri);
465        case 3076010: /*data*/  return new Property("data", "base64Binary", "The actual data found at uri, if supplied inline.", 0, 1, data);
466        case 1939875509: /*media_type*/  return new Property("media_type", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "Data media type coded from openEHR code set media types (interface for the IANA MIME types code set).", 0, 1, media_type);
467        case 1993343190: /*compression_algorithm*/  return new Property("compression_algorithm", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "Compression type, a coded value from the openEHR Integrity check code set. Void means no compression.", 0, 1, compression_algorithm);
468        case 1076156822: /*integrity_check*/  return new Property("integrity_check", "base64Binary", "Binary cryptographic integrity checksum.", 0, 1, integrity_check);
469        case 828114182: /*integrity_check_algorithm*/  return new Property("integrity_check_algorithm", "http://openehr.org/fhir/StructureDefinition/CODE-PHRASE", "Type of integrity check, a coded value from the openEHR Integrity check code set.", 0, 1, integrity_check_algorithm);
470        case 1330532588: /*thumbnail*/  return new Property("thumbnail", "http://openehr.org/fhir/StructureDefinition/DV-MULTIMEDIA", "The thumbnail for this item, if one exists; mainly for graphics formats.", 0, 1, thumbnail);
471        case 3530753: /*size*/  return new Property("size", "integer", "Original size in bytes of unencoded encapsulated data. I.e. encodings such as base64, hexadecimal etc do not change the value of this attribute.", 0, 1, size);
472        default: return super.getNamedProperty(_hash, _name, _checkValid);
473        }
474
475      }
476
477      @Override
478      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
479        switch (hash) {
480        case -208340526: /*alternate_text*/ return this.alternate_text == null ? new Base[0] : new Base[] {this.alternate_text}; // StringType
481        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // DV_URI
482        case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // Base64BinaryType
483        case 1939875509: /*media_type*/ return this.media_type == null ? new Base[0] : new Base[] {this.media_type}; // CODE_PHRASE
484        case 1993343190: /*compression_algorithm*/ return this.compression_algorithm == null ? new Base[0] : new Base[] {this.compression_algorithm}; // CODE_PHRASE
485        case 1076156822: /*integrity_check*/ return this.integrity_check == null ? new Base[0] : new Base[] {this.integrity_check}; // Base64BinaryType
486        case 828114182: /*integrity_check_algorithm*/ return this.integrity_check_algorithm == null ? new Base[0] : new Base[] {this.integrity_check_algorithm}; // CODE_PHRASE
487        case 1330532588: /*thumbnail*/ return this.thumbnail == null ? new Base[0] : new Base[] {this.thumbnail}; // DV_MULTIMEDIA
488        case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // IntegerType
489        default: return super.getProperty(hash, name, checkValid);
490        }
491
492      }
493
494      @Override
495      public Base setProperty(int hash, String name, Base value) throws FHIRException {
496        switch (hash) {
497        case -208340526: // alternate_text
498          this.alternate_text = TypeConvertor.castToString(value); // StringType
499          return value;
500        case 116076: // uri
501          this.uri = (DV_URI) value; // DV_URI
502          return value;
503        case 3076010: // data
504          this.data = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
505          return value;
506        case 1939875509: // media_type
507          this.media_type = (CODE_PHRASE) value; // CODE_PHRASE
508          return value;
509        case 1993343190: // compression_algorithm
510          this.compression_algorithm = (CODE_PHRASE) value; // CODE_PHRASE
511          return value;
512        case 1076156822: // integrity_check
513          this.integrity_check = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
514          return value;
515        case 828114182: // integrity_check_algorithm
516          this.integrity_check_algorithm = (CODE_PHRASE) value; // CODE_PHRASE
517          return value;
518        case 1330532588: // thumbnail
519          this.thumbnail = (DV_MULTIMEDIA) value; // DV_MULTIMEDIA
520          return value;
521        case 3530753: // size
522          this.size = TypeConvertor.castToInteger(value); // IntegerType
523          return value;
524        default: return super.setProperty(hash, name, value);
525        }
526
527      }
528
529      @Override
530      public Base setProperty(String name, Base value) throws FHIRException {
531        if (name.equals("alternate_text")) {
532          this.alternate_text = TypeConvertor.castToString(value); // StringType
533        } else if (name.equals("uri")) {
534          this.uri = (DV_URI) value; // DV_URI
535        } else if (name.equals("data")) {
536          this.data = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
537        } else if (name.equals("media_type")) {
538          this.media_type = (CODE_PHRASE) value; // CODE_PHRASE
539        } else if (name.equals("compression_algorithm")) {
540          this.compression_algorithm = (CODE_PHRASE) value; // CODE_PHRASE
541        } else if (name.equals("integrity_check")) {
542          this.integrity_check = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
543        } else if (name.equals("integrity_check_algorithm")) {
544          this.integrity_check_algorithm = (CODE_PHRASE) value; // CODE_PHRASE
545        } else if (name.equals("thumbnail")) {
546          this.thumbnail = (DV_MULTIMEDIA) value; // DV_MULTIMEDIA
547        } else if (name.equals("size")) {
548          this.size = TypeConvertor.castToInteger(value); // IntegerType
549        } else
550          return super.setProperty(name, value);
551        return value;
552      }
553
554      @Override
555      public Base makeProperty(int hash, String name) throws FHIRException {
556        switch (hash) {
557        case -208340526:  return getAlternate_textElement();
558        case 116076:  return getUri();
559        case 3076010:  return getDataElement();
560        case 1939875509:  return getMedia_type();
561        case 1993343190:  return getCompression_algorithm();
562        case 1076156822:  return getIntegrity_checkElement();
563        case 828114182:  return getIntegrity_check_algorithm();
564        case 1330532588:  return getThumbnail();
565        case 3530753:  return getSizeElement();
566        default: return super.makeProperty(hash, name);
567        }
568
569      }
570
571      @Override
572      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
573        switch (hash) {
574        case -208340526: /*alternate_text*/ return new String[] {"string"};
575        case 116076: /*uri*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/DV-URI"};
576        case 3076010: /*data*/ return new String[] {"base64Binary"};
577        case 1939875509: /*media_type*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/CODE-PHRASE"};
578        case 1993343190: /*compression_algorithm*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/CODE-PHRASE"};
579        case 1076156822: /*integrity_check*/ return new String[] {"base64Binary"};
580        case 828114182: /*integrity_check_algorithm*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/CODE-PHRASE"};
581        case 1330532588: /*thumbnail*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/DV-MULTIMEDIA"};
582        case 3530753: /*size*/ return new String[] {"integer"};
583        default: return super.getTypesForProperty(hash, name);
584        }
585
586      }
587
588      @Override
589      public Base addChild(String name) throws FHIRException {
590        if (name.equals("alternate_text")) {
591          throw new FHIRException("Cannot call addChild on a singleton property DV_MULTIMEDIA.alternate_text");
592        }
593        else if (name.equals("uri")) {
594          this.uri = new DV_URI();
595          return this.uri;
596        }
597        else if (name.equals("data")) {
598          throw new FHIRException("Cannot call addChild on a singleton property DV_MULTIMEDIA.data");
599        }
600        else if (name.equals("media_type")) {
601          this.media_type = new CODE_PHRASE();
602          return this.media_type;
603        }
604        else if (name.equals("compression_algorithm")) {
605          this.compression_algorithm = new CODE_PHRASE();
606          return this.compression_algorithm;
607        }
608        else if (name.equals("integrity_check")) {
609          throw new FHIRException("Cannot call addChild on a singleton property DV_MULTIMEDIA.integrity_check");
610        }
611        else if (name.equals("integrity_check_algorithm")) {
612          this.integrity_check_algorithm = new CODE_PHRASE();
613          return this.integrity_check_algorithm;
614        }
615        else if (name.equals("thumbnail")) {
616          this.thumbnail = new DV_MULTIMEDIA();
617          return this.thumbnail;
618        }
619        else if (name.equals("size")) {
620          throw new FHIRException("Cannot call addChild on a singleton property DV_MULTIMEDIA.size");
621        }
622        else
623          return super.addChild(name);
624      }
625
626  public String fhirType() {
627    return "DV_MULTIMEDIA";
628
629  }
630
631      public DV_MULTIMEDIA copy() {
632        DV_MULTIMEDIA dst = new DV_MULTIMEDIA();
633        copyValues(dst);
634        return dst;
635      }
636
637      public void copyValues(DV_MULTIMEDIA dst) {
638        super.copyValues(dst);
639        dst.alternate_text = alternate_text == null ? null : alternate_text.copy();
640        dst.uri = uri == null ? null : uri.copy();
641        dst.data = data == null ? null : data.copy();
642        dst.media_type = media_type == null ? null : media_type.copy();
643        dst.compression_algorithm = compression_algorithm == null ? null : compression_algorithm.copy();
644        dst.integrity_check = integrity_check == null ? null : integrity_check.copy();
645        dst.integrity_check_algorithm = integrity_check_algorithm == null ? null : integrity_check_algorithm.copy();
646        dst.thumbnail = thumbnail == null ? null : thumbnail.copy();
647        dst.size = size == null ? null : size.copy();
648      }
649
650      protected DV_MULTIMEDIA typedCopy() {
651        return copy();
652      }
653
654      @Override
655      public boolean equalsDeep(Base other_) {
656        if (!super.equalsDeep(other_))
657          return false;
658        if (!(other_ instanceof DV_MULTIMEDIA))
659          return false;
660        DV_MULTIMEDIA o = (DV_MULTIMEDIA) other_;
661        return compareDeep(alternate_text, o.alternate_text, true) && compareDeep(uri, o.uri, true) && compareDeep(data, o.data, true)
662           && compareDeep(media_type, o.media_type, true) && compareDeep(compression_algorithm, o.compression_algorithm, true)
663           && compareDeep(integrity_check, o.integrity_check, true) && compareDeep(integrity_check_algorithm, o.integrity_check_algorithm, true)
664           && compareDeep(thumbnail, o.thumbnail, true) && compareDeep(size, o.size, true);
665      }
666
667      @Override
668      public boolean equalsShallow(Base other_) {
669        if (!super.equalsShallow(other_))
670          return false;
671        if (!(other_ instanceof DV_MULTIMEDIA))
672          return false;
673        DV_MULTIMEDIA o = (DV_MULTIMEDIA) other_;
674        return compareValues(alternate_text, o.alternate_text, true) && compareValues(data, o.data, true) && compareValues(integrity_check, o.integrity_check, true)
675           && compareValues(size, o.size, true);
676      }
677
678      public boolean isEmpty() {
679        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(alternate_text, uri, data
680          , media_type, compression_algorithm, integrity_check, integrity_check_algorithm, thumbnail
681          , size);
682      }
683
684
685}
686