001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * Common Ancestor declaration for conformance and knowledge artifact resources.
048 */
049public abstract class MetadataResource extends DomainResource {
050
051    /**
052     * An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.
053     */
054    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
055    @Description(shortDefinition="Canonical identifier for this metadata resource, represented as a URI (globally unique)", formalDefinition="An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published." )
056    protected UriType url;
057
058    /**
059     * The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
060     */
061    @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
062    @Description(shortDefinition="Business version of the metadata resource", formalDefinition="The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence." )
063    protected StringType version;
064
065    /**
066     * A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.
067     */
068    @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
069    @Description(shortDefinition="Name for this metadata resource (computer friendly)", formalDefinition="A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation." )
070    protected StringType name;
071
072    /**
073     * A short, descriptive, user-friendly title for the metadata resource.
074     */
075    @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
076    @Description(shortDefinition="Name for this metadata resource (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the metadata resource." )
077    protected StringType title;
078
079    /**
080     * The status of this metadata resource. Enables tracking the life-cycle of the content.
081     */
082    @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true)
083    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this metadata resource. Enables tracking the life-cycle of the content." )
084    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
085    protected Enumeration<PublicationStatus> status;
086
087    /**
088     * A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
089     */
090    @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=true, summary=true)
091    @Description(shortDefinition="For testing purposes, not real usage", formalDefinition="A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage." )
092    protected BooleanType experimental;
093
094    /**
095     * The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.
096     */
097    @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
098    @Description(shortDefinition="Date last changed", formalDefinition="The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes." )
099    protected DateTimeType date;
100
101    /**
102     * The name of the organization or individual that published the metadata resource.
103     */
104    @Child(name = "publisher", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
105    @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the organization or individual that published the metadata resource." )
106    protected StringType publisher;
107
108    /**
109     * Contact details to assist a user in finding and communicating with the publisher.
110     */
111    @Child(name = "contact", type = {ContactDetail.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
112    @Description(shortDefinition="Contact details for the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
113    protected List<ContactDetail> contact;
114
115    /**
116     * A free text natural language description of the metadata resource from a consumer's perspective.
117     */
118    @Child(name = "description", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=false)
119    @Description(shortDefinition="Natural language description of the metadata resource", formalDefinition="A free text natural language description of the metadata resource from a consumer's perspective." )
120    protected MarkdownType description;
121
122    /**
123     * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances.
124     */
125    @Child(name = "useContext", type = {UsageContext.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
126    @Description(shortDefinition="The context that the content is intended to support", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances." )
127    protected List<UsageContext> useContext;
128
129    /**
130     * A legal or geographic region in which the metadata resource is intended to be used.
131     */
132    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
133    @Description(shortDefinition="Intended jurisdiction for metadata resource (if applicable)", formalDefinition="A legal or geographic region in which the metadata resource is intended to be used." )
134    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
135    protected List<CodeableConcept> jurisdiction;
136
137    private static final long serialVersionUID = 1952104592L;
138
139  /**
140   * Constructor
141   */
142    public MetadataResource() {
143      super();
144    }
145
146  /**
147   * Constructor
148   */
149    public MetadataResource(Enumeration<PublicationStatus> status) {
150      super();
151      this.status = status;
152    }
153
154    /**
155     * @return {@link #url} (An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
156     */
157    public UriType getUrlElement() { 
158      if (this.url == null)
159        if (Configuration.errorOnAutoCreate())
160          throw new Error("Attempt to auto-create MetadataResource.url");
161        else if (Configuration.doAutoCreate())
162          this.url = new UriType(); // bb
163      return this.url;
164    }
165
166    public boolean hasUrlElement() { 
167      return this.url != null && !this.url.isEmpty();
168    }
169
170    public boolean hasUrl() { 
171      return this.url != null && !this.url.isEmpty();
172    }
173
174    /**
175     * @param value {@link #url} (An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
176     */
177    public MetadataResource setUrlElement(UriType value) { 
178      this.url = value;
179      return this;
180    }
181
182    /**
183     * @return An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.
184     */
185    public String getUrl() { 
186      return this.url == null ? null : this.url.getValue();
187    }
188
189    /**
190     * @param value An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.
191     */
192    public MetadataResource setUrl(String value) { 
193      if (Utilities.noString(value))
194        this.url = null;
195      else {
196        if (this.url == null)
197          this.url = new UriType();
198        this.url.setValue(value);
199      }
200      return this;
201    }
202
203    /**
204     * @return {@link #version} (The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
205     */
206    public StringType getVersionElement() { 
207      if (this.version == null)
208        if (Configuration.errorOnAutoCreate())
209          throw new Error("Attempt to auto-create MetadataResource.version");
210        else if (Configuration.doAutoCreate())
211          this.version = new StringType(); // bb
212      return this.version;
213    }
214
215    public boolean hasVersionElement() { 
216      return this.version != null && !this.version.isEmpty();
217    }
218
219    public boolean hasVersion() { 
220      return this.version != null && !this.version.isEmpty();
221    }
222
223    /**
224     * @param value {@link #version} (The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
225     */
226    public MetadataResource setVersionElement(StringType value) { 
227      this.version = value;
228      return this;
229    }
230
231    /**
232     * @return The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
233     */
234    public String getVersion() { 
235      return this.version == null ? null : this.version.getValue();
236    }
237
238    /**
239     * @param value The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
240     */
241    public MetadataResource setVersion(String value) { 
242      if (Utilities.noString(value))
243        this.version = null;
244      else {
245        if (this.version == null)
246          this.version = new StringType();
247        this.version.setValue(value);
248      }
249      return this;
250    }
251
252    /**
253     * @return {@link #name} (A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
254     */
255    public StringType getNameElement() { 
256      if (this.name == null)
257        if (Configuration.errorOnAutoCreate())
258          throw new Error("Attempt to auto-create MetadataResource.name");
259        else if (Configuration.doAutoCreate())
260          this.name = new StringType(); // bb
261      return this.name;
262    }
263
264    public boolean hasNameElement() { 
265      return this.name != null && !this.name.isEmpty();
266    }
267
268    public boolean hasName() { 
269      return this.name != null && !this.name.isEmpty();
270    }
271
272    /**
273     * @param value {@link #name} (A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
274     */
275    public MetadataResource setNameElement(StringType value) { 
276      this.name = value;
277      return this;
278    }
279
280    /**
281     * @return A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.
282     */
283    public String getName() { 
284      return this.name == null ? null : this.name.getValue();
285    }
286
287    /**
288     * @param value A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.
289     */
290    public MetadataResource setName(String value) { 
291      if (Utilities.noString(value))
292        this.name = null;
293      else {
294        if (this.name == null)
295          this.name = new StringType();
296        this.name.setValue(value);
297      }
298      return this;
299    }
300
301    /**
302     * @return {@link #title} (A short, descriptive, user-friendly title for the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
303     */
304    public StringType getTitleElement() { 
305      if (this.title == null)
306        if (Configuration.errorOnAutoCreate())
307          throw new Error("Attempt to auto-create MetadataResource.title");
308        else if (Configuration.doAutoCreate())
309          this.title = new StringType(); // bb
310      return this.title;
311    }
312
313    public boolean hasTitleElement() { 
314      return this.title != null && !this.title.isEmpty();
315    }
316
317    public boolean hasTitle() { 
318      return this.title != null && !this.title.isEmpty();
319    }
320
321    /**
322     * @param value {@link #title} (A short, descriptive, user-friendly title for the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
323     */
324    public MetadataResource setTitleElement(StringType value) { 
325      this.title = value;
326      return this;
327    }
328
329    /**
330     * @return A short, descriptive, user-friendly title for the metadata resource.
331     */
332    public String getTitle() { 
333      return this.title == null ? null : this.title.getValue();
334    }
335
336    /**
337     * @param value A short, descriptive, user-friendly title for the metadata resource.
338     */
339    public MetadataResource setTitle(String value) { 
340      if (Utilities.noString(value))
341        this.title = null;
342      else {
343        if (this.title == null)
344          this.title = new StringType();
345        this.title.setValue(value);
346      }
347      return this;
348    }
349
350    /**
351     * @return {@link #status} (The status of this metadata resource. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
352     */
353    public Enumeration<PublicationStatus> getStatusElement() { 
354      if (this.status == null)
355        if (Configuration.errorOnAutoCreate())
356          throw new Error("Attempt to auto-create MetadataResource.status");
357        else if (Configuration.doAutoCreate())
358          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
359      return this.status;
360    }
361
362    public boolean hasStatusElement() { 
363      return this.status != null && !this.status.isEmpty();
364    }
365
366    public boolean hasStatus() { 
367      return this.status != null && !this.status.isEmpty();
368    }
369
370    /**
371     * @param value {@link #status} (The status of this metadata resource. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
372     */
373    public MetadataResource setStatusElement(Enumeration<PublicationStatus> value) { 
374      this.status = value;
375      return this;
376    }
377
378    /**
379     * @return The status of this metadata resource. Enables tracking the life-cycle of the content.
380     */
381    public PublicationStatus getStatus() { 
382      return this.status == null ? null : this.status.getValue();
383    }
384
385    /**
386     * @param value The status of this metadata resource. Enables tracking the life-cycle of the content.
387     */
388    public MetadataResource setStatus(PublicationStatus value) { 
389        if (this.status == null)
390          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
391        this.status.setValue(value);
392      return this;
393    }
394
395    /**
396     * @return {@link #experimental} (A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
397     */
398    public BooleanType getExperimentalElement() { 
399      if (this.experimental == null)
400        if (Configuration.errorOnAutoCreate())
401          throw new Error("Attempt to auto-create MetadataResource.experimental");
402        else if (Configuration.doAutoCreate())
403          this.experimental = new BooleanType(); // bb
404      return this.experimental;
405    }
406
407    public boolean hasExperimentalElement() { 
408      return this.experimental != null && !this.experimental.isEmpty();
409    }
410
411    public boolean hasExperimental() { 
412      return this.experimental != null && !this.experimental.isEmpty();
413    }
414
415    /**
416     * @param value {@link #experimental} (A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
417     */
418    public MetadataResource setExperimentalElement(BooleanType value) { 
419      this.experimental = value;
420      return this;
421    }
422
423    /**
424     * @return A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
425     */
426    public boolean getExperimental() { 
427      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
428    }
429
430    /**
431     * @param value A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
432     */
433    public MetadataResource setExperimental(boolean value) { 
434        if (this.experimental == null)
435          this.experimental = new BooleanType();
436        this.experimental.setValue(value);
437      return this;
438    }
439
440    /**
441     * @return {@link #date} (The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
442     */
443    public DateTimeType getDateElement() { 
444      if (this.date == null)
445        if (Configuration.errorOnAutoCreate())
446          throw new Error("Attempt to auto-create MetadataResource.date");
447        else if (Configuration.doAutoCreate())
448          this.date = new DateTimeType(); // bb
449      return this.date;
450    }
451
452    public boolean hasDateElement() { 
453      return this.date != null && !this.date.isEmpty();
454    }
455
456    public boolean hasDate() { 
457      return this.date != null && !this.date.isEmpty();
458    }
459
460    /**
461     * @param value {@link #date} (The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
462     */
463    public MetadataResource setDateElement(DateTimeType value) { 
464      this.date = value;
465      return this;
466    }
467
468    /**
469     * @return The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.
470     */
471    public Date getDate() { 
472      return this.date == null ? null : this.date.getValue();
473    }
474
475    /**
476     * @param value The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.
477     */
478    public MetadataResource setDate(Date value) { 
479      if (value == null)
480        this.date = null;
481      else {
482        if (this.date == null)
483          this.date = new DateTimeType();
484        this.date.setValue(value);
485      }
486      return this;
487    }
488
489    /**
490     * @return {@link #publisher} (The name of the organization or individual that published the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
491     */
492    public StringType getPublisherElement() { 
493      if (this.publisher == null)
494        if (Configuration.errorOnAutoCreate())
495          throw new Error("Attempt to auto-create MetadataResource.publisher");
496        else if (Configuration.doAutoCreate())
497          this.publisher = new StringType(); // bb
498      return this.publisher;
499    }
500
501    public boolean hasPublisherElement() { 
502      return this.publisher != null && !this.publisher.isEmpty();
503    }
504
505    public boolean hasPublisher() { 
506      return this.publisher != null && !this.publisher.isEmpty();
507    }
508
509    /**
510     * @param value {@link #publisher} (The name of the organization or individual that published the metadata resource.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
511     */
512    public MetadataResource setPublisherElement(StringType value) { 
513      this.publisher = value;
514      return this;
515    }
516
517    /**
518     * @return The name of the organization or individual that published the metadata resource.
519     */
520    public String getPublisher() { 
521      return this.publisher == null ? null : this.publisher.getValue();
522    }
523
524    /**
525     * @param value The name of the organization or individual that published the metadata resource.
526     */
527    public MetadataResource setPublisher(String value) { 
528      if (Utilities.noString(value))
529        this.publisher = null;
530      else {
531        if (this.publisher == null)
532          this.publisher = new StringType();
533        this.publisher.setValue(value);
534      }
535      return this;
536    }
537
538    /**
539     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
540     */
541    public List<ContactDetail> getContact() { 
542      if (this.contact == null)
543        this.contact = new ArrayList<ContactDetail>();
544      return this.contact;
545    }
546
547    /**
548     * @return Returns a reference to <code>this</code> for easy method chaining
549     */
550    public MetadataResource setContact(List<ContactDetail> theContact) { 
551      this.contact = theContact;
552      return this;
553    }
554
555    public boolean hasContact() { 
556      if (this.contact == null)
557        return false;
558      for (ContactDetail item : this.contact)
559        if (!item.isEmpty())
560          return true;
561      return false;
562    }
563
564    public ContactDetail addContact() { //3
565      ContactDetail t = new ContactDetail();
566      if (this.contact == null)
567        this.contact = new ArrayList<ContactDetail>();
568      this.contact.add(t);
569      return t;
570    }
571
572    public MetadataResource addContact(ContactDetail t) { //3
573      if (t == null)
574        return this;
575      if (this.contact == null)
576        this.contact = new ArrayList<ContactDetail>();
577      this.contact.add(t);
578      return this;
579    }
580
581    /**
582     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
583     */
584    public ContactDetail getContactFirstRep() { 
585      if (getContact().isEmpty()) {
586        addContact();
587      }
588      return getContact().get(0);
589    }
590
591    /**
592     * @return {@link #description} (A free text natural language description of the metadata resource from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
593     */
594    public MarkdownType getDescriptionElement() { 
595      if (this.description == null)
596        if (Configuration.errorOnAutoCreate())
597          throw new Error("Attempt to auto-create MetadataResource.description");
598        else if (Configuration.doAutoCreate())
599          this.description = new MarkdownType(); // bb
600      return this.description;
601    }
602
603    public boolean hasDescriptionElement() { 
604      return this.description != null && !this.description.isEmpty();
605    }
606
607    public boolean hasDescription() { 
608      return this.description != null && !this.description.isEmpty();
609    }
610
611    /**
612     * @param value {@link #description} (A free text natural language description of the metadata resource from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
613     */
614    public MetadataResource setDescriptionElement(MarkdownType value) { 
615      this.description = value;
616      return this;
617    }
618
619    /**
620     * @return A free text natural language description of the metadata resource from a consumer's perspective.
621     */
622    public String getDescription() { 
623      return this.description == null ? null : this.description.getValue();
624    }
625
626    /**
627     * @param value A free text natural language description of the metadata resource from a consumer's perspective.
628     */
629    public MetadataResource setDescription(String value) { 
630      if (value == null)
631        this.description = null;
632      else {
633        if (this.description == null)
634          this.description = new MarkdownType();
635        this.description.setValue(value);
636      }
637      return this;
638    }
639
640    /**
641     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances.)
642     */
643    public List<UsageContext> getUseContext() { 
644      if (this.useContext == null)
645        this.useContext = new ArrayList<UsageContext>();
646      return this.useContext;
647    }
648
649    /**
650     * @return Returns a reference to <code>this</code> for easy method chaining
651     */
652    public MetadataResource setUseContext(List<UsageContext> theUseContext) { 
653      this.useContext = theUseContext;
654      return this;
655    }
656
657    public boolean hasUseContext() { 
658      if (this.useContext == null)
659        return false;
660      for (UsageContext item : this.useContext)
661        if (!item.isEmpty())
662          return true;
663      return false;
664    }
665
666    public UsageContext addUseContext() { //3
667      UsageContext t = new UsageContext();
668      if (this.useContext == null)
669        this.useContext = new ArrayList<UsageContext>();
670      this.useContext.add(t);
671      return t;
672    }
673
674    public MetadataResource addUseContext(UsageContext t) { //3
675      if (t == null)
676        return this;
677      if (this.useContext == null)
678        this.useContext = new ArrayList<UsageContext>();
679      this.useContext.add(t);
680      return this;
681    }
682
683    /**
684     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
685     */
686    public UsageContext getUseContextFirstRep() { 
687      if (getUseContext().isEmpty()) {
688        addUseContext();
689      }
690      return getUseContext().get(0);
691    }
692
693    /**
694     * @return {@link #jurisdiction} (A legal or geographic region in which the metadata resource is intended to be used.)
695     */
696    public List<CodeableConcept> getJurisdiction() { 
697      if (this.jurisdiction == null)
698        this.jurisdiction = new ArrayList<CodeableConcept>();
699      return this.jurisdiction;
700    }
701
702    /**
703     * @return Returns a reference to <code>this</code> for easy method chaining
704     */
705    public MetadataResource setJurisdiction(List<CodeableConcept> theJurisdiction) { 
706      this.jurisdiction = theJurisdiction;
707      return this;
708    }
709
710    public boolean hasJurisdiction() { 
711      if (this.jurisdiction == null)
712        return false;
713      for (CodeableConcept item : this.jurisdiction)
714        if (!item.isEmpty())
715          return true;
716      return false;
717    }
718
719    public CodeableConcept addJurisdiction() { //3
720      CodeableConcept t = new CodeableConcept();
721      if (this.jurisdiction == null)
722        this.jurisdiction = new ArrayList<CodeableConcept>();
723      this.jurisdiction.add(t);
724      return t;
725    }
726
727    public MetadataResource addJurisdiction(CodeableConcept t) { //3
728      if (t == null)
729        return this;
730      if (this.jurisdiction == null)
731        this.jurisdiction = new ArrayList<CodeableConcept>();
732      this.jurisdiction.add(t);
733      return this;
734    }
735
736    /**
737     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
738     */
739    public CodeableConcept getJurisdictionFirstRep() { 
740      if (getJurisdiction().isEmpty()) {
741        addJurisdiction();
742      }
743      return getJurisdiction().get(0);
744    }
745
746      protected void listChildren(List<Property> children) {
747        children.add(new Property("url", "uri", "An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.", 0, 1, url));
748        children.add(new Property("version", "string", "The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
749        children.add(new Property("name", "string", "A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
750        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the metadata resource.", 0, 1, title));
751        children.add(new Property("status", "code", "The status of this metadata resource. Enables tracking the life-cycle of the content.", 0, 1, status));
752        children.add(new Property("experimental", "boolean", "A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental));
753        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.", 0, 1, date));
754        children.add(new Property("publisher", "string", "The name of the organization or individual that published the metadata resource.", 0, 1, publisher));
755        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
756        children.add(new Property("description", "markdown", "A free text natural language description of the metadata resource from a consumer's perspective.", 0, 1, description));
757        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
758        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the metadata resource is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
759      }
760
761      @Override
762      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
763        switch (_hash) {
764        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this metadata resource is (or will be) published.", 0, 1, url);
765        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
766        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
767        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the metadata resource.", 0, 1, title);
768        case -892481550: /*status*/  return new Property("status", "code", "The status of this metadata resource. Enables tracking the life-cycle of the content.", 0, 1, status);
769        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental);
770        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes.", 0, 1, date);
771        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the metadata resource.", 0, 1, publisher);
772        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
773        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the metadata resource from a consumer's perspective.", 0, 1, description);
774        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate metadata resource instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
775        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the metadata resource is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
776        default: return super.getNamedProperty(_hash, _name, _checkValid);
777        }
778
779      }
780
781      @Override
782      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
783        switch (hash) {
784        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
785        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
786        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
787        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
788        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
789        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
790        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
791        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
792        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
793        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
794        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
795        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
796        default: return super.getProperty(hash, name, checkValid);
797        }
798
799      }
800
801      @Override
802      public Base setProperty(int hash, String name, Base value) throws FHIRException {
803        switch (hash) {
804        case 116079: // url
805          this.url = castToUri(value); // UriType
806          return value;
807        case 351608024: // version
808          this.version = castToString(value); // StringType
809          return value;
810        case 3373707: // name
811          this.name = castToString(value); // StringType
812          return value;
813        case 110371416: // title
814          this.title = castToString(value); // StringType
815          return value;
816        case -892481550: // status
817          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
818          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
819          return value;
820        case -404562712: // experimental
821          this.experimental = castToBoolean(value); // BooleanType
822          return value;
823        case 3076014: // date
824          this.date = castToDateTime(value); // DateTimeType
825          return value;
826        case 1447404028: // publisher
827          this.publisher = castToString(value); // StringType
828          return value;
829        case 951526432: // contact
830          this.getContact().add(castToContactDetail(value)); // ContactDetail
831          return value;
832        case -1724546052: // description
833          this.description = castToMarkdown(value); // MarkdownType
834          return value;
835        case -669707736: // useContext
836          this.getUseContext().add(castToUsageContext(value)); // UsageContext
837          return value;
838        case -507075711: // jurisdiction
839          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
840          return value;
841        default: return super.setProperty(hash, name, value);
842        }
843
844      }
845
846      @Override
847      public Base setProperty(String name, Base value) throws FHIRException {
848        if (name.equals("url")) {
849          this.url = castToUri(value); // UriType
850        } else if (name.equals("version")) {
851          this.version = castToString(value); // StringType
852        } else if (name.equals("name")) {
853          this.name = castToString(value); // StringType
854        } else if (name.equals("title")) {
855          this.title = castToString(value); // StringType
856        } else if (name.equals("status")) {
857          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
858          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
859        } else if (name.equals("experimental")) {
860          this.experimental = castToBoolean(value); // BooleanType
861        } else if (name.equals("date")) {
862          this.date = castToDateTime(value); // DateTimeType
863        } else if (name.equals("publisher")) {
864          this.publisher = castToString(value); // StringType
865        } else if (name.equals("contact")) {
866          this.getContact().add(castToContactDetail(value));
867        } else if (name.equals("description")) {
868          this.description = castToMarkdown(value); // MarkdownType
869        } else if (name.equals("useContext")) {
870          this.getUseContext().add(castToUsageContext(value));
871        } else if (name.equals("jurisdiction")) {
872          this.getJurisdiction().add(castToCodeableConcept(value));
873        } else
874          return super.setProperty(name, value);
875        return value;
876      }
877
878      @Override
879      public Base makeProperty(int hash, String name) throws FHIRException {
880        switch (hash) {
881        case 116079:  return getUrlElement();
882        case 351608024:  return getVersionElement();
883        case 3373707:  return getNameElement();
884        case 110371416:  return getTitleElement();
885        case -892481550:  return getStatusElement();
886        case -404562712:  return getExperimentalElement();
887        case 3076014:  return getDateElement();
888        case 1447404028:  return getPublisherElement();
889        case 951526432:  return addContact(); 
890        case -1724546052:  return getDescriptionElement();
891        case -669707736:  return addUseContext(); 
892        case -507075711:  return addJurisdiction(); 
893        default: return super.makeProperty(hash, name);
894        }
895
896      }
897
898      @Override
899      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
900        switch (hash) {
901        case 116079: /*url*/ return new String[] {"uri"};
902        case 351608024: /*version*/ return new String[] {"string"};
903        case 3373707: /*name*/ return new String[] {"string"};
904        case 110371416: /*title*/ return new String[] {"string"};
905        case -892481550: /*status*/ return new String[] {"code"};
906        case -404562712: /*experimental*/ return new String[] {"boolean"};
907        case 3076014: /*date*/ return new String[] {"dateTime"};
908        case 1447404028: /*publisher*/ return new String[] {"string"};
909        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
910        case -1724546052: /*description*/ return new String[] {"markdown"};
911        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
912        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
913        default: return super.getTypesForProperty(hash, name);
914        }
915
916      }
917
918      @Override
919      public Base addChild(String name) throws FHIRException {
920        if (name.equals("url")) {
921          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.url");
922        }
923        else if (name.equals("version")) {
924          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.version");
925        }
926        else if (name.equals("name")) {
927          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.name");
928        }
929        else if (name.equals("title")) {
930          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.title");
931        }
932        else if (name.equals("status")) {
933          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.status");
934        }
935        else if (name.equals("experimental")) {
936          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.experimental");
937        }
938        else if (name.equals("date")) {
939          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.date");
940        }
941        else if (name.equals("publisher")) {
942          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.publisher");
943        }
944        else if (name.equals("contact")) {
945          return addContact();
946        }
947        else if (name.equals("description")) {
948          throw new FHIRException("Cannot call addChild on a primitive type MetadataResource.description");
949        }
950        else if (name.equals("useContext")) {
951          return addUseContext();
952        }
953        else if (name.equals("jurisdiction")) {
954          return addJurisdiction();
955        }
956        else
957          return super.addChild(name);
958      }
959
960  public String fhirType() {
961    return "MetadataResource";
962
963  }
964
965      public abstract MetadataResource copy();
966
967      public void copyValues(MetadataResource dst) {
968        super.copyValues(dst);
969        dst.url = url == null ? null : url.copy();
970        dst.version = version == null ? null : version.copy();
971        dst.name = name == null ? null : name.copy();
972        dst.title = title == null ? null : title.copy();
973        dst.status = status == null ? null : status.copy();
974        dst.experimental = experimental == null ? null : experimental.copy();
975        dst.date = date == null ? null : date.copy();
976        dst.publisher = publisher == null ? null : publisher.copy();
977        if (contact != null) {
978          dst.contact = new ArrayList<ContactDetail>();
979          for (ContactDetail i : contact)
980            dst.contact.add(i.copy());
981        };
982        dst.description = description == null ? null : description.copy();
983        if (useContext != null) {
984          dst.useContext = new ArrayList<UsageContext>();
985          for (UsageContext i : useContext)
986            dst.useContext.add(i.copy());
987        };
988        if (jurisdiction != null) {
989          dst.jurisdiction = new ArrayList<CodeableConcept>();
990          for (CodeableConcept i : jurisdiction)
991            dst.jurisdiction.add(i.copy());
992        };
993      }
994
995      @Override
996      public boolean equalsDeep(Base other_) {
997        if (!super.equalsDeep(other_))
998          return false;
999        if (!(other_ instanceof MetadataResource))
1000          return false;
1001        MetadataResource o = (MetadataResource) other_;
1002        return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true)
1003           && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true)
1004           && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true)
1005           && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true)
1006           && compareDeep(jurisdiction, o.jurisdiction, true);
1007      }
1008
1009      @Override
1010      public boolean equalsShallow(Base other_) {
1011        if (!super.equalsShallow(other_))
1012          return false;
1013        if (!(other_ instanceof MetadataResource))
1014          return false;
1015        MetadataResource o = (MetadataResource) other_;
1016        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
1017           && compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true)
1018           && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true)
1019          ;
1020      }
1021
1022      public boolean isEmpty() {
1023        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, version, name, title
1024          , status, experimental, date, publisher, contact, description, useContext, jurisdiction
1025          );
1026      }
1027
1028// added from java-adornments.txt:
1029      @Override
1030      public String toString() {
1031        return fhirType()+"["+getUrl()+"]";
1032      }
1033
1034// end addition
1035
1036}
1037