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