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