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