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