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