001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b, a REST endpoint for another FHIR server, or a s/Mime email address. This may include any security context information.
052 */
053@ResourceDef(name="Endpoint", profile="http://hl7.org/fhir/StructureDefinition/Endpoint")
054public class Endpoint extends DomainResource {
055
056    public enum EndpointStatus {
057        /**
058         * This endpoint is expected to be active and can be used.
059         */
060        ACTIVE, 
061        /**
062         * This endpoint is temporarily unavailable.
063         */
064        SUSPENDED, 
065        /**
066         * This endpoint has exceeded connectivity thresholds and is considered in an error state and should no longer be attempted to connect to until corrective action is taken.
067         */
068        ERROR, 
069        /**
070         * This endpoint is no longer to be used.
071         */
072        OFF, 
073        /**
074         * This instance should not have been part of this patient's medical record.
075         */
076        ENTEREDINERROR, 
077        /**
078         * added to help the parsers with the generic types
079         */
080        NULL;
081        public static EndpointStatus fromCode(String codeString) throws FHIRException {
082            if (codeString == null || "".equals(codeString))
083                return null;
084        if ("active".equals(codeString))
085          return ACTIVE;
086        if ("suspended".equals(codeString))
087          return SUSPENDED;
088        if ("error".equals(codeString))
089          return ERROR;
090        if ("off".equals(codeString))
091          return OFF;
092        if ("entered-in-error".equals(codeString))
093          return ENTEREDINERROR;
094        if (Configuration.isAcceptInvalidEnums())
095          return null;
096        else
097          throw new FHIRException("Unknown EndpointStatus code '"+codeString+"'");
098        }
099        public String toCode() {
100          switch (this) {
101            case ACTIVE: return "active";
102            case SUSPENDED: return "suspended";
103            case ERROR: return "error";
104            case OFF: return "off";
105            case ENTEREDINERROR: return "entered-in-error";
106            case NULL: return null;
107            default: return "?";
108          }
109        }
110        public String getSystem() {
111          switch (this) {
112            case ACTIVE: return "http://hl7.org/fhir/endpoint-status";
113            case SUSPENDED: return "http://hl7.org/fhir/endpoint-status";
114            case ERROR: return "http://hl7.org/fhir/endpoint-status";
115            case OFF: return "http://hl7.org/fhir/endpoint-status";
116            case ENTEREDINERROR: return "http://hl7.org/fhir/endpoint-status";
117            case NULL: return null;
118            default: return "?";
119          }
120        }
121        public String getDefinition() {
122          switch (this) {
123            case ACTIVE: return "This endpoint is expected to be active and can be used.";
124            case SUSPENDED: return "This endpoint is temporarily unavailable.";
125            case ERROR: return "This endpoint has exceeded connectivity thresholds and is considered in an error state and should no longer be attempted to connect to until corrective action is taken.";
126            case OFF: return "This endpoint is no longer to be used.";
127            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
128            case NULL: return null;
129            default: return "?";
130          }
131        }
132        public String getDisplay() {
133          switch (this) {
134            case ACTIVE: return "Active";
135            case SUSPENDED: return "Suspended";
136            case ERROR: return "Error";
137            case OFF: return "Off";
138            case ENTEREDINERROR: return "Entered in error";
139            case NULL: return null;
140            default: return "?";
141          }
142        }
143    }
144
145  public static class EndpointStatusEnumFactory implements EnumFactory<EndpointStatus> {
146    public EndpointStatus fromCode(String codeString) throws IllegalArgumentException {
147      if (codeString == null || "".equals(codeString))
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("active".equals(codeString))
151          return EndpointStatus.ACTIVE;
152        if ("suspended".equals(codeString))
153          return EndpointStatus.SUSPENDED;
154        if ("error".equals(codeString))
155          return EndpointStatus.ERROR;
156        if ("off".equals(codeString))
157          return EndpointStatus.OFF;
158        if ("entered-in-error".equals(codeString))
159          return EndpointStatus.ENTEREDINERROR;
160        throw new IllegalArgumentException("Unknown EndpointStatus code '"+codeString+"'");
161        }
162        public Enumeration<EndpointStatus> fromType(PrimitiveType<?> code) throws FHIRException {
163          if (code == null)
164            return null;
165          if (code.isEmpty())
166            return new Enumeration<EndpointStatus>(this, EndpointStatus.NULL, code);
167          String codeString = ((PrimitiveType) code).asStringValue();
168          if (codeString == null || "".equals(codeString))
169            return new Enumeration<EndpointStatus>(this, EndpointStatus.NULL, code);
170        if ("active".equals(codeString))
171          return new Enumeration<EndpointStatus>(this, EndpointStatus.ACTIVE, code);
172        if ("suspended".equals(codeString))
173          return new Enumeration<EndpointStatus>(this, EndpointStatus.SUSPENDED, code);
174        if ("error".equals(codeString))
175          return new Enumeration<EndpointStatus>(this, EndpointStatus.ERROR, code);
176        if ("off".equals(codeString))
177          return new Enumeration<EndpointStatus>(this, EndpointStatus.OFF, code);
178        if ("entered-in-error".equals(codeString))
179          return new Enumeration<EndpointStatus>(this, EndpointStatus.ENTEREDINERROR, code);
180        throw new FHIRException("Unknown EndpointStatus code '"+codeString+"'");
181        }
182    public String toCode(EndpointStatus code) {
183      if (code == EndpointStatus.ACTIVE)
184        return "active";
185      if (code == EndpointStatus.SUSPENDED)
186        return "suspended";
187      if (code == EndpointStatus.ERROR)
188        return "error";
189      if (code == EndpointStatus.OFF)
190        return "off";
191      if (code == EndpointStatus.ENTEREDINERROR)
192        return "entered-in-error";
193      return "?";
194      }
195    public String toSystem(EndpointStatus code) {
196      return code.getSystem();
197      }
198    }
199
200    @Block()
201    public static class EndpointPayloadComponent extends BackboneElement implements IBaseBackboneElement {
202        /**
203         * The payload type describes the acceptable content that can be communicated on the endpoint.
204         */
205        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
206        @Description(shortDefinition="The type of content that may be used at this endpoint (e.g. XDS Discharge summaries)", formalDefinition="The payload type describes the acceptable content that can be communicated on the endpoint." )
207        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/endpoint-payload-type")
208        protected List<CodeableConcept> type;
209
210        /**
211         * The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).
212         */
213        @Child(name = "mimeType", type = {CodeType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
214        @Description(shortDefinition="Mimetype to send. If not specified, the content could be anything (including no payload, if the connectionType defined this)", formalDefinition="The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType)." )
215        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes")
216        protected List<CodeType> mimeType;
217
218        private static final long serialVersionUID = -1398955844L;
219
220    /**
221     * Constructor
222     */
223      public EndpointPayloadComponent() {
224        super();
225      }
226
227        /**
228         * @return {@link #type} (The payload type describes the acceptable content that can be communicated on the endpoint.)
229         */
230        public List<CodeableConcept> getType() { 
231          if (this.type == null)
232            this.type = new ArrayList<CodeableConcept>();
233          return this.type;
234        }
235
236        /**
237         * @return Returns a reference to <code>this</code> for easy method chaining
238         */
239        public EndpointPayloadComponent setType(List<CodeableConcept> theType) { 
240          this.type = theType;
241          return this;
242        }
243
244        public boolean hasType() { 
245          if (this.type == null)
246            return false;
247          for (CodeableConcept item : this.type)
248            if (!item.isEmpty())
249              return true;
250          return false;
251        }
252
253        public CodeableConcept addType() { //3
254          CodeableConcept t = new CodeableConcept();
255          if (this.type == null)
256            this.type = new ArrayList<CodeableConcept>();
257          this.type.add(t);
258          return t;
259        }
260
261        public EndpointPayloadComponent addType(CodeableConcept t) { //3
262          if (t == null)
263            return this;
264          if (this.type == null)
265            this.type = new ArrayList<CodeableConcept>();
266          this.type.add(t);
267          return this;
268        }
269
270        /**
271         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
272         */
273        public CodeableConcept getTypeFirstRep() { 
274          if (getType().isEmpty()) {
275            addType();
276          }
277          return getType().get(0);
278        }
279
280        /**
281         * @return {@link #mimeType} (The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).)
282         */
283        public List<CodeType> getMimeType() { 
284          if (this.mimeType == null)
285            this.mimeType = new ArrayList<CodeType>();
286          return this.mimeType;
287        }
288
289        /**
290         * @return Returns a reference to <code>this</code> for easy method chaining
291         */
292        public EndpointPayloadComponent setMimeType(List<CodeType> theMimeType) { 
293          this.mimeType = theMimeType;
294          return this;
295        }
296
297        public boolean hasMimeType() { 
298          if (this.mimeType == null)
299            return false;
300          for (CodeType item : this.mimeType)
301            if (!item.isEmpty())
302              return true;
303          return false;
304        }
305
306        /**
307         * @return {@link #mimeType} (The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).)
308         */
309        public CodeType addMimeTypeElement() {//2 
310          CodeType t = new CodeType();
311          if (this.mimeType == null)
312            this.mimeType = new ArrayList<CodeType>();
313          this.mimeType.add(t);
314          return t;
315        }
316
317        /**
318         * @param value {@link #mimeType} (The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).)
319         */
320        public EndpointPayloadComponent addMimeType(String value) { //1
321          CodeType t = new CodeType();
322          t.setValue(value);
323          if (this.mimeType == null)
324            this.mimeType = new ArrayList<CodeType>();
325          this.mimeType.add(t);
326          return this;
327        }
328
329        /**
330         * @param value {@link #mimeType} (The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).)
331         */
332        public boolean hasMimeType(String value) { 
333          if (this.mimeType == null)
334            return false;
335          for (CodeType v : this.mimeType)
336            if (v.getValue().equals(value)) // code
337              return true;
338          return false;
339        }
340
341        protected void listChildren(List<Property> children) {
342          super.listChildren(children);
343          children.add(new Property("type", "CodeableConcept", "The payload type describes the acceptable content that can be communicated on the endpoint.", 0, java.lang.Integer.MAX_VALUE, type));
344          children.add(new Property("mimeType", "code", "The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).", 0, java.lang.Integer.MAX_VALUE, mimeType));
345        }
346
347        @Override
348        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
349          switch (_hash) {
350          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The payload type describes the acceptable content that can be communicated on the endpoint.", 0, java.lang.Integer.MAX_VALUE, type);
351          case -1392120434: /*mimeType*/  return new Property("mimeType", "code", "The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).", 0, java.lang.Integer.MAX_VALUE, mimeType);
352          default: return super.getNamedProperty(_hash, _name, _checkValid);
353          }
354
355        }
356
357      @Override
358      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
359        switch (hash) {
360        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
361        case -1392120434: /*mimeType*/ return this.mimeType == null ? new Base[0] : this.mimeType.toArray(new Base[this.mimeType.size()]); // CodeType
362        default: return super.getProperty(hash, name, checkValid);
363        }
364
365      }
366
367      @Override
368      public Base setProperty(int hash, String name, Base value) throws FHIRException {
369        switch (hash) {
370        case 3575610: // type
371          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
372          return value;
373        case -1392120434: // mimeType
374          this.getMimeType().add(TypeConvertor.castToCode(value)); // CodeType
375          return value;
376        default: return super.setProperty(hash, name, value);
377        }
378
379      }
380
381      @Override
382      public Base setProperty(String name, Base value) throws FHIRException {
383        if (name.equals("type")) {
384          this.getType().add(TypeConvertor.castToCodeableConcept(value));
385        } else if (name.equals("mimeType")) {
386          this.getMimeType().add(TypeConvertor.castToCode(value));
387        } else
388          return super.setProperty(name, value);
389        return value;
390      }
391
392  @Override
393  public void removeChild(String name, Base value) throws FHIRException {
394        if (name.equals("type")) {
395          this.getType().remove(value);
396        } else if (name.equals("mimeType")) {
397          this.getMimeType().remove(value);
398        } else
399          super.removeChild(name, value);
400        
401      }
402
403      @Override
404      public Base makeProperty(int hash, String name) throws FHIRException {
405        switch (hash) {
406        case 3575610:  return addType(); 
407        case -1392120434:  return addMimeTypeElement();
408        default: return super.makeProperty(hash, name);
409        }
410
411      }
412
413      @Override
414      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
415        switch (hash) {
416        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
417        case -1392120434: /*mimeType*/ return new String[] {"code"};
418        default: return super.getTypesForProperty(hash, name);
419        }
420
421      }
422
423      @Override
424      public Base addChild(String name) throws FHIRException {
425        if (name.equals("type")) {
426          return addType();
427        }
428        else if (name.equals("mimeType")) {
429          throw new FHIRException("Cannot call addChild on a singleton property Endpoint.payload.mimeType");
430        }
431        else
432          return super.addChild(name);
433      }
434
435      public EndpointPayloadComponent copy() {
436        EndpointPayloadComponent dst = new EndpointPayloadComponent();
437        copyValues(dst);
438        return dst;
439      }
440
441      public void copyValues(EndpointPayloadComponent dst) {
442        super.copyValues(dst);
443        if (type != null) {
444          dst.type = new ArrayList<CodeableConcept>();
445          for (CodeableConcept i : type)
446            dst.type.add(i.copy());
447        };
448        if (mimeType != null) {
449          dst.mimeType = new ArrayList<CodeType>();
450          for (CodeType i : mimeType)
451            dst.mimeType.add(i.copy());
452        };
453      }
454
455      @Override
456      public boolean equalsDeep(Base other_) {
457        if (!super.equalsDeep(other_))
458          return false;
459        if (!(other_ instanceof EndpointPayloadComponent))
460          return false;
461        EndpointPayloadComponent o = (EndpointPayloadComponent) other_;
462        return compareDeep(type, o.type, true) && compareDeep(mimeType, o.mimeType, true);
463      }
464
465      @Override
466      public boolean equalsShallow(Base other_) {
467        if (!super.equalsShallow(other_))
468          return false;
469        if (!(other_ instanceof EndpointPayloadComponent))
470          return false;
471        EndpointPayloadComponent o = (EndpointPayloadComponent) other_;
472        return compareValues(mimeType, o.mimeType, true);
473      }
474
475      public boolean isEmpty() {
476        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, mimeType);
477      }
478
479  public String fhirType() {
480    return "Endpoint.payload";
481
482  }
483
484  }
485
486    /**
487     * Identifier for the organization that is used to identify the endpoint across multiple disparate systems.
488     */
489    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
490    @Description(shortDefinition="Identifies this endpoint across multiple systems", formalDefinition="Identifier for the organization that is used to identify the endpoint across multiple disparate systems." )
491    protected List<Identifier> identifier;
492
493    /**
494     * The endpoint status represents the general expected availability of an endpoint.
495     */
496    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
497    @Description(shortDefinition="active | suspended | error | off | entered-in-error | test", formalDefinition="The endpoint status represents the general expected availability of an endpoint." )
498    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/endpoint-status")
499    protected Enumeration<EndpointStatus> status;
500
501    /**
502     * A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).
503     */
504    @Child(name = "connectionType", type = {CodeableConcept.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
505    @Description(shortDefinition="Protocol/Profile/Standard to be used with this endpoint connection", formalDefinition="A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook)." )
506    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/endpoint-connection-type")
507    protected List<CodeableConcept> connectionType;
508
509    /**
510     * A friendly name that this endpoint can be referred to with.
511     */
512    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
513    @Description(shortDefinition="A name that this endpoint can be identified by", formalDefinition="A friendly name that this endpoint can be referred to with." )
514    protected StringType name;
515
516    /**
517     * The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).
518     */
519    @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
520    @Description(shortDefinition="Additional details about the endpoint that could be displayed as further information to identify the description beyond its name", formalDefinition="The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose)." )
521    protected StringType description;
522
523    /**
524     * The type of environment(s) exposed at this endpoint (dev, prod, test, etc.).
525     */
526    @Child(name = "environmentType", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
527    @Description(shortDefinition="The type of environment(s) exposed at this endpoint", formalDefinition="The type of environment(s) exposed at this endpoint (dev, prod, test, etc.)." )
528    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/endpoint-environment")
529    protected List<CodeableConcept> environmentType;
530
531    /**
532     * The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).
533     */
534    @Child(name = "managingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
535    @Description(shortDefinition="Organization that manages this endpoint (might not be the organization that exposes the endpoint)", formalDefinition="The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data)." )
536    protected Reference managingOrganization;
537
538    /**
539     * Contact details for a human to contact about the endpoint. The primary use of this for system administrator troubleshooting.
540     */
541    @Child(name = "contact", type = {ContactPoint.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
542    @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Contact details for a human to contact about the endpoint. The primary use of this for system administrator troubleshooting." )
543    protected List<ContactPoint> contact;
544
545    /**
546     * The interval during which the endpoint is expected to be operational.
547     */
548    @Child(name = "period", type = {Period.class}, order=8, min=0, max=1, modifier=false, summary=true)
549    @Description(shortDefinition="Interval the endpoint is expected to be operational", formalDefinition="The interval during which the endpoint is expected to be operational." )
550    protected Period period;
551
552    /**
553     * The set of payloads that are provided/available at this endpoint.
554     */
555    @Child(name = "payload", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
556    @Description(shortDefinition="Set of payloads that are provided by this endpoint", formalDefinition="The set of payloads that are provided/available at this endpoint." )
557    protected List<EndpointPayloadComponent> payload;
558
559    /**
560     * The uri that describes the actual end-point to connect to.
561     */
562    @Child(name = "address", type = {UrlType.class}, order=10, min=1, max=1, modifier=false, summary=true)
563    @Description(shortDefinition="The technical base address for connecting to this endpoint", formalDefinition="The uri that describes the actual end-point to connect to." )
564    protected UrlType address;
565
566    /**
567     * Additional headers / information to send as part of the notification.
568     */
569    @Child(name = "header", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
570    @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Additional headers / information to send as part of the notification." )
571    protected List<StringType> header;
572
573    private static final long serialVersionUID = 1633700267L;
574
575  /**
576   * Constructor
577   */
578    public Endpoint() {
579      super();
580    }
581
582  /**
583   * Constructor
584   */
585    public Endpoint(EndpointStatus status, CodeableConcept connectionType, String address) {
586      super();
587      this.setStatus(status);
588      this.addConnectionType(connectionType);
589      this.setAddress(address);
590    }
591
592    /**
593     * @return {@link #identifier} (Identifier for the organization that is used to identify the endpoint across multiple disparate systems.)
594     */
595    public List<Identifier> getIdentifier() { 
596      if (this.identifier == null)
597        this.identifier = new ArrayList<Identifier>();
598      return this.identifier;
599    }
600
601    /**
602     * @return Returns a reference to <code>this</code> for easy method chaining
603     */
604    public Endpoint setIdentifier(List<Identifier> theIdentifier) { 
605      this.identifier = theIdentifier;
606      return this;
607    }
608
609    public boolean hasIdentifier() { 
610      if (this.identifier == null)
611        return false;
612      for (Identifier item : this.identifier)
613        if (!item.isEmpty())
614          return true;
615      return false;
616    }
617
618    public Identifier addIdentifier() { //3
619      Identifier t = new Identifier();
620      if (this.identifier == null)
621        this.identifier = new ArrayList<Identifier>();
622      this.identifier.add(t);
623      return t;
624    }
625
626    public Endpoint addIdentifier(Identifier t) { //3
627      if (t == null)
628        return this;
629      if (this.identifier == null)
630        this.identifier = new ArrayList<Identifier>();
631      this.identifier.add(t);
632      return this;
633    }
634
635    /**
636     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
637     */
638    public Identifier getIdentifierFirstRep() { 
639      if (getIdentifier().isEmpty()) {
640        addIdentifier();
641      }
642      return getIdentifier().get(0);
643    }
644
645    /**
646     * @return {@link #status} (The endpoint status represents the general expected availability of an endpoint.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
647     */
648    public Enumeration<EndpointStatus> getStatusElement() { 
649      if (this.status == null)
650        if (Configuration.errorOnAutoCreate())
651          throw new Error("Attempt to auto-create Endpoint.status");
652        else if (Configuration.doAutoCreate())
653          this.status = new Enumeration<EndpointStatus>(new EndpointStatusEnumFactory()); // bb
654      return this.status;
655    }
656
657    public boolean hasStatusElement() { 
658      return this.status != null && !this.status.isEmpty();
659    }
660
661    public boolean hasStatus() { 
662      return this.status != null && !this.status.isEmpty();
663    }
664
665    /**
666     * @param value {@link #status} (The endpoint status represents the general expected availability of an endpoint.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
667     */
668    public Endpoint setStatusElement(Enumeration<EndpointStatus> value) { 
669      this.status = value;
670      return this;
671    }
672
673    /**
674     * @return The endpoint status represents the general expected availability of an endpoint.
675     */
676    public EndpointStatus getStatus() { 
677      return this.status == null ? null : this.status.getValue();
678    }
679
680    /**
681     * @param value The endpoint status represents the general expected availability of an endpoint.
682     */
683    public Endpoint setStatus(EndpointStatus value) { 
684        if (this.status == null)
685          this.status = new Enumeration<EndpointStatus>(new EndpointStatusEnumFactory());
686        this.status.setValue(value);
687      return this;
688    }
689
690    /**
691     * @return {@link #connectionType} (A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).)
692     */
693    public List<CodeableConcept> getConnectionType() { 
694      if (this.connectionType == null)
695        this.connectionType = new ArrayList<CodeableConcept>();
696      return this.connectionType;
697    }
698
699    /**
700     * @return Returns a reference to <code>this</code> for easy method chaining
701     */
702    public Endpoint setConnectionType(List<CodeableConcept> theConnectionType) { 
703      this.connectionType = theConnectionType;
704      return this;
705    }
706
707    public boolean hasConnectionType() { 
708      if (this.connectionType == null)
709        return false;
710      for (CodeableConcept item : this.connectionType)
711        if (!item.isEmpty())
712          return true;
713      return false;
714    }
715
716    public CodeableConcept addConnectionType() { //3
717      CodeableConcept t = new CodeableConcept();
718      if (this.connectionType == null)
719        this.connectionType = new ArrayList<CodeableConcept>();
720      this.connectionType.add(t);
721      return t;
722    }
723
724    public Endpoint addConnectionType(CodeableConcept t) { //3
725      if (t == null)
726        return this;
727      if (this.connectionType == null)
728        this.connectionType = new ArrayList<CodeableConcept>();
729      this.connectionType.add(t);
730      return this;
731    }
732
733    /**
734     * @return The first repetition of repeating field {@link #connectionType}, creating it if it does not already exist {3}
735     */
736    public CodeableConcept getConnectionTypeFirstRep() { 
737      if (getConnectionType().isEmpty()) {
738        addConnectionType();
739      }
740      return getConnectionType().get(0);
741    }
742
743    /**
744     * @return {@link #name} (A friendly name that this endpoint can be referred to with.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
745     */
746    public StringType getNameElement() { 
747      if (this.name == null)
748        if (Configuration.errorOnAutoCreate())
749          throw new Error("Attempt to auto-create Endpoint.name");
750        else if (Configuration.doAutoCreate())
751          this.name = new StringType(); // bb
752      return this.name;
753    }
754
755    public boolean hasNameElement() { 
756      return this.name != null && !this.name.isEmpty();
757    }
758
759    public boolean hasName() { 
760      return this.name != null && !this.name.isEmpty();
761    }
762
763    /**
764     * @param value {@link #name} (A friendly name that this endpoint can be referred to with.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
765     */
766    public Endpoint setNameElement(StringType value) { 
767      this.name = value;
768      return this;
769    }
770
771    /**
772     * @return A friendly name that this endpoint can be referred to with.
773     */
774    public String getName() { 
775      return this.name == null ? null : this.name.getValue();
776    }
777
778    /**
779     * @param value A friendly name that this endpoint can be referred to with.
780     */
781    public Endpoint setName(String value) { 
782      if (Utilities.noString(value))
783        this.name = null;
784      else {
785        if (this.name == null)
786          this.name = new StringType();
787        this.name.setValue(value);
788      }
789      return this;
790    }
791
792    /**
793     * @return {@link #description} (The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
794     */
795    public StringType getDescriptionElement() { 
796      if (this.description == null)
797        if (Configuration.errorOnAutoCreate())
798          throw new Error("Attempt to auto-create Endpoint.description");
799        else if (Configuration.doAutoCreate())
800          this.description = new StringType(); // bb
801      return this.description;
802    }
803
804    public boolean hasDescriptionElement() { 
805      return this.description != null && !this.description.isEmpty();
806    }
807
808    public boolean hasDescription() { 
809      return this.description != null && !this.description.isEmpty();
810    }
811
812    /**
813     * @param value {@link #description} (The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
814     */
815    public Endpoint setDescriptionElement(StringType value) { 
816      this.description = value;
817      return this;
818    }
819
820    /**
821     * @return The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).
822     */
823    public String getDescription() { 
824      return this.description == null ? null : this.description.getValue();
825    }
826
827    /**
828     * @param value The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).
829     */
830    public Endpoint setDescription(String value) { 
831      if (Utilities.noString(value))
832        this.description = null;
833      else {
834        if (this.description == null)
835          this.description = new StringType();
836        this.description.setValue(value);
837      }
838      return this;
839    }
840
841    /**
842     * @return {@link #environmentType} (The type of environment(s) exposed at this endpoint (dev, prod, test, etc.).)
843     */
844    public List<CodeableConcept> getEnvironmentType() { 
845      if (this.environmentType == null)
846        this.environmentType = new ArrayList<CodeableConcept>();
847      return this.environmentType;
848    }
849
850    /**
851     * @return Returns a reference to <code>this</code> for easy method chaining
852     */
853    public Endpoint setEnvironmentType(List<CodeableConcept> theEnvironmentType) { 
854      this.environmentType = theEnvironmentType;
855      return this;
856    }
857
858    public boolean hasEnvironmentType() { 
859      if (this.environmentType == null)
860        return false;
861      for (CodeableConcept item : this.environmentType)
862        if (!item.isEmpty())
863          return true;
864      return false;
865    }
866
867    public CodeableConcept addEnvironmentType() { //3
868      CodeableConcept t = new CodeableConcept();
869      if (this.environmentType == null)
870        this.environmentType = new ArrayList<CodeableConcept>();
871      this.environmentType.add(t);
872      return t;
873    }
874
875    public Endpoint addEnvironmentType(CodeableConcept t) { //3
876      if (t == null)
877        return this;
878      if (this.environmentType == null)
879        this.environmentType = new ArrayList<CodeableConcept>();
880      this.environmentType.add(t);
881      return this;
882    }
883
884    /**
885     * @return The first repetition of repeating field {@link #environmentType}, creating it if it does not already exist {3}
886     */
887    public CodeableConcept getEnvironmentTypeFirstRep() { 
888      if (getEnvironmentType().isEmpty()) {
889        addEnvironmentType();
890      }
891      return getEnvironmentType().get(0);
892    }
893
894    /**
895     * @return {@link #managingOrganization} (The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).)
896     */
897    public Reference getManagingOrganization() { 
898      if (this.managingOrganization == null)
899        if (Configuration.errorOnAutoCreate())
900          throw new Error("Attempt to auto-create Endpoint.managingOrganization");
901        else if (Configuration.doAutoCreate())
902          this.managingOrganization = new Reference(); // cc
903      return this.managingOrganization;
904    }
905
906    public boolean hasManagingOrganization() { 
907      return this.managingOrganization != null && !this.managingOrganization.isEmpty();
908    }
909
910    /**
911     * @param value {@link #managingOrganization} (The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).)
912     */
913    public Endpoint setManagingOrganization(Reference value) { 
914      this.managingOrganization = value;
915      return this;
916    }
917
918    /**
919     * @return {@link #contact} (Contact details for a human to contact about the endpoint. The primary use of this for system administrator troubleshooting.)
920     */
921    public List<ContactPoint> getContact() { 
922      if (this.contact == null)
923        this.contact = new ArrayList<ContactPoint>();
924      return this.contact;
925    }
926
927    /**
928     * @return Returns a reference to <code>this</code> for easy method chaining
929     */
930    public Endpoint setContact(List<ContactPoint> theContact) { 
931      this.contact = theContact;
932      return this;
933    }
934
935    public boolean hasContact() { 
936      if (this.contact == null)
937        return false;
938      for (ContactPoint item : this.contact)
939        if (!item.isEmpty())
940          return true;
941      return false;
942    }
943
944    public ContactPoint addContact() { //3
945      ContactPoint t = new ContactPoint();
946      if (this.contact == null)
947        this.contact = new ArrayList<ContactPoint>();
948      this.contact.add(t);
949      return t;
950    }
951
952    public Endpoint addContact(ContactPoint t) { //3
953      if (t == null)
954        return this;
955      if (this.contact == null)
956        this.contact = new ArrayList<ContactPoint>();
957      this.contact.add(t);
958      return this;
959    }
960
961    /**
962     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
963     */
964    public ContactPoint getContactFirstRep() { 
965      if (getContact().isEmpty()) {
966        addContact();
967      }
968      return getContact().get(0);
969    }
970
971    /**
972     * @return {@link #period} (The interval during which the endpoint is expected to be operational.)
973     */
974    public Period getPeriod() { 
975      if (this.period == null)
976        if (Configuration.errorOnAutoCreate())
977          throw new Error("Attempt to auto-create Endpoint.period");
978        else if (Configuration.doAutoCreate())
979          this.period = new Period(); // cc
980      return this.period;
981    }
982
983    public boolean hasPeriod() { 
984      return this.period != null && !this.period.isEmpty();
985    }
986
987    /**
988     * @param value {@link #period} (The interval during which the endpoint is expected to be operational.)
989     */
990    public Endpoint setPeriod(Period value) { 
991      this.period = value;
992      return this;
993    }
994
995    /**
996     * @return {@link #payload} (The set of payloads that are provided/available at this endpoint.)
997     */
998    public List<EndpointPayloadComponent> getPayload() { 
999      if (this.payload == null)
1000        this.payload = new ArrayList<EndpointPayloadComponent>();
1001      return this.payload;
1002    }
1003
1004    /**
1005     * @return Returns a reference to <code>this</code> for easy method chaining
1006     */
1007    public Endpoint setPayload(List<EndpointPayloadComponent> thePayload) { 
1008      this.payload = thePayload;
1009      return this;
1010    }
1011
1012    public boolean hasPayload() { 
1013      if (this.payload == null)
1014        return false;
1015      for (EndpointPayloadComponent item : this.payload)
1016        if (!item.isEmpty())
1017          return true;
1018      return false;
1019    }
1020
1021    public EndpointPayloadComponent addPayload() { //3
1022      EndpointPayloadComponent t = new EndpointPayloadComponent();
1023      if (this.payload == null)
1024        this.payload = new ArrayList<EndpointPayloadComponent>();
1025      this.payload.add(t);
1026      return t;
1027    }
1028
1029    public Endpoint addPayload(EndpointPayloadComponent t) { //3
1030      if (t == null)
1031        return this;
1032      if (this.payload == null)
1033        this.payload = new ArrayList<EndpointPayloadComponent>();
1034      this.payload.add(t);
1035      return this;
1036    }
1037
1038    /**
1039     * @return The first repetition of repeating field {@link #payload}, creating it if it does not already exist {3}
1040     */
1041    public EndpointPayloadComponent getPayloadFirstRep() { 
1042      if (getPayload().isEmpty()) {
1043        addPayload();
1044      }
1045      return getPayload().get(0);
1046    }
1047
1048    /**
1049     * @return {@link #address} (The uri that describes the actual end-point to connect to.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
1050     */
1051    public UrlType getAddressElement() { 
1052      if (this.address == null)
1053        if (Configuration.errorOnAutoCreate())
1054          throw new Error("Attempt to auto-create Endpoint.address");
1055        else if (Configuration.doAutoCreate())
1056          this.address = new UrlType(); // bb
1057      return this.address;
1058    }
1059
1060    public boolean hasAddressElement() { 
1061      return this.address != null && !this.address.isEmpty();
1062    }
1063
1064    public boolean hasAddress() { 
1065      return this.address != null && !this.address.isEmpty();
1066    }
1067
1068    /**
1069     * @param value {@link #address} (The uri that describes the actual end-point to connect to.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
1070     */
1071    public Endpoint setAddressElement(UrlType value) { 
1072      this.address = value;
1073      return this;
1074    }
1075
1076    /**
1077     * @return The uri that describes the actual end-point to connect to.
1078     */
1079    public String getAddress() { 
1080      return this.address == null ? null : this.address.getValue();
1081    }
1082
1083    /**
1084     * @param value The uri that describes the actual end-point to connect to.
1085     */
1086    public Endpoint setAddress(String value) { 
1087        if (this.address == null)
1088          this.address = new UrlType();
1089        this.address.setValue(value);
1090      return this;
1091    }
1092
1093    /**
1094     * @return {@link #header} (Additional headers / information to send as part of the notification.)
1095     */
1096    public List<StringType> getHeader() { 
1097      if (this.header == null)
1098        this.header = new ArrayList<StringType>();
1099      return this.header;
1100    }
1101
1102    /**
1103     * @return Returns a reference to <code>this</code> for easy method chaining
1104     */
1105    public Endpoint setHeader(List<StringType> theHeader) { 
1106      this.header = theHeader;
1107      return this;
1108    }
1109
1110    public boolean hasHeader() { 
1111      if (this.header == null)
1112        return false;
1113      for (StringType item : this.header)
1114        if (!item.isEmpty())
1115          return true;
1116      return false;
1117    }
1118
1119    /**
1120     * @return {@link #header} (Additional headers / information to send as part of the notification.)
1121     */
1122    public StringType addHeaderElement() {//2 
1123      StringType t = new StringType();
1124      if (this.header == null)
1125        this.header = new ArrayList<StringType>();
1126      this.header.add(t);
1127      return t;
1128    }
1129
1130    /**
1131     * @param value {@link #header} (Additional headers / information to send as part of the notification.)
1132     */
1133    public Endpoint addHeader(String value) { //1
1134      StringType t = new StringType();
1135      t.setValue(value);
1136      if (this.header == null)
1137        this.header = new ArrayList<StringType>();
1138      this.header.add(t);
1139      return this;
1140    }
1141
1142    /**
1143     * @param value {@link #header} (Additional headers / information to send as part of the notification.)
1144     */
1145    public boolean hasHeader(String value) { 
1146      if (this.header == null)
1147        return false;
1148      for (StringType v : this.header)
1149        if (v.getValue().equals(value)) // string
1150          return true;
1151      return false;
1152    }
1153
1154      protected void listChildren(List<Property> children) {
1155        super.listChildren(children);
1156        children.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the endpoint across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
1157        children.add(new Property("status", "code", "The endpoint status represents the general expected availability of an endpoint.", 0, 1, status));
1158        children.add(new Property("connectionType", "CodeableConcept", "A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).", 0, java.lang.Integer.MAX_VALUE, connectionType));
1159        children.add(new Property("name", "string", "A friendly name that this endpoint can be referred to with.", 0, 1, name));
1160        children.add(new Property("description", "string", "The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).", 0, 1, description));
1161        children.add(new Property("environmentType", "CodeableConcept", "The type of environment(s) exposed at this endpoint (dev, prod, test, etc.).", 0, java.lang.Integer.MAX_VALUE, environmentType));
1162        children.add(new Property("managingOrganization", "Reference(Organization)", "The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).", 0, 1, managingOrganization));
1163        children.add(new Property("contact", "ContactPoint", "Contact details for a human to contact about the endpoint. The primary use of this for system administrator troubleshooting.", 0, java.lang.Integer.MAX_VALUE, contact));
1164        children.add(new Property("period", "Period", "The interval during which the endpoint is expected to be operational.", 0, 1, period));
1165        children.add(new Property("payload", "", "The set of payloads that are provided/available at this endpoint.", 0, java.lang.Integer.MAX_VALUE, payload));
1166        children.add(new Property("address", "url", "The uri that describes the actual end-point to connect to.", 0, 1, address));
1167        children.add(new Property("header", "string", "Additional headers / information to send as part of the notification.", 0, java.lang.Integer.MAX_VALUE, header));
1168      }
1169
1170      @Override
1171      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1172        switch (_hash) {
1173        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the endpoint across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier);
1174        case -892481550: /*status*/  return new Property("status", "code", "The endpoint status represents the general expected availability of an endpoint.", 0, 1, status);
1175        case 1270211384: /*connectionType*/  return new Property("connectionType", "CodeableConcept", "A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).", 0, java.lang.Integer.MAX_VALUE, connectionType);
1176        case 3373707: /*name*/  return new Property("name", "string", "A friendly name that this endpoint can be referred to with.", 0, 1, name);
1177        case -1724546052: /*description*/  return new Property("description", "string", "The description of the endpoint and what it is for (typically used as supplemental information in an endpoint directory describing its usage/purpose).", 0, 1, description);
1178        case 1680602093: /*environmentType*/  return new Property("environmentType", "CodeableConcept", "The type of environment(s) exposed at this endpoint (dev, prod, test, etc.).", 0, java.lang.Integer.MAX_VALUE, environmentType);
1179        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).", 0, 1, managingOrganization);
1180        case 951526432: /*contact*/  return new Property("contact", "ContactPoint", "Contact details for a human to contact about the endpoint. The primary use of this for system administrator troubleshooting.", 0, java.lang.Integer.MAX_VALUE, contact);
1181        case -991726143: /*period*/  return new Property("period", "Period", "The interval during which the endpoint is expected to be operational.", 0, 1, period);
1182        case -786701938: /*payload*/  return new Property("payload", "", "The set of payloads that are provided/available at this endpoint.", 0, java.lang.Integer.MAX_VALUE, payload);
1183        case -1147692044: /*address*/  return new Property("address", "url", "The uri that describes the actual end-point to connect to.", 0, 1, address);
1184        case -1221270899: /*header*/  return new Property("header", "string", "Additional headers / information to send as part of the notification.", 0, java.lang.Integer.MAX_VALUE, header);
1185        default: return super.getNamedProperty(_hash, _name, _checkValid);
1186        }
1187
1188      }
1189
1190      @Override
1191      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1192        switch (hash) {
1193        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1194        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EndpointStatus>
1195        case 1270211384: /*connectionType*/ return this.connectionType == null ? new Base[0] : this.connectionType.toArray(new Base[this.connectionType.size()]); // CodeableConcept
1196        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1197        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1198        case 1680602093: /*environmentType*/ return this.environmentType == null ? new Base[0] : this.environmentType.toArray(new Base[this.environmentType.size()]); // CodeableConcept
1199        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference
1200        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint
1201        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1202        case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // EndpointPayloadComponent
1203        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // UrlType
1204        case -1221270899: /*header*/ return this.header == null ? new Base[0] : this.header.toArray(new Base[this.header.size()]); // StringType
1205        default: return super.getProperty(hash, name, checkValid);
1206        }
1207
1208      }
1209
1210      @Override
1211      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1212        switch (hash) {
1213        case -1618432855: // identifier
1214          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1215          return value;
1216        case -892481550: // status
1217          value = new EndpointStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1218          this.status = (Enumeration) value; // Enumeration<EndpointStatus>
1219          return value;
1220        case 1270211384: // connectionType
1221          this.getConnectionType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1222          return value;
1223        case 3373707: // name
1224          this.name = TypeConvertor.castToString(value); // StringType
1225          return value;
1226        case -1724546052: // description
1227          this.description = TypeConvertor.castToString(value); // StringType
1228          return value;
1229        case 1680602093: // environmentType
1230          this.getEnvironmentType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1231          return value;
1232        case -2058947787: // managingOrganization
1233          this.managingOrganization = TypeConvertor.castToReference(value); // Reference
1234          return value;
1235        case 951526432: // contact
1236          this.getContact().add(TypeConvertor.castToContactPoint(value)); // ContactPoint
1237          return value;
1238        case -991726143: // period
1239          this.period = TypeConvertor.castToPeriod(value); // Period
1240          return value;
1241        case -786701938: // payload
1242          this.getPayload().add((EndpointPayloadComponent) value); // EndpointPayloadComponent
1243          return value;
1244        case -1147692044: // address
1245          this.address = TypeConvertor.castToUrl(value); // UrlType
1246          return value;
1247        case -1221270899: // header
1248          this.getHeader().add(TypeConvertor.castToString(value)); // StringType
1249          return value;
1250        default: return super.setProperty(hash, name, value);
1251        }
1252
1253      }
1254
1255      @Override
1256      public Base setProperty(String name, Base value) throws FHIRException {
1257        if (name.equals("identifier")) {
1258          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1259        } else if (name.equals("status")) {
1260          value = new EndpointStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1261          this.status = (Enumeration) value; // Enumeration<EndpointStatus>
1262        } else if (name.equals("connectionType")) {
1263          this.getConnectionType().add(TypeConvertor.castToCodeableConcept(value));
1264        } else if (name.equals("name")) {
1265          this.name = TypeConvertor.castToString(value); // StringType
1266        } else if (name.equals("description")) {
1267          this.description = TypeConvertor.castToString(value); // StringType
1268        } else if (name.equals("environmentType")) {
1269          this.getEnvironmentType().add(TypeConvertor.castToCodeableConcept(value));
1270        } else if (name.equals("managingOrganization")) {
1271          this.managingOrganization = TypeConvertor.castToReference(value); // Reference
1272        } else if (name.equals("contact")) {
1273          this.getContact().add(TypeConvertor.castToContactPoint(value));
1274        } else if (name.equals("period")) {
1275          this.period = TypeConvertor.castToPeriod(value); // Period
1276        } else if (name.equals("payload")) {
1277          this.getPayload().add((EndpointPayloadComponent) value);
1278        } else if (name.equals("address")) {
1279          this.address = TypeConvertor.castToUrl(value); // UrlType
1280        } else if (name.equals("header")) {
1281          this.getHeader().add(TypeConvertor.castToString(value));
1282        } else
1283          return super.setProperty(name, value);
1284        return value;
1285      }
1286
1287  @Override
1288  public void removeChild(String name, Base value) throws FHIRException {
1289        if (name.equals("identifier")) {
1290          this.getIdentifier().remove(value);
1291        } else if (name.equals("status")) {
1292          value = new EndpointStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1293          this.status = (Enumeration) value; // Enumeration<EndpointStatus>
1294        } else if (name.equals("connectionType")) {
1295          this.getConnectionType().remove(value);
1296        } else if (name.equals("name")) {
1297          this.name = null;
1298        } else if (name.equals("description")) {
1299          this.description = null;
1300        } else if (name.equals("environmentType")) {
1301          this.getEnvironmentType().remove(value);
1302        } else if (name.equals("managingOrganization")) {
1303          this.managingOrganization = null;
1304        } else if (name.equals("contact")) {
1305          this.getContact().remove(value);
1306        } else if (name.equals("period")) {
1307          this.period = null;
1308        } else if (name.equals("payload")) {
1309          this.getPayload().remove((EndpointPayloadComponent) value);
1310        } else if (name.equals("address")) {
1311          this.address = null;
1312        } else if (name.equals("header")) {
1313          this.getHeader().remove(value);
1314        } else
1315          super.removeChild(name, value);
1316        
1317      }
1318
1319      @Override
1320      public Base makeProperty(int hash, String name) throws FHIRException {
1321        switch (hash) {
1322        case -1618432855:  return addIdentifier(); 
1323        case -892481550:  return getStatusElement();
1324        case 1270211384:  return addConnectionType(); 
1325        case 3373707:  return getNameElement();
1326        case -1724546052:  return getDescriptionElement();
1327        case 1680602093:  return addEnvironmentType(); 
1328        case -2058947787:  return getManagingOrganization();
1329        case 951526432:  return addContact(); 
1330        case -991726143:  return getPeriod();
1331        case -786701938:  return addPayload(); 
1332        case -1147692044:  return getAddressElement();
1333        case -1221270899:  return addHeaderElement();
1334        default: return super.makeProperty(hash, name);
1335        }
1336
1337      }
1338
1339      @Override
1340      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1341        switch (hash) {
1342        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1343        case -892481550: /*status*/ return new String[] {"code"};
1344        case 1270211384: /*connectionType*/ return new String[] {"CodeableConcept"};
1345        case 3373707: /*name*/ return new String[] {"string"};
1346        case -1724546052: /*description*/ return new String[] {"string"};
1347        case 1680602093: /*environmentType*/ return new String[] {"CodeableConcept"};
1348        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
1349        case 951526432: /*contact*/ return new String[] {"ContactPoint"};
1350        case -991726143: /*period*/ return new String[] {"Period"};
1351        case -786701938: /*payload*/ return new String[] {};
1352        case -1147692044: /*address*/ return new String[] {"url"};
1353        case -1221270899: /*header*/ return new String[] {"string"};
1354        default: return super.getTypesForProperty(hash, name);
1355        }
1356
1357      }
1358
1359      @Override
1360      public Base addChild(String name) throws FHIRException {
1361        if (name.equals("identifier")) {
1362          return addIdentifier();
1363        }
1364        else if (name.equals("status")) {
1365          throw new FHIRException("Cannot call addChild on a singleton property Endpoint.status");
1366        }
1367        else if (name.equals("connectionType")) {
1368          return addConnectionType();
1369        }
1370        else if (name.equals("name")) {
1371          throw new FHIRException("Cannot call addChild on a singleton property Endpoint.name");
1372        }
1373        else if (name.equals("description")) {
1374          throw new FHIRException("Cannot call addChild on a singleton property Endpoint.description");
1375        }
1376        else if (name.equals("environmentType")) {
1377          return addEnvironmentType();
1378        }
1379        else if (name.equals("managingOrganization")) {
1380          this.managingOrganization = new Reference();
1381          return this.managingOrganization;
1382        }
1383        else if (name.equals("contact")) {
1384          return addContact();
1385        }
1386        else if (name.equals("period")) {
1387          this.period = new Period();
1388          return this.period;
1389        }
1390        else if (name.equals("payload")) {
1391          return addPayload();
1392        }
1393        else if (name.equals("address")) {
1394          throw new FHIRException("Cannot call addChild on a singleton property Endpoint.address");
1395        }
1396        else if (name.equals("header")) {
1397          throw new FHIRException("Cannot call addChild on a singleton property Endpoint.header");
1398        }
1399        else
1400          return super.addChild(name);
1401      }
1402
1403  public String fhirType() {
1404    return "Endpoint";
1405
1406  }
1407
1408      public Endpoint copy() {
1409        Endpoint dst = new Endpoint();
1410        copyValues(dst);
1411        return dst;
1412      }
1413
1414      public void copyValues(Endpoint dst) {
1415        super.copyValues(dst);
1416        if (identifier != null) {
1417          dst.identifier = new ArrayList<Identifier>();
1418          for (Identifier i : identifier)
1419            dst.identifier.add(i.copy());
1420        };
1421        dst.status = status == null ? null : status.copy();
1422        if (connectionType != null) {
1423          dst.connectionType = new ArrayList<CodeableConcept>();
1424          for (CodeableConcept i : connectionType)
1425            dst.connectionType.add(i.copy());
1426        };
1427        dst.name = name == null ? null : name.copy();
1428        dst.description = description == null ? null : description.copy();
1429        if (environmentType != null) {
1430          dst.environmentType = new ArrayList<CodeableConcept>();
1431          for (CodeableConcept i : environmentType)
1432            dst.environmentType.add(i.copy());
1433        };
1434        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
1435        if (contact != null) {
1436          dst.contact = new ArrayList<ContactPoint>();
1437          for (ContactPoint i : contact)
1438            dst.contact.add(i.copy());
1439        };
1440        dst.period = period == null ? null : period.copy();
1441        if (payload != null) {
1442          dst.payload = new ArrayList<EndpointPayloadComponent>();
1443          for (EndpointPayloadComponent i : payload)
1444            dst.payload.add(i.copy());
1445        };
1446        dst.address = address == null ? null : address.copy();
1447        if (header != null) {
1448          dst.header = new ArrayList<StringType>();
1449          for (StringType i : header)
1450            dst.header.add(i.copy());
1451        };
1452      }
1453
1454      protected Endpoint typedCopy() {
1455        return copy();
1456      }
1457
1458      @Override
1459      public boolean equalsDeep(Base other_) {
1460        if (!super.equalsDeep(other_))
1461          return false;
1462        if (!(other_ instanceof Endpoint))
1463          return false;
1464        Endpoint o = (Endpoint) other_;
1465        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(connectionType, o.connectionType, true)
1466           && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(environmentType, o.environmentType, true)
1467           && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(contact, o.contact, true)
1468           && compareDeep(period, o.period, true) && compareDeep(payload, o.payload, true) && compareDeep(address, o.address, true)
1469           && compareDeep(header, o.header, true);
1470      }
1471
1472      @Override
1473      public boolean equalsShallow(Base other_) {
1474        if (!super.equalsShallow(other_))
1475          return false;
1476        if (!(other_ instanceof Endpoint))
1477          return false;
1478        Endpoint o = (Endpoint) other_;
1479        return compareValues(status, o.status, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true)
1480           && compareValues(address, o.address, true) && compareValues(header, o.header, true);
1481      }
1482
1483      public boolean isEmpty() {
1484        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, connectionType
1485          , name, description, environmentType, managingOrganization, contact, period, payload
1486          , address, header);
1487      }
1488
1489  @Override
1490  public ResourceType getResourceType() {
1491    return ResourceType.Endpoint;
1492   }
1493
1494 /**
1495   * Search parameter: <b>connection-type</b>
1496   * <p>
1497   * Description: <b>Protocol/Profile/Standard to be used with this endpoint connection</b><br>
1498   * Type: <b>token</b><br>
1499   * Path: <b>Endpoint.connectionType</b><br>
1500   * </p>
1501   */
1502  @SearchParamDefinition(name="connection-type", path="Endpoint.connectionType", description="Protocol/Profile/Standard to be used with this endpoint connection", type="token" )
1503  public static final String SP_CONNECTION_TYPE = "connection-type";
1504 /**
1505   * <b>Fluent Client</b> search parameter constant for <b>connection-type</b>
1506   * <p>
1507   * Description: <b>Protocol/Profile/Standard to be used with this endpoint connection</b><br>
1508   * Type: <b>token</b><br>
1509   * Path: <b>Endpoint.connectionType</b><br>
1510   * </p>
1511   */
1512  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONNECTION_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONNECTION_TYPE);
1513
1514 /**
1515   * Search parameter: <b>identifier</b>
1516   * <p>
1517   * Description: <b>Identifies this endpoint across multiple systems</b><br>
1518   * Type: <b>token</b><br>
1519   * Path: <b>Endpoint.identifier</b><br>
1520   * </p>
1521   */
1522  @SearchParamDefinition(name="identifier", path="Endpoint.identifier", description="Identifies this endpoint across multiple systems", type="token" )
1523  public static final String SP_IDENTIFIER = "identifier";
1524 /**
1525   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1526   * <p>
1527   * Description: <b>Identifies this endpoint across multiple systems</b><br>
1528   * Type: <b>token</b><br>
1529   * Path: <b>Endpoint.identifier</b><br>
1530   * </p>
1531   */
1532  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1533
1534 /**
1535   * Search parameter: <b>name</b>
1536   * <p>
1537   * Description: <b>A name that this endpoint can be identified by</b><br>
1538   * Type: <b>string</b><br>
1539   * Path: <b>Endpoint.name</b><br>
1540   * </p>
1541   */
1542  @SearchParamDefinition(name="name", path="Endpoint.name", description="A name that this endpoint can be identified by", type="string" )
1543  public static final String SP_NAME = "name";
1544 /**
1545   * <b>Fluent Client</b> search parameter constant for <b>name</b>
1546   * <p>
1547   * Description: <b>A name that this endpoint can be identified by</b><br>
1548   * Type: <b>string</b><br>
1549   * Path: <b>Endpoint.name</b><br>
1550   * </p>
1551   */
1552  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
1553
1554 /**
1555   * Search parameter: <b>organization</b>
1556   * <p>
1557   * Description: <b>The organization that is managing the endpoint</b><br>
1558   * Type: <b>reference</b><br>
1559   * Path: <b>Endpoint.managingOrganization</b><br>
1560   * </p>
1561   */
1562  @SearchParamDefinition(name="organization", path="Endpoint.managingOrganization", description="The organization that is managing the endpoint", type="reference", target={Organization.class } )
1563  public static final String SP_ORGANIZATION = "organization";
1564 /**
1565   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1566   * <p>
1567   * Description: <b>The organization that is managing the endpoint</b><br>
1568   * Type: <b>reference</b><br>
1569   * Path: <b>Endpoint.managingOrganization</b><br>
1570   * </p>
1571   */
1572  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1573
1574/**
1575   * Constant for fluent queries to be used to add include statements. Specifies
1576   * the path value of "<b>Endpoint:organization</b>".
1577   */
1578  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Endpoint:organization").toLocked();
1579
1580 /**
1581   * Search parameter: <b>payload-type</b>
1582   * <p>
1583   * Description: <b>The type of content that may be used at this endpoint (e.g. XDS Discharge summaries)</b><br>
1584   * Type: <b>token</b><br>
1585   * Path: <b>Endpoint.payload.type</b><br>
1586   * </p>
1587   */
1588  @SearchParamDefinition(name="payload-type", path="Endpoint.payload.type", description="The type of content that may be used at this endpoint (e.g. XDS Discharge summaries)", type="token" )
1589  public static final String SP_PAYLOAD_TYPE = "payload-type";
1590 /**
1591   * <b>Fluent Client</b> search parameter constant for <b>payload-type</b>
1592   * <p>
1593   * Description: <b>The type of content that may be used at this endpoint (e.g. XDS Discharge summaries)</b><br>
1594   * Type: <b>token</b><br>
1595   * Path: <b>Endpoint.payload.type</b><br>
1596   * </p>
1597   */
1598  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PAYLOAD_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PAYLOAD_TYPE);
1599
1600 /**
1601   * Search parameter: <b>status</b>
1602   * <p>
1603   * Description: <b>The current status of the Endpoint (usually expected to be active)</b><br>
1604   * Type: <b>token</b><br>
1605   * Path: <b>Endpoint.status</b><br>
1606   * </p>
1607   */
1608  @SearchParamDefinition(name="status", path="Endpoint.status", description="The current status of the Endpoint (usually expected to be active)", type="token" )
1609  public static final String SP_STATUS = "status";
1610 /**
1611   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1612   * <p>
1613   * Description: <b>The current status of the Endpoint (usually expected to be active)</b><br>
1614   * Type: <b>token</b><br>
1615   * Path: <b>Endpoint.status</b><br>
1616   * </p>
1617   */
1618  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1619
1620
1621}
1622