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