001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import ca.uhn.fhir.model.api.annotation.ResourceDef;
041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.Block;
046import org.hl7.fhir.instance.model.api.*;
047import org.hl7.fhir.exceptions.FHIRException;
048/**
049 * Describes validation requirements, source(s), status and dates for one or more elements.
050 */
051@ResourceDef(name="VerificationResult", profile="http://hl7.org/fhir/StructureDefinition/VerificationResult")
052public class VerificationResult extends DomainResource {
053
054    public enum Status {
055        /**
056         * ***TODO***
057         */
058        ATTESTED, 
059        /**
060         * ***TODO***
061         */
062        VALIDATED, 
063        /**
064         * ***TODO***
065         */
066        INPROCESS, 
067        /**
068         * ***TODO***
069         */
070        REQREVALID, 
071        /**
072         * ***TODO***
073         */
074        VALFAIL, 
075        /**
076         * ***TODO***
077         */
078        REVALFAIL, 
079        /**
080         * added to help the parsers with the generic types
081         */
082        NULL;
083        public static Status fromCode(String codeString) throws FHIRException {
084            if (codeString == null || "".equals(codeString))
085                return null;
086        if ("attested".equals(codeString))
087          return ATTESTED;
088        if ("validated".equals(codeString))
089          return VALIDATED;
090        if ("in-process".equals(codeString))
091          return INPROCESS;
092        if ("req-revalid".equals(codeString))
093          return REQREVALID;
094        if ("val-fail".equals(codeString))
095          return VALFAIL;
096        if ("reval-fail".equals(codeString))
097          return REVALFAIL;
098        if (Configuration.isAcceptInvalidEnums())
099          return null;
100        else
101          throw new FHIRException("Unknown Status code '"+codeString+"'");
102        }
103        public String toCode() {
104          switch (this) {
105            case ATTESTED: return "attested";
106            case VALIDATED: return "validated";
107            case INPROCESS: return "in-process";
108            case REQREVALID: return "req-revalid";
109            case VALFAIL: return "val-fail";
110            case REVALFAIL: return "reval-fail";
111            default: return "?";
112          }
113        }
114        public String getSystem() {
115          switch (this) {
116            case ATTESTED: return "http://hl7.org/fhir/CodeSystem/status";
117            case VALIDATED: return "http://hl7.org/fhir/CodeSystem/status";
118            case INPROCESS: return "http://hl7.org/fhir/CodeSystem/status";
119            case REQREVALID: return "http://hl7.org/fhir/CodeSystem/status";
120            case VALFAIL: return "http://hl7.org/fhir/CodeSystem/status";
121            case REVALFAIL: return "http://hl7.org/fhir/CodeSystem/status";
122            default: return "?";
123          }
124        }
125        public String getDefinition() {
126          switch (this) {
127            case ATTESTED: return "***TODO***";
128            case VALIDATED: return "***TODO***";
129            case INPROCESS: return "***TODO***";
130            case REQREVALID: return "***TODO***";
131            case VALFAIL: return "***TODO***";
132            case REVALFAIL: return "***TODO***";
133            default: return "?";
134          }
135        }
136        public String getDisplay() {
137          switch (this) {
138            case ATTESTED: return "Attested";
139            case VALIDATED: return "Validated";
140            case INPROCESS: return "In process";
141            case REQREVALID: return "Requires revalidation";
142            case VALFAIL: return "Validation failed";
143            case REVALFAIL: return "Re-Validation failed";
144            default: return "?";
145          }
146        }
147    }
148
149  public static class StatusEnumFactory implements EnumFactory<Status> {
150    public Status fromCode(String codeString) throws IllegalArgumentException {
151      if (codeString == null || "".equals(codeString))
152            if (codeString == null || "".equals(codeString))
153                return null;
154        if ("attested".equals(codeString))
155          return Status.ATTESTED;
156        if ("validated".equals(codeString))
157          return Status.VALIDATED;
158        if ("in-process".equals(codeString))
159          return Status.INPROCESS;
160        if ("req-revalid".equals(codeString))
161          return Status.REQREVALID;
162        if ("val-fail".equals(codeString))
163          return Status.VALFAIL;
164        if ("reval-fail".equals(codeString))
165          return Status.REVALFAIL;
166        throw new IllegalArgumentException("Unknown Status code '"+codeString+"'");
167        }
168        public Enumeration<Status> fromType(Base code) throws FHIRException {
169          if (code == null)
170            return null;
171          if (code.isEmpty())
172            return new Enumeration<Status>(this);
173          String codeString = ((PrimitiveType) code).asStringValue();
174          if (codeString == null || "".equals(codeString))
175            return null;
176        if ("attested".equals(codeString))
177          return new Enumeration<Status>(this, Status.ATTESTED);
178        if ("validated".equals(codeString))
179          return new Enumeration<Status>(this, Status.VALIDATED);
180        if ("in-process".equals(codeString))
181          return new Enumeration<Status>(this, Status.INPROCESS);
182        if ("req-revalid".equals(codeString))
183          return new Enumeration<Status>(this, Status.REQREVALID);
184        if ("val-fail".equals(codeString))
185          return new Enumeration<Status>(this, Status.VALFAIL);
186        if ("reval-fail".equals(codeString))
187          return new Enumeration<Status>(this, Status.REVALFAIL);
188        throw new FHIRException("Unknown Status code '"+codeString+"'");
189        }
190    public String toCode(Status code) {
191      if (code == Status.ATTESTED)
192        return "attested";
193      if (code == Status.VALIDATED)
194        return "validated";
195      if (code == Status.INPROCESS)
196        return "in-process";
197      if (code == Status.REQREVALID)
198        return "req-revalid";
199      if (code == Status.VALFAIL)
200        return "val-fail";
201      if (code == Status.REVALFAIL)
202        return "reval-fail";
203      return "?";
204      }
205    public String toSystem(Status code) {
206      return code.getSystem();
207      }
208    }
209
210    @Block()
211    public static class VerificationResultPrimarySourceComponent extends BackboneElement implements IBaseBackboneElement {
212        /**
213         * Reference to the primary source.
214         */
215        @Child(name = "who", type = {Organization.class, Practitioner.class, PractitionerRole.class}, order=1, min=0, max=1, modifier=false, summary=false)
216        @Description(shortDefinition="Reference to the primary source", formalDefinition="Reference to the primary source." )
217        protected Reference who;
218
219        /**
220         * The actual object that is the target of the reference (Reference to the primary source.)
221         */
222        protected Resource whoTarget;
223
224        /**
225         * Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source).
226         */
227        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
228        @Description(shortDefinition="Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source)", formalDefinition="Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source)." )
229        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-primary-source-type")
230        protected List<CodeableConcept> type;
231
232        /**
233         * Method for communicating with the primary source (manual; API; Push).
234         */
235        @Child(name = "communicationMethod", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
236        @Description(shortDefinition="Method for exchanging information with the primary source", formalDefinition="Method for communicating with the primary source (manual; API; Push)." )
237        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-communication-method")
238        protected List<CodeableConcept> communicationMethod;
239
240        /**
241         * Status of the validation of the target against the primary source (successful; failed; unknown).
242         */
243        @Child(name = "validationStatus", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
244        @Description(shortDefinition="successful | failed | unknown", formalDefinition="Status of the validation of the target against the primary source (successful; failed; unknown)." )
245        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-validation-status")
246        protected CodeableConcept validationStatus;
247
248        /**
249         * When the target was validated against the primary source.
250         */
251        @Child(name = "validationDate", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
252        @Description(shortDefinition="When the target was validated against the primary source", formalDefinition="When the target was validated against the primary source." )
253        protected DateTimeType validationDate;
254
255        /**
256         * Ability of the primary source to push updates/alerts (yes; no; undetermined).
257         */
258        @Child(name = "canPushUpdates", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
259        @Description(shortDefinition="yes | no | undetermined", formalDefinition="Ability of the primary source to push updates/alerts (yes; no; undetermined)." )
260        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-can-push-updates")
261        protected CodeableConcept canPushUpdates;
262
263        /**
264         * Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source).
265         */
266        @Child(name = "pushTypeAvailable", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
267        @Description(shortDefinition="specific | any | source", formalDefinition="Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source)." )
268        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-push-type-available")
269        protected List<CodeableConcept> pushTypeAvailable;
270
271        private static final long serialVersionUID = -928858332L;
272
273    /**
274     * Constructor
275     */
276      public VerificationResultPrimarySourceComponent() {
277        super();
278      }
279
280        /**
281         * @return {@link #who} (Reference to the primary source.)
282         */
283        public Reference getWho() { 
284          if (this.who == null)
285            if (Configuration.errorOnAutoCreate())
286              throw new Error("Attempt to auto-create VerificationResultPrimarySourceComponent.who");
287            else if (Configuration.doAutoCreate())
288              this.who = new Reference(); // cc
289          return this.who;
290        }
291
292        public boolean hasWho() { 
293          return this.who != null && !this.who.isEmpty();
294        }
295
296        /**
297         * @param value {@link #who} (Reference to the primary source.)
298         */
299        public VerificationResultPrimarySourceComponent setWho(Reference value) { 
300          this.who = value;
301          return this;
302        }
303
304        /**
305         * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the primary source.)
306         */
307        public Resource getWhoTarget() { 
308          return this.whoTarget;
309        }
310
311        /**
312         * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the primary source.)
313         */
314        public VerificationResultPrimarySourceComponent setWhoTarget(Resource value) { 
315          this.whoTarget = value;
316          return this;
317        }
318
319        /**
320         * @return {@link #type} (Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source).)
321         */
322        public List<CodeableConcept> getType() { 
323          if (this.type == null)
324            this.type = new ArrayList<CodeableConcept>();
325          return this.type;
326        }
327
328        /**
329         * @return Returns a reference to <code>this</code> for easy method chaining
330         */
331        public VerificationResultPrimarySourceComponent setType(List<CodeableConcept> theType) { 
332          this.type = theType;
333          return this;
334        }
335
336        public boolean hasType() { 
337          if (this.type == null)
338            return false;
339          for (CodeableConcept item : this.type)
340            if (!item.isEmpty())
341              return true;
342          return false;
343        }
344
345        public CodeableConcept addType() { //3
346          CodeableConcept t = new CodeableConcept();
347          if (this.type == null)
348            this.type = new ArrayList<CodeableConcept>();
349          this.type.add(t);
350          return t;
351        }
352
353        public VerificationResultPrimarySourceComponent addType(CodeableConcept t) { //3
354          if (t == null)
355            return this;
356          if (this.type == null)
357            this.type = new ArrayList<CodeableConcept>();
358          this.type.add(t);
359          return this;
360        }
361
362        /**
363         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
364         */
365        public CodeableConcept getTypeFirstRep() { 
366          if (getType().isEmpty()) {
367            addType();
368          }
369          return getType().get(0);
370        }
371
372        /**
373         * @return {@link #communicationMethod} (Method for communicating with the primary source (manual; API; Push).)
374         */
375        public List<CodeableConcept> getCommunicationMethod() { 
376          if (this.communicationMethod == null)
377            this.communicationMethod = new ArrayList<CodeableConcept>();
378          return this.communicationMethod;
379        }
380
381        /**
382         * @return Returns a reference to <code>this</code> for easy method chaining
383         */
384        public VerificationResultPrimarySourceComponent setCommunicationMethod(List<CodeableConcept> theCommunicationMethod) { 
385          this.communicationMethod = theCommunicationMethod;
386          return this;
387        }
388
389        public boolean hasCommunicationMethod() { 
390          if (this.communicationMethod == null)
391            return false;
392          for (CodeableConcept item : this.communicationMethod)
393            if (!item.isEmpty())
394              return true;
395          return false;
396        }
397
398        public CodeableConcept addCommunicationMethod() { //3
399          CodeableConcept t = new CodeableConcept();
400          if (this.communicationMethod == null)
401            this.communicationMethod = new ArrayList<CodeableConcept>();
402          this.communicationMethod.add(t);
403          return t;
404        }
405
406        public VerificationResultPrimarySourceComponent addCommunicationMethod(CodeableConcept t) { //3
407          if (t == null)
408            return this;
409          if (this.communicationMethod == null)
410            this.communicationMethod = new ArrayList<CodeableConcept>();
411          this.communicationMethod.add(t);
412          return this;
413        }
414
415        /**
416         * @return The first repetition of repeating field {@link #communicationMethod}, creating it if it does not already exist
417         */
418        public CodeableConcept getCommunicationMethodFirstRep() { 
419          if (getCommunicationMethod().isEmpty()) {
420            addCommunicationMethod();
421          }
422          return getCommunicationMethod().get(0);
423        }
424
425        /**
426         * @return {@link #validationStatus} (Status of the validation of the target against the primary source (successful; failed; unknown).)
427         */
428        public CodeableConcept getValidationStatus() { 
429          if (this.validationStatus == null)
430            if (Configuration.errorOnAutoCreate())
431              throw new Error("Attempt to auto-create VerificationResultPrimarySourceComponent.validationStatus");
432            else if (Configuration.doAutoCreate())
433              this.validationStatus = new CodeableConcept(); // cc
434          return this.validationStatus;
435        }
436
437        public boolean hasValidationStatus() { 
438          return this.validationStatus != null && !this.validationStatus.isEmpty();
439        }
440
441        /**
442         * @param value {@link #validationStatus} (Status of the validation of the target against the primary source (successful; failed; unknown).)
443         */
444        public VerificationResultPrimarySourceComponent setValidationStatus(CodeableConcept value) { 
445          this.validationStatus = value;
446          return this;
447        }
448
449        /**
450         * @return {@link #validationDate} (When the target was validated against the primary source.). This is the underlying object with id, value and extensions. The accessor "getValidationDate" gives direct access to the value
451         */
452        public DateTimeType getValidationDateElement() { 
453          if (this.validationDate == null)
454            if (Configuration.errorOnAutoCreate())
455              throw new Error("Attempt to auto-create VerificationResultPrimarySourceComponent.validationDate");
456            else if (Configuration.doAutoCreate())
457              this.validationDate = new DateTimeType(); // bb
458          return this.validationDate;
459        }
460
461        public boolean hasValidationDateElement() { 
462          return this.validationDate != null && !this.validationDate.isEmpty();
463        }
464
465        public boolean hasValidationDate() { 
466          return this.validationDate != null && !this.validationDate.isEmpty();
467        }
468
469        /**
470         * @param value {@link #validationDate} (When the target was validated against the primary source.). This is the underlying object with id, value and extensions. The accessor "getValidationDate" gives direct access to the value
471         */
472        public VerificationResultPrimarySourceComponent setValidationDateElement(DateTimeType value) { 
473          this.validationDate = value;
474          return this;
475        }
476
477        /**
478         * @return When the target was validated against the primary source.
479         */
480        public Date getValidationDate() { 
481          return this.validationDate == null ? null : this.validationDate.getValue();
482        }
483
484        /**
485         * @param value When the target was validated against the primary source.
486         */
487        public VerificationResultPrimarySourceComponent setValidationDate(Date value) { 
488          if (value == null)
489            this.validationDate = null;
490          else {
491            if (this.validationDate == null)
492              this.validationDate = new DateTimeType();
493            this.validationDate.setValue(value);
494          }
495          return this;
496        }
497
498        /**
499         * @return {@link #canPushUpdates} (Ability of the primary source to push updates/alerts (yes; no; undetermined).)
500         */
501        public CodeableConcept getCanPushUpdates() { 
502          if (this.canPushUpdates == null)
503            if (Configuration.errorOnAutoCreate())
504              throw new Error("Attempt to auto-create VerificationResultPrimarySourceComponent.canPushUpdates");
505            else if (Configuration.doAutoCreate())
506              this.canPushUpdates = new CodeableConcept(); // cc
507          return this.canPushUpdates;
508        }
509
510        public boolean hasCanPushUpdates() { 
511          return this.canPushUpdates != null && !this.canPushUpdates.isEmpty();
512        }
513
514        /**
515         * @param value {@link #canPushUpdates} (Ability of the primary source to push updates/alerts (yes; no; undetermined).)
516         */
517        public VerificationResultPrimarySourceComponent setCanPushUpdates(CodeableConcept value) { 
518          this.canPushUpdates = value;
519          return this;
520        }
521
522        /**
523         * @return {@link #pushTypeAvailable} (Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source).)
524         */
525        public List<CodeableConcept> getPushTypeAvailable() { 
526          if (this.pushTypeAvailable == null)
527            this.pushTypeAvailable = new ArrayList<CodeableConcept>();
528          return this.pushTypeAvailable;
529        }
530
531        /**
532         * @return Returns a reference to <code>this</code> for easy method chaining
533         */
534        public VerificationResultPrimarySourceComponent setPushTypeAvailable(List<CodeableConcept> thePushTypeAvailable) { 
535          this.pushTypeAvailable = thePushTypeAvailable;
536          return this;
537        }
538
539        public boolean hasPushTypeAvailable() { 
540          if (this.pushTypeAvailable == null)
541            return false;
542          for (CodeableConcept item : this.pushTypeAvailable)
543            if (!item.isEmpty())
544              return true;
545          return false;
546        }
547
548        public CodeableConcept addPushTypeAvailable() { //3
549          CodeableConcept t = new CodeableConcept();
550          if (this.pushTypeAvailable == null)
551            this.pushTypeAvailable = new ArrayList<CodeableConcept>();
552          this.pushTypeAvailable.add(t);
553          return t;
554        }
555
556        public VerificationResultPrimarySourceComponent addPushTypeAvailable(CodeableConcept t) { //3
557          if (t == null)
558            return this;
559          if (this.pushTypeAvailable == null)
560            this.pushTypeAvailable = new ArrayList<CodeableConcept>();
561          this.pushTypeAvailable.add(t);
562          return this;
563        }
564
565        /**
566         * @return The first repetition of repeating field {@link #pushTypeAvailable}, creating it if it does not already exist
567         */
568        public CodeableConcept getPushTypeAvailableFirstRep() { 
569          if (getPushTypeAvailable().isEmpty()) {
570            addPushTypeAvailable();
571          }
572          return getPushTypeAvailable().get(0);
573        }
574
575        protected void listChildren(List<Property> children) {
576          super.listChildren(children);
577          children.add(new Property("who", "Reference(Organization|Practitioner|PractitionerRole)", "Reference to the primary source.", 0, 1, who));
578          children.add(new Property("type", "CodeableConcept", "Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source).", 0, java.lang.Integer.MAX_VALUE, type));
579          children.add(new Property("communicationMethod", "CodeableConcept", "Method for communicating with the primary source (manual; API; Push).", 0, java.lang.Integer.MAX_VALUE, communicationMethod));
580          children.add(new Property("validationStatus", "CodeableConcept", "Status of the validation of the target against the primary source (successful; failed; unknown).", 0, 1, validationStatus));
581          children.add(new Property("validationDate", "dateTime", "When the target was validated against the primary source.", 0, 1, validationDate));
582          children.add(new Property("canPushUpdates", "CodeableConcept", "Ability of the primary source to push updates/alerts (yes; no; undetermined).", 0, 1, canPushUpdates));
583          children.add(new Property("pushTypeAvailable", "CodeableConcept", "Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source).", 0, java.lang.Integer.MAX_VALUE, pushTypeAvailable));
584        }
585
586        @Override
587        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
588          switch (_hash) {
589          case 117694: /*who*/  return new Property("who", "Reference(Organization|Practitioner|PractitionerRole)", "Reference to the primary source.", 0, 1, who);
590          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source).", 0, java.lang.Integer.MAX_VALUE, type);
591          case 1314116695: /*communicationMethod*/  return new Property("communicationMethod", "CodeableConcept", "Method for communicating with the primary source (manual; API; Push).", 0, java.lang.Integer.MAX_VALUE, communicationMethod);
592          case 1775633867: /*validationStatus*/  return new Property("validationStatus", "CodeableConcept", "Status of the validation of the target against the primary source (successful; failed; unknown).", 0, 1, validationStatus);
593          case -280180793: /*validationDate*/  return new Property("validationDate", "dateTime", "When the target was validated against the primary source.", 0, 1, validationDate);
594          case 1463787104: /*canPushUpdates*/  return new Property("canPushUpdates", "CodeableConcept", "Ability of the primary source to push updates/alerts (yes; no; undetermined).", 0, 1, canPushUpdates);
595          case 945223605: /*pushTypeAvailable*/  return new Property("pushTypeAvailable", "CodeableConcept", "Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source).", 0, java.lang.Integer.MAX_VALUE, pushTypeAvailable);
596          default: return super.getNamedProperty(_hash, _name, _checkValid);
597          }
598
599        }
600
601      @Override
602      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
603        switch (hash) {
604        case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Reference
605        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
606        case 1314116695: /*communicationMethod*/ return this.communicationMethod == null ? new Base[0] : this.communicationMethod.toArray(new Base[this.communicationMethod.size()]); // CodeableConcept
607        case 1775633867: /*validationStatus*/ return this.validationStatus == null ? new Base[0] : new Base[] {this.validationStatus}; // CodeableConcept
608        case -280180793: /*validationDate*/ return this.validationDate == null ? new Base[0] : new Base[] {this.validationDate}; // DateTimeType
609        case 1463787104: /*canPushUpdates*/ return this.canPushUpdates == null ? new Base[0] : new Base[] {this.canPushUpdates}; // CodeableConcept
610        case 945223605: /*pushTypeAvailable*/ return this.pushTypeAvailable == null ? new Base[0] : this.pushTypeAvailable.toArray(new Base[this.pushTypeAvailable.size()]); // CodeableConcept
611        default: return super.getProperty(hash, name, checkValid);
612        }
613
614      }
615
616      @Override
617      public Base setProperty(int hash, String name, Base value) throws FHIRException {
618        switch (hash) {
619        case 117694: // who
620          this.who = castToReference(value); // Reference
621          return value;
622        case 3575610: // type
623          this.getType().add(castToCodeableConcept(value)); // CodeableConcept
624          return value;
625        case 1314116695: // communicationMethod
626          this.getCommunicationMethod().add(castToCodeableConcept(value)); // CodeableConcept
627          return value;
628        case 1775633867: // validationStatus
629          this.validationStatus = castToCodeableConcept(value); // CodeableConcept
630          return value;
631        case -280180793: // validationDate
632          this.validationDate = castToDateTime(value); // DateTimeType
633          return value;
634        case 1463787104: // canPushUpdates
635          this.canPushUpdates = castToCodeableConcept(value); // CodeableConcept
636          return value;
637        case 945223605: // pushTypeAvailable
638          this.getPushTypeAvailable().add(castToCodeableConcept(value)); // CodeableConcept
639          return value;
640        default: return super.setProperty(hash, name, value);
641        }
642
643      }
644
645      @Override
646      public Base setProperty(String name, Base value) throws FHIRException {
647        if (name.equals("who")) {
648          this.who = castToReference(value); // Reference
649        } else if (name.equals("type")) {
650          this.getType().add(castToCodeableConcept(value));
651        } else if (name.equals("communicationMethod")) {
652          this.getCommunicationMethod().add(castToCodeableConcept(value));
653        } else if (name.equals("validationStatus")) {
654          this.validationStatus = castToCodeableConcept(value); // CodeableConcept
655        } else if (name.equals("validationDate")) {
656          this.validationDate = castToDateTime(value); // DateTimeType
657        } else if (name.equals("canPushUpdates")) {
658          this.canPushUpdates = castToCodeableConcept(value); // CodeableConcept
659        } else if (name.equals("pushTypeAvailable")) {
660          this.getPushTypeAvailable().add(castToCodeableConcept(value));
661        } else
662          return super.setProperty(name, value);
663        return value;
664      }
665
666      @Override
667      public Base makeProperty(int hash, String name) throws FHIRException {
668        switch (hash) {
669        case 117694:  return getWho(); 
670        case 3575610:  return addType(); 
671        case 1314116695:  return addCommunicationMethod(); 
672        case 1775633867:  return getValidationStatus(); 
673        case -280180793:  return getValidationDateElement();
674        case 1463787104:  return getCanPushUpdates(); 
675        case 945223605:  return addPushTypeAvailable(); 
676        default: return super.makeProperty(hash, name);
677        }
678
679      }
680
681      @Override
682      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
683        switch (hash) {
684        case 117694: /*who*/ return new String[] {"Reference"};
685        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
686        case 1314116695: /*communicationMethod*/ return new String[] {"CodeableConcept"};
687        case 1775633867: /*validationStatus*/ return new String[] {"CodeableConcept"};
688        case -280180793: /*validationDate*/ return new String[] {"dateTime"};
689        case 1463787104: /*canPushUpdates*/ return new String[] {"CodeableConcept"};
690        case 945223605: /*pushTypeAvailable*/ return new String[] {"CodeableConcept"};
691        default: return super.getTypesForProperty(hash, name);
692        }
693
694      }
695
696      @Override
697      public Base addChild(String name) throws FHIRException {
698        if (name.equals("who")) {
699          this.who = new Reference();
700          return this.who;
701        }
702        else if (name.equals("type")) {
703          return addType();
704        }
705        else if (name.equals("communicationMethod")) {
706          return addCommunicationMethod();
707        }
708        else if (name.equals("validationStatus")) {
709          this.validationStatus = new CodeableConcept();
710          return this.validationStatus;
711        }
712        else if (name.equals("validationDate")) {
713          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.validationDate");
714        }
715        else if (name.equals("canPushUpdates")) {
716          this.canPushUpdates = new CodeableConcept();
717          return this.canPushUpdates;
718        }
719        else if (name.equals("pushTypeAvailable")) {
720          return addPushTypeAvailable();
721        }
722        else
723          return super.addChild(name);
724      }
725
726      public VerificationResultPrimarySourceComponent copy() {
727        VerificationResultPrimarySourceComponent dst = new VerificationResultPrimarySourceComponent();
728        copyValues(dst);
729        return dst;
730      }
731
732      public void copyValues(VerificationResultPrimarySourceComponent dst) {
733        super.copyValues(dst);
734        dst.who = who == null ? null : who.copy();
735        if (type != null) {
736          dst.type = new ArrayList<CodeableConcept>();
737          for (CodeableConcept i : type)
738            dst.type.add(i.copy());
739        };
740        if (communicationMethod != null) {
741          dst.communicationMethod = new ArrayList<CodeableConcept>();
742          for (CodeableConcept i : communicationMethod)
743            dst.communicationMethod.add(i.copy());
744        };
745        dst.validationStatus = validationStatus == null ? null : validationStatus.copy();
746        dst.validationDate = validationDate == null ? null : validationDate.copy();
747        dst.canPushUpdates = canPushUpdates == null ? null : canPushUpdates.copy();
748        if (pushTypeAvailable != null) {
749          dst.pushTypeAvailable = new ArrayList<CodeableConcept>();
750          for (CodeableConcept i : pushTypeAvailable)
751            dst.pushTypeAvailable.add(i.copy());
752        };
753      }
754
755      @Override
756      public boolean equalsDeep(Base other_) {
757        if (!super.equalsDeep(other_))
758          return false;
759        if (!(other_ instanceof VerificationResultPrimarySourceComponent))
760          return false;
761        VerificationResultPrimarySourceComponent o = (VerificationResultPrimarySourceComponent) other_;
762        return compareDeep(who, o.who, true) && compareDeep(type, o.type, true) && compareDeep(communicationMethod, o.communicationMethod, true)
763           && compareDeep(validationStatus, o.validationStatus, true) && compareDeep(validationDate, o.validationDate, true)
764           && compareDeep(canPushUpdates, o.canPushUpdates, true) && compareDeep(pushTypeAvailable, o.pushTypeAvailable, true)
765          ;
766      }
767
768      @Override
769      public boolean equalsShallow(Base other_) {
770        if (!super.equalsShallow(other_))
771          return false;
772        if (!(other_ instanceof VerificationResultPrimarySourceComponent))
773          return false;
774        VerificationResultPrimarySourceComponent o = (VerificationResultPrimarySourceComponent) other_;
775        return compareValues(validationDate, o.validationDate, true);
776      }
777
778      public boolean isEmpty() {
779        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(who, type, communicationMethod
780          , validationStatus, validationDate, canPushUpdates, pushTypeAvailable);
781      }
782
783  public String fhirType() {
784    return "VerificationResult.primarySource";
785
786  }
787
788  }
789
790    @Block()
791    public static class VerificationResultAttestationComponent extends BackboneElement implements IBaseBackboneElement {
792        /**
793         * The individual or organization attesting to information.
794         */
795        @Child(name = "who", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=1, min=0, max=1, modifier=false, summary=true)
796        @Description(shortDefinition="The individual or organization attesting to information", formalDefinition="The individual or organization attesting to information." )
797        protected Reference who;
798
799        /**
800         * The actual object that is the target of the reference (The individual or organization attesting to information.)
801         */
802        protected Resource whoTarget;
803
804        /**
805         * When the who is asserting on behalf of another (organization or individual).
806         */
807        @Child(name = "onBehalfOf", type = {Organization.class, Practitioner.class, PractitionerRole.class}, order=2, min=0, max=1, modifier=false, summary=true)
808        @Description(shortDefinition="When the who is asserting on behalf of another (organization or individual)", formalDefinition="When the who is asserting on behalf of another (organization or individual)." )
809        protected Reference onBehalfOf;
810
811        /**
812         * The actual object that is the target of the reference (When the who is asserting on behalf of another (organization or individual).)
813         */
814        protected Resource onBehalfOfTarget;
815
816        /**
817         * The method by which attested information was submitted/retrieved (manual; API; Push).
818         */
819        @Child(name = "communicationMethod", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
820        @Description(shortDefinition="The method by which attested information was submitted/retrieved", formalDefinition="The method by which attested information was submitted/retrieved (manual; API; Push)." )
821        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-communication-method")
822        protected CodeableConcept communicationMethod;
823
824        /**
825         * The date the information was attested to.
826         */
827        @Child(name = "date", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true)
828        @Description(shortDefinition="The date the information was attested to", formalDefinition="The date the information was attested to." )
829        protected DateType date;
830
831        /**
832         * A digital identity certificate associated with the attestation source.
833         */
834        @Child(name = "sourceIdentityCertificate", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
835        @Description(shortDefinition="A digital identity certificate associated with the attestation source", formalDefinition="A digital identity certificate associated with the attestation source." )
836        protected StringType sourceIdentityCertificate;
837
838        /**
839         * A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.
840         */
841        @Child(name = "proxyIdentityCertificate", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
842        @Description(shortDefinition="A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source", formalDefinition="A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source." )
843        protected StringType proxyIdentityCertificate;
844
845        /**
846         * Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.
847         */
848        @Child(name = "proxySignature", type = {Signature.class}, order=7, min=0, max=1, modifier=false, summary=false)
849        @Description(shortDefinition="Proxy signature", formalDefinition="Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source." )
850        protected Signature proxySignature;
851
852        /**
853         * Signed assertion by the attestation source that they have attested to the information.
854         */
855        @Child(name = "sourceSignature", type = {Signature.class}, order=8, min=0, max=1, modifier=false, summary=false)
856        @Description(shortDefinition="Attester signature", formalDefinition="Signed assertion by the attestation source that they have attested to the information." )
857        protected Signature sourceSignature;
858
859        private static final long serialVersionUID = -900018800L;
860
861    /**
862     * Constructor
863     */
864      public VerificationResultAttestationComponent() {
865        super();
866      }
867
868        /**
869         * @return {@link #who} (The individual or organization attesting to information.)
870         */
871        public Reference getWho() { 
872          if (this.who == null)
873            if (Configuration.errorOnAutoCreate())
874              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.who");
875            else if (Configuration.doAutoCreate())
876              this.who = new Reference(); // cc
877          return this.who;
878        }
879
880        public boolean hasWho() { 
881          return this.who != null && !this.who.isEmpty();
882        }
883
884        /**
885         * @param value {@link #who} (The individual or organization attesting to information.)
886         */
887        public VerificationResultAttestationComponent setWho(Reference value) { 
888          this.who = value;
889          return this;
890        }
891
892        /**
893         * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual or organization attesting to information.)
894         */
895        public Resource getWhoTarget() { 
896          return this.whoTarget;
897        }
898
899        /**
900         * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual or organization attesting to information.)
901         */
902        public VerificationResultAttestationComponent setWhoTarget(Resource value) { 
903          this.whoTarget = value;
904          return this;
905        }
906
907        /**
908         * @return {@link #onBehalfOf} (When the who is asserting on behalf of another (organization or individual).)
909         */
910        public Reference getOnBehalfOf() { 
911          if (this.onBehalfOf == null)
912            if (Configuration.errorOnAutoCreate())
913              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.onBehalfOf");
914            else if (Configuration.doAutoCreate())
915              this.onBehalfOf = new Reference(); // cc
916          return this.onBehalfOf;
917        }
918
919        public boolean hasOnBehalfOf() { 
920          return this.onBehalfOf != null && !this.onBehalfOf.isEmpty();
921        }
922
923        /**
924         * @param value {@link #onBehalfOf} (When the who is asserting on behalf of another (organization or individual).)
925         */
926        public VerificationResultAttestationComponent setOnBehalfOf(Reference value) { 
927          this.onBehalfOf = value;
928          return this;
929        }
930
931        /**
932         * @return {@link #onBehalfOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (When the who is asserting on behalf of another (organization or individual).)
933         */
934        public Resource getOnBehalfOfTarget() { 
935          return this.onBehalfOfTarget;
936        }
937
938        /**
939         * @param value {@link #onBehalfOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (When the who is asserting on behalf of another (organization or individual).)
940         */
941        public VerificationResultAttestationComponent setOnBehalfOfTarget(Resource value) { 
942          this.onBehalfOfTarget = value;
943          return this;
944        }
945
946        /**
947         * @return {@link #communicationMethod} (The method by which attested information was submitted/retrieved (manual; API; Push).)
948         */
949        public CodeableConcept getCommunicationMethod() { 
950          if (this.communicationMethod == null)
951            if (Configuration.errorOnAutoCreate())
952              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.communicationMethod");
953            else if (Configuration.doAutoCreate())
954              this.communicationMethod = new CodeableConcept(); // cc
955          return this.communicationMethod;
956        }
957
958        public boolean hasCommunicationMethod() { 
959          return this.communicationMethod != null && !this.communicationMethod.isEmpty();
960        }
961
962        /**
963         * @param value {@link #communicationMethod} (The method by which attested information was submitted/retrieved (manual; API; Push).)
964         */
965        public VerificationResultAttestationComponent setCommunicationMethod(CodeableConcept value) { 
966          this.communicationMethod = value;
967          return this;
968        }
969
970        /**
971         * @return {@link #date} (The date the information was attested to.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
972         */
973        public DateType getDateElement() { 
974          if (this.date == null)
975            if (Configuration.errorOnAutoCreate())
976              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.date");
977            else if (Configuration.doAutoCreate())
978              this.date = new DateType(); // bb
979          return this.date;
980        }
981
982        public boolean hasDateElement() { 
983          return this.date != null && !this.date.isEmpty();
984        }
985
986        public boolean hasDate() { 
987          return this.date != null && !this.date.isEmpty();
988        }
989
990        /**
991         * @param value {@link #date} (The date the information was attested to.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
992         */
993        public VerificationResultAttestationComponent setDateElement(DateType value) { 
994          this.date = value;
995          return this;
996        }
997
998        /**
999         * @return The date the information was attested to.
1000         */
1001        public Date getDate() { 
1002          return this.date == null ? null : this.date.getValue();
1003        }
1004
1005        /**
1006         * @param value The date the information was attested to.
1007         */
1008        public VerificationResultAttestationComponent setDate(Date value) { 
1009          if (value == null)
1010            this.date = null;
1011          else {
1012            if (this.date == null)
1013              this.date = new DateType();
1014            this.date.setValue(value);
1015          }
1016          return this;
1017        }
1018
1019        /**
1020         * @return {@link #sourceIdentityCertificate} (A digital identity certificate associated with the attestation source.). This is the underlying object with id, value and extensions. The accessor "getSourceIdentityCertificate" gives direct access to the value
1021         */
1022        public StringType getSourceIdentityCertificateElement() { 
1023          if (this.sourceIdentityCertificate == null)
1024            if (Configuration.errorOnAutoCreate())
1025              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.sourceIdentityCertificate");
1026            else if (Configuration.doAutoCreate())
1027              this.sourceIdentityCertificate = new StringType(); // bb
1028          return this.sourceIdentityCertificate;
1029        }
1030
1031        public boolean hasSourceIdentityCertificateElement() { 
1032          return this.sourceIdentityCertificate != null && !this.sourceIdentityCertificate.isEmpty();
1033        }
1034
1035        public boolean hasSourceIdentityCertificate() { 
1036          return this.sourceIdentityCertificate != null && !this.sourceIdentityCertificate.isEmpty();
1037        }
1038
1039        /**
1040         * @param value {@link #sourceIdentityCertificate} (A digital identity certificate associated with the attestation source.). This is the underlying object with id, value and extensions. The accessor "getSourceIdentityCertificate" gives direct access to the value
1041         */
1042        public VerificationResultAttestationComponent setSourceIdentityCertificateElement(StringType value) { 
1043          this.sourceIdentityCertificate = value;
1044          return this;
1045        }
1046
1047        /**
1048         * @return A digital identity certificate associated with the attestation source.
1049         */
1050        public String getSourceIdentityCertificate() { 
1051          return this.sourceIdentityCertificate == null ? null : this.sourceIdentityCertificate.getValue();
1052        }
1053
1054        /**
1055         * @param value A digital identity certificate associated with the attestation source.
1056         */
1057        public VerificationResultAttestationComponent setSourceIdentityCertificate(String value) { 
1058          if (Utilities.noString(value))
1059            this.sourceIdentityCertificate = null;
1060          else {
1061            if (this.sourceIdentityCertificate == null)
1062              this.sourceIdentityCertificate = new StringType();
1063            this.sourceIdentityCertificate.setValue(value);
1064          }
1065          return this;
1066        }
1067
1068        /**
1069         * @return {@link #proxyIdentityCertificate} (A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.). This is the underlying object with id, value and extensions. The accessor "getProxyIdentityCertificate" gives direct access to the value
1070         */
1071        public StringType getProxyIdentityCertificateElement() { 
1072          if (this.proxyIdentityCertificate == null)
1073            if (Configuration.errorOnAutoCreate())
1074              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.proxyIdentityCertificate");
1075            else if (Configuration.doAutoCreate())
1076              this.proxyIdentityCertificate = new StringType(); // bb
1077          return this.proxyIdentityCertificate;
1078        }
1079
1080        public boolean hasProxyIdentityCertificateElement() { 
1081          return this.proxyIdentityCertificate != null && !this.proxyIdentityCertificate.isEmpty();
1082        }
1083
1084        public boolean hasProxyIdentityCertificate() { 
1085          return this.proxyIdentityCertificate != null && !this.proxyIdentityCertificate.isEmpty();
1086        }
1087
1088        /**
1089         * @param value {@link #proxyIdentityCertificate} (A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.). This is the underlying object with id, value and extensions. The accessor "getProxyIdentityCertificate" gives direct access to the value
1090         */
1091        public VerificationResultAttestationComponent setProxyIdentityCertificateElement(StringType value) { 
1092          this.proxyIdentityCertificate = value;
1093          return this;
1094        }
1095
1096        /**
1097         * @return A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.
1098         */
1099        public String getProxyIdentityCertificate() { 
1100          return this.proxyIdentityCertificate == null ? null : this.proxyIdentityCertificate.getValue();
1101        }
1102
1103        /**
1104         * @param value A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.
1105         */
1106        public VerificationResultAttestationComponent setProxyIdentityCertificate(String value) { 
1107          if (Utilities.noString(value))
1108            this.proxyIdentityCertificate = null;
1109          else {
1110            if (this.proxyIdentityCertificate == null)
1111              this.proxyIdentityCertificate = new StringType();
1112            this.proxyIdentityCertificate.setValue(value);
1113          }
1114          return this;
1115        }
1116
1117        /**
1118         * @return {@link #proxySignature} (Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.)
1119         */
1120        public Signature getProxySignature() { 
1121          if (this.proxySignature == null)
1122            if (Configuration.errorOnAutoCreate())
1123              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.proxySignature");
1124            else if (Configuration.doAutoCreate())
1125              this.proxySignature = new Signature(); // cc
1126          return this.proxySignature;
1127        }
1128
1129        public boolean hasProxySignature() { 
1130          return this.proxySignature != null && !this.proxySignature.isEmpty();
1131        }
1132
1133        /**
1134         * @param value {@link #proxySignature} (Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.)
1135         */
1136        public VerificationResultAttestationComponent setProxySignature(Signature value) { 
1137          this.proxySignature = value;
1138          return this;
1139        }
1140
1141        /**
1142         * @return {@link #sourceSignature} (Signed assertion by the attestation source that they have attested to the information.)
1143         */
1144        public Signature getSourceSignature() { 
1145          if (this.sourceSignature == null)
1146            if (Configuration.errorOnAutoCreate())
1147              throw new Error("Attempt to auto-create VerificationResultAttestationComponent.sourceSignature");
1148            else if (Configuration.doAutoCreate())
1149              this.sourceSignature = new Signature(); // cc
1150          return this.sourceSignature;
1151        }
1152
1153        public boolean hasSourceSignature() { 
1154          return this.sourceSignature != null && !this.sourceSignature.isEmpty();
1155        }
1156
1157        /**
1158         * @param value {@link #sourceSignature} (Signed assertion by the attestation source that they have attested to the information.)
1159         */
1160        public VerificationResultAttestationComponent setSourceSignature(Signature value) { 
1161          this.sourceSignature = value;
1162          return this;
1163        }
1164
1165        protected void listChildren(List<Property> children) {
1166          super.listChildren(children);
1167          children.add(new Property("who", "Reference(Practitioner|PractitionerRole|Organization)", "The individual or organization attesting to information.", 0, 1, who));
1168          children.add(new Property("onBehalfOf", "Reference(Organization|Practitioner|PractitionerRole)", "When the who is asserting on behalf of another (organization or individual).", 0, 1, onBehalfOf));
1169          children.add(new Property("communicationMethod", "CodeableConcept", "The method by which attested information was submitted/retrieved (manual; API; Push).", 0, 1, communicationMethod));
1170          children.add(new Property("date", "date", "The date the information was attested to.", 0, 1, date));
1171          children.add(new Property("sourceIdentityCertificate", "string", "A digital identity certificate associated with the attestation source.", 0, 1, sourceIdentityCertificate));
1172          children.add(new Property("proxyIdentityCertificate", "string", "A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.", 0, 1, proxyIdentityCertificate));
1173          children.add(new Property("proxySignature", "Signature", "Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.", 0, 1, proxySignature));
1174          children.add(new Property("sourceSignature", "Signature", "Signed assertion by the attestation source that they have attested to the information.", 0, 1, sourceSignature));
1175        }
1176
1177        @Override
1178        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1179          switch (_hash) {
1180          case 117694: /*who*/  return new Property("who", "Reference(Practitioner|PractitionerRole|Organization)", "The individual or organization attesting to information.", 0, 1, who);
1181          case -14402964: /*onBehalfOf*/  return new Property("onBehalfOf", "Reference(Organization|Practitioner|PractitionerRole)", "When the who is asserting on behalf of another (organization or individual).", 0, 1, onBehalfOf);
1182          case 1314116695: /*communicationMethod*/  return new Property("communicationMethod", "CodeableConcept", "The method by which attested information was submitted/retrieved (manual; API; Push).", 0, 1, communicationMethod);
1183          case 3076014: /*date*/  return new Property("date", "date", "The date the information was attested to.", 0, 1, date);
1184          case -799067682: /*sourceIdentityCertificate*/  return new Property("sourceIdentityCertificate", "string", "A digital identity certificate associated with the attestation source.", 0, 1, sourceIdentityCertificate);
1185          case 431558827: /*proxyIdentityCertificate*/  return new Property("proxyIdentityCertificate", "string", "A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.", 0, 1, proxyIdentityCertificate);
1186          case 1455540714: /*proxySignature*/  return new Property("proxySignature", "Signature", "Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.", 0, 1, proxySignature);
1187          case 1754480349: /*sourceSignature*/  return new Property("sourceSignature", "Signature", "Signed assertion by the attestation source that they have attested to the information.", 0, 1, sourceSignature);
1188          default: return super.getNamedProperty(_hash, _name, _checkValid);
1189          }
1190
1191        }
1192
1193      @Override
1194      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1195        switch (hash) {
1196        case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Reference
1197        case -14402964: /*onBehalfOf*/ return this.onBehalfOf == null ? new Base[0] : new Base[] {this.onBehalfOf}; // Reference
1198        case 1314116695: /*communicationMethod*/ return this.communicationMethod == null ? new Base[0] : new Base[] {this.communicationMethod}; // CodeableConcept
1199        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
1200        case -799067682: /*sourceIdentityCertificate*/ return this.sourceIdentityCertificate == null ? new Base[0] : new Base[] {this.sourceIdentityCertificate}; // StringType
1201        case 431558827: /*proxyIdentityCertificate*/ return this.proxyIdentityCertificate == null ? new Base[0] : new Base[] {this.proxyIdentityCertificate}; // StringType
1202        case 1455540714: /*proxySignature*/ return this.proxySignature == null ? new Base[0] : new Base[] {this.proxySignature}; // Signature
1203        case 1754480349: /*sourceSignature*/ return this.sourceSignature == null ? new Base[0] : new Base[] {this.sourceSignature}; // Signature
1204        default: return super.getProperty(hash, name, checkValid);
1205        }
1206
1207      }
1208
1209      @Override
1210      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1211        switch (hash) {
1212        case 117694: // who
1213          this.who = castToReference(value); // Reference
1214          return value;
1215        case -14402964: // onBehalfOf
1216          this.onBehalfOf = castToReference(value); // Reference
1217          return value;
1218        case 1314116695: // communicationMethod
1219          this.communicationMethod = castToCodeableConcept(value); // CodeableConcept
1220          return value;
1221        case 3076014: // date
1222          this.date = castToDate(value); // DateType
1223          return value;
1224        case -799067682: // sourceIdentityCertificate
1225          this.sourceIdentityCertificate = castToString(value); // StringType
1226          return value;
1227        case 431558827: // proxyIdentityCertificate
1228          this.proxyIdentityCertificate = castToString(value); // StringType
1229          return value;
1230        case 1455540714: // proxySignature
1231          this.proxySignature = castToSignature(value); // Signature
1232          return value;
1233        case 1754480349: // sourceSignature
1234          this.sourceSignature = castToSignature(value); // Signature
1235          return value;
1236        default: return super.setProperty(hash, name, value);
1237        }
1238
1239      }
1240
1241      @Override
1242      public Base setProperty(String name, Base value) throws FHIRException {
1243        if (name.equals("who")) {
1244          this.who = castToReference(value); // Reference
1245        } else if (name.equals("onBehalfOf")) {
1246          this.onBehalfOf = castToReference(value); // Reference
1247        } else if (name.equals("communicationMethod")) {
1248          this.communicationMethod = castToCodeableConcept(value); // CodeableConcept
1249        } else if (name.equals("date")) {
1250          this.date = castToDate(value); // DateType
1251        } else if (name.equals("sourceIdentityCertificate")) {
1252          this.sourceIdentityCertificate = castToString(value); // StringType
1253        } else if (name.equals("proxyIdentityCertificate")) {
1254          this.proxyIdentityCertificate = castToString(value); // StringType
1255        } else if (name.equals("proxySignature")) {
1256          this.proxySignature = castToSignature(value); // Signature
1257        } else if (name.equals("sourceSignature")) {
1258          this.sourceSignature = castToSignature(value); // Signature
1259        } else
1260          return super.setProperty(name, value);
1261        return value;
1262      }
1263
1264      @Override
1265      public Base makeProperty(int hash, String name) throws FHIRException {
1266        switch (hash) {
1267        case 117694:  return getWho(); 
1268        case -14402964:  return getOnBehalfOf(); 
1269        case 1314116695:  return getCommunicationMethod(); 
1270        case 3076014:  return getDateElement();
1271        case -799067682:  return getSourceIdentityCertificateElement();
1272        case 431558827:  return getProxyIdentityCertificateElement();
1273        case 1455540714:  return getProxySignature(); 
1274        case 1754480349:  return getSourceSignature(); 
1275        default: return super.makeProperty(hash, name);
1276        }
1277
1278      }
1279
1280      @Override
1281      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1282        switch (hash) {
1283        case 117694: /*who*/ return new String[] {"Reference"};
1284        case -14402964: /*onBehalfOf*/ return new String[] {"Reference"};
1285        case 1314116695: /*communicationMethod*/ return new String[] {"CodeableConcept"};
1286        case 3076014: /*date*/ return new String[] {"date"};
1287        case -799067682: /*sourceIdentityCertificate*/ return new String[] {"string"};
1288        case 431558827: /*proxyIdentityCertificate*/ return new String[] {"string"};
1289        case 1455540714: /*proxySignature*/ return new String[] {"Signature"};
1290        case 1754480349: /*sourceSignature*/ return new String[] {"Signature"};
1291        default: return super.getTypesForProperty(hash, name);
1292        }
1293
1294      }
1295
1296      @Override
1297      public Base addChild(String name) throws FHIRException {
1298        if (name.equals("who")) {
1299          this.who = new Reference();
1300          return this.who;
1301        }
1302        else if (name.equals("onBehalfOf")) {
1303          this.onBehalfOf = new Reference();
1304          return this.onBehalfOf;
1305        }
1306        else if (name.equals("communicationMethod")) {
1307          this.communicationMethod = new CodeableConcept();
1308          return this.communicationMethod;
1309        }
1310        else if (name.equals("date")) {
1311          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.date");
1312        }
1313        else if (name.equals("sourceIdentityCertificate")) {
1314          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.sourceIdentityCertificate");
1315        }
1316        else if (name.equals("proxyIdentityCertificate")) {
1317          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.proxyIdentityCertificate");
1318        }
1319        else if (name.equals("proxySignature")) {
1320          this.proxySignature = new Signature();
1321          return this.proxySignature;
1322        }
1323        else if (name.equals("sourceSignature")) {
1324          this.sourceSignature = new Signature();
1325          return this.sourceSignature;
1326        }
1327        else
1328          return super.addChild(name);
1329      }
1330
1331      public VerificationResultAttestationComponent copy() {
1332        VerificationResultAttestationComponent dst = new VerificationResultAttestationComponent();
1333        copyValues(dst);
1334        return dst;
1335      }
1336
1337      public void copyValues(VerificationResultAttestationComponent dst) {
1338        super.copyValues(dst);
1339        dst.who = who == null ? null : who.copy();
1340        dst.onBehalfOf = onBehalfOf == null ? null : onBehalfOf.copy();
1341        dst.communicationMethod = communicationMethod == null ? null : communicationMethod.copy();
1342        dst.date = date == null ? null : date.copy();
1343        dst.sourceIdentityCertificate = sourceIdentityCertificate == null ? null : sourceIdentityCertificate.copy();
1344        dst.proxyIdentityCertificate = proxyIdentityCertificate == null ? null : proxyIdentityCertificate.copy();
1345        dst.proxySignature = proxySignature == null ? null : proxySignature.copy();
1346        dst.sourceSignature = sourceSignature == null ? null : sourceSignature.copy();
1347      }
1348
1349      @Override
1350      public boolean equalsDeep(Base other_) {
1351        if (!super.equalsDeep(other_))
1352          return false;
1353        if (!(other_ instanceof VerificationResultAttestationComponent))
1354          return false;
1355        VerificationResultAttestationComponent o = (VerificationResultAttestationComponent) other_;
1356        return compareDeep(who, o.who, true) && compareDeep(onBehalfOf, o.onBehalfOf, true) && compareDeep(communicationMethod, o.communicationMethod, true)
1357           && compareDeep(date, o.date, true) && compareDeep(sourceIdentityCertificate, o.sourceIdentityCertificate, true)
1358           && compareDeep(proxyIdentityCertificate, o.proxyIdentityCertificate, true) && compareDeep(proxySignature, o.proxySignature, true)
1359           && compareDeep(sourceSignature, o.sourceSignature, true);
1360      }
1361
1362      @Override
1363      public boolean equalsShallow(Base other_) {
1364        if (!super.equalsShallow(other_))
1365          return false;
1366        if (!(other_ instanceof VerificationResultAttestationComponent))
1367          return false;
1368        VerificationResultAttestationComponent o = (VerificationResultAttestationComponent) other_;
1369        return compareValues(date, o.date, true) && compareValues(sourceIdentityCertificate, o.sourceIdentityCertificate, true)
1370           && compareValues(proxyIdentityCertificate, o.proxyIdentityCertificate, true);
1371      }
1372
1373      public boolean isEmpty() {
1374        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(who, onBehalfOf, communicationMethod
1375          , date, sourceIdentityCertificate, proxyIdentityCertificate, proxySignature, sourceSignature
1376          );
1377      }
1378
1379  public String fhirType() {
1380    return "VerificationResult.attestation";
1381
1382  }
1383
1384  }
1385
1386    @Block()
1387    public static class VerificationResultValidatorComponent extends BackboneElement implements IBaseBackboneElement {
1388        /**
1389         * Reference to the organization validating information.
1390         */
1391        @Child(name = "organization", type = {Organization.class}, order=1, min=1, max=1, modifier=false, summary=false)
1392        @Description(shortDefinition="Reference to the organization validating information", formalDefinition="Reference to the organization validating information." )
1393        protected Reference organization;
1394
1395        /**
1396         * The actual object that is the target of the reference (Reference to the organization validating information.)
1397         */
1398        protected Organization organizationTarget;
1399
1400        /**
1401         * A digital identity certificate associated with the validator.
1402         */
1403        @Child(name = "identityCertificate", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1404        @Description(shortDefinition="A digital identity certificate associated with the validator", formalDefinition="A digital identity certificate associated with the validator." )
1405        protected StringType identityCertificate;
1406
1407        /**
1408         * Signed assertion by the validator that they have validated the information.
1409         */
1410        @Child(name = "attestationSignature", type = {Signature.class}, order=3, min=0, max=1, modifier=false, summary=false)
1411        @Description(shortDefinition="Validator signature", formalDefinition="Signed assertion by the validator that they have validated the information." )
1412        protected Signature attestationSignature;
1413
1414        private static final long serialVersionUID = 35580619L;
1415
1416    /**
1417     * Constructor
1418     */
1419      public VerificationResultValidatorComponent() {
1420        super();
1421      }
1422
1423    /**
1424     * Constructor
1425     */
1426      public VerificationResultValidatorComponent(Reference organization) {
1427        super();
1428        this.organization = organization;
1429      }
1430
1431        /**
1432         * @return {@link #organization} (Reference to the organization validating information.)
1433         */
1434        public Reference getOrganization() { 
1435          if (this.organization == null)
1436            if (Configuration.errorOnAutoCreate())
1437              throw new Error("Attempt to auto-create VerificationResultValidatorComponent.organization");
1438            else if (Configuration.doAutoCreate())
1439              this.organization = new Reference(); // cc
1440          return this.organization;
1441        }
1442
1443        public boolean hasOrganization() { 
1444          return this.organization != null && !this.organization.isEmpty();
1445        }
1446
1447        /**
1448         * @param value {@link #organization} (Reference to the organization validating information.)
1449         */
1450        public VerificationResultValidatorComponent setOrganization(Reference value) { 
1451          this.organization = value;
1452          return this;
1453        }
1454
1455        /**
1456         * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the organization validating information.)
1457         */
1458        public Organization getOrganizationTarget() { 
1459          if (this.organizationTarget == null)
1460            if (Configuration.errorOnAutoCreate())
1461              throw new Error("Attempt to auto-create VerificationResultValidatorComponent.organization");
1462            else if (Configuration.doAutoCreate())
1463              this.organizationTarget = new Organization(); // aa
1464          return this.organizationTarget;
1465        }
1466
1467        /**
1468         * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the organization validating information.)
1469         */
1470        public VerificationResultValidatorComponent setOrganizationTarget(Organization value) { 
1471          this.organizationTarget = value;
1472          return this;
1473        }
1474
1475        /**
1476         * @return {@link #identityCertificate} (A digital identity certificate associated with the validator.). This is the underlying object with id, value and extensions. The accessor "getIdentityCertificate" gives direct access to the value
1477         */
1478        public StringType getIdentityCertificateElement() { 
1479          if (this.identityCertificate == null)
1480            if (Configuration.errorOnAutoCreate())
1481              throw new Error("Attempt to auto-create VerificationResultValidatorComponent.identityCertificate");
1482            else if (Configuration.doAutoCreate())
1483              this.identityCertificate = new StringType(); // bb
1484          return this.identityCertificate;
1485        }
1486
1487        public boolean hasIdentityCertificateElement() { 
1488          return this.identityCertificate != null && !this.identityCertificate.isEmpty();
1489        }
1490
1491        public boolean hasIdentityCertificate() { 
1492          return this.identityCertificate != null && !this.identityCertificate.isEmpty();
1493        }
1494
1495        /**
1496         * @param value {@link #identityCertificate} (A digital identity certificate associated with the validator.). This is the underlying object with id, value and extensions. The accessor "getIdentityCertificate" gives direct access to the value
1497         */
1498        public VerificationResultValidatorComponent setIdentityCertificateElement(StringType value) { 
1499          this.identityCertificate = value;
1500          return this;
1501        }
1502
1503        /**
1504         * @return A digital identity certificate associated with the validator.
1505         */
1506        public String getIdentityCertificate() { 
1507          return this.identityCertificate == null ? null : this.identityCertificate.getValue();
1508        }
1509
1510        /**
1511         * @param value A digital identity certificate associated with the validator.
1512         */
1513        public VerificationResultValidatorComponent setIdentityCertificate(String value) { 
1514          if (Utilities.noString(value))
1515            this.identityCertificate = null;
1516          else {
1517            if (this.identityCertificate == null)
1518              this.identityCertificate = new StringType();
1519            this.identityCertificate.setValue(value);
1520          }
1521          return this;
1522        }
1523
1524        /**
1525         * @return {@link #attestationSignature} (Signed assertion by the validator that they have validated the information.)
1526         */
1527        public Signature getAttestationSignature() { 
1528          if (this.attestationSignature == null)
1529            if (Configuration.errorOnAutoCreate())
1530              throw new Error("Attempt to auto-create VerificationResultValidatorComponent.attestationSignature");
1531            else if (Configuration.doAutoCreate())
1532              this.attestationSignature = new Signature(); // cc
1533          return this.attestationSignature;
1534        }
1535
1536        public boolean hasAttestationSignature() { 
1537          return this.attestationSignature != null && !this.attestationSignature.isEmpty();
1538        }
1539
1540        /**
1541         * @param value {@link #attestationSignature} (Signed assertion by the validator that they have validated the information.)
1542         */
1543        public VerificationResultValidatorComponent setAttestationSignature(Signature value) { 
1544          this.attestationSignature = value;
1545          return this;
1546        }
1547
1548        protected void listChildren(List<Property> children) {
1549          super.listChildren(children);
1550          children.add(new Property("organization", "Reference(Organization)", "Reference to the organization validating information.", 0, 1, organization));
1551          children.add(new Property("identityCertificate", "string", "A digital identity certificate associated with the validator.", 0, 1, identityCertificate));
1552          children.add(new Property("attestationSignature", "Signature", "Signed assertion by the validator that they have validated the information.", 0, 1, attestationSignature));
1553        }
1554
1555        @Override
1556        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1557          switch (_hash) {
1558          case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "Reference to the organization validating information.", 0, 1, organization);
1559          case -854379015: /*identityCertificate*/  return new Property("identityCertificate", "string", "A digital identity certificate associated with the validator.", 0, 1, identityCertificate);
1560          case -184196152: /*attestationSignature*/  return new Property("attestationSignature", "Signature", "Signed assertion by the validator that they have validated the information.", 0, 1, attestationSignature);
1561          default: return super.getNamedProperty(_hash, _name, _checkValid);
1562          }
1563
1564        }
1565
1566      @Override
1567      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1568        switch (hash) {
1569        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
1570        case -854379015: /*identityCertificate*/ return this.identityCertificate == null ? new Base[0] : new Base[] {this.identityCertificate}; // StringType
1571        case -184196152: /*attestationSignature*/ return this.attestationSignature == null ? new Base[0] : new Base[] {this.attestationSignature}; // Signature
1572        default: return super.getProperty(hash, name, checkValid);
1573        }
1574
1575      }
1576
1577      @Override
1578      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1579        switch (hash) {
1580        case 1178922291: // organization
1581          this.organization = castToReference(value); // Reference
1582          return value;
1583        case -854379015: // identityCertificate
1584          this.identityCertificate = castToString(value); // StringType
1585          return value;
1586        case -184196152: // attestationSignature
1587          this.attestationSignature = castToSignature(value); // Signature
1588          return value;
1589        default: return super.setProperty(hash, name, value);
1590        }
1591
1592      }
1593
1594      @Override
1595      public Base setProperty(String name, Base value) throws FHIRException {
1596        if (name.equals("organization")) {
1597          this.organization = castToReference(value); // Reference
1598        } else if (name.equals("identityCertificate")) {
1599          this.identityCertificate = castToString(value); // StringType
1600        } else if (name.equals("attestationSignature")) {
1601          this.attestationSignature = castToSignature(value); // Signature
1602        } else
1603          return super.setProperty(name, value);
1604        return value;
1605      }
1606
1607      @Override
1608      public Base makeProperty(int hash, String name) throws FHIRException {
1609        switch (hash) {
1610        case 1178922291:  return getOrganization(); 
1611        case -854379015:  return getIdentityCertificateElement();
1612        case -184196152:  return getAttestationSignature(); 
1613        default: return super.makeProperty(hash, name);
1614        }
1615
1616      }
1617
1618      @Override
1619      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1620        switch (hash) {
1621        case 1178922291: /*organization*/ return new String[] {"Reference"};
1622        case -854379015: /*identityCertificate*/ return new String[] {"string"};
1623        case -184196152: /*attestationSignature*/ return new String[] {"Signature"};
1624        default: return super.getTypesForProperty(hash, name);
1625        }
1626
1627      }
1628
1629      @Override
1630      public Base addChild(String name) throws FHIRException {
1631        if (name.equals("organization")) {
1632          this.organization = new Reference();
1633          return this.organization;
1634        }
1635        else if (name.equals("identityCertificate")) {
1636          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.identityCertificate");
1637        }
1638        else if (name.equals("attestationSignature")) {
1639          this.attestationSignature = new Signature();
1640          return this.attestationSignature;
1641        }
1642        else
1643          return super.addChild(name);
1644      }
1645
1646      public VerificationResultValidatorComponent copy() {
1647        VerificationResultValidatorComponent dst = new VerificationResultValidatorComponent();
1648        copyValues(dst);
1649        return dst;
1650      }
1651
1652      public void copyValues(VerificationResultValidatorComponent dst) {
1653        super.copyValues(dst);
1654        dst.organization = organization == null ? null : organization.copy();
1655        dst.identityCertificate = identityCertificate == null ? null : identityCertificate.copy();
1656        dst.attestationSignature = attestationSignature == null ? null : attestationSignature.copy();
1657      }
1658
1659      @Override
1660      public boolean equalsDeep(Base other_) {
1661        if (!super.equalsDeep(other_))
1662          return false;
1663        if (!(other_ instanceof VerificationResultValidatorComponent))
1664          return false;
1665        VerificationResultValidatorComponent o = (VerificationResultValidatorComponent) other_;
1666        return compareDeep(organization, o.organization, true) && compareDeep(identityCertificate, o.identityCertificate, true)
1667           && compareDeep(attestationSignature, o.attestationSignature, true);
1668      }
1669
1670      @Override
1671      public boolean equalsShallow(Base other_) {
1672        if (!super.equalsShallow(other_))
1673          return false;
1674        if (!(other_ instanceof VerificationResultValidatorComponent))
1675          return false;
1676        VerificationResultValidatorComponent o = (VerificationResultValidatorComponent) other_;
1677        return compareValues(identityCertificate, o.identityCertificate, true);
1678      }
1679
1680      public boolean isEmpty() {
1681        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(organization, identityCertificate
1682          , attestationSignature);
1683      }
1684
1685  public String fhirType() {
1686    return "VerificationResult.validator";
1687
1688  }
1689
1690  }
1691
1692    /**
1693     * A resource that was validated.
1694     */
1695    @Child(name = "target", type = {Reference.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1696    @Description(shortDefinition="A resource that was validated", formalDefinition="A resource that was validated." )
1697    protected List<Reference> target;
1698    /**
1699     * The actual objects that are the target of the reference (A resource that was validated.)
1700     */
1701    protected List<Resource> targetTarget;
1702
1703
1704    /**
1705     * The fhirpath location(s) within the resource that was validated.
1706     */
1707    @Child(name = "targetLocation", type = {StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1708    @Description(shortDefinition="The fhirpath location(s) within the resource that was validated", formalDefinition="The fhirpath location(s) within the resource that was validated." )
1709    protected List<StringType> targetLocation;
1710
1711    /**
1712     * The frequency with which the target must be validated (none; initial; periodic).
1713     */
1714    @Child(name = "need", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1715    @Description(shortDefinition="none | initial | periodic", formalDefinition="The frequency with which the target must be validated (none; initial; periodic)." )
1716    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-need")
1717    protected CodeableConcept need;
1718
1719    /**
1720     * The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).
1721     */
1722    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1723    @Description(shortDefinition="attested | validated | in-process | req-revalid | val-fail | reval-fail", formalDefinition="The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed)." )
1724    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-status")
1725    protected Enumeration<Status> status;
1726
1727    /**
1728     * When the validation status was updated.
1729     */
1730    @Child(name = "statusDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1731    @Description(shortDefinition="When the validation status was updated", formalDefinition="When the validation status was updated." )
1732    protected DateTimeType statusDate;
1733
1734    /**
1735     * What the target is validated against (nothing; primary source; multiple sources).
1736     */
1737    @Child(name = "validationType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
1738    @Description(shortDefinition="nothing | primary | multiple", formalDefinition="What the target is validated against (nothing; primary source; multiple sources)." )
1739    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-validation-type")
1740    protected CodeableConcept validationType;
1741
1742    /**
1743     * The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context).
1744     */
1745    @Child(name = "validationProcess", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1746    @Description(shortDefinition="The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context)", formalDefinition="The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context)." )
1747    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-validation-process")
1748    protected List<CodeableConcept> validationProcess;
1749
1750    /**
1751     * Frequency of revalidation.
1752     */
1753    @Child(name = "frequency", type = {Timing.class}, order=7, min=0, max=1, modifier=false, summary=false)
1754    @Description(shortDefinition="Frequency of revalidation", formalDefinition="Frequency of revalidation." )
1755    protected Timing frequency;
1756
1757    /**
1758     * The date/time validation was last completed (including failed validations).
1759     */
1760    @Child(name = "lastPerformed", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1761    @Description(shortDefinition="The date/time validation was last completed (including failed validations)", formalDefinition="The date/time validation was last completed (including failed validations)." )
1762    protected DateTimeType lastPerformed;
1763
1764    /**
1765     * The date when target is next validated, if appropriate.
1766     */
1767    @Child(name = "nextScheduled", type = {DateType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1768    @Description(shortDefinition="The date when target is next validated, if appropriate", formalDefinition="The date when target is next validated, if appropriate." )
1769    protected DateType nextScheduled;
1770
1771    /**
1772     * The result if validation fails (fatal; warning; record only; none).
1773     */
1774    @Child(name = "failureAction", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
1775    @Description(shortDefinition="fatal | warn | rec-only | none", formalDefinition="The result if validation fails (fatal; warning; record only; none)." )
1776    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/verificationresult-failure-action")
1777    protected CodeableConcept failureAction;
1778
1779    /**
1780     * Information about the primary source(s) involved in validation.
1781     */
1782    @Child(name = "primarySource", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1783    @Description(shortDefinition="Information about the primary source(s) involved in validation", formalDefinition="Information about the primary source(s) involved in validation." )
1784    protected List<VerificationResultPrimarySourceComponent> primarySource;
1785
1786    /**
1787     * Information about the entity attesting to information.
1788     */
1789    @Child(name = "attestation", type = {}, order=12, min=0, max=1, modifier=false, summary=false)
1790    @Description(shortDefinition="Information about the entity attesting to information", formalDefinition="Information about the entity attesting to information." )
1791    protected VerificationResultAttestationComponent attestation;
1792
1793    /**
1794     * Information about the entity validating information.
1795     */
1796    @Child(name = "validator", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1797    @Description(shortDefinition="Information about the entity validating information", formalDefinition="Information about the entity validating information." )
1798    protected List<VerificationResultValidatorComponent> validator;
1799
1800    private static final long serialVersionUID = -284059204L;
1801
1802  /**
1803   * Constructor
1804   */
1805    public VerificationResult() {
1806      super();
1807    }
1808
1809  /**
1810   * Constructor
1811   */
1812    public VerificationResult(Enumeration<Status> status) {
1813      super();
1814      this.status = status;
1815    }
1816
1817    /**
1818     * @return {@link #target} (A resource that was validated.)
1819     */
1820    public List<Reference> getTarget() { 
1821      if (this.target == null)
1822        this.target = new ArrayList<Reference>();
1823      return this.target;
1824    }
1825
1826    /**
1827     * @return Returns a reference to <code>this</code> for easy method chaining
1828     */
1829    public VerificationResult setTarget(List<Reference> theTarget) { 
1830      this.target = theTarget;
1831      return this;
1832    }
1833
1834    public boolean hasTarget() { 
1835      if (this.target == null)
1836        return false;
1837      for (Reference item : this.target)
1838        if (!item.isEmpty())
1839          return true;
1840      return false;
1841    }
1842
1843    public Reference addTarget() { //3
1844      Reference t = new Reference();
1845      if (this.target == null)
1846        this.target = new ArrayList<Reference>();
1847      this.target.add(t);
1848      return t;
1849    }
1850
1851    public VerificationResult addTarget(Reference t) { //3
1852      if (t == null)
1853        return this;
1854      if (this.target == null)
1855        this.target = new ArrayList<Reference>();
1856      this.target.add(t);
1857      return this;
1858    }
1859
1860    /**
1861     * @return The first repetition of repeating field {@link #target}, creating it if it does not already exist
1862     */
1863    public Reference getTargetFirstRep() { 
1864      if (getTarget().isEmpty()) {
1865        addTarget();
1866      }
1867      return getTarget().get(0);
1868    }
1869
1870    /**
1871     * @deprecated Use Reference#setResource(IBaseResource) instead
1872     */
1873    @Deprecated
1874    public List<Resource> getTargetTarget() { 
1875      if (this.targetTarget == null)
1876        this.targetTarget = new ArrayList<Resource>();
1877      return this.targetTarget;
1878    }
1879
1880    /**
1881     * @return {@link #targetLocation} (The fhirpath location(s) within the resource that was validated.)
1882     */
1883    public List<StringType> getTargetLocation() { 
1884      if (this.targetLocation == null)
1885        this.targetLocation = new ArrayList<StringType>();
1886      return this.targetLocation;
1887    }
1888
1889    /**
1890     * @return Returns a reference to <code>this</code> for easy method chaining
1891     */
1892    public VerificationResult setTargetLocation(List<StringType> theTargetLocation) { 
1893      this.targetLocation = theTargetLocation;
1894      return this;
1895    }
1896
1897    public boolean hasTargetLocation() { 
1898      if (this.targetLocation == null)
1899        return false;
1900      for (StringType item : this.targetLocation)
1901        if (!item.isEmpty())
1902          return true;
1903      return false;
1904    }
1905
1906    /**
1907     * @return {@link #targetLocation} (The fhirpath location(s) within the resource that was validated.)
1908     */
1909    public StringType addTargetLocationElement() {//2 
1910      StringType t = new StringType();
1911      if (this.targetLocation == null)
1912        this.targetLocation = new ArrayList<StringType>();
1913      this.targetLocation.add(t);
1914      return t;
1915    }
1916
1917    /**
1918     * @param value {@link #targetLocation} (The fhirpath location(s) within the resource that was validated.)
1919     */
1920    public VerificationResult addTargetLocation(String value) { //1
1921      StringType t = new StringType();
1922      t.setValue(value);
1923      if (this.targetLocation == null)
1924        this.targetLocation = new ArrayList<StringType>();
1925      this.targetLocation.add(t);
1926      return this;
1927    }
1928
1929    /**
1930     * @param value {@link #targetLocation} (The fhirpath location(s) within the resource that was validated.)
1931     */
1932    public boolean hasTargetLocation(String value) { 
1933      if (this.targetLocation == null)
1934        return false;
1935      for (StringType v : this.targetLocation)
1936        if (v.getValue().equals(value)) // string
1937          return true;
1938      return false;
1939    }
1940
1941    /**
1942     * @return {@link #need} (The frequency with which the target must be validated (none; initial; periodic).)
1943     */
1944    public CodeableConcept getNeed() { 
1945      if (this.need == null)
1946        if (Configuration.errorOnAutoCreate())
1947          throw new Error("Attempt to auto-create VerificationResult.need");
1948        else if (Configuration.doAutoCreate())
1949          this.need = new CodeableConcept(); // cc
1950      return this.need;
1951    }
1952
1953    public boolean hasNeed() { 
1954      return this.need != null && !this.need.isEmpty();
1955    }
1956
1957    /**
1958     * @param value {@link #need} (The frequency with which the target must be validated (none; initial; periodic).)
1959     */
1960    public VerificationResult setNeed(CodeableConcept value) { 
1961      this.need = value;
1962      return this;
1963    }
1964
1965    /**
1966     * @return {@link #status} (The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1967     */
1968    public Enumeration<Status> getStatusElement() { 
1969      if (this.status == null)
1970        if (Configuration.errorOnAutoCreate())
1971          throw new Error("Attempt to auto-create VerificationResult.status");
1972        else if (Configuration.doAutoCreate())
1973          this.status = new Enumeration<Status>(new StatusEnumFactory()); // bb
1974      return this.status;
1975    }
1976
1977    public boolean hasStatusElement() { 
1978      return this.status != null && !this.status.isEmpty();
1979    }
1980
1981    public boolean hasStatus() { 
1982      return this.status != null && !this.status.isEmpty();
1983    }
1984
1985    /**
1986     * @param value {@link #status} (The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1987     */
1988    public VerificationResult setStatusElement(Enumeration<Status> value) { 
1989      this.status = value;
1990      return this;
1991    }
1992
1993    /**
1994     * @return The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).
1995     */
1996    public Status getStatus() { 
1997      return this.status == null ? null : this.status.getValue();
1998    }
1999
2000    /**
2001     * @param value The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).
2002     */
2003    public VerificationResult setStatus(Status value) { 
2004        if (this.status == null)
2005          this.status = new Enumeration<Status>(new StatusEnumFactory());
2006        this.status.setValue(value);
2007      return this;
2008    }
2009
2010    /**
2011     * @return {@link #statusDate} (When the validation status was updated.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
2012     */
2013    public DateTimeType getStatusDateElement() { 
2014      if (this.statusDate == null)
2015        if (Configuration.errorOnAutoCreate())
2016          throw new Error("Attempt to auto-create VerificationResult.statusDate");
2017        else if (Configuration.doAutoCreate())
2018          this.statusDate = new DateTimeType(); // bb
2019      return this.statusDate;
2020    }
2021
2022    public boolean hasStatusDateElement() { 
2023      return this.statusDate != null && !this.statusDate.isEmpty();
2024    }
2025
2026    public boolean hasStatusDate() { 
2027      return this.statusDate != null && !this.statusDate.isEmpty();
2028    }
2029
2030    /**
2031     * @param value {@link #statusDate} (When the validation status was updated.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
2032     */
2033    public VerificationResult setStatusDateElement(DateTimeType value) { 
2034      this.statusDate = value;
2035      return this;
2036    }
2037
2038    /**
2039     * @return When the validation status was updated.
2040     */
2041    public Date getStatusDate() { 
2042      return this.statusDate == null ? null : this.statusDate.getValue();
2043    }
2044
2045    /**
2046     * @param value When the validation status was updated.
2047     */
2048    public VerificationResult setStatusDate(Date value) { 
2049      if (value == null)
2050        this.statusDate = null;
2051      else {
2052        if (this.statusDate == null)
2053          this.statusDate = new DateTimeType();
2054        this.statusDate.setValue(value);
2055      }
2056      return this;
2057    }
2058
2059    /**
2060     * @return {@link #validationType} (What the target is validated against (nothing; primary source; multiple sources).)
2061     */
2062    public CodeableConcept getValidationType() { 
2063      if (this.validationType == null)
2064        if (Configuration.errorOnAutoCreate())
2065          throw new Error("Attempt to auto-create VerificationResult.validationType");
2066        else if (Configuration.doAutoCreate())
2067          this.validationType = new CodeableConcept(); // cc
2068      return this.validationType;
2069    }
2070
2071    public boolean hasValidationType() { 
2072      return this.validationType != null && !this.validationType.isEmpty();
2073    }
2074
2075    /**
2076     * @param value {@link #validationType} (What the target is validated against (nothing; primary source; multiple sources).)
2077     */
2078    public VerificationResult setValidationType(CodeableConcept value) { 
2079      this.validationType = value;
2080      return this;
2081    }
2082
2083    /**
2084     * @return {@link #validationProcess} (The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context).)
2085     */
2086    public List<CodeableConcept> getValidationProcess() { 
2087      if (this.validationProcess == null)
2088        this.validationProcess = new ArrayList<CodeableConcept>();
2089      return this.validationProcess;
2090    }
2091
2092    /**
2093     * @return Returns a reference to <code>this</code> for easy method chaining
2094     */
2095    public VerificationResult setValidationProcess(List<CodeableConcept> theValidationProcess) { 
2096      this.validationProcess = theValidationProcess;
2097      return this;
2098    }
2099
2100    public boolean hasValidationProcess() { 
2101      if (this.validationProcess == null)
2102        return false;
2103      for (CodeableConcept item : this.validationProcess)
2104        if (!item.isEmpty())
2105          return true;
2106      return false;
2107    }
2108
2109    public CodeableConcept addValidationProcess() { //3
2110      CodeableConcept t = new CodeableConcept();
2111      if (this.validationProcess == null)
2112        this.validationProcess = new ArrayList<CodeableConcept>();
2113      this.validationProcess.add(t);
2114      return t;
2115    }
2116
2117    public VerificationResult addValidationProcess(CodeableConcept t) { //3
2118      if (t == null)
2119        return this;
2120      if (this.validationProcess == null)
2121        this.validationProcess = new ArrayList<CodeableConcept>();
2122      this.validationProcess.add(t);
2123      return this;
2124    }
2125
2126    /**
2127     * @return The first repetition of repeating field {@link #validationProcess}, creating it if it does not already exist
2128     */
2129    public CodeableConcept getValidationProcessFirstRep() { 
2130      if (getValidationProcess().isEmpty()) {
2131        addValidationProcess();
2132      }
2133      return getValidationProcess().get(0);
2134    }
2135
2136    /**
2137     * @return {@link #frequency} (Frequency of revalidation.)
2138     */
2139    public Timing getFrequency() { 
2140      if (this.frequency == null)
2141        if (Configuration.errorOnAutoCreate())
2142          throw new Error("Attempt to auto-create VerificationResult.frequency");
2143        else if (Configuration.doAutoCreate())
2144          this.frequency = new Timing(); // cc
2145      return this.frequency;
2146    }
2147
2148    public boolean hasFrequency() { 
2149      return this.frequency != null && !this.frequency.isEmpty();
2150    }
2151
2152    /**
2153     * @param value {@link #frequency} (Frequency of revalidation.)
2154     */
2155    public VerificationResult setFrequency(Timing value) { 
2156      this.frequency = value;
2157      return this;
2158    }
2159
2160    /**
2161     * @return {@link #lastPerformed} (The date/time validation was last completed (including failed validations).). This is the underlying object with id, value and extensions. The accessor "getLastPerformed" gives direct access to the value
2162     */
2163    public DateTimeType getLastPerformedElement() { 
2164      if (this.lastPerformed == null)
2165        if (Configuration.errorOnAutoCreate())
2166          throw new Error("Attempt to auto-create VerificationResult.lastPerformed");
2167        else if (Configuration.doAutoCreate())
2168          this.lastPerformed = new DateTimeType(); // bb
2169      return this.lastPerformed;
2170    }
2171
2172    public boolean hasLastPerformedElement() { 
2173      return this.lastPerformed != null && !this.lastPerformed.isEmpty();
2174    }
2175
2176    public boolean hasLastPerformed() { 
2177      return this.lastPerformed != null && !this.lastPerformed.isEmpty();
2178    }
2179
2180    /**
2181     * @param value {@link #lastPerformed} (The date/time validation was last completed (including failed validations).). This is the underlying object with id, value and extensions. The accessor "getLastPerformed" gives direct access to the value
2182     */
2183    public VerificationResult setLastPerformedElement(DateTimeType value) { 
2184      this.lastPerformed = value;
2185      return this;
2186    }
2187
2188    /**
2189     * @return The date/time validation was last completed (including failed validations).
2190     */
2191    public Date getLastPerformed() { 
2192      return this.lastPerformed == null ? null : this.lastPerformed.getValue();
2193    }
2194
2195    /**
2196     * @param value The date/time validation was last completed (including failed validations).
2197     */
2198    public VerificationResult setLastPerformed(Date value) { 
2199      if (value == null)
2200        this.lastPerformed = null;
2201      else {
2202        if (this.lastPerformed == null)
2203          this.lastPerformed = new DateTimeType();
2204        this.lastPerformed.setValue(value);
2205      }
2206      return this;
2207    }
2208
2209    /**
2210     * @return {@link #nextScheduled} (The date when target is next validated, if appropriate.). This is the underlying object with id, value and extensions. The accessor "getNextScheduled" gives direct access to the value
2211     */
2212    public DateType getNextScheduledElement() { 
2213      if (this.nextScheduled == null)
2214        if (Configuration.errorOnAutoCreate())
2215          throw new Error("Attempt to auto-create VerificationResult.nextScheduled");
2216        else if (Configuration.doAutoCreate())
2217          this.nextScheduled = new DateType(); // bb
2218      return this.nextScheduled;
2219    }
2220
2221    public boolean hasNextScheduledElement() { 
2222      return this.nextScheduled != null && !this.nextScheduled.isEmpty();
2223    }
2224
2225    public boolean hasNextScheduled() { 
2226      return this.nextScheduled != null && !this.nextScheduled.isEmpty();
2227    }
2228
2229    /**
2230     * @param value {@link #nextScheduled} (The date when target is next validated, if appropriate.). This is the underlying object with id, value and extensions. The accessor "getNextScheduled" gives direct access to the value
2231     */
2232    public VerificationResult setNextScheduledElement(DateType value) { 
2233      this.nextScheduled = value;
2234      return this;
2235    }
2236
2237    /**
2238     * @return The date when target is next validated, if appropriate.
2239     */
2240    public Date getNextScheduled() { 
2241      return this.nextScheduled == null ? null : this.nextScheduled.getValue();
2242    }
2243
2244    /**
2245     * @param value The date when target is next validated, if appropriate.
2246     */
2247    public VerificationResult setNextScheduled(Date value) { 
2248      if (value == null)
2249        this.nextScheduled = null;
2250      else {
2251        if (this.nextScheduled == null)
2252          this.nextScheduled = new DateType();
2253        this.nextScheduled.setValue(value);
2254      }
2255      return this;
2256    }
2257
2258    /**
2259     * @return {@link #failureAction} (The result if validation fails (fatal; warning; record only; none).)
2260     */
2261    public CodeableConcept getFailureAction() { 
2262      if (this.failureAction == null)
2263        if (Configuration.errorOnAutoCreate())
2264          throw new Error("Attempt to auto-create VerificationResult.failureAction");
2265        else if (Configuration.doAutoCreate())
2266          this.failureAction = new CodeableConcept(); // cc
2267      return this.failureAction;
2268    }
2269
2270    public boolean hasFailureAction() { 
2271      return this.failureAction != null && !this.failureAction.isEmpty();
2272    }
2273
2274    /**
2275     * @param value {@link #failureAction} (The result if validation fails (fatal; warning; record only; none).)
2276     */
2277    public VerificationResult setFailureAction(CodeableConcept value) { 
2278      this.failureAction = value;
2279      return this;
2280    }
2281
2282    /**
2283     * @return {@link #primarySource} (Information about the primary source(s) involved in validation.)
2284     */
2285    public List<VerificationResultPrimarySourceComponent> getPrimarySource() { 
2286      if (this.primarySource == null)
2287        this.primarySource = new ArrayList<VerificationResultPrimarySourceComponent>();
2288      return this.primarySource;
2289    }
2290
2291    /**
2292     * @return Returns a reference to <code>this</code> for easy method chaining
2293     */
2294    public VerificationResult setPrimarySource(List<VerificationResultPrimarySourceComponent> thePrimarySource) { 
2295      this.primarySource = thePrimarySource;
2296      return this;
2297    }
2298
2299    public boolean hasPrimarySource() { 
2300      if (this.primarySource == null)
2301        return false;
2302      for (VerificationResultPrimarySourceComponent item : this.primarySource)
2303        if (!item.isEmpty())
2304          return true;
2305      return false;
2306    }
2307
2308    public VerificationResultPrimarySourceComponent addPrimarySource() { //3
2309      VerificationResultPrimarySourceComponent t = new VerificationResultPrimarySourceComponent();
2310      if (this.primarySource == null)
2311        this.primarySource = new ArrayList<VerificationResultPrimarySourceComponent>();
2312      this.primarySource.add(t);
2313      return t;
2314    }
2315
2316    public VerificationResult addPrimarySource(VerificationResultPrimarySourceComponent t) { //3
2317      if (t == null)
2318        return this;
2319      if (this.primarySource == null)
2320        this.primarySource = new ArrayList<VerificationResultPrimarySourceComponent>();
2321      this.primarySource.add(t);
2322      return this;
2323    }
2324
2325    /**
2326     * @return The first repetition of repeating field {@link #primarySource}, creating it if it does not already exist
2327     */
2328    public VerificationResultPrimarySourceComponent getPrimarySourceFirstRep() { 
2329      if (getPrimarySource().isEmpty()) {
2330        addPrimarySource();
2331      }
2332      return getPrimarySource().get(0);
2333    }
2334
2335    /**
2336     * @return {@link #attestation} (Information about the entity attesting to information.)
2337     */
2338    public VerificationResultAttestationComponent getAttestation() { 
2339      if (this.attestation == null)
2340        if (Configuration.errorOnAutoCreate())
2341          throw new Error("Attempt to auto-create VerificationResult.attestation");
2342        else if (Configuration.doAutoCreate())
2343          this.attestation = new VerificationResultAttestationComponent(); // cc
2344      return this.attestation;
2345    }
2346
2347    public boolean hasAttestation() { 
2348      return this.attestation != null && !this.attestation.isEmpty();
2349    }
2350
2351    /**
2352     * @param value {@link #attestation} (Information about the entity attesting to information.)
2353     */
2354    public VerificationResult setAttestation(VerificationResultAttestationComponent value) { 
2355      this.attestation = value;
2356      return this;
2357    }
2358
2359    /**
2360     * @return {@link #validator} (Information about the entity validating information.)
2361     */
2362    public List<VerificationResultValidatorComponent> getValidator() { 
2363      if (this.validator == null)
2364        this.validator = new ArrayList<VerificationResultValidatorComponent>();
2365      return this.validator;
2366    }
2367
2368    /**
2369     * @return Returns a reference to <code>this</code> for easy method chaining
2370     */
2371    public VerificationResult setValidator(List<VerificationResultValidatorComponent> theValidator) { 
2372      this.validator = theValidator;
2373      return this;
2374    }
2375
2376    public boolean hasValidator() { 
2377      if (this.validator == null)
2378        return false;
2379      for (VerificationResultValidatorComponent item : this.validator)
2380        if (!item.isEmpty())
2381          return true;
2382      return false;
2383    }
2384
2385    public VerificationResultValidatorComponent addValidator() { //3
2386      VerificationResultValidatorComponent t = new VerificationResultValidatorComponent();
2387      if (this.validator == null)
2388        this.validator = new ArrayList<VerificationResultValidatorComponent>();
2389      this.validator.add(t);
2390      return t;
2391    }
2392
2393    public VerificationResult addValidator(VerificationResultValidatorComponent t) { //3
2394      if (t == null)
2395        return this;
2396      if (this.validator == null)
2397        this.validator = new ArrayList<VerificationResultValidatorComponent>();
2398      this.validator.add(t);
2399      return this;
2400    }
2401
2402    /**
2403     * @return The first repetition of repeating field {@link #validator}, creating it if it does not already exist
2404     */
2405    public VerificationResultValidatorComponent getValidatorFirstRep() { 
2406      if (getValidator().isEmpty()) {
2407        addValidator();
2408      }
2409      return getValidator().get(0);
2410    }
2411
2412      protected void listChildren(List<Property> children) {
2413        super.listChildren(children);
2414        children.add(new Property("target", "Reference(Any)", "A resource that was validated.", 0, java.lang.Integer.MAX_VALUE, target));
2415        children.add(new Property("targetLocation", "string", "The fhirpath location(s) within the resource that was validated.", 0, java.lang.Integer.MAX_VALUE, targetLocation));
2416        children.add(new Property("need", "CodeableConcept", "The frequency with which the target must be validated (none; initial; periodic).", 0, 1, need));
2417        children.add(new Property("status", "code", "The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).", 0, 1, status));
2418        children.add(new Property("statusDate", "dateTime", "When the validation status was updated.", 0, 1, statusDate));
2419        children.add(new Property("validationType", "CodeableConcept", "What the target is validated against (nothing; primary source; multiple sources).", 0, 1, validationType));
2420        children.add(new Property("validationProcess", "CodeableConcept", "The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context).", 0, java.lang.Integer.MAX_VALUE, validationProcess));
2421        children.add(new Property("frequency", "Timing", "Frequency of revalidation.", 0, 1, frequency));
2422        children.add(new Property("lastPerformed", "dateTime", "The date/time validation was last completed (including failed validations).", 0, 1, lastPerformed));
2423        children.add(new Property("nextScheduled", "date", "The date when target is next validated, if appropriate.", 0, 1, nextScheduled));
2424        children.add(new Property("failureAction", "CodeableConcept", "The result if validation fails (fatal; warning; record only; none).", 0, 1, failureAction));
2425        children.add(new Property("primarySource", "", "Information about the primary source(s) involved in validation.", 0, java.lang.Integer.MAX_VALUE, primarySource));
2426        children.add(new Property("attestation", "", "Information about the entity attesting to information.", 0, 1, attestation));
2427        children.add(new Property("validator", "", "Information about the entity validating information.", 0, java.lang.Integer.MAX_VALUE, validator));
2428      }
2429
2430      @Override
2431      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2432        switch (_hash) {
2433        case -880905839: /*target*/  return new Property("target", "Reference(Any)", "A resource that was validated.", 0, java.lang.Integer.MAX_VALUE, target);
2434        case 308958310: /*targetLocation*/  return new Property("targetLocation", "string", "The fhirpath location(s) within the resource that was validated.", 0, java.lang.Integer.MAX_VALUE, targetLocation);
2435        case 3377302: /*need*/  return new Property("need", "CodeableConcept", "The frequency with which the target must be validated (none; initial; periodic).", 0, 1, need);
2436        case -892481550: /*status*/  return new Property("status", "code", "The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).", 0, 1, status);
2437        case 247524032: /*statusDate*/  return new Property("statusDate", "dateTime", "When the validation status was updated.", 0, 1, statusDate);
2438        case -279681197: /*validationType*/  return new Property("validationType", "CodeableConcept", "What the target is validated against (nothing; primary source; multiple sources).", 0, 1, validationType);
2439        case 797680566: /*validationProcess*/  return new Property("validationProcess", "CodeableConcept", "The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context).", 0, java.lang.Integer.MAX_VALUE, validationProcess);
2440        case -70023844: /*frequency*/  return new Property("frequency", "Timing", "Frequency of revalidation.", 0, 1, frequency);
2441        case -1313229366: /*lastPerformed*/  return new Property("lastPerformed", "dateTime", "The date/time validation was last completed (including failed validations).", 0, 1, lastPerformed);
2442        case 1874589434: /*nextScheduled*/  return new Property("nextScheduled", "date", "The date when target is next validated, if appropriate.", 0, 1, nextScheduled);
2443        case 1816382560: /*failureAction*/  return new Property("failureAction", "CodeableConcept", "The result if validation fails (fatal; warning; record only; none).", 0, 1, failureAction);
2444        case -528721731: /*primarySource*/  return new Property("primarySource", "", "Information about the primary source(s) involved in validation.", 0, java.lang.Integer.MAX_VALUE, primarySource);
2445        case -709624112: /*attestation*/  return new Property("attestation", "", "Information about the entity attesting to information.", 0, 1, attestation);
2446        case -1109783726: /*validator*/  return new Property("validator", "", "Information about the entity validating information.", 0, java.lang.Integer.MAX_VALUE, validator);
2447        default: return super.getNamedProperty(_hash, _name, _checkValid);
2448        }
2449
2450      }
2451
2452      @Override
2453      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2454        switch (hash) {
2455        case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // Reference
2456        case 308958310: /*targetLocation*/ return this.targetLocation == null ? new Base[0] : this.targetLocation.toArray(new Base[this.targetLocation.size()]); // StringType
2457        case 3377302: /*need*/ return this.need == null ? new Base[0] : new Base[] {this.need}; // CodeableConcept
2458        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<Status>
2459        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateTimeType
2460        case -279681197: /*validationType*/ return this.validationType == null ? new Base[0] : new Base[] {this.validationType}; // CodeableConcept
2461        case 797680566: /*validationProcess*/ return this.validationProcess == null ? new Base[0] : this.validationProcess.toArray(new Base[this.validationProcess.size()]); // CodeableConcept
2462        case -70023844: /*frequency*/ return this.frequency == null ? new Base[0] : new Base[] {this.frequency}; // Timing
2463        case -1313229366: /*lastPerformed*/ return this.lastPerformed == null ? new Base[0] : new Base[] {this.lastPerformed}; // DateTimeType
2464        case 1874589434: /*nextScheduled*/ return this.nextScheduled == null ? new Base[0] : new Base[] {this.nextScheduled}; // DateType
2465        case 1816382560: /*failureAction*/ return this.failureAction == null ? new Base[0] : new Base[] {this.failureAction}; // CodeableConcept
2466        case -528721731: /*primarySource*/ return this.primarySource == null ? new Base[0] : this.primarySource.toArray(new Base[this.primarySource.size()]); // VerificationResultPrimarySourceComponent
2467        case -709624112: /*attestation*/ return this.attestation == null ? new Base[0] : new Base[] {this.attestation}; // VerificationResultAttestationComponent
2468        case -1109783726: /*validator*/ return this.validator == null ? new Base[0] : this.validator.toArray(new Base[this.validator.size()]); // VerificationResultValidatorComponent
2469        default: return super.getProperty(hash, name, checkValid);
2470        }
2471
2472      }
2473
2474      @Override
2475      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2476        switch (hash) {
2477        case -880905839: // target
2478          this.getTarget().add(castToReference(value)); // Reference
2479          return value;
2480        case 308958310: // targetLocation
2481          this.getTargetLocation().add(castToString(value)); // StringType
2482          return value;
2483        case 3377302: // need
2484          this.need = castToCodeableConcept(value); // CodeableConcept
2485          return value;
2486        case -892481550: // status
2487          value = new StatusEnumFactory().fromType(castToCode(value));
2488          this.status = (Enumeration) value; // Enumeration<Status>
2489          return value;
2490        case 247524032: // statusDate
2491          this.statusDate = castToDateTime(value); // DateTimeType
2492          return value;
2493        case -279681197: // validationType
2494          this.validationType = castToCodeableConcept(value); // CodeableConcept
2495          return value;
2496        case 797680566: // validationProcess
2497          this.getValidationProcess().add(castToCodeableConcept(value)); // CodeableConcept
2498          return value;
2499        case -70023844: // frequency
2500          this.frequency = castToTiming(value); // Timing
2501          return value;
2502        case -1313229366: // lastPerformed
2503          this.lastPerformed = castToDateTime(value); // DateTimeType
2504          return value;
2505        case 1874589434: // nextScheduled
2506          this.nextScheduled = castToDate(value); // DateType
2507          return value;
2508        case 1816382560: // failureAction
2509          this.failureAction = castToCodeableConcept(value); // CodeableConcept
2510          return value;
2511        case -528721731: // primarySource
2512          this.getPrimarySource().add((VerificationResultPrimarySourceComponent) value); // VerificationResultPrimarySourceComponent
2513          return value;
2514        case -709624112: // attestation
2515          this.attestation = (VerificationResultAttestationComponent) value; // VerificationResultAttestationComponent
2516          return value;
2517        case -1109783726: // validator
2518          this.getValidator().add((VerificationResultValidatorComponent) value); // VerificationResultValidatorComponent
2519          return value;
2520        default: return super.setProperty(hash, name, value);
2521        }
2522
2523      }
2524
2525      @Override
2526      public Base setProperty(String name, Base value) throws FHIRException {
2527        if (name.equals("target")) {
2528          this.getTarget().add(castToReference(value));
2529        } else if (name.equals("targetLocation")) {
2530          this.getTargetLocation().add(castToString(value));
2531        } else if (name.equals("need")) {
2532          this.need = castToCodeableConcept(value); // CodeableConcept
2533        } else if (name.equals("status")) {
2534          value = new StatusEnumFactory().fromType(castToCode(value));
2535          this.status = (Enumeration) value; // Enumeration<Status>
2536        } else if (name.equals("statusDate")) {
2537          this.statusDate = castToDateTime(value); // DateTimeType
2538        } else if (name.equals("validationType")) {
2539          this.validationType = castToCodeableConcept(value); // CodeableConcept
2540        } else if (name.equals("validationProcess")) {
2541          this.getValidationProcess().add(castToCodeableConcept(value));
2542        } else if (name.equals("frequency")) {
2543          this.frequency = castToTiming(value); // Timing
2544        } else if (name.equals("lastPerformed")) {
2545          this.lastPerformed = castToDateTime(value); // DateTimeType
2546        } else if (name.equals("nextScheduled")) {
2547          this.nextScheduled = castToDate(value); // DateType
2548        } else if (name.equals("failureAction")) {
2549          this.failureAction = castToCodeableConcept(value); // CodeableConcept
2550        } else if (name.equals("primarySource")) {
2551          this.getPrimarySource().add((VerificationResultPrimarySourceComponent) value);
2552        } else if (name.equals("attestation")) {
2553          this.attestation = (VerificationResultAttestationComponent) value; // VerificationResultAttestationComponent
2554        } else if (name.equals("validator")) {
2555          this.getValidator().add((VerificationResultValidatorComponent) value);
2556        } else
2557          return super.setProperty(name, value);
2558        return value;
2559      }
2560
2561      @Override
2562      public Base makeProperty(int hash, String name) throws FHIRException {
2563        switch (hash) {
2564        case -880905839:  return addTarget(); 
2565        case 308958310:  return addTargetLocationElement();
2566        case 3377302:  return getNeed(); 
2567        case -892481550:  return getStatusElement();
2568        case 247524032:  return getStatusDateElement();
2569        case -279681197:  return getValidationType(); 
2570        case 797680566:  return addValidationProcess(); 
2571        case -70023844:  return getFrequency(); 
2572        case -1313229366:  return getLastPerformedElement();
2573        case 1874589434:  return getNextScheduledElement();
2574        case 1816382560:  return getFailureAction(); 
2575        case -528721731:  return addPrimarySource(); 
2576        case -709624112:  return getAttestation(); 
2577        case -1109783726:  return addValidator(); 
2578        default: return super.makeProperty(hash, name);
2579        }
2580
2581      }
2582
2583      @Override
2584      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2585        switch (hash) {
2586        case -880905839: /*target*/ return new String[] {"Reference"};
2587        case 308958310: /*targetLocation*/ return new String[] {"string"};
2588        case 3377302: /*need*/ return new String[] {"CodeableConcept"};
2589        case -892481550: /*status*/ return new String[] {"code"};
2590        case 247524032: /*statusDate*/ return new String[] {"dateTime"};
2591        case -279681197: /*validationType*/ return new String[] {"CodeableConcept"};
2592        case 797680566: /*validationProcess*/ return new String[] {"CodeableConcept"};
2593        case -70023844: /*frequency*/ return new String[] {"Timing"};
2594        case -1313229366: /*lastPerformed*/ return new String[] {"dateTime"};
2595        case 1874589434: /*nextScheduled*/ return new String[] {"date"};
2596        case 1816382560: /*failureAction*/ return new String[] {"CodeableConcept"};
2597        case -528721731: /*primarySource*/ return new String[] {};
2598        case -709624112: /*attestation*/ return new String[] {};
2599        case -1109783726: /*validator*/ return new String[] {};
2600        default: return super.getTypesForProperty(hash, name);
2601        }
2602
2603      }
2604
2605      @Override
2606      public Base addChild(String name) throws FHIRException {
2607        if (name.equals("target")) {
2608          return addTarget();
2609        }
2610        else if (name.equals("targetLocation")) {
2611          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.targetLocation");
2612        }
2613        else if (name.equals("need")) {
2614          this.need = new CodeableConcept();
2615          return this.need;
2616        }
2617        else if (name.equals("status")) {
2618          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.status");
2619        }
2620        else if (name.equals("statusDate")) {
2621          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.statusDate");
2622        }
2623        else if (name.equals("validationType")) {
2624          this.validationType = new CodeableConcept();
2625          return this.validationType;
2626        }
2627        else if (name.equals("validationProcess")) {
2628          return addValidationProcess();
2629        }
2630        else if (name.equals("frequency")) {
2631          this.frequency = new Timing();
2632          return this.frequency;
2633        }
2634        else if (name.equals("lastPerformed")) {
2635          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.lastPerformed");
2636        }
2637        else if (name.equals("nextScheduled")) {
2638          throw new FHIRException("Cannot call addChild on a primitive type VerificationResult.nextScheduled");
2639        }
2640        else if (name.equals("failureAction")) {
2641          this.failureAction = new CodeableConcept();
2642          return this.failureAction;
2643        }
2644        else if (name.equals("primarySource")) {
2645          return addPrimarySource();
2646        }
2647        else if (name.equals("attestation")) {
2648          this.attestation = new VerificationResultAttestationComponent();
2649          return this.attestation;
2650        }
2651        else if (name.equals("validator")) {
2652          return addValidator();
2653        }
2654        else
2655          return super.addChild(name);
2656      }
2657
2658  public String fhirType() {
2659    return "VerificationResult";
2660
2661  }
2662
2663      public VerificationResult copy() {
2664        VerificationResult dst = new VerificationResult();
2665        copyValues(dst);
2666        return dst;
2667      }
2668
2669      public void copyValues(VerificationResult dst) {
2670        super.copyValues(dst);
2671        if (target != null) {
2672          dst.target = new ArrayList<Reference>();
2673          for (Reference i : target)
2674            dst.target.add(i.copy());
2675        };
2676        if (targetLocation != null) {
2677          dst.targetLocation = new ArrayList<StringType>();
2678          for (StringType i : targetLocation)
2679            dst.targetLocation.add(i.copy());
2680        };
2681        dst.need = need == null ? null : need.copy();
2682        dst.status = status == null ? null : status.copy();
2683        dst.statusDate = statusDate == null ? null : statusDate.copy();
2684        dst.validationType = validationType == null ? null : validationType.copy();
2685        if (validationProcess != null) {
2686          dst.validationProcess = new ArrayList<CodeableConcept>();
2687          for (CodeableConcept i : validationProcess)
2688            dst.validationProcess.add(i.copy());
2689        };
2690        dst.frequency = frequency == null ? null : frequency.copy();
2691        dst.lastPerformed = lastPerformed == null ? null : lastPerformed.copy();
2692        dst.nextScheduled = nextScheduled == null ? null : nextScheduled.copy();
2693        dst.failureAction = failureAction == null ? null : failureAction.copy();
2694        if (primarySource != null) {
2695          dst.primarySource = new ArrayList<VerificationResultPrimarySourceComponent>();
2696          for (VerificationResultPrimarySourceComponent i : primarySource)
2697            dst.primarySource.add(i.copy());
2698        };
2699        dst.attestation = attestation == null ? null : attestation.copy();
2700        if (validator != null) {
2701          dst.validator = new ArrayList<VerificationResultValidatorComponent>();
2702          for (VerificationResultValidatorComponent i : validator)
2703            dst.validator.add(i.copy());
2704        };
2705      }
2706
2707      protected VerificationResult typedCopy() {
2708        return copy();
2709      }
2710
2711      @Override
2712      public boolean equalsDeep(Base other_) {
2713        if (!super.equalsDeep(other_))
2714          return false;
2715        if (!(other_ instanceof VerificationResult))
2716          return false;
2717        VerificationResult o = (VerificationResult) other_;
2718        return compareDeep(target, o.target, true) && compareDeep(targetLocation, o.targetLocation, true)
2719           && compareDeep(need, o.need, true) && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true)
2720           && compareDeep(validationType, o.validationType, true) && compareDeep(validationProcess, o.validationProcess, true)
2721           && compareDeep(frequency, o.frequency, true) && compareDeep(lastPerformed, o.lastPerformed, true)
2722           && compareDeep(nextScheduled, o.nextScheduled, true) && compareDeep(failureAction, o.failureAction, true)
2723           && compareDeep(primarySource, o.primarySource, true) && compareDeep(attestation, o.attestation, true)
2724           && compareDeep(validator, o.validator, true);
2725      }
2726
2727      @Override
2728      public boolean equalsShallow(Base other_) {
2729        if (!super.equalsShallow(other_))
2730          return false;
2731        if (!(other_ instanceof VerificationResult))
2732          return false;
2733        VerificationResult o = (VerificationResult) other_;
2734        return compareValues(targetLocation, o.targetLocation, true) && compareValues(status, o.status, true)
2735           && compareValues(statusDate, o.statusDate, true) && compareValues(lastPerformed, o.lastPerformed, true)
2736           && compareValues(nextScheduled, o.nextScheduled, true);
2737      }
2738
2739      public boolean isEmpty() {
2740        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(target, targetLocation, need
2741          , status, statusDate, validationType, validationProcess, frequency, lastPerformed
2742          , nextScheduled, failureAction, primarySource, attestation, validator);
2743      }
2744
2745  @Override
2746  public ResourceType getResourceType() {
2747    return ResourceType.VerificationResult;
2748   }
2749
2750 /**
2751   * Search parameter: <b>target</b>
2752   * <p>
2753   * Description: <b>A resource that was validated</b><br>
2754   * Type: <b>reference</b><br>
2755   * Path: <b>VerificationResult.target</b><br>
2756   * </p>
2757   */
2758  @SearchParamDefinition(name="target", path="VerificationResult.target", description="A resource that was validated", type="reference" )
2759  public static final String SP_TARGET = "target";
2760 /**
2761   * <b>Fluent Client</b> search parameter constant for <b>target</b>
2762   * <p>
2763   * Description: <b>A resource that was validated</b><br>
2764   * Type: <b>reference</b><br>
2765   * Path: <b>VerificationResult.target</b><br>
2766   * </p>
2767   */
2768  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET);
2769
2770/**
2771   * Constant for fluent queries to be used to add include statements. Specifies
2772   * the path value of "<b>VerificationResult:target</b>".
2773   */
2774  public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("VerificationResult:target").toLocked();
2775
2776
2777}