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