001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
042import org.hl7.fhir.utilities.Utilities;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049/**
050 * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.
051 */
052@ResourceDef(name="AuditEvent", profile="http://hl7.org/fhir/Profile/AuditEvent")
053public class AuditEvent extends DomainResource {
054
055    public enum AuditEventAction {
056        /**
057         * Create a new database object, such as placing an order.
058         */
059        C, 
060        /**
061         * Display or print data, such as a doctor census.
062         */
063        R, 
064        /**
065         * Update data, such as revise patient information.
066         */
067        U, 
068        /**
069         * Delete items, such as a doctor master file record.
070         */
071        D, 
072        /**
073         * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation.
074         */
075        E, 
076        /**
077         * added to help the parsers
078         */
079        NULL;
080        public static AuditEventAction fromCode(String codeString) throws FHIRException {
081            if (codeString == null || "".equals(codeString))
082                return null;
083        if ("C".equals(codeString))
084          return C;
085        if ("R".equals(codeString))
086          return R;
087        if ("U".equals(codeString))
088          return U;
089        if ("D".equals(codeString))
090          return D;
091        if ("E".equals(codeString))
092          return E;
093        throw new FHIRException("Unknown AuditEventAction code '"+codeString+"'");
094        }
095        public String toCode() {
096          switch (this) {
097            case C: return "C";
098            case R: return "R";
099            case U: return "U";
100            case D: return "D";
101            case E: return "E";
102            case NULL: return null;
103            default: return "?";
104          }
105        }
106        public String getSystem() {
107          switch (this) {
108            case C: return "http://hl7.org/fhir/audit-event-action";
109            case R: return "http://hl7.org/fhir/audit-event-action";
110            case U: return "http://hl7.org/fhir/audit-event-action";
111            case D: return "http://hl7.org/fhir/audit-event-action";
112            case E: return "http://hl7.org/fhir/audit-event-action";
113            case NULL: return null;
114            default: return "?";
115          }
116        }
117        public String getDefinition() {
118          switch (this) {
119            case C: return "Create a new database object, such as placing an order.";
120            case R: return "Display or print data, such as a doctor census.";
121            case U: return "Update data, such as revise patient information.";
122            case D: return "Delete items, such as a doctor master file record.";
123            case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation.";
124            case NULL: return null;
125            default: return "?";
126          }
127        }
128        public String getDisplay() {
129          switch (this) {
130            case C: return "Create";
131            case R: return "Read/View/Print";
132            case U: return "Update";
133            case D: return "Delete";
134            case E: return "Execute";
135            case NULL: return null;
136            default: return "?";
137          }
138        }
139    }
140
141  public static class AuditEventActionEnumFactory implements EnumFactory<AuditEventAction> {
142    public AuditEventAction fromCode(String codeString) throws IllegalArgumentException {
143      if (codeString == null || "".equals(codeString))
144            if (codeString == null || "".equals(codeString))
145                return null;
146        if ("C".equals(codeString))
147          return AuditEventAction.C;
148        if ("R".equals(codeString))
149          return AuditEventAction.R;
150        if ("U".equals(codeString))
151          return AuditEventAction.U;
152        if ("D".equals(codeString))
153          return AuditEventAction.D;
154        if ("E".equals(codeString))
155          return AuditEventAction.E;
156        throw new IllegalArgumentException("Unknown AuditEventAction code '"+codeString+"'");
157        }
158        public Enumeration<AuditEventAction> fromType(Base code) throws FHIRException {
159          if (code == null || code.isEmpty())
160            return null;
161          String codeString = ((PrimitiveType) code).asStringValue();
162          if (codeString == null || "".equals(codeString))
163            return null;
164        if ("C".equals(codeString))
165          return new Enumeration<AuditEventAction>(this, AuditEventAction.C);
166        if ("R".equals(codeString))
167          return new Enumeration<AuditEventAction>(this, AuditEventAction.R);
168        if ("U".equals(codeString))
169          return new Enumeration<AuditEventAction>(this, AuditEventAction.U);
170        if ("D".equals(codeString))
171          return new Enumeration<AuditEventAction>(this, AuditEventAction.D);
172        if ("E".equals(codeString))
173          return new Enumeration<AuditEventAction>(this, AuditEventAction.E);
174        throw new FHIRException("Unknown AuditEventAction code '"+codeString+"'");
175        }
176    public String toCode(AuditEventAction code) {
177      if (code == AuditEventAction.C)
178        return "C";
179      if (code == AuditEventAction.R)
180        return "R";
181      if (code == AuditEventAction.U)
182        return "U";
183      if (code == AuditEventAction.D)
184        return "D";
185      if (code == AuditEventAction.E)
186        return "E";
187      return "?";
188      }
189    public String toSystem(AuditEventAction code) {
190      return code.getSystem();
191      }
192    }
193
194    public enum AuditEventOutcome {
195        /**
196         * The operation completed successfully (whether with warnings or not).
197         */
198        _0, 
199        /**
200         * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response).
201         */
202        _4, 
203        /**
204         * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response).
205         */
206        _8, 
207        /**
208         * An error of such magnitude occurred that the system is no longer available for use (i.e. the system died).
209         */
210        _12, 
211        /**
212         * added to help the parsers
213         */
214        NULL;
215        public static AuditEventOutcome fromCode(String codeString) throws FHIRException {
216            if (codeString == null || "".equals(codeString))
217                return null;
218        if ("0".equals(codeString))
219          return _0;
220        if ("4".equals(codeString))
221          return _4;
222        if ("8".equals(codeString))
223          return _8;
224        if ("12".equals(codeString))
225          return _12;
226        throw new FHIRException("Unknown AuditEventOutcome code '"+codeString+"'");
227        }
228        public String toCode() {
229          switch (this) {
230            case _0: return "0";
231            case _4: return "4";
232            case _8: return "8";
233            case _12: return "12";
234            case NULL: return null;
235            default: return "?";
236          }
237        }
238        public String getSystem() {
239          switch (this) {
240            case _0: return "http://hl7.org/fhir/audit-event-outcome";
241            case _4: return "http://hl7.org/fhir/audit-event-outcome";
242            case _8: return "http://hl7.org/fhir/audit-event-outcome";
243            case _12: return "http://hl7.org/fhir/audit-event-outcome";
244            case NULL: return null;
245            default: return "?";
246          }
247        }
248        public String getDefinition() {
249          switch (this) {
250            case _0: return "The operation completed successfully (whether with warnings or not).";
251            case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response).";
252            case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response).";
253            case _12: return "An error of such magnitude occurred that the system is no longer available for use (i.e. the system died).";
254            case NULL: return null;
255            default: return "?";
256          }
257        }
258        public String getDisplay() {
259          switch (this) {
260            case _0: return "Success";
261            case _4: return "Minor failure";
262            case _8: return "Serious failure";
263            case _12: return "Major failure";
264            case NULL: return null;
265            default: return "?";
266          }
267        }
268    }
269
270  public static class AuditEventOutcomeEnumFactory implements EnumFactory<AuditEventOutcome> {
271    public AuditEventOutcome fromCode(String codeString) throws IllegalArgumentException {
272      if (codeString == null || "".equals(codeString))
273            if (codeString == null || "".equals(codeString))
274                return null;
275        if ("0".equals(codeString))
276          return AuditEventOutcome._0;
277        if ("4".equals(codeString))
278          return AuditEventOutcome._4;
279        if ("8".equals(codeString))
280          return AuditEventOutcome._8;
281        if ("12".equals(codeString))
282          return AuditEventOutcome._12;
283        throw new IllegalArgumentException("Unknown AuditEventOutcome code '"+codeString+"'");
284        }
285        public Enumeration<AuditEventOutcome> fromType(Base code) throws FHIRException {
286          if (code == null || code.isEmpty())
287            return null;
288          String codeString = ((PrimitiveType) code).asStringValue();
289          if (codeString == null || "".equals(codeString))
290            return null;
291        if ("0".equals(codeString))
292          return new Enumeration<AuditEventOutcome>(this, AuditEventOutcome._0);
293        if ("4".equals(codeString))
294          return new Enumeration<AuditEventOutcome>(this, AuditEventOutcome._4);
295        if ("8".equals(codeString))
296          return new Enumeration<AuditEventOutcome>(this, AuditEventOutcome._8);
297        if ("12".equals(codeString))
298          return new Enumeration<AuditEventOutcome>(this, AuditEventOutcome._12);
299        throw new FHIRException("Unknown AuditEventOutcome code '"+codeString+"'");
300        }
301    public String toCode(AuditEventOutcome code) {
302      if (code == AuditEventOutcome._0)
303        return "0";
304      if (code == AuditEventOutcome._4)
305        return "4";
306      if (code == AuditEventOutcome._8)
307        return "8";
308      if (code == AuditEventOutcome._12)
309        return "12";
310      return "?";
311      }
312    public String toSystem(AuditEventOutcome code) {
313      return code.getSystem();
314      }
315    }
316
317    public enum AuditEventParticipantNetworkType {
318        /**
319         * The machine name, including DNS name.
320         */
321        _1, 
322        /**
323         * The assigned Internet Protocol (IP) address.
324         */
325        _2, 
326        /**
327         * The assigned telephone number.
328         */
329        _3, 
330        /**
331         * The assigned email address.
332         */
333        _4, 
334        /**
335         * URI (User directory, HTTP-PUT, ftp, etc.).
336         */
337        _5, 
338        /**
339         * added to help the parsers
340         */
341        NULL;
342        public static AuditEventParticipantNetworkType fromCode(String codeString) throws FHIRException {
343            if (codeString == null || "".equals(codeString))
344                return null;
345        if ("1".equals(codeString))
346          return _1;
347        if ("2".equals(codeString))
348          return _2;
349        if ("3".equals(codeString))
350          return _3;
351        if ("4".equals(codeString))
352          return _4;
353        if ("5".equals(codeString))
354          return _5;
355        throw new FHIRException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'");
356        }
357        public String toCode() {
358          switch (this) {
359            case _1: return "1";
360            case _2: return "2";
361            case _3: return "3";
362            case _4: return "4";
363            case _5: return "5";
364            case NULL: return null;
365            default: return "?";
366          }
367        }
368        public String getSystem() {
369          switch (this) {
370            case _1: return "http://hl7.org/fhir/network-type";
371            case _2: return "http://hl7.org/fhir/network-type";
372            case _3: return "http://hl7.org/fhir/network-type";
373            case _4: return "http://hl7.org/fhir/network-type";
374            case _5: return "http://hl7.org/fhir/network-type";
375            case NULL: return null;
376            default: return "?";
377          }
378        }
379        public String getDefinition() {
380          switch (this) {
381            case _1: return "The machine name, including DNS name.";
382            case _2: return "The assigned Internet Protocol (IP) address.";
383            case _3: return "The assigned telephone number.";
384            case _4: return "The assigned email address.";
385            case _5: return "URI (User directory, HTTP-PUT, ftp, etc.).";
386            case NULL: return null;
387            default: return "?";
388          }
389        }
390        public String getDisplay() {
391          switch (this) {
392            case _1: return "Machine Name";
393            case _2: return "IP Address";
394            case _3: return "Telephone Number";
395            case _4: return "Email address";
396            case _5: return "URI";
397            case NULL: return null;
398            default: return "?";
399          }
400        }
401    }
402
403  public static class AuditEventParticipantNetworkTypeEnumFactory implements EnumFactory<AuditEventParticipantNetworkType> {
404    public AuditEventParticipantNetworkType fromCode(String codeString) throws IllegalArgumentException {
405      if (codeString == null || "".equals(codeString))
406            if (codeString == null || "".equals(codeString))
407                return null;
408        if ("1".equals(codeString))
409          return AuditEventParticipantNetworkType._1;
410        if ("2".equals(codeString))
411          return AuditEventParticipantNetworkType._2;
412        if ("3".equals(codeString))
413          return AuditEventParticipantNetworkType._3;
414        if ("4".equals(codeString))
415          return AuditEventParticipantNetworkType._4;
416        if ("5".equals(codeString))
417          return AuditEventParticipantNetworkType._5;
418        throw new IllegalArgumentException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'");
419        }
420        public Enumeration<AuditEventParticipantNetworkType> fromType(Base code) throws FHIRException {
421          if (code == null || code.isEmpty())
422            return null;
423          String codeString = ((PrimitiveType) code).asStringValue();
424          if (codeString == null || "".equals(codeString))
425            return null;
426        if ("1".equals(codeString))
427          return new Enumeration<AuditEventParticipantNetworkType>(this, AuditEventParticipantNetworkType._1);
428        if ("2".equals(codeString))
429          return new Enumeration<AuditEventParticipantNetworkType>(this, AuditEventParticipantNetworkType._2);
430        if ("3".equals(codeString))
431          return new Enumeration<AuditEventParticipantNetworkType>(this, AuditEventParticipantNetworkType._3);
432        if ("4".equals(codeString))
433          return new Enumeration<AuditEventParticipantNetworkType>(this, AuditEventParticipantNetworkType._4);
434        if ("5".equals(codeString))
435          return new Enumeration<AuditEventParticipantNetworkType>(this, AuditEventParticipantNetworkType._5);
436        throw new FHIRException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'");
437        }
438    public String toCode(AuditEventParticipantNetworkType code) {
439      if (code == AuditEventParticipantNetworkType._1)
440        return "1";
441      if (code == AuditEventParticipantNetworkType._2)
442        return "2";
443      if (code == AuditEventParticipantNetworkType._3)
444        return "3";
445      if (code == AuditEventParticipantNetworkType._4)
446        return "4";
447      if (code == AuditEventParticipantNetworkType._5)
448        return "5";
449      return "?";
450      }
451    public String toSystem(AuditEventParticipantNetworkType code) {
452      return code.getSystem();
453      }
454    }
455
456    @Block()
457    public static class AuditEventAgentComponent extends BackboneElement implements IBaseBackboneElement {
458        /**
459         * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.
460         */
461        @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
462        @Description(shortDefinition="Agent role in the event", formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context." )
463        protected List<CodeableConcept> role;
464
465        /**
466         * Direct reference to a resource that identifies the agent.
467         */
468        @Child(name = "reference", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true)
469        @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the agent." )
470        protected Reference reference;
471
472        /**
473         * The actual object that is the target of the reference (Direct reference to a resource that identifies the agent.)
474         */
475        protected Resource referenceTarget;
476
477        /**
478         * Unique identifier for the user actively participating in the event.
479         */
480        @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
481        @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." )
482        protected Identifier userId;
483
484        /**
485         * Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.
486         */
487        @Child(name = "altId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
488        @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available." )
489        protected StringType altId;
490
491        /**
492         * Human-meaningful name for the agent.
493         */
494        @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
495        @Description(shortDefinition="Human-meaningful name for the agent", formalDefinition="Human-meaningful name for the agent." )
496        protected StringType name;
497
498        /**
499         * Indicator that the user is or is not the requestor, or initiator, for the event being audited.
500         */
501        @Child(name = "requestor", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false)
502        @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." )
503        protected BooleanType requestor;
504
505        /**
506         * Where the event occurred.
507         */
508        @Child(name = "location", type = {Location.class}, order=7, min=0, max=1, modifier=false, summary=false)
509        @Description(shortDefinition="Where", formalDefinition="Where the event occurred." )
510        protected Reference location;
511
512        /**
513         * The actual object that is the target of the reference (Where the event occurred.)
514         */
515        protected Location locationTarget;
516
517        /**
518         * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
519         */
520        @Child(name = "policy", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
521        @Description(shortDefinition="Policy that authorized event", formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used." )
522        protected List<UriType> policy;
523
524        /**
525         * Type of media involved. Used when the event is about exporting/importing onto media.
526         */
527        @Child(name = "media", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=false)
528        @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." )
529        protected Coding media;
530
531        /**
532         * Logical network location for application activity, if the activity has a network location.
533         */
534        @Child(name = "network", type = {}, order=10, min=0, max=1, modifier=false, summary=false)
535        @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." )
536        protected AuditEventAgentNetworkComponent network;
537
538        /**
539         * The reason (purpose of use), specific to this agent, that was used during the event being recorded.
540         */
541        @Child(name = "purposeOfUse", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
542        @Description(shortDefinition="Reason given for this user", formalDefinition="The reason (purpose of use), specific to this agent, that was used during the event being recorded." )
543        protected List<Coding> purposeOfUse;
544
545        private static final long serialVersionUID = 1802747339L;
546
547    /**
548     * Constructor
549     */
550      public AuditEventAgentComponent() {
551        super();
552      }
553
554    /**
555     * Constructor
556     */
557      public AuditEventAgentComponent(BooleanType requestor) {
558        super();
559        this.requestor = requestor;
560      }
561
562        /**
563         * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.)
564         */
565        public List<CodeableConcept> getRole() { 
566          if (this.role == null)
567            this.role = new ArrayList<CodeableConcept>();
568          return this.role;
569        }
570
571        public boolean hasRole() { 
572          if (this.role == null)
573            return false;
574          for (CodeableConcept item : this.role)
575            if (!item.isEmpty())
576              return true;
577          return false;
578        }
579
580        /**
581         * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.)
582         */
583    // syntactic sugar
584        public CodeableConcept addRole() { //3
585          CodeableConcept t = new CodeableConcept();
586          if (this.role == null)
587            this.role = new ArrayList<CodeableConcept>();
588          this.role.add(t);
589          return t;
590        }
591
592    // syntactic sugar
593        public AuditEventAgentComponent addRole(CodeableConcept t) { //3
594          if (t == null)
595            return this;
596          if (this.role == null)
597            this.role = new ArrayList<CodeableConcept>();
598          this.role.add(t);
599          return this;
600        }
601
602        /**
603         * @return {@link #reference} (Direct reference to a resource that identifies the agent.)
604         */
605        public Reference getReference() { 
606          if (this.reference == null)
607            if (Configuration.errorOnAutoCreate())
608              throw new Error("Attempt to auto-create AuditEventAgentComponent.reference");
609            else if (Configuration.doAutoCreate())
610              this.reference = new Reference(); // cc
611          return this.reference;
612        }
613
614        public boolean hasReference() { 
615          return this.reference != null && !this.reference.isEmpty();
616        }
617
618        /**
619         * @param value {@link #reference} (Direct reference to a resource that identifies the agent.)
620         */
621        public AuditEventAgentComponent setReference(Reference value) { 
622          this.reference = value;
623          return this;
624        }
625
626        /**
627         * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the agent.)
628         */
629        public Resource getReferenceTarget() { 
630          return this.referenceTarget;
631        }
632
633        /**
634         * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the agent.)
635         */
636        public AuditEventAgentComponent setReferenceTarget(Resource value) { 
637          this.referenceTarget = value;
638          return this;
639        }
640
641        /**
642         * @return {@link #userId} (Unique identifier for the user actively participating in the event.)
643         */
644        public Identifier getUserId() { 
645          if (this.userId == null)
646            if (Configuration.errorOnAutoCreate())
647              throw new Error("Attempt to auto-create AuditEventAgentComponent.userId");
648            else if (Configuration.doAutoCreate())
649              this.userId = new Identifier(); // cc
650          return this.userId;
651        }
652
653        public boolean hasUserId() { 
654          return this.userId != null && !this.userId.isEmpty();
655        }
656
657        /**
658         * @param value {@link #userId} (Unique identifier for the user actively participating in the event.)
659         */
660        public AuditEventAgentComponent setUserId(Identifier value) { 
661          this.userId = value;
662          return this;
663        }
664
665        /**
666         * @return {@link #altId} (Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value
667         */
668        public StringType getAltIdElement() { 
669          if (this.altId == null)
670            if (Configuration.errorOnAutoCreate())
671              throw new Error("Attempt to auto-create AuditEventAgentComponent.altId");
672            else if (Configuration.doAutoCreate())
673              this.altId = new StringType(); // bb
674          return this.altId;
675        }
676
677        public boolean hasAltIdElement() { 
678          return this.altId != null && !this.altId.isEmpty();
679        }
680
681        public boolean hasAltId() { 
682          return this.altId != null && !this.altId.isEmpty();
683        }
684
685        /**
686         * @param value {@link #altId} (Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value
687         */
688        public AuditEventAgentComponent setAltIdElement(StringType value) { 
689          this.altId = value;
690          return this;
691        }
692
693        /**
694         * @return Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.
695         */
696        public String getAltId() { 
697          return this.altId == null ? null : this.altId.getValue();
698        }
699
700        /**
701         * @param value Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.
702         */
703        public AuditEventAgentComponent setAltId(String value) { 
704          if (Utilities.noString(value))
705            this.altId = null;
706          else {
707            if (this.altId == null)
708              this.altId = new StringType();
709            this.altId.setValue(value);
710          }
711          return this;
712        }
713
714        /**
715         * @return {@link #name} (Human-meaningful name for the agent.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
716         */
717        public StringType getNameElement() { 
718          if (this.name == null)
719            if (Configuration.errorOnAutoCreate())
720              throw new Error("Attempt to auto-create AuditEventAgentComponent.name");
721            else if (Configuration.doAutoCreate())
722              this.name = new StringType(); // bb
723          return this.name;
724        }
725
726        public boolean hasNameElement() { 
727          return this.name != null && !this.name.isEmpty();
728        }
729
730        public boolean hasName() { 
731          return this.name != null && !this.name.isEmpty();
732        }
733
734        /**
735         * @param value {@link #name} (Human-meaningful name for the agent.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
736         */
737        public AuditEventAgentComponent setNameElement(StringType value) { 
738          this.name = value;
739          return this;
740        }
741
742        /**
743         * @return Human-meaningful name for the agent.
744         */
745        public String getName() { 
746          return this.name == null ? null : this.name.getValue();
747        }
748
749        /**
750         * @param value Human-meaningful name for the agent.
751         */
752        public AuditEventAgentComponent setName(String value) { 
753          if (Utilities.noString(value))
754            this.name = null;
755          else {
756            if (this.name == null)
757              this.name = new StringType();
758            this.name.setValue(value);
759          }
760          return this;
761        }
762
763        /**
764         * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value
765         */
766        public BooleanType getRequestorElement() { 
767          if (this.requestor == null)
768            if (Configuration.errorOnAutoCreate())
769              throw new Error("Attempt to auto-create AuditEventAgentComponent.requestor");
770            else if (Configuration.doAutoCreate())
771              this.requestor = new BooleanType(); // bb
772          return this.requestor;
773        }
774
775        public boolean hasRequestorElement() { 
776          return this.requestor != null && !this.requestor.isEmpty();
777        }
778
779        public boolean hasRequestor() { 
780          return this.requestor != null && !this.requestor.isEmpty();
781        }
782
783        /**
784         * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value
785         */
786        public AuditEventAgentComponent setRequestorElement(BooleanType value) { 
787          this.requestor = value;
788          return this;
789        }
790
791        /**
792         * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited.
793         */
794        public boolean getRequestor() { 
795          return this.requestor == null || this.requestor.isEmpty() ? false : this.requestor.getValue();
796        }
797
798        /**
799         * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited.
800         */
801        public AuditEventAgentComponent setRequestor(boolean value) { 
802            if (this.requestor == null)
803              this.requestor = new BooleanType();
804            this.requestor.setValue(value);
805          return this;
806        }
807
808        /**
809         * @return {@link #location} (Where the event occurred.)
810         */
811        public Reference getLocation() { 
812          if (this.location == null)
813            if (Configuration.errorOnAutoCreate())
814              throw new Error("Attempt to auto-create AuditEventAgentComponent.location");
815            else if (Configuration.doAutoCreate())
816              this.location = new Reference(); // cc
817          return this.location;
818        }
819
820        public boolean hasLocation() { 
821          return this.location != null && !this.location.isEmpty();
822        }
823
824        /**
825         * @param value {@link #location} (Where the event occurred.)
826         */
827        public AuditEventAgentComponent setLocation(Reference value) { 
828          this.location = value;
829          return this;
830        }
831
832        /**
833         * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the event occurred.)
834         */
835        public Location getLocationTarget() { 
836          if (this.locationTarget == null)
837            if (Configuration.errorOnAutoCreate())
838              throw new Error("Attempt to auto-create AuditEventAgentComponent.location");
839            else if (Configuration.doAutoCreate())
840              this.locationTarget = new Location(); // aa
841          return this.locationTarget;
842        }
843
844        /**
845         * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the event occurred.)
846         */
847        public AuditEventAgentComponent setLocationTarget(Location value) { 
848          this.locationTarget = value;
849          return this;
850        }
851
852        /**
853         * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.)
854         */
855        public List<UriType> getPolicy() { 
856          if (this.policy == null)
857            this.policy = new ArrayList<UriType>();
858          return this.policy;
859        }
860
861        public boolean hasPolicy() { 
862          if (this.policy == null)
863            return false;
864          for (UriType item : this.policy)
865            if (!item.isEmpty())
866              return true;
867          return false;
868        }
869
870        /**
871         * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.)
872         */
873    // syntactic sugar
874        public UriType addPolicyElement() {//2 
875          UriType t = new UriType();
876          if (this.policy == null)
877            this.policy = new ArrayList<UriType>();
878          this.policy.add(t);
879          return t;
880        }
881
882        /**
883         * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.)
884         */
885        public AuditEventAgentComponent addPolicy(String value) { //1
886          UriType t = new UriType();
887          t.setValue(value);
888          if (this.policy == null)
889            this.policy = new ArrayList<UriType>();
890          this.policy.add(t);
891          return this;
892        }
893
894        /**
895         * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.)
896         */
897        public boolean hasPolicy(String value) { 
898          if (this.policy == null)
899            return false;
900          for (UriType v : this.policy)
901            if (v.equals(value)) // uri
902              return true;
903          return false;
904        }
905
906        /**
907         * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.)
908         */
909        public Coding getMedia() { 
910          if (this.media == null)
911            if (Configuration.errorOnAutoCreate())
912              throw new Error("Attempt to auto-create AuditEventAgentComponent.media");
913            else if (Configuration.doAutoCreate())
914              this.media = new Coding(); // cc
915          return this.media;
916        }
917
918        public boolean hasMedia() { 
919          return this.media != null && !this.media.isEmpty();
920        }
921
922        /**
923         * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.)
924         */
925        public AuditEventAgentComponent setMedia(Coding value) { 
926          this.media = value;
927          return this;
928        }
929
930        /**
931         * @return {@link #network} (Logical network location for application activity, if the activity has a network location.)
932         */
933        public AuditEventAgentNetworkComponent getNetwork() { 
934          if (this.network == null)
935            if (Configuration.errorOnAutoCreate())
936              throw new Error("Attempt to auto-create AuditEventAgentComponent.network");
937            else if (Configuration.doAutoCreate())
938              this.network = new AuditEventAgentNetworkComponent(); // cc
939          return this.network;
940        }
941
942        public boolean hasNetwork() { 
943          return this.network != null && !this.network.isEmpty();
944        }
945
946        /**
947         * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.)
948         */
949        public AuditEventAgentComponent setNetwork(AuditEventAgentNetworkComponent value) { 
950          this.network = value;
951          return this;
952        }
953
954        /**
955         * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.)
956         */
957        public List<Coding> getPurposeOfUse() { 
958          if (this.purposeOfUse == null)
959            this.purposeOfUse = new ArrayList<Coding>();
960          return this.purposeOfUse;
961        }
962
963        public boolean hasPurposeOfUse() { 
964          if (this.purposeOfUse == null)
965            return false;
966          for (Coding item : this.purposeOfUse)
967            if (!item.isEmpty())
968              return true;
969          return false;
970        }
971
972        /**
973         * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.)
974         */
975    // syntactic sugar
976        public Coding addPurposeOfUse() { //3
977          Coding t = new Coding();
978          if (this.purposeOfUse == null)
979            this.purposeOfUse = new ArrayList<Coding>();
980          this.purposeOfUse.add(t);
981          return t;
982        }
983
984    // syntactic sugar
985        public AuditEventAgentComponent addPurposeOfUse(Coding t) { //3
986          if (t == null)
987            return this;
988          if (this.purposeOfUse == null)
989            this.purposeOfUse = new ArrayList<Coding>();
990          this.purposeOfUse.add(t);
991          return this;
992        }
993
994        protected void listChildren(List<Property> childrenList) {
995          super.listChildren(childrenList);
996          childrenList.add(new Property("role", "CodeableConcept", "Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.", 0, java.lang.Integer.MAX_VALUE, role));
997          childrenList.add(new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, java.lang.Integer.MAX_VALUE, reference));
998          childrenList.add(new Property("userId", "Identifier", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId));
999          childrenList.add(new Property("altId", "string", "Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.", 0, java.lang.Integer.MAX_VALUE, altId));
1000          childrenList.add(new Property("name", "string", "Human-meaningful name for the agent.", 0, java.lang.Integer.MAX_VALUE, name));
1001          childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor));
1002          childrenList.add(new Property("location", "Reference(Location)", "Where the event occurred.", 0, java.lang.Integer.MAX_VALUE, location));
1003          childrenList.add(new Property("policy", "uri", "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.", 0, java.lang.Integer.MAX_VALUE, policy));
1004          childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media));
1005          childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network));
1006          childrenList.add(new Property("purposeOfUse", "Coding", "The reason (purpose of use), specific to this agent, that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse));
1007        }
1008
1009      @Override
1010      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1011        switch (hash) {
1012        case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept
1013        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
1014        case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier
1015        case 92912804: /*altId*/ return this.altId == null ? new Base[0] : new Base[] {this.altId}; // StringType
1016        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1017        case 693934258: /*requestor*/ return this.requestor == null ? new Base[0] : new Base[] {this.requestor}; // BooleanType
1018        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
1019        case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType
1020        case 103772132: /*media*/ return this.media == null ? new Base[0] : new Base[] {this.media}; // Coding
1021        case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // AuditEventAgentNetworkComponent
1022        case -1881902670: /*purposeOfUse*/ return this.purposeOfUse == null ? new Base[0] : this.purposeOfUse.toArray(new Base[this.purposeOfUse.size()]); // Coding
1023        default: return super.getProperty(hash, name, checkValid);
1024        }
1025
1026      }
1027
1028      @Override
1029      public void setProperty(int hash, String name, Base value) throws FHIRException {
1030        switch (hash) {
1031        case 3506294: // role
1032          this.getRole().add(castToCodeableConcept(value)); // CodeableConcept
1033          break;
1034        case -925155509: // reference
1035          this.reference = castToReference(value); // Reference
1036          break;
1037        case -836030906: // userId
1038          this.userId = castToIdentifier(value); // Identifier
1039          break;
1040        case 92912804: // altId
1041          this.altId = castToString(value); // StringType
1042          break;
1043        case 3373707: // name
1044          this.name = castToString(value); // StringType
1045          break;
1046        case 693934258: // requestor
1047          this.requestor = castToBoolean(value); // BooleanType
1048          break;
1049        case 1901043637: // location
1050          this.location = castToReference(value); // Reference
1051          break;
1052        case -982670030: // policy
1053          this.getPolicy().add(castToUri(value)); // UriType
1054          break;
1055        case 103772132: // media
1056          this.media = castToCoding(value); // Coding
1057          break;
1058        case 1843485230: // network
1059          this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent
1060          break;
1061        case -1881902670: // purposeOfUse
1062          this.getPurposeOfUse().add(castToCoding(value)); // Coding
1063          break;
1064        default: super.setProperty(hash, name, value);
1065        }
1066
1067      }
1068
1069      @Override
1070      public void setProperty(String name, Base value) throws FHIRException {
1071        if (name.equals("role"))
1072          this.getRole().add(castToCodeableConcept(value));
1073        else if (name.equals("reference"))
1074          this.reference = castToReference(value); // Reference
1075        else if (name.equals("userId"))
1076          this.userId = castToIdentifier(value); // Identifier
1077        else if (name.equals("altId"))
1078          this.altId = castToString(value); // StringType
1079        else if (name.equals("name"))
1080          this.name = castToString(value); // StringType
1081        else if (name.equals("requestor"))
1082          this.requestor = castToBoolean(value); // BooleanType
1083        else if (name.equals("location"))
1084          this.location = castToReference(value); // Reference
1085        else if (name.equals("policy"))
1086          this.getPolicy().add(castToUri(value));
1087        else if (name.equals("media"))
1088          this.media = castToCoding(value); // Coding
1089        else if (name.equals("network"))
1090          this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent
1091        else if (name.equals("purposeOfUse"))
1092          this.getPurposeOfUse().add(castToCoding(value));
1093        else
1094          super.setProperty(name, value);
1095      }
1096
1097      @Override
1098      public Base makeProperty(int hash, String name) throws FHIRException {
1099        switch (hash) {
1100        case 3506294:  return addRole(); // CodeableConcept
1101        case -925155509:  return getReference(); // Reference
1102        case -836030906:  return getUserId(); // Identifier
1103        case 92912804: throw new FHIRException("Cannot make property altId as it is not a complex type"); // StringType
1104        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
1105        case 693934258: throw new FHIRException("Cannot make property requestor as it is not a complex type"); // BooleanType
1106        case 1901043637:  return getLocation(); // Reference
1107        case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType
1108        case 103772132:  return getMedia(); // Coding
1109        case 1843485230:  return getNetwork(); // AuditEventAgentNetworkComponent
1110        case -1881902670:  return addPurposeOfUse(); // Coding
1111        default: return super.makeProperty(hash, name);
1112        }
1113
1114      }
1115
1116      @Override
1117      public Base addChild(String name) throws FHIRException {
1118        if (name.equals("role")) {
1119          return addRole();
1120        }
1121        else if (name.equals("reference")) {
1122          this.reference = new Reference();
1123          return this.reference;
1124        }
1125        else if (name.equals("userId")) {
1126          this.userId = new Identifier();
1127          return this.userId;
1128        }
1129        else if (name.equals("altId")) {
1130          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.altId");
1131        }
1132        else if (name.equals("name")) {
1133          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.name");
1134        }
1135        else if (name.equals("requestor")) {
1136          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.requestor");
1137        }
1138        else if (name.equals("location")) {
1139          this.location = new Reference();
1140          return this.location;
1141        }
1142        else if (name.equals("policy")) {
1143          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.policy");
1144        }
1145        else if (name.equals("media")) {
1146          this.media = new Coding();
1147          return this.media;
1148        }
1149        else if (name.equals("network")) {
1150          this.network = new AuditEventAgentNetworkComponent();
1151          return this.network;
1152        }
1153        else if (name.equals("purposeOfUse")) {
1154          return addPurposeOfUse();
1155        }
1156        else
1157          return super.addChild(name);
1158      }
1159
1160      public AuditEventAgentComponent copy() {
1161        AuditEventAgentComponent dst = new AuditEventAgentComponent();
1162        copyValues(dst);
1163        if (role != null) {
1164          dst.role = new ArrayList<CodeableConcept>();
1165          for (CodeableConcept i : role)
1166            dst.role.add(i.copy());
1167        };
1168        dst.reference = reference == null ? null : reference.copy();
1169        dst.userId = userId == null ? null : userId.copy();
1170        dst.altId = altId == null ? null : altId.copy();
1171        dst.name = name == null ? null : name.copy();
1172        dst.requestor = requestor == null ? null : requestor.copy();
1173        dst.location = location == null ? null : location.copy();
1174        if (policy != null) {
1175          dst.policy = new ArrayList<UriType>();
1176          for (UriType i : policy)
1177            dst.policy.add(i.copy());
1178        };
1179        dst.media = media == null ? null : media.copy();
1180        dst.network = network == null ? null : network.copy();
1181        if (purposeOfUse != null) {
1182          dst.purposeOfUse = new ArrayList<Coding>();
1183          for (Coding i : purposeOfUse)
1184            dst.purposeOfUse.add(i.copy());
1185        };
1186        return dst;
1187      }
1188
1189      @Override
1190      public boolean equalsDeep(Base other) {
1191        if (!super.equalsDeep(other))
1192          return false;
1193        if (!(other instanceof AuditEventAgentComponent))
1194          return false;
1195        AuditEventAgentComponent o = (AuditEventAgentComponent) other;
1196        return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(userId, o.userId, true)
1197           && compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true) && compareDeep(requestor, o.requestor, true)
1198           && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) && compareDeep(media, o.media, true)
1199           && compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true);
1200      }
1201
1202      @Override
1203      public boolean equalsShallow(Base other) {
1204        if (!super.equalsShallow(other))
1205          return false;
1206        if (!(other instanceof AuditEventAgentComponent))
1207          return false;
1208        AuditEventAgentComponent o = (AuditEventAgentComponent) other;
1209        return compareValues(altId, o.altId, true) && compareValues(name, o.name, true) && compareValues(requestor, o.requestor, true)
1210           && compareValues(policy, o.policy, true);
1211      }
1212
1213      public boolean isEmpty() {
1214        return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty())
1215           && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty())
1216           && (requestor == null || requestor.isEmpty()) && (location == null || location.isEmpty())
1217           && (policy == null || policy.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty())
1218           && (purposeOfUse == null || purposeOfUse.isEmpty());
1219      }
1220
1221  public String fhirType() {
1222    return "AuditEvent.agent";
1223
1224  }
1225
1226  }
1227
1228    @Block()
1229    public static class AuditEventAgentNetworkComponent extends BackboneElement implements IBaseBackboneElement {
1230        /**
1231         * An identifier for the network access point of the user device for the audit event.
1232         */
1233        @Child(name = "address", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1234        @Description(shortDefinition="Identifier for the network access point of the user device", formalDefinition="An identifier for the network access point of the user device for the audit event." )
1235        protected StringType address;
1236
1237        /**
1238         * An identifier for the type of network access point that originated the audit event.
1239         */
1240        @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1241        @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." )
1242        protected Enumeration<AuditEventParticipantNetworkType> type;
1243
1244        private static final long serialVersionUID = -1355220390L;
1245
1246    /**
1247     * Constructor
1248     */
1249      public AuditEventAgentNetworkComponent() {
1250        super();
1251      }
1252
1253        /**
1254         * @return {@link #address} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
1255         */
1256        public StringType getAddressElement() { 
1257          if (this.address == null)
1258            if (Configuration.errorOnAutoCreate())
1259              throw new Error("Attempt to auto-create AuditEventAgentNetworkComponent.address");
1260            else if (Configuration.doAutoCreate())
1261              this.address = new StringType(); // bb
1262          return this.address;
1263        }
1264
1265        public boolean hasAddressElement() { 
1266          return this.address != null && !this.address.isEmpty();
1267        }
1268
1269        public boolean hasAddress() { 
1270          return this.address != null && !this.address.isEmpty();
1271        }
1272
1273        /**
1274         * @param value {@link #address} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
1275         */
1276        public AuditEventAgentNetworkComponent setAddressElement(StringType value) { 
1277          this.address = value;
1278          return this;
1279        }
1280
1281        /**
1282         * @return An identifier for the network access point of the user device for the audit event.
1283         */
1284        public String getAddress() { 
1285          return this.address == null ? null : this.address.getValue();
1286        }
1287
1288        /**
1289         * @param value An identifier for the network access point of the user device for the audit event.
1290         */
1291        public AuditEventAgentNetworkComponent setAddress(String value) { 
1292          if (Utilities.noString(value))
1293            this.address = null;
1294          else {
1295            if (this.address == null)
1296              this.address = new StringType();
1297            this.address.setValue(value);
1298          }
1299          return this;
1300        }
1301
1302        /**
1303         * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1304         */
1305        public Enumeration<AuditEventParticipantNetworkType> getTypeElement() { 
1306          if (this.type == null)
1307            if (Configuration.errorOnAutoCreate())
1308              throw new Error("Attempt to auto-create AuditEventAgentNetworkComponent.type");
1309            else if (Configuration.doAutoCreate())
1310              this.type = new Enumeration<AuditEventParticipantNetworkType>(new AuditEventParticipantNetworkTypeEnumFactory()); // bb
1311          return this.type;
1312        }
1313
1314        public boolean hasTypeElement() { 
1315          return this.type != null && !this.type.isEmpty();
1316        }
1317
1318        public boolean hasType() { 
1319          return this.type != null && !this.type.isEmpty();
1320        }
1321
1322        /**
1323         * @param value {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1324         */
1325        public AuditEventAgentNetworkComponent setTypeElement(Enumeration<AuditEventParticipantNetworkType> value) { 
1326          this.type = value;
1327          return this;
1328        }
1329
1330        /**
1331         * @return An identifier for the type of network access point that originated the audit event.
1332         */
1333        public AuditEventParticipantNetworkType getType() { 
1334          return this.type == null ? null : this.type.getValue();
1335        }
1336
1337        /**
1338         * @param value An identifier for the type of network access point that originated the audit event.
1339         */
1340        public AuditEventAgentNetworkComponent setType(AuditEventParticipantNetworkType value) { 
1341          if (value == null)
1342            this.type = null;
1343          else {
1344            if (this.type == null)
1345              this.type = new Enumeration<AuditEventParticipantNetworkType>(new AuditEventParticipantNetworkTypeEnumFactory());
1346            this.type.setValue(value);
1347          }
1348          return this;
1349        }
1350
1351        protected void listChildren(List<Property> childrenList) {
1352          super.listChildren(childrenList);
1353          childrenList.add(new Property("address", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, address));
1354          childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type));
1355        }
1356
1357      @Override
1358      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1359        switch (hash) {
1360        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // StringType
1361        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<AuditEventParticipantNetworkType>
1362        default: return super.getProperty(hash, name, checkValid);
1363        }
1364
1365      }
1366
1367      @Override
1368      public void setProperty(int hash, String name, Base value) throws FHIRException {
1369        switch (hash) {
1370        case -1147692044: // address
1371          this.address = castToString(value); // StringType
1372          break;
1373        case 3575610: // type
1374          this.type = new AuditEventParticipantNetworkTypeEnumFactory().fromType(value); // Enumeration<AuditEventParticipantNetworkType>
1375          break;
1376        default: super.setProperty(hash, name, value);
1377        }
1378
1379      }
1380
1381      @Override
1382      public void setProperty(String name, Base value) throws FHIRException {
1383        if (name.equals("address"))
1384          this.address = castToString(value); // StringType
1385        else if (name.equals("type"))
1386          this.type = new AuditEventParticipantNetworkTypeEnumFactory().fromType(value); // Enumeration<AuditEventParticipantNetworkType>
1387        else
1388          super.setProperty(name, value);
1389      }
1390
1391      @Override
1392      public Base makeProperty(int hash, String name) throws FHIRException {
1393        switch (hash) {
1394        case -1147692044: throw new FHIRException("Cannot make property address as it is not a complex type"); // StringType
1395        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration<AuditEventParticipantNetworkType>
1396        default: return super.makeProperty(hash, name);
1397        }
1398
1399      }
1400
1401      @Override
1402      public Base addChild(String name) throws FHIRException {
1403        if (name.equals("address")) {
1404          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.address");
1405        }
1406        else if (name.equals("type")) {
1407          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type");
1408        }
1409        else
1410          return super.addChild(name);
1411      }
1412
1413      public AuditEventAgentNetworkComponent copy() {
1414        AuditEventAgentNetworkComponent dst = new AuditEventAgentNetworkComponent();
1415        copyValues(dst);
1416        dst.address = address == null ? null : address.copy();
1417        dst.type = type == null ? null : type.copy();
1418        return dst;
1419      }
1420
1421      @Override
1422      public boolean equalsDeep(Base other) {
1423        if (!super.equalsDeep(other))
1424          return false;
1425        if (!(other instanceof AuditEventAgentNetworkComponent))
1426          return false;
1427        AuditEventAgentNetworkComponent o = (AuditEventAgentNetworkComponent) other;
1428        return compareDeep(address, o.address, true) && compareDeep(type, o.type, true);
1429      }
1430
1431      @Override
1432      public boolean equalsShallow(Base other) {
1433        if (!super.equalsShallow(other))
1434          return false;
1435        if (!(other instanceof AuditEventAgentNetworkComponent))
1436          return false;
1437        AuditEventAgentNetworkComponent o = (AuditEventAgentNetworkComponent) other;
1438        return compareValues(address, o.address, true) && compareValues(type, o.type, true);
1439      }
1440
1441      public boolean isEmpty() {
1442        return super.isEmpty() && (address == null || address.isEmpty()) && (type == null || type.isEmpty())
1443          ;
1444      }
1445
1446  public String fhirType() {
1447    return "AuditEvent.agent.network";
1448
1449  }
1450
1451  }
1452
1453    @Block()
1454    public static class AuditEventSourceComponent extends BackboneElement implements IBaseBackboneElement {
1455        /**
1456         * Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.
1457         */
1458        @Child(name = "site", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1459        @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group." )
1460        protected StringType site;
1461
1462        /**
1463         * Identifier of the source where the event was detected.
1464         */
1465        @Child(name = "identifier", type = {Identifier.class}, order=2, min=1, max=1, modifier=false, summary=true)
1466        @Description(shortDefinition="The identity of source detecting the event", formalDefinition="Identifier of the source where the event was detected." )
1467        protected Identifier identifier;
1468
1469        /**
1470         * Code specifying the type of source where event originated.
1471         */
1472        @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1473        @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." )
1474        protected List<Coding> type;
1475
1476        private static final long serialVersionUID = -1562673890L;
1477
1478    /**
1479     * Constructor
1480     */
1481      public AuditEventSourceComponent() {
1482        super();
1483      }
1484
1485    /**
1486     * Constructor
1487     */
1488      public AuditEventSourceComponent(Identifier identifier) {
1489        super();
1490        this.identifier = identifier;
1491      }
1492
1493        /**
1494         * @return {@link #site} (Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value
1495         */
1496        public StringType getSiteElement() { 
1497          if (this.site == null)
1498            if (Configuration.errorOnAutoCreate())
1499              throw new Error("Attempt to auto-create AuditEventSourceComponent.site");
1500            else if (Configuration.doAutoCreate())
1501              this.site = new StringType(); // bb
1502          return this.site;
1503        }
1504
1505        public boolean hasSiteElement() { 
1506          return this.site != null && !this.site.isEmpty();
1507        }
1508
1509        public boolean hasSite() { 
1510          return this.site != null && !this.site.isEmpty();
1511        }
1512
1513        /**
1514         * @param value {@link #site} (Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value
1515         */
1516        public AuditEventSourceComponent setSiteElement(StringType value) { 
1517          this.site = value;
1518          return this;
1519        }
1520
1521        /**
1522         * @return Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.
1523         */
1524        public String getSite() { 
1525          return this.site == null ? null : this.site.getValue();
1526        }
1527
1528        /**
1529         * @param value Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.
1530         */
1531        public AuditEventSourceComponent setSite(String value) { 
1532          if (Utilities.noString(value))
1533            this.site = null;
1534          else {
1535            if (this.site == null)
1536              this.site = new StringType();
1537            this.site.setValue(value);
1538          }
1539          return this;
1540        }
1541
1542        /**
1543         * @return {@link #identifier} (Identifier of the source where the event was detected.)
1544         */
1545        public Identifier getIdentifier() { 
1546          if (this.identifier == null)
1547            if (Configuration.errorOnAutoCreate())
1548              throw new Error("Attempt to auto-create AuditEventSourceComponent.identifier");
1549            else if (Configuration.doAutoCreate())
1550              this.identifier = new Identifier(); // cc
1551          return this.identifier;
1552        }
1553
1554        public boolean hasIdentifier() { 
1555          return this.identifier != null && !this.identifier.isEmpty();
1556        }
1557
1558        /**
1559         * @param value {@link #identifier} (Identifier of the source where the event was detected.)
1560         */
1561        public AuditEventSourceComponent setIdentifier(Identifier value) { 
1562          this.identifier = value;
1563          return this;
1564        }
1565
1566        /**
1567         * @return {@link #type} (Code specifying the type of source where event originated.)
1568         */
1569        public List<Coding> getType() { 
1570          if (this.type == null)
1571            this.type = new ArrayList<Coding>();
1572          return this.type;
1573        }
1574
1575        public boolean hasType() { 
1576          if (this.type == null)
1577            return false;
1578          for (Coding item : this.type)
1579            if (!item.isEmpty())
1580              return true;
1581          return false;
1582        }
1583
1584        /**
1585         * @return {@link #type} (Code specifying the type of source where event originated.)
1586         */
1587    // syntactic sugar
1588        public Coding addType() { //3
1589          Coding t = new Coding();
1590          if (this.type == null)
1591            this.type = new ArrayList<Coding>();
1592          this.type.add(t);
1593          return t;
1594        }
1595
1596    // syntactic sugar
1597        public AuditEventSourceComponent addType(Coding t) { //3
1598          if (t == null)
1599            return this;
1600          if (this.type == null)
1601            this.type = new ArrayList<Coding>();
1602          this.type.add(t);
1603          return this;
1604        }
1605
1606        protected void listChildren(List<Property> childrenList) {
1607          super.listChildren(childrenList);
1608          childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.", 0, java.lang.Integer.MAX_VALUE, site));
1609          childrenList.add(new Property("identifier", "Identifier", "Identifier of the source where the event was detected.", 0, java.lang.Integer.MAX_VALUE, identifier));
1610          childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type));
1611        }
1612
1613      @Override
1614      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1615        switch (hash) {
1616        case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // StringType
1617        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1618        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding
1619        default: return super.getProperty(hash, name, checkValid);
1620        }
1621
1622      }
1623
1624      @Override
1625      public void setProperty(int hash, String name, Base value) throws FHIRException {
1626        switch (hash) {
1627        case 3530567: // site
1628          this.site = castToString(value); // StringType
1629          break;
1630        case -1618432855: // identifier
1631          this.identifier = castToIdentifier(value); // Identifier
1632          break;
1633        case 3575610: // type
1634          this.getType().add(castToCoding(value)); // Coding
1635          break;
1636        default: super.setProperty(hash, name, value);
1637        }
1638
1639      }
1640
1641      @Override
1642      public void setProperty(String name, Base value) throws FHIRException {
1643        if (name.equals("site"))
1644          this.site = castToString(value); // StringType
1645        else if (name.equals("identifier"))
1646          this.identifier = castToIdentifier(value); // Identifier
1647        else if (name.equals("type"))
1648          this.getType().add(castToCoding(value));
1649        else
1650          super.setProperty(name, value);
1651      }
1652
1653      @Override
1654      public Base makeProperty(int hash, String name) throws FHIRException {
1655        switch (hash) {
1656        case 3530567: throw new FHIRException("Cannot make property site as it is not a complex type"); // StringType
1657        case -1618432855:  return getIdentifier(); // Identifier
1658        case 3575610:  return addType(); // Coding
1659        default: return super.makeProperty(hash, name);
1660        }
1661
1662      }
1663
1664      @Override
1665      public Base addChild(String name) throws FHIRException {
1666        if (name.equals("site")) {
1667          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.site");
1668        }
1669        else if (name.equals("identifier")) {
1670          this.identifier = new Identifier();
1671          return this.identifier;
1672        }
1673        else if (name.equals("type")) {
1674          return addType();
1675        }
1676        else
1677          return super.addChild(name);
1678      }
1679
1680      public AuditEventSourceComponent copy() {
1681        AuditEventSourceComponent dst = new AuditEventSourceComponent();
1682        copyValues(dst);
1683        dst.site = site == null ? null : site.copy();
1684        dst.identifier = identifier == null ? null : identifier.copy();
1685        if (type != null) {
1686          dst.type = new ArrayList<Coding>();
1687          for (Coding i : type)
1688            dst.type.add(i.copy());
1689        };
1690        return dst;
1691      }
1692
1693      @Override
1694      public boolean equalsDeep(Base other) {
1695        if (!super.equalsDeep(other))
1696          return false;
1697        if (!(other instanceof AuditEventSourceComponent))
1698          return false;
1699        AuditEventSourceComponent o = (AuditEventSourceComponent) other;
1700        return compareDeep(site, o.site, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true)
1701          ;
1702      }
1703
1704      @Override
1705      public boolean equalsShallow(Base other) {
1706        if (!super.equalsShallow(other))
1707          return false;
1708        if (!(other instanceof AuditEventSourceComponent))
1709          return false;
1710        AuditEventSourceComponent o = (AuditEventSourceComponent) other;
1711        return compareValues(site, o.site, true);
1712      }
1713
1714      public boolean isEmpty() {
1715        return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty())
1716           && (type == null || type.isEmpty());
1717      }
1718
1719  public String fhirType() {
1720    return "AuditEvent.source";
1721
1722  }
1723
1724  }
1725
1726    @Block()
1727    public static class AuditEventEntityComponent extends BackboneElement implements IBaseBackboneElement {
1728        /**
1729         * Identifies a specific instance of the entity. The reference should always be version specific.
1730         */
1731        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true)
1732        @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the entity. The reference should always be version specific." )
1733        protected Identifier identifier;
1734
1735        /**
1736         * Identifies a specific instance of the entity. The reference should always be version specific.
1737         */
1738        @Child(name = "reference", type = {}, order=2, min=0, max=1, modifier=false, summary=true)
1739        @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the entity. The reference should always be version specific." )
1740        protected Reference reference;
1741
1742        /**
1743         * The actual object that is the target of the reference (Identifies a specific instance of the entity. The reference should always be version specific.)
1744         */
1745        protected Resource referenceTarget;
1746
1747        /**
1748         * The type of the object that was involved in this audit event.
1749         */
1750        @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false)
1751        @Description(shortDefinition="Type of object involved", formalDefinition="The type of the object that was involved in this audit event." )
1752        protected Coding type;
1753
1754        /**
1755         * Code representing the role the entity played in the event being audited.
1756         */
1757        @Child(name = "role", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false)
1758        @Description(shortDefinition="What role the entity played", formalDefinition="Code representing the role the entity played in the event being audited." )
1759        protected Coding role;
1760
1761        /**
1762         * Identifier for the data life-cycle stage for the entity.
1763         */
1764        @Child(name = "lifecycle", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false)
1765        @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the entity." )
1766        protected Coding lifecycle;
1767
1768        /**
1769         * Denotes security labels for the identified entity.
1770         */
1771        @Child(name = "securityLabel", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1772        @Description(shortDefinition="Security labels applied to the object", formalDefinition="Denotes security labels for the identified entity." )
1773        protected List<Coding> securityLabel;
1774
1775        /**
1776         * A name of the entity in the audit event.
1777         */
1778        @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1779        @Description(shortDefinition="Descriptor for entity", formalDefinition="A name of the entity in the audit event." )
1780        protected StringType name;
1781
1782        /**
1783         * Text that describes the entity in more detail.
1784         */
1785        @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1786        @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the entity in more detail." )
1787        protected StringType description;
1788
1789        /**
1790         * The query parameters for a query-type entities.
1791         */
1792        @Child(name = "query", type = {Base64BinaryType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1793        @Description(shortDefinition="Query parameters", formalDefinition="The query parameters for a query-type entities." )
1794        protected Base64BinaryType query;
1795
1796        /**
1797         * Additional Information about the entity.
1798         */
1799        @Child(name = "detail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1800        @Description(shortDefinition="Additional Information about the entity", formalDefinition="Additional Information about the entity." )
1801        protected List<AuditEventEntityDetailComponent> detail;
1802
1803        private static final long serialVersionUID = -1393424632L;
1804
1805    /**
1806     * Constructor
1807     */
1808      public AuditEventEntityComponent() {
1809        super();
1810      }
1811
1812        /**
1813         * @return {@link #identifier} (Identifies a specific instance of the entity. The reference should always be version specific.)
1814         */
1815        public Identifier getIdentifier() { 
1816          if (this.identifier == null)
1817            if (Configuration.errorOnAutoCreate())
1818              throw new Error("Attempt to auto-create AuditEventEntityComponent.identifier");
1819            else if (Configuration.doAutoCreate())
1820              this.identifier = new Identifier(); // cc
1821          return this.identifier;
1822        }
1823
1824        public boolean hasIdentifier() { 
1825          return this.identifier != null && !this.identifier.isEmpty();
1826        }
1827
1828        /**
1829         * @param value {@link #identifier} (Identifies a specific instance of the entity. The reference should always be version specific.)
1830         */
1831        public AuditEventEntityComponent setIdentifier(Identifier value) { 
1832          this.identifier = value;
1833          return this;
1834        }
1835
1836        /**
1837         * @return {@link #reference} (Identifies a specific instance of the entity. The reference should always be version specific.)
1838         */
1839        public Reference getReference() { 
1840          if (this.reference == null)
1841            if (Configuration.errorOnAutoCreate())
1842              throw new Error("Attempt to auto-create AuditEventEntityComponent.reference");
1843            else if (Configuration.doAutoCreate())
1844              this.reference = new Reference(); // cc
1845          return this.reference;
1846        }
1847
1848        public boolean hasReference() { 
1849          return this.reference != null && !this.reference.isEmpty();
1850        }
1851
1852        /**
1853         * @param value {@link #reference} (Identifies a specific instance of the entity. The reference should always be version specific.)
1854         */
1855        public AuditEventEntityComponent setReference(Reference value) { 
1856          this.reference = value;
1857          return this;
1858        }
1859
1860        /**
1861         * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the entity. The reference should always be version specific.)
1862         */
1863        public Resource getReferenceTarget() { 
1864          return this.referenceTarget;
1865        }
1866
1867        /**
1868         * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the entity. The reference should always be version specific.)
1869         */
1870        public AuditEventEntityComponent setReferenceTarget(Resource value) { 
1871          this.referenceTarget = value;
1872          return this;
1873        }
1874
1875        /**
1876         * @return {@link #type} (The type of the object that was involved in this audit event.)
1877         */
1878        public Coding getType() { 
1879          if (this.type == null)
1880            if (Configuration.errorOnAutoCreate())
1881              throw new Error("Attempt to auto-create AuditEventEntityComponent.type");
1882            else if (Configuration.doAutoCreate())
1883              this.type = new Coding(); // cc
1884          return this.type;
1885        }
1886
1887        public boolean hasType() { 
1888          return this.type != null && !this.type.isEmpty();
1889        }
1890
1891        /**
1892         * @param value {@link #type} (The type of the object that was involved in this audit event.)
1893         */
1894        public AuditEventEntityComponent setType(Coding value) { 
1895          this.type = value;
1896          return this;
1897        }
1898
1899        /**
1900         * @return {@link #role} (Code representing the role the entity played in the event being audited.)
1901         */
1902        public Coding getRole() { 
1903          if (this.role == null)
1904            if (Configuration.errorOnAutoCreate())
1905              throw new Error("Attempt to auto-create AuditEventEntityComponent.role");
1906            else if (Configuration.doAutoCreate())
1907              this.role = new Coding(); // cc
1908          return this.role;
1909        }
1910
1911        public boolean hasRole() { 
1912          return this.role != null && !this.role.isEmpty();
1913        }
1914
1915        /**
1916         * @param value {@link #role} (Code representing the role the entity played in the event being audited.)
1917         */
1918        public AuditEventEntityComponent setRole(Coding value) { 
1919          this.role = value;
1920          return this;
1921        }
1922
1923        /**
1924         * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the entity.)
1925         */
1926        public Coding getLifecycle() { 
1927          if (this.lifecycle == null)
1928            if (Configuration.errorOnAutoCreate())
1929              throw new Error("Attempt to auto-create AuditEventEntityComponent.lifecycle");
1930            else if (Configuration.doAutoCreate())
1931              this.lifecycle = new Coding(); // cc
1932          return this.lifecycle;
1933        }
1934
1935        public boolean hasLifecycle() { 
1936          return this.lifecycle != null && !this.lifecycle.isEmpty();
1937        }
1938
1939        /**
1940         * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the entity.)
1941         */
1942        public AuditEventEntityComponent setLifecycle(Coding value) { 
1943          this.lifecycle = value;
1944          return this;
1945        }
1946
1947        /**
1948         * @return {@link #securityLabel} (Denotes security labels for the identified entity.)
1949         */
1950        public List<Coding> getSecurityLabel() { 
1951          if (this.securityLabel == null)
1952            this.securityLabel = new ArrayList<Coding>();
1953          return this.securityLabel;
1954        }
1955
1956        public boolean hasSecurityLabel() { 
1957          if (this.securityLabel == null)
1958            return false;
1959          for (Coding item : this.securityLabel)
1960            if (!item.isEmpty())
1961              return true;
1962          return false;
1963        }
1964
1965        /**
1966         * @return {@link #securityLabel} (Denotes security labels for the identified entity.)
1967         */
1968    // syntactic sugar
1969        public Coding addSecurityLabel() { //3
1970          Coding t = new Coding();
1971          if (this.securityLabel == null)
1972            this.securityLabel = new ArrayList<Coding>();
1973          this.securityLabel.add(t);
1974          return t;
1975        }
1976
1977    // syntactic sugar
1978        public AuditEventEntityComponent addSecurityLabel(Coding t) { //3
1979          if (t == null)
1980            return this;
1981          if (this.securityLabel == null)
1982            this.securityLabel = new ArrayList<Coding>();
1983          this.securityLabel.add(t);
1984          return this;
1985        }
1986
1987        /**
1988         * @return {@link #name} (A name of the entity in the audit event.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1989         */
1990        public StringType getNameElement() { 
1991          if (this.name == null)
1992            if (Configuration.errorOnAutoCreate())
1993              throw new Error("Attempt to auto-create AuditEventEntityComponent.name");
1994            else if (Configuration.doAutoCreate())
1995              this.name = new StringType(); // bb
1996          return this.name;
1997        }
1998
1999        public boolean hasNameElement() { 
2000          return this.name != null && !this.name.isEmpty();
2001        }
2002
2003        public boolean hasName() { 
2004          return this.name != null && !this.name.isEmpty();
2005        }
2006
2007        /**
2008         * @param value {@link #name} (A name of the entity in the audit event.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2009         */
2010        public AuditEventEntityComponent setNameElement(StringType value) { 
2011          this.name = value;
2012          return this;
2013        }
2014
2015        /**
2016         * @return A name of the entity in the audit event.
2017         */
2018        public String getName() { 
2019          return this.name == null ? null : this.name.getValue();
2020        }
2021
2022        /**
2023         * @param value A name of the entity in the audit event.
2024         */
2025        public AuditEventEntityComponent setName(String value) { 
2026          if (Utilities.noString(value))
2027            this.name = null;
2028          else {
2029            if (this.name == null)
2030              this.name = new StringType();
2031            this.name.setValue(value);
2032          }
2033          return this;
2034        }
2035
2036        /**
2037         * @return {@link #description} (Text that describes the entity in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2038         */
2039        public StringType getDescriptionElement() { 
2040          if (this.description == null)
2041            if (Configuration.errorOnAutoCreate())
2042              throw new Error("Attempt to auto-create AuditEventEntityComponent.description");
2043            else if (Configuration.doAutoCreate())
2044              this.description = new StringType(); // bb
2045          return this.description;
2046        }
2047
2048        public boolean hasDescriptionElement() { 
2049          return this.description != null && !this.description.isEmpty();
2050        }
2051
2052        public boolean hasDescription() { 
2053          return this.description != null && !this.description.isEmpty();
2054        }
2055
2056        /**
2057         * @param value {@link #description} (Text that describes the entity in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2058         */
2059        public AuditEventEntityComponent setDescriptionElement(StringType value) { 
2060          this.description = value;
2061          return this;
2062        }
2063
2064        /**
2065         * @return Text that describes the entity in more detail.
2066         */
2067        public String getDescription() { 
2068          return this.description == null ? null : this.description.getValue();
2069        }
2070
2071        /**
2072         * @param value Text that describes the entity in more detail.
2073         */
2074        public AuditEventEntityComponent setDescription(String value) { 
2075          if (Utilities.noString(value))
2076            this.description = null;
2077          else {
2078            if (this.description == null)
2079              this.description = new StringType();
2080            this.description.setValue(value);
2081          }
2082          return this;
2083        }
2084
2085        /**
2086         * @return {@link #query} (The query parameters for a query-type entities.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value
2087         */
2088        public Base64BinaryType getQueryElement() { 
2089          if (this.query == null)
2090            if (Configuration.errorOnAutoCreate())
2091              throw new Error("Attempt to auto-create AuditEventEntityComponent.query");
2092            else if (Configuration.doAutoCreate())
2093              this.query = new Base64BinaryType(); // bb
2094          return this.query;
2095        }
2096
2097        public boolean hasQueryElement() { 
2098          return this.query != null && !this.query.isEmpty();
2099        }
2100
2101        public boolean hasQuery() { 
2102          return this.query != null && !this.query.isEmpty();
2103        }
2104
2105        /**
2106         * @param value {@link #query} (The query parameters for a query-type entities.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value
2107         */
2108        public AuditEventEntityComponent setQueryElement(Base64BinaryType value) { 
2109          this.query = value;
2110          return this;
2111        }
2112
2113        /**
2114         * @return The query parameters for a query-type entities.
2115         */
2116        public byte[] getQuery() { 
2117          return this.query == null ? null : this.query.getValue();
2118        }
2119
2120        /**
2121         * @param value The query parameters for a query-type entities.
2122         */
2123        public AuditEventEntityComponent setQuery(byte[] value) { 
2124          if (value == null)
2125            this.query = null;
2126          else {
2127            if (this.query == null)
2128              this.query = new Base64BinaryType();
2129            this.query.setValue(value);
2130          }
2131          return this;
2132        }
2133
2134        /**
2135         * @return {@link #detail} (Additional Information about the entity.)
2136         */
2137        public List<AuditEventEntityDetailComponent> getDetail() { 
2138          if (this.detail == null)
2139            this.detail = new ArrayList<AuditEventEntityDetailComponent>();
2140          return this.detail;
2141        }
2142
2143        public boolean hasDetail() { 
2144          if (this.detail == null)
2145            return false;
2146          for (AuditEventEntityDetailComponent item : this.detail)
2147            if (!item.isEmpty())
2148              return true;
2149          return false;
2150        }
2151
2152        /**
2153         * @return {@link #detail} (Additional Information about the entity.)
2154         */
2155    // syntactic sugar
2156        public AuditEventEntityDetailComponent addDetail() { //3
2157          AuditEventEntityDetailComponent t = new AuditEventEntityDetailComponent();
2158          if (this.detail == null)
2159            this.detail = new ArrayList<AuditEventEntityDetailComponent>();
2160          this.detail.add(t);
2161          return t;
2162        }
2163
2164    // syntactic sugar
2165        public AuditEventEntityComponent addDetail(AuditEventEntityDetailComponent t) { //3
2166          if (t == null)
2167            return this;
2168          if (this.detail == null)
2169            this.detail = new ArrayList<AuditEventEntityDetailComponent>();
2170          this.detail.add(t);
2171          return this;
2172        }
2173
2174        protected void listChildren(List<Property> childrenList) {
2175          super.listChildren(childrenList);
2176          childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the entity. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier));
2177          childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the entity. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference));
2178          childrenList.add(new Property("type", "Coding", "The type of the object that was involved in this audit event.", 0, java.lang.Integer.MAX_VALUE, type));
2179          childrenList.add(new Property("role", "Coding", "Code representing the role the entity played in the event being audited.", 0, java.lang.Integer.MAX_VALUE, role));
2180          childrenList.add(new Property("lifecycle", "Coding", "Identifier for the data life-cycle stage for the entity.", 0, java.lang.Integer.MAX_VALUE, lifecycle));
2181          childrenList.add(new Property("securityLabel", "Coding", "Denotes security labels for the identified entity.", 0, java.lang.Integer.MAX_VALUE, securityLabel));
2182          childrenList.add(new Property("name", "string", "A name of the entity in the audit event.", 0, java.lang.Integer.MAX_VALUE, name));
2183          childrenList.add(new Property("description", "string", "Text that describes the entity in more detail.", 0, java.lang.Integer.MAX_VALUE, description));
2184          childrenList.add(new Property("query", "base64Binary", "The query parameters for a query-type entities.", 0, java.lang.Integer.MAX_VALUE, query));
2185          childrenList.add(new Property("detail", "", "Additional Information about the entity.", 0, java.lang.Integer.MAX_VALUE, detail));
2186        }
2187
2188      @Override
2189      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2190        switch (hash) {
2191        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
2192        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2193        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
2194        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding
2195        case -302323862: /*lifecycle*/ return this.lifecycle == null ? new Base[0] : new Base[] {this.lifecycle}; // Coding
2196        case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // Coding
2197        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2198        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2199        case 107944136: /*query*/ return this.query == null ? new Base[0] : new Base[] {this.query}; // Base64BinaryType
2200        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AuditEventEntityDetailComponent
2201        default: return super.getProperty(hash, name, checkValid);
2202        }
2203
2204      }
2205
2206      @Override
2207      public void setProperty(int hash, String name, Base value) throws FHIRException {
2208        switch (hash) {
2209        case -1618432855: // identifier
2210          this.identifier = castToIdentifier(value); // Identifier
2211          break;
2212        case -925155509: // reference
2213          this.reference = castToReference(value); // Reference
2214          break;
2215        case 3575610: // type
2216          this.type = castToCoding(value); // Coding
2217          break;
2218        case 3506294: // role
2219          this.role = castToCoding(value); // Coding
2220          break;
2221        case -302323862: // lifecycle
2222          this.lifecycle = castToCoding(value); // Coding
2223          break;
2224        case -722296940: // securityLabel
2225          this.getSecurityLabel().add(castToCoding(value)); // Coding
2226          break;
2227        case 3373707: // name
2228          this.name = castToString(value); // StringType
2229          break;
2230        case -1724546052: // description
2231          this.description = castToString(value); // StringType
2232          break;
2233        case 107944136: // query
2234          this.query = castToBase64Binary(value); // Base64BinaryType
2235          break;
2236        case -1335224239: // detail
2237          this.getDetail().add((AuditEventEntityDetailComponent) value); // AuditEventEntityDetailComponent
2238          break;
2239        default: super.setProperty(hash, name, value);
2240        }
2241
2242      }
2243
2244      @Override
2245      public void setProperty(String name, Base value) throws FHIRException {
2246        if (name.equals("identifier"))
2247          this.identifier = castToIdentifier(value); // Identifier
2248        else if (name.equals("reference"))
2249          this.reference = castToReference(value); // Reference
2250        else if (name.equals("type"))
2251          this.type = castToCoding(value); // Coding
2252        else if (name.equals("role"))
2253          this.role = castToCoding(value); // Coding
2254        else if (name.equals("lifecycle"))
2255          this.lifecycle = castToCoding(value); // Coding
2256        else if (name.equals("securityLabel"))
2257          this.getSecurityLabel().add(castToCoding(value));
2258        else if (name.equals("name"))
2259          this.name = castToString(value); // StringType
2260        else if (name.equals("description"))
2261          this.description = castToString(value); // StringType
2262        else if (name.equals("query"))
2263          this.query = castToBase64Binary(value); // Base64BinaryType
2264        else if (name.equals("detail"))
2265          this.getDetail().add((AuditEventEntityDetailComponent) value);
2266        else
2267          super.setProperty(name, value);
2268      }
2269
2270      @Override
2271      public Base makeProperty(int hash, String name) throws FHIRException {
2272        switch (hash) {
2273        case -1618432855:  return getIdentifier(); // Identifier
2274        case -925155509:  return getReference(); // Reference
2275        case 3575610:  return getType(); // Coding
2276        case 3506294:  return getRole(); // Coding
2277        case -302323862:  return getLifecycle(); // Coding
2278        case -722296940:  return addSecurityLabel(); // Coding
2279        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
2280        case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType
2281        case 107944136: throw new FHIRException("Cannot make property query as it is not a complex type"); // Base64BinaryType
2282        case -1335224239:  return addDetail(); // AuditEventEntityDetailComponent
2283        default: return super.makeProperty(hash, name);
2284        }
2285
2286      }
2287
2288      @Override
2289      public Base addChild(String name) throws FHIRException {
2290        if (name.equals("identifier")) {
2291          this.identifier = new Identifier();
2292          return this.identifier;
2293        }
2294        else if (name.equals("reference")) {
2295          this.reference = new Reference();
2296          return this.reference;
2297        }
2298        else if (name.equals("type")) {
2299          this.type = new Coding();
2300          return this.type;
2301        }
2302        else if (name.equals("role")) {
2303          this.role = new Coding();
2304          return this.role;
2305        }
2306        else if (name.equals("lifecycle")) {
2307          this.lifecycle = new Coding();
2308          return this.lifecycle;
2309        }
2310        else if (name.equals("securityLabel")) {
2311          return addSecurityLabel();
2312        }
2313        else if (name.equals("name")) {
2314          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.name");
2315        }
2316        else if (name.equals("description")) {
2317          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.description");
2318        }
2319        else if (name.equals("query")) {
2320          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.query");
2321        }
2322        else if (name.equals("detail")) {
2323          return addDetail();
2324        }
2325        else
2326          return super.addChild(name);
2327      }
2328
2329      public AuditEventEntityComponent copy() {
2330        AuditEventEntityComponent dst = new AuditEventEntityComponent();
2331        copyValues(dst);
2332        dst.identifier = identifier == null ? null : identifier.copy();
2333        dst.reference = reference == null ? null : reference.copy();
2334        dst.type = type == null ? null : type.copy();
2335        dst.role = role == null ? null : role.copy();
2336        dst.lifecycle = lifecycle == null ? null : lifecycle.copy();
2337        if (securityLabel != null) {
2338          dst.securityLabel = new ArrayList<Coding>();
2339          for (Coding i : securityLabel)
2340            dst.securityLabel.add(i.copy());
2341        };
2342        dst.name = name == null ? null : name.copy();
2343        dst.description = description == null ? null : description.copy();
2344        dst.query = query == null ? null : query.copy();
2345        if (detail != null) {
2346          dst.detail = new ArrayList<AuditEventEntityDetailComponent>();
2347          for (AuditEventEntityDetailComponent i : detail)
2348            dst.detail.add(i.copy());
2349        };
2350        return dst;
2351      }
2352
2353      @Override
2354      public boolean equalsDeep(Base other) {
2355        if (!super.equalsDeep(other))
2356          return false;
2357        if (!(other instanceof AuditEventEntityComponent))
2358          return false;
2359        AuditEventEntityComponent o = (AuditEventEntityComponent) other;
2360        return compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true)
2361           && compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(lifecycle, o.lifecycle, true)
2362           && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true)
2363           && compareDeep(query, o.query, true) && compareDeep(detail, o.detail, true);
2364      }
2365
2366      @Override
2367      public boolean equalsShallow(Base other) {
2368        if (!super.equalsShallow(other))
2369          return false;
2370        if (!(other instanceof AuditEventEntityComponent))
2371          return false;
2372        AuditEventEntityComponent o = (AuditEventEntityComponent) other;
2373        return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(query, o.query, true)
2374          ;
2375      }
2376
2377      public boolean isEmpty() {
2378        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty())
2379           && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty())
2380           && (securityLabel == null || securityLabel.isEmpty()) && (name == null || name.isEmpty())
2381           && (description == null || description.isEmpty()) && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty())
2382          ;
2383      }
2384
2385  public String fhirType() {
2386    return "AuditEvent.entity";
2387
2388  }
2389
2390  }
2391
2392    @Block()
2393    public static class AuditEventEntityDetailComponent extends BackboneElement implements IBaseBackboneElement {
2394        /**
2395         * Name of the property.
2396         */
2397        @Child(name = "type", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2398        @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." )
2399        protected StringType type;
2400
2401        /**
2402         * Property value.
2403         */
2404        @Child(name = "value", type = {Base64BinaryType.class}, order=2, min=1, max=1, modifier=false, summary=false)
2405        @Description(shortDefinition="Property value", formalDefinition="Property value." )
2406        protected Base64BinaryType value;
2407
2408        private static final long serialVersionUID = 11139504L;
2409
2410    /**
2411     * Constructor
2412     */
2413      public AuditEventEntityDetailComponent() {
2414        super();
2415      }
2416
2417    /**
2418     * Constructor
2419     */
2420      public AuditEventEntityDetailComponent(StringType type, Base64BinaryType value) {
2421        super();
2422        this.type = type;
2423        this.value = value;
2424      }
2425
2426        /**
2427         * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2428         */
2429        public StringType getTypeElement() { 
2430          if (this.type == null)
2431            if (Configuration.errorOnAutoCreate())
2432              throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.type");
2433            else if (Configuration.doAutoCreate())
2434              this.type = new StringType(); // bb
2435          return this.type;
2436        }
2437
2438        public boolean hasTypeElement() { 
2439          return this.type != null && !this.type.isEmpty();
2440        }
2441
2442        public boolean hasType() { 
2443          return this.type != null && !this.type.isEmpty();
2444        }
2445
2446        /**
2447         * @param value {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2448         */
2449        public AuditEventEntityDetailComponent setTypeElement(StringType value) { 
2450          this.type = value;
2451          return this;
2452        }
2453
2454        /**
2455         * @return Name of the property.
2456         */
2457        public String getType() { 
2458          return this.type == null ? null : this.type.getValue();
2459        }
2460
2461        /**
2462         * @param value Name of the property.
2463         */
2464        public AuditEventEntityDetailComponent setType(String value) { 
2465            if (this.type == null)
2466              this.type = new StringType();
2467            this.type.setValue(value);
2468          return this;
2469        }
2470
2471        /**
2472         * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2473         */
2474        public Base64BinaryType getValueElement() { 
2475          if (this.value == null)
2476            if (Configuration.errorOnAutoCreate())
2477              throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.value");
2478            else if (Configuration.doAutoCreate())
2479              this.value = new Base64BinaryType(); // bb
2480          return this.value;
2481        }
2482
2483        public boolean hasValueElement() { 
2484          return this.value != null && !this.value.isEmpty();
2485        }
2486
2487        public boolean hasValue() { 
2488          return this.value != null && !this.value.isEmpty();
2489        }
2490
2491        /**
2492         * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2493         */
2494        public AuditEventEntityDetailComponent setValueElement(Base64BinaryType value) { 
2495          this.value = value;
2496          return this;
2497        }
2498
2499        /**
2500         * @return Property value.
2501         */
2502        public byte[] getValue() { 
2503          return this.value == null ? null : this.value.getValue();
2504        }
2505
2506        /**
2507         * @param value Property value.
2508         */
2509        public AuditEventEntityDetailComponent setValue(byte[] value) { 
2510            if (this.value == null)
2511              this.value = new Base64BinaryType();
2512            this.value.setValue(value);
2513          return this;
2514        }
2515
2516        protected void listChildren(List<Property> childrenList) {
2517          super.listChildren(childrenList);
2518          childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type));
2519          childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value));
2520        }
2521
2522      @Override
2523      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2524        switch (hash) {
2525        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType
2526        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Base64BinaryType
2527        default: return super.getProperty(hash, name, checkValid);
2528        }
2529
2530      }
2531
2532      @Override
2533      public void setProperty(int hash, String name, Base value) throws FHIRException {
2534        switch (hash) {
2535        case 3575610: // type
2536          this.type = castToString(value); // StringType
2537          break;
2538        case 111972721: // value
2539          this.value = castToBase64Binary(value); // Base64BinaryType
2540          break;
2541        default: super.setProperty(hash, name, value);
2542        }
2543
2544      }
2545
2546      @Override
2547      public void setProperty(String name, Base value) throws FHIRException {
2548        if (name.equals("type"))
2549          this.type = castToString(value); // StringType
2550        else if (name.equals("value"))
2551          this.value = castToBase64Binary(value); // Base64BinaryType
2552        else
2553          super.setProperty(name, value);
2554      }
2555
2556      @Override
2557      public Base makeProperty(int hash, String name) throws FHIRException {
2558        switch (hash) {
2559        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType
2560        case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // Base64BinaryType
2561        default: return super.makeProperty(hash, name);
2562        }
2563
2564      }
2565
2566      @Override
2567      public Base addChild(String name) throws FHIRException {
2568        if (name.equals("type")) {
2569          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type");
2570        }
2571        else if (name.equals("value")) {
2572          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.value");
2573        }
2574        else
2575          return super.addChild(name);
2576      }
2577
2578      public AuditEventEntityDetailComponent copy() {
2579        AuditEventEntityDetailComponent dst = new AuditEventEntityDetailComponent();
2580        copyValues(dst);
2581        dst.type = type == null ? null : type.copy();
2582        dst.value = value == null ? null : value.copy();
2583        return dst;
2584      }
2585
2586      @Override
2587      public boolean equalsDeep(Base other) {
2588        if (!super.equalsDeep(other))
2589          return false;
2590        if (!(other instanceof AuditEventEntityDetailComponent))
2591          return false;
2592        AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other;
2593        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
2594      }
2595
2596      @Override
2597      public boolean equalsShallow(Base other) {
2598        if (!super.equalsShallow(other))
2599          return false;
2600        if (!(other instanceof AuditEventEntityDetailComponent))
2601          return false;
2602        AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other;
2603        return compareValues(type, o.type, true) && compareValues(value, o.value, true);
2604      }
2605
2606      public boolean isEmpty() {
2607        return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty())
2608          ;
2609      }
2610
2611  public String fhirType() {
2612    return "AuditEvent.entity.detail";
2613
2614  }
2615
2616  }
2617
2618    /**
2619     * Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.
2620     */
2621    @Child(name = "type", type = {Coding.class}, order=0, min=1, max=1, modifier=false, summary=true)
2622    @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function." )
2623    protected Coding type;
2624
2625    /**
2626     * Identifier for the category of event.
2627     */
2628    @Child(name = "subtype", type = {Coding.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2629    @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." )
2630    protected List<Coding> subtype;
2631
2632    /**
2633     * Indicator for type of action performed during the event that generated the audit.
2634     */
2635    @Child(name = "action", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2636    @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." )
2637    protected Enumeration<AuditEventAction> action;
2638
2639    /**
2640     * The time when the event occurred on the source.
2641     */
2642    @Child(name = "recorded", type = {InstantType.class}, order=3, min=1, max=1, modifier=false, summary=true)
2643    @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." )
2644    protected InstantType recorded;
2645
2646    /**
2647     * Indicates whether the event succeeded or failed.
2648     */
2649    @Child(name = "outcome", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2650    @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." )
2651    protected Enumeration<AuditEventOutcome> outcome;
2652
2653    /**
2654     * A free text description of the outcome of the event.
2655     */
2656    @Child(name = "outcomeDesc", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2657    @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." )
2658    protected StringType outcomeDesc;
2659
2660    /**
2661     * The purposeOfUse (reason) that was used during the event being recorded.
2662     */
2663    @Child(name = "purposeOfEvent", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2664    @Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." )
2665    protected List<Coding> purposeOfEvent;
2666
2667    /**
2668     * An actor taking an active role in the event or activity that is logged.
2669     */
2670    @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2671    @Description(shortDefinition="Actor involved in the event", formalDefinition="An actor taking an active role in the event or activity that is logged." )
2672    protected List<AuditEventAgentComponent> agent;
2673
2674    /**
2675     * Application systems and processes.
2676     */
2677    @Child(name = "source", type = {}, order=8, min=1, max=1, modifier=false, summary=false)
2678    @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." )
2679    protected AuditEventSourceComponent source;
2680
2681    /**
2682     * Specific instances of data or objects that have been accessed.
2683     */
2684    @Child(name = "entity", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2685    @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." )
2686    protected List<AuditEventEntityComponent> entity;
2687
2688    private static final long serialVersionUID = 945153702L;
2689
2690  /**
2691   * Constructor
2692   */
2693    public AuditEvent() {
2694      super();
2695    }
2696
2697  /**
2698   * Constructor
2699   */
2700    public AuditEvent(Coding type, InstantType recorded, AuditEventSourceComponent source) {
2701      super();
2702      this.type = type;
2703      this.recorded = recorded;
2704      this.source = source;
2705    }
2706
2707    /**
2708     * @return {@link #type} (Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.)
2709     */
2710    public Coding getType() { 
2711      if (this.type == null)
2712        if (Configuration.errorOnAutoCreate())
2713          throw new Error("Attempt to auto-create AuditEvent.type");
2714        else if (Configuration.doAutoCreate())
2715          this.type = new Coding(); // cc
2716      return this.type;
2717    }
2718
2719    public boolean hasType() { 
2720      return this.type != null && !this.type.isEmpty();
2721    }
2722
2723    /**
2724     * @param value {@link #type} (Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.)
2725     */
2726    public AuditEvent setType(Coding value) { 
2727      this.type = value;
2728      return this;
2729    }
2730
2731    /**
2732     * @return {@link #subtype} (Identifier for the category of event.)
2733     */
2734    public List<Coding> getSubtype() { 
2735      if (this.subtype == null)
2736        this.subtype = new ArrayList<Coding>();
2737      return this.subtype;
2738    }
2739
2740    public boolean hasSubtype() { 
2741      if (this.subtype == null)
2742        return false;
2743      for (Coding item : this.subtype)
2744        if (!item.isEmpty())
2745          return true;
2746      return false;
2747    }
2748
2749    /**
2750     * @return {@link #subtype} (Identifier for the category of event.)
2751     */
2752    // syntactic sugar
2753    public Coding addSubtype() { //3
2754      Coding t = new Coding();
2755      if (this.subtype == null)
2756        this.subtype = new ArrayList<Coding>();
2757      this.subtype.add(t);
2758      return t;
2759    }
2760
2761    // syntactic sugar
2762    public AuditEvent addSubtype(Coding t) { //3
2763      if (t == null)
2764        return this;
2765      if (this.subtype == null)
2766        this.subtype = new ArrayList<Coding>();
2767      this.subtype.add(t);
2768      return this;
2769    }
2770
2771    /**
2772     * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value
2773     */
2774    public Enumeration<AuditEventAction> getActionElement() { 
2775      if (this.action == null)
2776        if (Configuration.errorOnAutoCreate())
2777          throw new Error("Attempt to auto-create AuditEvent.action");
2778        else if (Configuration.doAutoCreate())
2779          this.action = new Enumeration<AuditEventAction>(new AuditEventActionEnumFactory()); // bb
2780      return this.action;
2781    }
2782
2783    public boolean hasActionElement() { 
2784      return this.action != null && !this.action.isEmpty();
2785    }
2786
2787    public boolean hasAction() { 
2788      return this.action != null && !this.action.isEmpty();
2789    }
2790
2791    /**
2792     * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value
2793     */
2794    public AuditEvent setActionElement(Enumeration<AuditEventAction> value) { 
2795      this.action = value;
2796      return this;
2797    }
2798
2799    /**
2800     * @return Indicator for type of action performed during the event that generated the audit.
2801     */
2802    public AuditEventAction getAction() { 
2803      return this.action == null ? null : this.action.getValue();
2804    }
2805
2806    /**
2807     * @param value Indicator for type of action performed during the event that generated the audit.
2808     */
2809    public AuditEvent setAction(AuditEventAction value) { 
2810      if (value == null)
2811        this.action = null;
2812      else {
2813        if (this.action == null)
2814          this.action = new Enumeration<AuditEventAction>(new AuditEventActionEnumFactory());
2815        this.action.setValue(value);
2816      }
2817      return this;
2818    }
2819
2820    /**
2821     * @return {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
2822     */
2823    public InstantType getRecordedElement() { 
2824      if (this.recorded == null)
2825        if (Configuration.errorOnAutoCreate())
2826          throw new Error("Attempt to auto-create AuditEvent.recorded");
2827        else if (Configuration.doAutoCreate())
2828          this.recorded = new InstantType(); // bb
2829      return this.recorded;
2830    }
2831
2832    public boolean hasRecordedElement() { 
2833      return this.recorded != null && !this.recorded.isEmpty();
2834    }
2835
2836    public boolean hasRecorded() { 
2837      return this.recorded != null && !this.recorded.isEmpty();
2838    }
2839
2840    /**
2841     * @param value {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
2842     */
2843    public AuditEvent setRecordedElement(InstantType value) { 
2844      this.recorded = value;
2845      return this;
2846    }
2847
2848    /**
2849     * @return The time when the event occurred on the source.
2850     */
2851    public Date getRecorded() { 
2852      return this.recorded == null ? null : this.recorded.getValue();
2853    }
2854
2855    /**
2856     * @param value The time when the event occurred on the source.
2857     */
2858    public AuditEvent setRecorded(Date value) { 
2859        if (this.recorded == null)
2860          this.recorded = new InstantType();
2861        this.recorded.setValue(value);
2862      return this;
2863    }
2864
2865    /**
2866     * @return {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
2867     */
2868    public Enumeration<AuditEventOutcome> getOutcomeElement() { 
2869      if (this.outcome == null)
2870        if (Configuration.errorOnAutoCreate())
2871          throw new Error("Attempt to auto-create AuditEvent.outcome");
2872        else if (Configuration.doAutoCreate())
2873          this.outcome = new Enumeration<AuditEventOutcome>(new AuditEventOutcomeEnumFactory()); // bb
2874      return this.outcome;
2875    }
2876
2877    public boolean hasOutcomeElement() { 
2878      return this.outcome != null && !this.outcome.isEmpty();
2879    }
2880
2881    public boolean hasOutcome() { 
2882      return this.outcome != null && !this.outcome.isEmpty();
2883    }
2884
2885    /**
2886     * @param value {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
2887     */
2888    public AuditEvent setOutcomeElement(Enumeration<AuditEventOutcome> value) { 
2889      this.outcome = value;
2890      return this;
2891    }
2892
2893    /**
2894     * @return Indicates whether the event succeeded or failed.
2895     */
2896    public AuditEventOutcome getOutcome() { 
2897      return this.outcome == null ? null : this.outcome.getValue();
2898    }
2899
2900    /**
2901     * @param value Indicates whether the event succeeded or failed.
2902     */
2903    public AuditEvent setOutcome(AuditEventOutcome value) { 
2904      if (value == null)
2905        this.outcome = null;
2906      else {
2907        if (this.outcome == null)
2908          this.outcome = new Enumeration<AuditEventOutcome>(new AuditEventOutcomeEnumFactory());
2909        this.outcome.setValue(value);
2910      }
2911      return this;
2912    }
2913
2914    /**
2915     * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value
2916     */
2917    public StringType getOutcomeDescElement() { 
2918      if (this.outcomeDesc == null)
2919        if (Configuration.errorOnAutoCreate())
2920          throw new Error("Attempt to auto-create AuditEvent.outcomeDesc");
2921        else if (Configuration.doAutoCreate())
2922          this.outcomeDesc = new StringType(); // bb
2923      return this.outcomeDesc;
2924    }
2925
2926    public boolean hasOutcomeDescElement() { 
2927      return this.outcomeDesc != null && !this.outcomeDesc.isEmpty();
2928    }
2929
2930    public boolean hasOutcomeDesc() { 
2931      return this.outcomeDesc != null && !this.outcomeDesc.isEmpty();
2932    }
2933
2934    /**
2935     * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value
2936     */
2937    public AuditEvent setOutcomeDescElement(StringType value) { 
2938      this.outcomeDesc = value;
2939      return this;
2940    }
2941
2942    /**
2943     * @return A free text description of the outcome of the event.
2944     */
2945    public String getOutcomeDesc() { 
2946      return this.outcomeDesc == null ? null : this.outcomeDesc.getValue();
2947    }
2948
2949    /**
2950     * @param value A free text description of the outcome of the event.
2951     */
2952    public AuditEvent setOutcomeDesc(String value) { 
2953      if (Utilities.noString(value))
2954        this.outcomeDesc = null;
2955      else {
2956        if (this.outcomeDesc == null)
2957          this.outcomeDesc = new StringType();
2958        this.outcomeDesc.setValue(value);
2959      }
2960      return this;
2961    }
2962
2963    /**
2964     * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.)
2965     */
2966    public List<Coding> getPurposeOfEvent() { 
2967      if (this.purposeOfEvent == null)
2968        this.purposeOfEvent = new ArrayList<Coding>();
2969      return this.purposeOfEvent;
2970    }
2971
2972    public boolean hasPurposeOfEvent() { 
2973      if (this.purposeOfEvent == null)
2974        return false;
2975      for (Coding item : this.purposeOfEvent)
2976        if (!item.isEmpty())
2977          return true;
2978      return false;
2979    }
2980
2981    /**
2982     * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.)
2983     */
2984    // syntactic sugar
2985    public Coding addPurposeOfEvent() { //3
2986      Coding t = new Coding();
2987      if (this.purposeOfEvent == null)
2988        this.purposeOfEvent = new ArrayList<Coding>();
2989      this.purposeOfEvent.add(t);
2990      return t;
2991    }
2992
2993    // syntactic sugar
2994    public AuditEvent addPurposeOfEvent(Coding t) { //3
2995      if (t == null)
2996        return this;
2997      if (this.purposeOfEvent == null)
2998        this.purposeOfEvent = new ArrayList<Coding>();
2999      this.purposeOfEvent.add(t);
3000      return this;
3001    }
3002
3003    /**
3004     * @return {@link #agent} (An actor taking an active role in the event or activity that is logged.)
3005     */
3006    public List<AuditEventAgentComponent> getAgent() { 
3007      if (this.agent == null)
3008        this.agent = new ArrayList<AuditEventAgentComponent>();
3009      return this.agent;
3010    }
3011
3012    public boolean hasAgent() { 
3013      if (this.agent == null)
3014        return false;
3015      for (AuditEventAgentComponent item : this.agent)
3016        if (!item.isEmpty())
3017          return true;
3018      return false;
3019    }
3020
3021    /**
3022     * @return {@link #agent} (An actor taking an active role in the event or activity that is logged.)
3023     */
3024    // syntactic sugar
3025    public AuditEventAgentComponent addAgent() { //3
3026      AuditEventAgentComponent t = new AuditEventAgentComponent();
3027      if (this.agent == null)
3028        this.agent = new ArrayList<AuditEventAgentComponent>();
3029      this.agent.add(t);
3030      return t;
3031    }
3032
3033    // syntactic sugar
3034    public AuditEvent addAgent(AuditEventAgentComponent t) { //3
3035      if (t == null)
3036        return this;
3037      if (this.agent == null)
3038        this.agent = new ArrayList<AuditEventAgentComponent>();
3039      this.agent.add(t);
3040      return this;
3041    }
3042
3043    /**
3044     * @return {@link #source} (Application systems and processes.)
3045     */
3046    public AuditEventSourceComponent getSource() { 
3047      if (this.source == null)
3048        if (Configuration.errorOnAutoCreate())
3049          throw new Error("Attempt to auto-create AuditEvent.source");
3050        else if (Configuration.doAutoCreate())
3051          this.source = new AuditEventSourceComponent(); // cc
3052      return this.source;
3053    }
3054
3055    public boolean hasSource() { 
3056      return this.source != null && !this.source.isEmpty();
3057    }
3058
3059    /**
3060     * @param value {@link #source} (Application systems and processes.)
3061     */
3062    public AuditEvent setSource(AuditEventSourceComponent value) { 
3063      this.source = value;
3064      return this;
3065    }
3066
3067    /**
3068     * @return {@link #entity} (Specific instances of data or objects that have been accessed.)
3069     */
3070    public List<AuditEventEntityComponent> getEntity() { 
3071      if (this.entity == null)
3072        this.entity = new ArrayList<AuditEventEntityComponent>();
3073      return this.entity;
3074    }
3075
3076    public boolean hasEntity() { 
3077      if (this.entity == null)
3078        return false;
3079      for (AuditEventEntityComponent item : this.entity)
3080        if (!item.isEmpty())
3081          return true;
3082      return false;
3083    }
3084
3085    /**
3086     * @return {@link #entity} (Specific instances of data or objects that have been accessed.)
3087     */
3088    // syntactic sugar
3089    public AuditEventEntityComponent addEntity() { //3
3090      AuditEventEntityComponent t = new AuditEventEntityComponent();
3091      if (this.entity == null)
3092        this.entity = new ArrayList<AuditEventEntityComponent>();
3093      this.entity.add(t);
3094      return t;
3095    }
3096
3097    // syntactic sugar
3098    public AuditEvent addEntity(AuditEventEntityComponent t) { //3
3099      if (t == null)
3100        return this;
3101      if (this.entity == null)
3102        this.entity = new ArrayList<AuditEventEntityComponent>();
3103      this.entity.add(t);
3104      return this;
3105    }
3106
3107      protected void listChildren(List<Property> childrenList) {
3108        super.listChildren(childrenList);
3109        childrenList.add(new Property("type", "Coding", "Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.", 0, java.lang.Integer.MAX_VALUE, type));
3110        childrenList.add(new Property("subtype", "Coding", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype));
3111        childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action));
3112        childrenList.add(new Property("recorded", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, recorded));
3113        childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome));
3114        childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc));
3115        childrenList.add(new Property("purposeOfEvent", "Coding", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent));
3116        childrenList.add(new Property("agent", "", "An actor taking an active role in the event or activity that is logged.", 0, java.lang.Integer.MAX_VALUE, agent));
3117        childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source));
3118        childrenList.add(new Property("entity", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, entity));
3119      }
3120
3121      @Override
3122      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3123        switch (hash) {
3124        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
3125        case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : this.subtype.toArray(new Base[this.subtype.size()]); // Coding
3126        case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration<AuditEventAction>
3127        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType
3128        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<AuditEventOutcome>
3129        case 1062502659: /*outcomeDesc*/ return this.outcomeDesc == null ? new Base[0] : new Base[] {this.outcomeDesc}; // StringType
3130        case -341917691: /*purposeOfEvent*/ return this.purposeOfEvent == null ? new Base[0] : this.purposeOfEvent.toArray(new Base[this.purposeOfEvent.size()]); // Coding
3131        case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AuditEventAgentComponent
3132        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // AuditEventSourceComponent
3133        case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // AuditEventEntityComponent
3134        default: return super.getProperty(hash, name, checkValid);
3135        }
3136
3137      }
3138
3139      @Override
3140      public void setProperty(int hash, String name, Base value) throws FHIRException {
3141        switch (hash) {
3142        case 3575610: // type
3143          this.type = castToCoding(value); // Coding
3144          break;
3145        case -1867567750: // subtype
3146          this.getSubtype().add(castToCoding(value)); // Coding
3147          break;
3148        case -1422950858: // action
3149          this.action = new AuditEventActionEnumFactory().fromType(value); // Enumeration<AuditEventAction>
3150          break;
3151        case -799233872: // recorded
3152          this.recorded = castToInstant(value); // InstantType
3153          break;
3154        case -1106507950: // outcome
3155          this.outcome = new AuditEventOutcomeEnumFactory().fromType(value); // Enumeration<AuditEventOutcome>
3156          break;
3157        case 1062502659: // outcomeDesc
3158          this.outcomeDesc = castToString(value); // StringType
3159          break;
3160        case -341917691: // purposeOfEvent
3161          this.getPurposeOfEvent().add(castToCoding(value)); // Coding
3162          break;
3163        case 92750597: // agent
3164          this.getAgent().add((AuditEventAgentComponent) value); // AuditEventAgentComponent
3165          break;
3166        case -896505829: // source
3167          this.source = (AuditEventSourceComponent) value; // AuditEventSourceComponent
3168          break;
3169        case -1298275357: // entity
3170          this.getEntity().add((AuditEventEntityComponent) value); // AuditEventEntityComponent
3171          break;
3172        default: super.setProperty(hash, name, value);
3173        }
3174
3175      }
3176
3177      @Override
3178      public void setProperty(String name, Base value) throws FHIRException {
3179        if (name.equals("type"))
3180          this.type = castToCoding(value); // Coding
3181        else if (name.equals("subtype"))
3182          this.getSubtype().add(castToCoding(value));
3183        else if (name.equals("action"))
3184          this.action = new AuditEventActionEnumFactory().fromType(value); // Enumeration<AuditEventAction>
3185        else if (name.equals("recorded"))
3186          this.recorded = castToInstant(value); // InstantType
3187        else if (name.equals("outcome"))
3188          this.outcome = new AuditEventOutcomeEnumFactory().fromType(value); // Enumeration<AuditEventOutcome>
3189        else if (name.equals("outcomeDesc"))
3190          this.outcomeDesc = castToString(value); // StringType
3191        else if (name.equals("purposeOfEvent"))
3192          this.getPurposeOfEvent().add(castToCoding(value));
3193        else if (name.equals("agent"))
3194          this.getAgent().add((AuditEventAgentComponent) value);
3195        else if (name.equals("source"))
3196          this.source = (AuditEventSourceComponent) value; // AuditEventSourceComponent
3197        else if (name.equals("entity"))
3198          this.getEntity().add((AuditEventEntityComponent) value);
3199        else
3200          super.setProperty(name, value);
3201      }
3202
3203      @Override
3204      public Base makeProperty(int hash, String name) throws FHIRException {
3205        switch (hash) {
3206        case 3575610:  return getType(); // Coding
3207        case -1867567750:  return addSubtype(); // Coding
3208        case -1422950858: throw new FHIRException("Cannot make property action as it is not a complex type"); // Enumeration<AuditEventAction>
3209        case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType
3210        case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration<AuditEventOutcome>
3211        case 1062502659: throw new FHIRException("Cannot make property outcomeDesc as it is not a complex type"); // StringType
3212        case -341917691:  return addPurposeOfEvent(); // Coding
3213        case 92750597:  return addAgent(); // AuditEventAgentComponent
3214        case -896505829:  return getSource(); // AuditEventSourceComponent
3215        case -1298275357:  return addEntity(); // AuditEventEntityComponent
3216        default: return super.makeProperty(hash, name);
3217        }
3218
3219      }
3220
3221      @Override
3222      public Base addChild(String name) throws FHIRException {
3223        if (name.equals("type")) {
3224          this.type = new Coding();
3225          return this.type;
3226        }
3227        else if (name.equals("subtype")) {
3228          return addSubtype();
3229        }
3230        else if (name.equals("action")) {
3231          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.action");
3232        }
3233        else if (name.equals("recorded")) {
3234          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.recorded");
3235        }
3236        else if (name.equals("outcome")) {
3237          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.outcome");
3238        }
3239        else if (name.equals("outcomeDesc")) {
3240          throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.outcomeDesc");
3241        }
3242        else if (name.equals("purposeOfEvent")) {
3243          return addPurposeOfEvent();
3244        }
3245        else if (name.equals("agent")) {
3246          return addAgent();
3247        }
3248        else if (name.equals("source")) {
3249          this.source = new AuditEventSourceComponent();
3250          return this.source;
3251        }
3252        else if (name.equals("entity")) {
3253          return addEntity();
3254        }
3255        else
3256          return super.addChild(name);
3257      }
3258
3259  public String fhirType() {
3260    return "AuditEvent";
3261
3262  }
3263
3264      public AuditEvent copy() {
3265        AuditEvent dst = new AuditEvent();
3266        copyValues(dst);
3267        dst.type = type == null ? null : type.copy();
3268        if (subtype != null) {
3269          dst.subtype = new ArrayList<Coding>();
3270          for (Coding i : subtype)
3271            dst.subtype.add(i.copy());
3272        };
3273        dst.action = action == null ? null : action.copy();
3274        dst.recorded = recorded == null ? null : recorded.copy();
3275        dst.outcome = outcome == null ? null : outcome.copy();
3276        dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy();
3277        if (purposeOfEvent != null) {
3278          dst.purposeOfEvent = new ArrayList<Coding>();
3279          for (Coding i : purposeOfEvent)
3280            dst.purposeOfEvent.add(i.copy());
3281        };
3282        if (agent != null) {
3283          dst.agent = new ArrayList<AuditEventAgentComponent>();
3284          for (AuditEventAgentComponent i : agent)
3285            dst.agent.add(i.copy());
3286        };
3287        dst.source = source == null ? null : source.copy();
3288        if (entity != null) {
3289          dst.entity = new ArrayList<AuditEventEntityComponent>();
3290          for (AuditEventEntityComponent i : entity)
3291            dst.entity.add(i.copy());
3292        };
3293        return dst;
3294      }
3295
3296      protected AuditEvent typedCopy() {
3297        return copy();
3298      }
3299
3300      @Override
3301      public boolean equalsDeep(Base other) {
3302        if (!super.equalsDeep(other))
3303          return false;
3304        if (!(other instanceof AuditEvent))
3305          return false;
3306        AuditEvent o = (AuditEvent) other;
3307        return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(action, o.action, true)
3308           && compareDeep(recorded, o.recorded, true) && compareDeep(outcome, o.outcome, true) && compareDeep(outcomeDesc, o.outcomeDesc, true)
3309           && compareDeep(purposeOfEvent, o.purposeOfEvent, true) && compareDeep(agent, o.agent, true) && compareDeep(source, o.source, true)
3310           && compareDeep(entity, o.entity, true);
3311      }
3312
3313      @Override
3314      public boolean equalsShallow(Base other) {
3315        if (!super.equalsShallow(other))
3316          return false;
3317        if (!(other instanceof AuditEvent))
3318          return false;
3319        AuditEvent o = (AuditEvent) other;
3320        return compareValues(action, o.action, true) && compareValues(recorded, o.recorded, true) && compareValues(outcome, o.outcome, true)
3321           && compareValues(outcomeDesc, o.outcomeDesc, true);
3322      }
3323
3324      public boolean isEmpty() {
3325        return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty())
3326           && (action == null || action.isEmpty()) && (recorded == null || recorded.isEmpty()) && (outcome == null || outcome.isEmpty())
3327           && (outcomeDesc == null || outcomeDesc.isEmpty()) && (purposeOfEvent == null || purposeOfEvent.isEmpty())
3328           && (agent == null || agent.isEmpty()) && (source == null || source.isEmpty()) && (entity == null || entity.isEmpty())
3329          ;
3330      }
3331
3332  @Override
3333  public ResourceType getResourceType() {
3334    return ResourceType.AuditEvent;
3335   }
3336
3337 /**
3338   * Search parameter: <b>site</b>
3339   * <p>
3340   * Description: <b>Logical source location within the enterprise</b><br>
3341   * Type: <b>token</b><br>
3342   * Path: <b>AuditEvent.source.site</b><br>
3343   * </p>
3344   */
3345  @SearchParamDefinition(name="site", path="AuditEvent.source.site", description="Logical source location within the enterprise", type="token" )
3346  public static final String SP_SITE = "site";
3347 /**
3348   * <b>Fluent Client</b> search parameter constant for <b>site</b>
3349   * <p>
3350   * Description: <b>Logical source location within the enterprise</b><br>
3351   * Type: <b>token</b><br>
3352   * Path: <b>AuditEvent.source.site</b><br>
3353   * </p>
3354   */
3355  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SITE);
3356
3357 /**
3358   * Search parameter: <b>entity</b>
3359   * <p>
3360   * Description: <b>Specific instance of resource (e.g. versioned)</b><br>
3361   * Type: <b>reference</b><br>
3362   * Path: <b>AuditEvent.entity.reference</b><br>
3363   * </p>
3364   */
3365  @SearchParamDefinition(name="entity", path="AuditEvent.entity.reference", description="Specific instance of resource (e.g. versioned)", type="reference" )
3366  public static final String SP_ENTITY = "entity";
3367 /**
3368   * <b>Fluent Client</b> search parameter constant for <b>entity</b>
3369   * <p>
3370   * Description: <b>Specific instance of resource (e.g. versioned)</b><br>
3371   * Type: <b>reference</b><br>
3372   * Path: <b>AuditEvent.entity.reference</b><br>
3373   * </p>
3374   */
3375  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTITY);
3376
3377/**
3378   * Constant for fluent queries to be used to add include statements. Specifies
3379   * the path value of "<b>AuditEvent:entity</b>".
3380   */
3381  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTITY = new ca.uhn.fhir.model.api.Include("AuditEvent:entity").toLocked();
3382
3383 /**
3384   * Search parameter: <b>entity-type</b>
3385   * <p>
3386   * Description: <b>Type of object involved</b><br>
3387   * Type: <b>token</b><br>
3388   * Path: <b>AuditEvent.entity.type</b><br>
3389   * </p>
3390   */
3391  @SearchParamDefinition(name="entity-type", path="AuditEvent.entity.type", description="Type of object involved", type="token" )
3392  public static final String SP_ENTITY_TYPE = "entity-type";
3393 /**
3394   * <b>Fluent Client</b> search parameter constant for <b>entity-type</b>
3395   * <p>
3396   * Description: <b>Type of object involved</b><br>
3397   * Type: <b>token</b><br>
3398   * Path: <b>AuditEvent.entity.type</b><br>
3399   * </p>
3400   */
3401  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE);
3402
3403 /**
3404   * Search parameter: <b>type</b>
3405   * <p>
3406   * Description: <b>Type/identifier of event</b><br>
3407   * Type: <b>token</b><br>
3408   * Path: <b>AuditEvent.type</b><br>
3409   * </p>
3410   */
3411  @SearchParamDefinition(name="type", path="AuditEvent.type", description="Type/identifier of event", type="token" )
3412  public static final String SP_TYPE = "type";
3413 /**
3414   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3415   * <p>
3416   * Description: <b>Type/identifier of event</b><br>
3417   * Type: <b>token</b><br>
3418   * Path: <b>AuditEvent.type</b><br>
3419   * </p>
3420   */
3421  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3422
3423 /**
3424   * Search parameter: <b>date</b>
3425   * <p>
3426   * Description: <b>Time when the event occurred on source</b><br>
3427   * Type: <b>date</b><br>
3428   * Path: <b>AuditEvent.recorded</b><br>
3429   * </p>
3430   */
3431  @SearchParamDefinition(name="date", path="AuditEvent.recorded", description="Time when the event occurred on source", type="date" )
3432  public static final String SP_DATE = "date";
3433 /**
3434   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3435   * <p>
3436   * Description: <b>Time when the event occurred on source</b><br>
3437   * Type: <b>date</b><br>
3438   * Path: <b>AuditEvent.recorded</b><br>
3439   * </p>
3440   */
3441  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3442
3443 /**
3444   * Search parameter: <b>agent</b>
3445   * <p>
3446   * Description: <b>Direct reference to resource</b><br>
3447   * Type: <b>reference</b><br>
3448   * Path: <b>AuditEvent.agent.reference</b><br>
3449   * </p>
3450   */
3451  @SearchParamDefinition(name="agent", path="AuditEvent.agent.reference", description="Direct reference to resource", type="reference" )
3452  public static final String SP_AGENT = "agent";
3453 /**
3454   * <b>Fluent Client</b> search parameter constant for <b>agent</b>
3455   * <p>
3456   * Description: <b>Direct reference to resource</b><br>
3457   * Type: <b>reference</b><br>
3458   * Path: <b>AuditEvent.agent.reference</b><br>
3459   * </p>
3460   */
3461  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT);
3462
3463/**
3464   * Constant for fluent queries to be used to add include statements. Specifies
3465   * the path value of "<b>AuditEvent:agent</b>".
3466   */
3467  public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("AuditEvent:agent").toLocked();
3468
3469 /**
3470   * Search parameter: <b>agent-name</b>
3471   * <p>
3472   * Description: <b>Human-meaningful name for the agent</b><br>
3473   * Type: <b>string</b><br>
3474   * Path: <b>AuditEvent.agent.name</b><br>
3475   * </p>
3476   */
3477  @SearchParamDefinition(name="agent-name", path="AuditEvent.agent.name", description="Human-meaningful name for the agent", type="string" )
3478  public static final String SP_AGENT_NAME = "agent-name";
3479 /**
3480   * <b>Fluent Client</b> search parameter constant for <b>agent-name</b>
3481   * <p>
3482   * Description: <b>Human-meaningful name for the agent</b><br>
3483   * Type: <b>string</b><br>
3484   * Path: <b>AuditEvent.agent.name</b><br>
3485   * </p>
3486   */
3487  public static final ca.uhn.fhir.rest.gclient.StringClientParam AGENT_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_AGENT_NAME);
3488
3489 /**
3490   * Search parameter: <b>entity-id</b>
3491   * <p>
3492   * Description: <b>Specific instance of object (e.g. versioned)</b><br>
3493   * Type: <b>token</b><br>
3494   * Path: <b>AuditEvent.entity.identifier</b><br>
3495   * </p>
3496   */
3497  @SearchParamDefinition(name="entity-id", path="AuditEvent.entity.identifier", description="Specific instance of object (e.g. versioned)", type="token" )
3498  public static final String SP_ENTITY_ID = "entity-id";
3499 /**
3500   * <b>Fluent Client</b> search parameter constant for <b>entity-id</b>
3501   * <p>
3502   * Description: <b>Specific instance of object (e.g. versioned)</b><br>
3503   * Type: <b>token</b><br>
3504   * Path: <b>AuditEvent.entity.identifier</b><br>
3505   * </p>
3506   */
3507  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_ID);
3508
3509 /**
3510   * Search parameter: <b>patient</b>
3511   * <p>
3512   * Description: <b>Direct reference to resource</b><br>
3513   * Type: <b>reference</b><br>
3514   * Path: <b>AuditEvent.agent.reference, AuditEvent.entity.reference</b><br>
3515   * </p>
3516   */
3517  @SearchParamDefinition(name="patient", path="AuditEvent.agent.reference | AuditEvent.entity.reference", description="Direct reference to resource", type="reference" )
3518  public static final String SP_PATIENT = "patient";
3519 /**
3520   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3521   * <p>
3522   * Description: <b>Direct reference to resource</b><br>
3523   * Type: <b>reference</b><br>
3524   * Path: <b>AuditEvent.agent.reference, AuditEvent.entity.reference</b><br>
3525   * </p>
3526   */
3527  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3528
3529/**
3530   * Constant for fluent queries to be used to add include statements. Specifies
3531   * the path value of "<b>AuditEvent:patient</b>".
3532   */
3533  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AuditEvent:patient").toLocked();
3534
3535 /**
3536   * Search parameter: <b>source</b>
3537   * <p>
3538   * Description: <b>The identity of source detecting the event</b><br>
3539   * Type: <b>token</b><br>
3540   * Path: <b>AuditEvent.source.identifier</b><br>
3541   * </p>
3542   */
3543  @SearchParamDefinition(name="source", path="AuditEvent.source.identifier", description="The identity of source detecting the event", type="token" )
3544  public static final String SP_SOURCE = "source";
3545 /**
3546   * <b>Fluent Client</b> search parameter constant for <b>source</b>
3547   * <p>
3548   * Description: <b>The identity of source detecting the event</b><br>
3549   * Type: <b>token</b><br>
3550   * Path: <b>AuditEvent.source.identifier</b><br>
3551   * </p>
3552   */
3553  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SOURCE);
3554
3555 /**
3556   * Search parameter: <b>altid</b>
3557   * <p>
3558   * Description: <b>Alternative User id e.g. authentication</b><br>
3559   * Type: <b>token</b><br>
3560   * Path: <b>AuditEvent.agent.altId</b><br>
3561   * </p>
3562   */
3563  @SearchParamDefinition(name="altid", path="AuditEvent.agent.altId", description="Alternative User id e.g. authentication", type="token" )
3564  public static final String SP_ALTID = "altid";
3565 /**
3566   * <b>Fluent Client</b> search parameter constant for <b>altid</b>
3567   * <p>
3568   * Description: <b>Alternative User id e.g. authentication</b><br>
3569   * Type: <b>token</b><br>
3570   * Path: <b>AuditEvent.agent.altId</b><br>
3571   * </p>
3572   */
3573  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ALTID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ALTID);
3574
3575 /**
3576   * Search parameter: <b>address</b>
3577   * <p>
3578   * Description: <b>Identifier for the network access point of the user device</b><br>
3579   * Type: <b>token</b><br>
3580   * Path: <b>AuditEvent.agent.network.address</b><br>
3581   * </p>
3582   */
3583  @SearchParamDefinition(name="address", path="AuditEvent.agent.network.address", description="Identifier for the network access point of the user device", type="token" )
3584  public static final String SP_ADDRESS = "address";
3585 /**
3586   * <b>Fluent Client</b> search parameter constant for <b>address</b>
3587   * <p>
3588   * Description: <b>Identifier for the network access point of the user device</b><br>
3589   * Type: <b>token</b><br>
3590   * Path: <b>AuditEvent.agent.network.address</b><br>
3591   * </p>
3592   */
3593  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS);
3594
3595 /**
3596   * Search parameter: <b>subtype</b>
3597   * <p>
3598   * Description: <b>More specific type/id for the event</b><br>
3599   * Type: <b>token</b><br>
3600   * Path: <b>AuditEvent.subtype</b><br>
3601   * </p>
3602   */
3603  @SearchParamDefinition(name="subtype", path="AuditEvent.subtype", description="More specific type/id for the event", type="token" )
3604  public static final String SP_SUBTYPE = "subtype";
3605 /**
3606   * <b>Fluent Client</b> search parameter constant for <b>subtype</b>
3607   * <p>
3608   * Description: <b>More specific type/id for the event</b><br>
3609   * Type: <b>token</b><br>
3610   * Path: <b>AuditEvent.subtype</b><br>
3611   * </p>
3612   */
3613  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBTYPE);
3614
3615 /**
3616   * Search parameter: <b>action</b>
3617   * <p>
3618   * Description: <b>Type of action performed during the event</b><br>
3619   * Type: <b>token</b><br>
3620   * Path: <b>AuditEvent.action</b><br>
3621   * </p>
3622   */
3623  @SearchParamDefinition(name="action", path="AuditEvent.action", description="Type of action performed during the event", type="token" )
3624  public static final String SP_ACTION = "action";
3625 /**
3626   * <b>Fluent Client</b> search parameter constant for <b>action</b>
3627   * <p>
3628   * Description: <b>Type of action performed during the event</b><br>
3629   * Type: <b>token</b><br>
3630   * Path: <b>AuditEvent.action</b><br>
3631   * </p>
3632   */
3633  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION);
3634
3635 /**
3636   * Search parameter: <b>policy</b>
3637   * <p>
3638   * Description: <b>Policy that authorized event</b><br>
3639   * Type: <b>uri</b><br>
3640   * Path: <b>AuditEvent.agent.policy</b><br>
3641   * </p>
3642   */
3643  @SearchParamDefinition(name="policy", path="AuditEvent.agent.policy", description="Policy that authorized event", type="uri" )
3644  public static final String SP_POLICY = "policy";
3645 /**
3646   * <b>Fluent Client</b> search parameter constant for <b>policy</b>
3647   * <p>
3648   * Description: <b>Policy that authorized event</b><br>
3649   * Type: <b>uri</b><br>
3650   * Path: <b>AuditEvent.agent.policy</b><br>
3651   * </p>
3652   */
3653  public static final ca.uhn.fhir.rest.gclient.UriClientParam POLICY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_POLICY);
3654
3655 /**
3656   * Search parameter: <b>user</b>
3657   * <p>
3658   * Description: <b>Unique identifier for the user</b><br>
3659   * Type: <b>token</b><br>
3660   * Path: <b>AuditEvent.agent.userId</b><br>
3661   * </p>
3662   */
3663  @SearchParamDefinition(name="user", path="AuditEvent.agent.userId", description="Unique identifier for the user", type="token" )
3664  public static final String SP_USER = "user";
3665 /**
3666   * <b>Fluent Client</b> search parameter constant for <b>user</b>
3667   * <p>
3668   * Description: <b>Unique identifier for the user</b><br>
3669   * Type: <b>token</b><br>
3670   * Path: <b>AuditEvent.agent.userId</b><br>
3671   * </p>
3672   */
3673  public static final ca.uhn.fhir.rest.gclient.TokenClientParam USER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USER);
3674
3675 /**
3676   * Search parameter: <b>entity-name</b>
3677   * <p>
3678   * Description: <b>Descriptor for entity</b><br>
3679   * Type: <b>string</b><br>
3680   * Path: <b>AuditEvent.entity.name</b><br>
3681   * </p>
3682   */
3683  @SearchParamDefinition(name="entity-name", path="AuditEvent.entity.name", description="Descriptor for entity", type="string" )
3684  public static final String SP_ENTITY_NAME = "entity-name";
3685 /**
3686   * <b>Fluent Client</b> search parameter constant for <b>entity-name</b>
3687   * <p>
3688   * Description: <b>Descriptor for entity</b><br>
3689   * Type: <b>string</b><br>
3690   * Path: <b>AuditEvent.entity.name</b><br>
3691   * </p>
3692   */
3693  public static final ca.uhn.fhir.rest.gclient.StringClientParam ENTITY_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ENTITY_NAME);
3694
3695
3696}