001package org.hl7.fhir.dstu2.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import ca.uhn.fhir.model.api.annotation.Block;
041import ca.uhn.fhir.model.api.annotation.Child;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import org.hl7.fhir.exceptions.FHIRException;
047/**
048 * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.
049 */
050@ResourceDef(name="Communication", profile="http://hl7.org/fhir/Profile/Communication")
051public class Communication extends DomainResource {
052
053    public enum CommunicationStatus {
054        /**
055         * The communication transmission is ongoing.
056         */
057        INPROGRESS, 
058        /**
059         * The message transmission is complete, i.e., delivered to the recipient's destination.
060         */
061        COMPLETED, 
062        /**
063         * The communication transmission has been held by originating system/user request.
064         */
065        SUSPENDED, 
066        /**
067         * The receiving system has declined to accept the message.
068         */
069        REJECTED, 
070        /**
071         * There was a failure in transmitting the message out.
072         */
073        FAILED, 
074        /**
075         * added to help the parsers
076         */
077        NULL;
078        public static CommunicationStatus fromCode(String codeString) throws FHIRException {
079            if (codeString == null || "".equals(codeString))
080                return null;
081        if ("in-progress".equals(codeString))
082          return INPROGRESS;
083        if ("completed".equals(codeString))
084          return COMPLETED;
085        if ("suspended".equals(codeString))
086          return SUSPENDED;
087        if ("rejected".equals(codeString))
088          return REJECTED;
089        if ("failed".equals(codeString))
090          return FAILED;
091        throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case INPROGRESS: return "in-progress";
096            case COMPLETED: return "completed";
097            case SUSPENDED: return "suspended";
098            case REJECTED: return "rejected";
099            case FAILED: return "failed";
100            case NULL: return null;
101            default: return "?";
102          }
103        }
104        public String getSystem() {
105          switch (this) {
106            case INPROGRESS: return "http://hl7.org/fhir/communication-status";
107            case COMPLETED: return "http://hl7.org/fhir/communication-status";
108            case SUSPENDED: return "http://hl7.org/fhir/communication-status";
109            case REJECTED: return "http://hl7.org/fhir/communication-status";
110            case FAILED: return "http://hl7.org/fhir/communication-status";
111            case NULL: return null;
112            default: return "?";
113          }
114        }
115        public String getDefinition() {
116          switch (this) {
117            case INPROGRESS: return "The communication transmission is ongoing.";
118            case COMPLETED: return "The message transmission is complete, i.e., delivered to the recipient's destination.";
119            case SUSPENDED: return "The communication transmission has been held by originating system/user request.";
120            case REJECTED: return "The receiving system has declined to accept the message.";
121            case FAILED: return "There was a failure in transmitting the message out.";
122            case NULL: return null;
123            default: return "?";
124          }
125        }
126        public String getDisplay() {
127          switch (this) {
128            case INPROGRESS: return "In Progress";
129            case COMPLETED: return "Completed";
130            case SUSPENDED: return "Suspended";
131            case REJECTED: return "Rejected";
132            case FAILED: return "Failed";
133            case NULL: return null;
134            default: return "?";
135          }
136        }
137    }
138
139  public static class CommunicationStatusEnumFactory implements EnumFactory<CommunicationStatus> {
140    public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException {
141      if (codeString == null || "".equals(codeString))
142            if (codeString == null || "".equals(codeString))
143                return null;
144        if ("in-progress".equals(codeString))
145          return CommunicationStatus.INPROGRESS;
146        if ("completed".equals(codeString))
147          return CommunicationStatus.COMPLETED;
148        if ("suspended".equals(codeString))
149          return CommunicationStatus.SUSPENDED;
150        if ("rejected".equals(codeString))
151          return CommunicationStatus.REJECTED;
152        if ("failed".equals(codeString))
153          return CommunicationStatus.FAILED;
154        throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'");
155        }
156        public Enumeration<CommunicationStatus> fromType(Base code) throws FHIRException {
157          if (code == null || code.isEmpty())
158            return null;
159          String codeString = ((PrimitiveType) code).asStringValue();
160          if (codeString == null || "".equals(codeString))
161            return null;
162        if ("in-progress".equals(codeString))
163          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.INPROGRESS);
164        if ("completed".equals(codeString))
165          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.COMPLETED);
166        if ("suspended".equals(codeString))
167          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.SUSPENDED);
168        if ("rejected".equals(codeString))
169          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.REJECTED);
170        if ("failed".equals(codeString))
171          return new Enumeration<CommunicationStatus>(this, CommunicationStatus.FAILED);
172        throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'");
173        }
174    public String toCode(CommunicationStatus code) {
175      if (code == CommunicationStatus.INPROGRESS)
176        return "in-progress";
177      if (code == CommunicationStatus.COMPLETED)
178        return "completed";
179      if (code == CommunicationStatus.SUSPENDED)
180        return "suspended";
181      if (code == CommunicationStatus.REJECTED)
182        return "rejected";
183      if (code == CommunicationStatus.FAILED)
184        return "failed";
185      return "?";
186      }
187    }
188
189    @Block()
190    public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement {
191        /**
192         * A communicated content (or for multi-part communications, one portion of the communication).
193         */
194        @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true)
195        @Description(shortDefinition="Message part content", formalDefinition="A communicated content (or for multi-part communications, one portion of the communication)." )
196        protected Type content;
197
198        private static final long serialVersionUID = -1763459053L;
199
200    /*
201     * Constructor
202     */
203      public CommunicationPayloadComponent() {
204        super();
205      }
206
207    /*
208     * Constructor
209     */
210      public CommunicationPayloadComponent(Type content) {
211        super();
212        this.content = content;
213      }
214
215        /**
216         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
217         */
218        public Type getContent() { 
219          return this.content;
220        }
221
222        /**
223         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
224         */
225        public StringType getContentStringType() throws FHIRException { 
226          if (!(this.content instanceof StringType))
227            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered");
228          return (StringType) this.content;
229        }
230
231        public boolean hasContentStringType() { 
232          return this.content instanceof StringType;
233        }
234
235        /**
236         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
237         */
238        public Attachment getContentAttachment() throws FHIRException { 
239          if (!(this.content instanceof Attachment))
240            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
241          return (Attachment) this.content;
242        }
243
244        public boolean hasContentAttachment() { 
245          return this.content instanceof Attachment;
246        }
247
248        /**
249         * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
250         */
251        public Reference getContentReference() throws FHIRException { 
252          if (!(this.content instanceof Reference))
253            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
254          return (Reference) this.content;
255        }
256
257        public boolean hasContentReference() { 
258          return this.content instanceof Reference;
259        }
260
261        public boolean hasContent() { 
262          return this.content != null && !this.content.isEmpty();
263        }
264
265        /**
266         * @param value {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).)
267         */
268        public CommunicationPayloadComponent setContent(Type value) { 
269          this.content = value;
270          return this;
271        }
272
273        protected void listChildren(List<Property> childrenList) {
274          super.listChildren(childrenList);
275          childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, java.lang.Integer.MAX_VALUE, content));
276        }
277
278      @Override
279      public void setProperty(String name, Base value) throws FHIRException {
280        if (name.equals("content[x]"))
281          this.content = (Type) value; // Type
282        else
283          super.setProperty(name, value);
284      }
285
286      @Override
287      public Base addChild(String name) throws FHIRException {
288        if (name.equals("contentString")) {
289          this.content = new StringType();
290          return this.content;
291        }
292        else if (name.equals("contentAttachment")) {
293          this.content = new Attachment();
294          return this.content;
295        }
296        else if (name.equals("contentReference")) {
297          this.content = new Reference();
298          return this.content;
299        }
300        else
301          return super.addChild(name);
302      }
303
304      public CommunicationPayloadComponent copy() {
305        CommunicationPayloadComponent dst = new CommunicationPayloadComponent();
306        copyValues(dst);
307        dst.content = content == null ? null : content.copy();
308        return dst;
309      }
310
311      @Override
312      public boolean equalsDeep(Base other) {
313        if (!super.equalsDeep(other))
314          return false;
315        if (!(other instanceof CommunicationPayloadComponent))
316          return false;
317        CommunicationPayloadComponent o = (CommunicationPayloadComponent) other;
318        return compareDeep(content, o.content, true);
319      }
320
321      @Override
322      public boolean equalsShallow(Base other) {
323        if (!super.equalsShallow(other))
324          return false;
325        if (!(other instanceof CommunicationPayloadComponent))
326          return false;
327        CommunicationPayloadComponent o = (CommunicationPayloadComponent) other;
328        return true;
329      }
330
331      public boolean isEmpty() {
332        return super.isEmpty() && (content == null || content.isEmpty());
333      }
334
335  public String fhirType() {
336    return "Communication.payload";
337
338  }
339
340  }
341
342    /**
343     * Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
344     */
345    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
346    @Description(shortDefinition="Unique identifier", formalDefinition="Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
347    protected List<Identifier> identifier;
348
349    /**
350     * The type of message conveyed such as alert, notification, reminder, instruction, etc.
351     */
352    @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
353    @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." )
354    protected CodeableConcept category;
355
356    /**
357     * The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.
358     */
359    @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true)
360    @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication." )
361    protected Reference sender;
362
363    /**
364     * The actual object that is the target of the reference (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
365     */
366    protected Resource senderTarget;
367
368    /**
369     * The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).
370     */
371    @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Group.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
372    @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time)." )
373    protected List<Reference> recipient;
374    /**
375     * The actual objects that are the target of the reference (The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).)
376     */
377    protected List<Resource> recipientTarget;
378
379
380    /**
381     * Text, attachment(s), or resource(s) that was communicated to the recipient.
382     */
383    @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
384    @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." )
385    protected List<CommunicationPayloadComponent> payload;
386
387    /**
388     * A channel that was used for this communication (e.g. email, fax).
389     */
390    @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
391    @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." )
392    protected List<CodeableConcept> medium;
393
394    /**
395     * The status of the transmission.
396     */
397    @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true)
398    @Description(shortDefinition="in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the transmission." )
399    protected Enumeration<CommunicationStatus> status;
400
401    /**
402     * The encounter within which the communication was sent.
403     */
404    @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1, modifier=false, summary=true)
405    @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication was sent." )
406    protected Reference encounter;
407
408    /**
409     * The actual object that is the target of the reference (The encounter within which the communication was sent.)
410     */
411    protected Encounter encounterTarget;
412
413    /**
414     * The time when this communication was sent.
415     */
416    @Child(name = "sent", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
417    @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." )
418    protected DateTimeType sent;
419
420    /**
421     * The time when this communication arrived at the destination.
422     */
423    @Child(name = "received", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
424    @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." )
425    protected DateTimeType received;
426
427    /**
428     * The reason or justification for the communication.
429     */
430    @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
431    @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." )
432    protected List<CodeableConcept> reason;
433
434    /**
435     * The patient who was the focus of this communication.
436     */
437    @Child(name = "subject", type = {Patient.class}, order=11, min=0, max=1, modifier=false, summary=true)
438    @Description(shortDefinition="Focus of message", formalDefinition="The patient who was the focus of this communication." )
439    protected Reference subject;
440
441    /**
442     * The actual object that is the target of the reference (The patient who was the focus of this communication.)
443     */
444    protected Patient subjectTarget;
445
446    /**
447     * The communication request that was responsible for producing this communication.
448     */
449    @Child(name = "requestDetail", type = {CommunicationRequest.class}, order=12, min=0, max=1, modifier=false, summary=true)
450    @Description(shortDefinition="CommunicationRequest producing this message", formalDefinition="The communication request that was responsible for producing this communication." )
451    protected Reference requestDetail;
452
453    /**
454     * The actual object that is the target of the reference (The communication request that was responsible for producing this communication.)
455     */
456    protected CommunicationRequest requestDetailTarget;
457
458    private static final long serialVersionUID = -1654449146L;
459
460  /*
461   * Constructor
462   */
463    public Communication() {
464      super();
465    }
466
467    /**
468     * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
469     */
470    public List<Identifier> getIdentifier() { 
471      if (this.identifier == null)
472        this.identifier = new ArrayList<Identifier>();
473      return this.identifier;
474    }
475
476    public boolean hasIdentifier() { 
477      if (this.identifier == null)
478        return false;
479      for (Identifier item : this.identifier)
480        if (!item.isEmpty())
481          return true;
482      return false;
483    }
484
485    /**
486     * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
487     */
488    // syntactic sugar
489    public Identifier addIdentifier() { //3
490      Identifier t = new Identifier();
491      if (this.identifier == null)
492        this.identifier = new ArrayList<Identifier>();
493      this.identifier.add(t);
494      return t;
495    }
496
497    // syntactic sugar
498    public Communication addIdentifier(Identifier t) { //3
499      if (t == null)
500        return this;
501      if (this.identifier == null)
502        this.identifier = new ArrayList<Identifier>();
503      this.identifier.add(t);
504      return this;
505    }
506
507    /**
508     * @return {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.)
509     */
510    public CodeableConcept getCategory() { 
511      if (this.category == null)
512        if (Configuration.errorOnAutoCreate())
513          throw new Error("Attempt to auto-create Communication.category");
514        else if (Configuration.doAutoCreate())
515          this.category = new CodeableConcept(); // cc
516      return this.category;
517    }
518
519    public boolean hasCategory() { 
520      return this.category != null && !this.category.isEmpty();
521    }
522
523    /**
524     * @param value {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.)
525     */
526    public Communication setCategory(CodeableConcept value) { 
527      this.category = value;
528      return this;
529    }
530
531    /**
532     * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
533     */
534    public Reference getSender() { 
535      if (this.sender == null)
536        if (Configuration.errorOnAutoCreate())
537          throw new Error("Attempt to auto-create Communication.sender");
538        else if (Configuration.doAutoCreate())
539          this.sender = new Reference(); // cc
540      return this.sender;
541    }
542
543    public boolean hasSender() { 
544      return this.sender != null && !this.sender.isEmpty();
545    }
546
547    /**
548     * @param value {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
549     */
550    public Communication setSender(Reference value) { 
551      this.sender = value;
552      return this;
553    }
554
555    /**
556     * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
557     */
558    public Resource getSenderTarget() { 
559      return this.senderTarget;
560    }
561
562    /**
563     * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.)
564     */
565    public Communication setSenderTarget(Resource value) { 
566      this.senderTarget = value;
567      return this;
568    }
569
570    /**
571     * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).)
572     */
573    public List<Reference> getRecipient() { 
574      if (this.recipient == null)
575        this.recipient = new ArrayList<Reference>();
576      return this.recipient;
577    }
578
579    public boolean hasRecipient() { 
580      if (this.recipient == null)
581        return false;
582      for (Reference item : this.recipient)
583        if (!item.isEmpty())
584          return true;
585      return false;
586    }
587
588    /**
589     * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).)
590     */
591    // syntactic sugar
592    public Reference addRecipient() { //3
593      Reference t = new Reference();
594      if (this.recipient == null)
595        this.recipient = new ArrayList<Reference>();
596      this.recipient.add(t);
597      return t;
598    }
599
600    // syntactic sugar
601    public Communication addRecipient(Reference t) { //3
602      if (t == null)
603        return this;
604      if (this.recipient == null)
605        this.recipient = new ArrayList<Reference>();
606      this.recipient.add(t);
607      return this;
608    }
609
610    /**
611     * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).)
612     */
613    public List<Resource> getRecipientTarget() { 
614      if (this.recipientTarget == null)
615        this.recipientTarget = new ArrayList<Resource>();
616      return this.recipientTarget;
617    }
618
619    /**
620     * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.)
621     */
622    public List<CommunicationPayloadComponent> getPayload() { 
623      if (this.payload == null)
624        this.payload = new ArrayList<CommunicationPayloadComponent>();
625      return this.payload;
626    }
627
628    public boolean hasPayload() { 
629      if (this.payload == null)
630        return false;
631      for (CommunicationPayloadComponent item : this.payload)
632        if (!item.isEmpty())
633          return true;
634      return false;
635    }
636
637    /**
638     * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.)
639     */
640    // syntactic sugar
641    public CommunicationPayloadComponent addPayload() { //3
642      CommunicationPayloadComponent t = new CommunicationPayloadComponent();
643      if (this.payload == null)
644        this.payload = new ArrayList<CommunicationPayloadComponent>();
645      this.payload.add(t);
646      return t;
647    }
648
649    // syntactic sugar
650    public Communication addPayload(CommunicationPayloadComponent t) { //3
651      if (t == null)
652        return this;
653      if (this.payload == null)
654        this.payload = new ArrayList<CommunicationPayloadComponent>();
655      this.payload.add(t);
656      return this;
657    }
658
659    /**
660     * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).)
661     */
662    public List<CodeableConcept> getMedium() { 
663      if (this.medium == null)
664        this.medium = new ArrayList<CodeableConcept>();
665      return this.medium;
666    }
667
668    public boolean hasMedium() { 
669      if (this.medium == null)
670        return false;
671      for (CodeableConcept item : this.medium)
672        if (!item.isEmpty())
673          return true;
674      return false;
675    }
676
677    /**
678     * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).)
679     */
680    // syntactic sugar
681    public CodeableConcept addMedium() { //3
682      CodeableConcept t = new CodeableConcept();
683      if (this.medium == null)
684        this.medium = new ArrayList<CodeableConcept>();
685      this.medium.add(t);
686      return t;
687    }
688
689    // syntactic sugar
690    public Communication addMedium(CodeableConcept t) { //3
691      if (t == null)
692        return this;
693      if (this.medium == null)
694        this.medium = new ArrayList<CodeableConcept>();
695      this.medium.add(t);
696      return this;
697    }
698
699    /**
700     * @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
701     */
702    public Enumeration<CommunicationStatus> getStatusElement() { 
703      if (this.status == null)
704        if (Configuration.errorOnAutoCreate())
705          throw new Error("Attempt to auto-create Communication.status");
706        else if (Configuration.doAutoCreate())
707          this.status = new Enumeration<CommunicationStatus>(new CommunicationStatusEnumFactory()); // bb
708      return this.status;
709    }
710
711    public boolean hasStatusElement() { 
712      return this.status != null && !this.status.isEmpty();
713    }
714
715    public boolean hasStatus() { 
716      return this.status != null && !this.status.isEmpty();
717    }
718
719    /**
720     * @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
721     */
722    public Communication setStatusElement(Enumeration<CommunicationStatus> value) { 
723      this.status = value;
724      return this;
725    }
726
727    /**
728     * @return The status of the transmission.
729     */
730    public CommunicationStatus getStatus() { 
731      return this.status == null ? null : this.status.getValue();
732    }
733
734    /**
735     * @param value The status of the transmission.
736     */
737    public Communication setStatus(CommunicationStatus value) { 
738      if (value == null)
739        this.status = null;
740      else {
741        if (this.status == null)
742          this.status = new Enumeration<CommunicationStatus>(new CommunicationStatusEnumFactory());
743        this.status.setValue(value);
744      }
745      return this;
746    }
747
748    /**
749     * @return {@link #encounter} (The encounter within which the communication was sent.)
750     */
751    public Reference getEncounter() { 
752      if (this.encounter == null)
753        if (Configuration.errorOnAutoCreate())
754          throw new Error("Attempt to auto-create Communication.encounter");
755        else if (Configuration.doAutoCreate())
756          this.encounter = new Reference(); // cc
757      return this.encounter;
758    }
759
760    public boolean hasEncounter() { 
761      return this.encounter != null && !this.encounter.isEmpty();
762    }
763
764    /**
765     * @param value {@link #encounter} (The encounter within which the communication was sent.)
766     */
767    public Communication setEncounter(Reference value) { 
768      this.encounter = value;
769      return this;
770    }
771
772    /**
773     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.)
774     */
775    public Encounter getEncounterTarget() { 
776      if (this.encounterTarget == null)
777        if (Configuration.errorOnAutoCreate())
778          throw new Error("Attempt to auto-create Communication.encounter");
779        else if (Configuration.doAutoCreate())
780          this.encounterTarget = new Encounter(); // aa
781      return this.encounterTarget;
782    }
783
784    /**
785     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.)
786     */
787    public Communication setEncounterTarget(Encounter value) { 
788      this.encounterTarget = value;
789      return this;
790    }
791
792    /**
793     * @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value
794     */
795    public DateTimeType getSentElement() { 
796      if (this.sent == null)
797        if (Configuration.errorOnAutoCreate())
798          throw new Error("Attempt to auto-create Communication.sent");
799        else if (Configuration.doAutoCreate())
800          this.sent = new DateTimeType(); // bb
801      return this.sent;
802    }
803
804    public boolean hasSentElement() { 
805      return this.sent != null && !this.sent.isEmpty();
806    }
807
808    public boolean hasSent() { 
809      return this.sent != null && !this.sent.isEmpty();
810    }
811
812    /**
813     * @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value
814     */
815    public Communication setSentElement(DateTimeType value) { 
816      this.sent = value;
817      return this;
818    }
819
820    /**
821     * @return The time when this communication was sent.
822     */
823    public Date getSent() { 
824      return this.sent == null ? null : this.sent.getValue();
825    }
826
827    /**
828     * @param value The time when this communication was sent.
829     */
830    public Communication setSent(Date value) { 
831      if (value == null)
832        this.sent = null;
833      else {
834        if (this.sent == null)
835          this.sent = new DateTimeType();
836        this.sent.setValue(value);
837      }
838      return this;
839    }
840
841    /**
842     * @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value
843     */
844    public DateTimeType getReceivedElement() { 
845      if (this.received == null)
846        if (Configuration.errorOnAutoCreate())
847          throw new Error("Attempt to auto-create Communication.received");
848        else if (Configuration.doAutoCreate())
849          this.received = new DateTimeType(); // bb
850      return this.received;
851    }
852
853    public boolean hasReceivedElement() { 
854      return this.received != null && !this.received.isEmpty();
855    }
856
857    public boolean hasReceived() { 
858      return this.received != null && !this.received.isEmpty();
859    }
860
861    /**
862     * @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value
863     */
864    public Communication setReceivedElement(DateTimeType value) { 
865      this.received = value;
866      return this;
867    }
868
869    /**
870     * @return The time when this communication arrived at the destination.
871     */
872    public Date getReceived() { 
873      return this.received == null ? null : this.received.getValue();
874    }
875
876    /**
877     * @param value The time when this communication arrived at the destination.
878     */
879    public Communication setReceived(Date value) { 
880      if (value == null)
881        this.received = null;
882      else {
883        if (this.received == null)
884          this.received = new DateTimeType();
885        this.received.setValue(value);
886      }
887      return this;
888    }
889
890    /**
891     * @return {@link #reason} (The reason or justification for the communication.)
892     */
893    public List<CodeableConcept> getReason() { 
894      if (this.reason == null)
895        this.reason = new ArrayList<CodeableConcept>();
896      return this.reason;
897    }
898
899    public boolean hasReason() { 
900      if (this.reason == null)
901        return false;
902      for (CodeableConcept item : this.reason)
903        if (!item.isEmpty())
904          return true;
905      return false;
906    }
907
908    /**
909     * @return {@link #reason} (The reason or justification for the communication.)
910     */
911    // syntactic sugar
912    public CodeableConcept addReason() { //3
913      CodeableConcept t = new CodeableConcept();
914      if (this.reason == null)
915        this.reason = new ArrayList<CodeableConcept>();
916      this.reason.add(t);
917      return t;
918    }
919
920    // syntactic sugar
921    public Communication addReason(CodeableConcept t) { //3
922      if (t == null)
923        return this;
924      if (this.reason == null)
925        this.reason = new ArrayList<CodeableConcept>();
926      this.reason.add(t);
927      return this;
928    }
929
930    /**
931     * @return {@link #subject} (The patient who was the focus of this communication.)
932     */
933    public Reference getSubject() { 
934      if (this.subject == null)
935        if (Configuration.errorOnAutoCreate())
936          throw new Error("Attempt to auto-create Communication.subject");
937        else if (Configuration.doAutoCreate())
938          this.subject = new Reference(); // cc
939      return this.subject;
940    }
941
942    public boolean hasSubject() { 
943      return this.subject != null && !this.subject.isEmpty();
944    }
945
946    /**
947     * @param value {@link #subject} (The patient who was the focus of this communication.)
948     */
949    public Communication setSubject(Reference value) { 
950      this.subject = value;
951      return this;
952    }
953
954    /**
955     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.)
956     */
957    public Patient getSubjectTarget() { 
958      if (this.subjectTarget == null)
959        if (Configuration.errorOnAutoCreate())
960          throw new Error("Attempt to auto-create Communication.subject");
961        else if (Configuration.doAutoCreate())
962          this.subjectTarget = new Patient(); // aa
963      return this.subjectTarget;
964    }
965
966    /**
967     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.)
968     */
969    public Communication setSubjectTarget(Patient value) { 
970      this.subjectTarget = value;
971      return this;
972    }
973
974    /**
975     * @return {@link #requestDetail} (The communication request that was responsible for producing this communication.)
976     */
977    public Reference getRequestDetail() { 
978      if (this.requestDetail == null)
979        if (Configuration.errorOnAutoCreate())
980          throw new Error("Attempt to auto-create Communication.requestDetail");
981        else if (Configuration.doAutoCreate())
982          this.requestDetail = new Reference(); // cc
983      return this.requestDetail;
984    }
985
986    public boolean hasRequestDetail() { 
987      return this.requestDetail != null && !this.requestDetail.isEmpty();
988    }
989
990    /**
991     * @param value {@link #requestDetail} (The communication request that was responsible for producing this communication.)
992     */
993    public Communication setRequestDetail(Reference value) { 
994      this.requestDetail = value;
995      return this;
996    }
997
998    /**
999     * @return {@link #requestDetail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The communication request that was responsible for producing this communication.)
1000     */
1001    public CommunicationRequest getRequestDetailTarget() { 
1002      if (this.requestDetailTarget == null)
1003        if (Configuration.errorOnAutoCreate())
1004          throw new Error("Attempt to auto-create Communication.requestDetail");
1005        else if (Configuration.doAutoCreate())
1006          this.requestDetailTarget = new CommunicationRequest(); // aa
1007      return this.requestDetailTarget;
1008    }
1009
1010    /**
1011     * @param value {@link #requestDetail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The communication request that was responsible for producing this communication.)
1012     */
1013    public Communication setRequestDetailTarget(CommunicationRequest value) { 
1014      this.requestDetailTarget = value;
1015      return this;
1016    }
1017
1018      protected void listChildren(List<Property> childrenList) {
1019        super.listChildren(childrenList);
1020        childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
1021        childrenList.add(new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category));
1022        childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender));
1023        childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson|Group)", "The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).", 0, java.lang.Integer.MAX_VALUE, recipient));
1024        childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload));
1025        childrenList.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium));
1026        childrenList.add(new Property("status", "code", "The status of the transmission.", 0, java.lang.Integer.MAX_VALUE, status));
1027        childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication was sent.", 0, java.lang.Integer.MAX_VALUE, encounter));
1028        childrenList.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, java.lang.Integer.MAX_VALUE, sent));
1029        childrenList.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, java.lang.Integer.MAX_VALUE, received));
1030        childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason));
1031        childrenList.add(new Property("subject", "Reference(Patient)", "The patient who was the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject));
1032        childrenList.add(new Property("requestDetail", "Reference(CommunicationRequest)", "The communication request that was responsible for producing this communication.", 0, java.lang.Integer.MAX_VALUE, requestDetail));
1033      }
1034
1035      @Override
1036      public void setProperty(String name, Base value) throws FHIRException {
1037        if (name.equals("identifier"))
1038          this.getIdentifier().add(castToIdentifier(value));
1039        else if (name.equals("category"))
1040          this.category = castToCodeableConcept(value); // CodeableConcept
1041        else if (name.equals("sender"))
1042          this.sender = castToReference(value); // Reference
1043        else if (name.equals("recipient"))
1044          this.getRecipient().add(castToReference(value));
1045        else if (name.equals("payload"))
1046          this.getPayload().add((CommunicationPayloadComponent) value);
1047        else if (name.equals("medium"))
1048          this.getMedium().add(castToCodeableConcept(value));
1049        else if (name.equals("status"))
1050          this.status = new CommunicationStatusEnumFactory().fromType(value); // Enumeration<CommunicationStatus>
1051        else if (name.equals("encounter"))
1052          this.encounter = castToReference(value); // Reference
1053        else if (name.equals("sent"))
1054          this.sent = castToDateTime(value); // DateTimeType
1055        else if (name.equals("received"))
1056          this.received = castToDateTime(value); // DateTimeType
1057        else if (name.equals("reason"))
1058          this.getReason().add(castToCodeableConcept(value));
1059        else if (name.equals("subject"))
1060          this.subject = castToReference(value); // Reference
1061        else if (name.equals("requestDetail"))
1062          this.requestDetail = castToReference(value); // Reference
1063        else
1064          super.setProperty(name, value);
1065      }
1066
1067      @Override
1068      public Base addChild(String name) throws FHIRException {
1069        if (name.equals("identifier")) {
1070          return addIdentifier();
1071        }
1072        else if (name.equals("category")) {
1073          this.category = new CodeableConcept();
1074          return this.category;
1075        }
1076        else if (name.equals("sender")) {
1077          this.sender = new Reference();
1078          return this.sender;
1079        }
1080        else if (name.equals("recipient")) {
1081          return addRecipient();
1082        }
1083        else if (name.equals("payload")) {
1084          return addPayload();
1085        }
1086        else if (name.equals("medium")) {
1087          return addMedium();
1088        }
1089        else if (name.equals("status")) {
1090          throw new FHIRException("Cannot call addChild on a primitive type Communication.status");
1091        }
1092        else if (name.equals("encounter")) {
1093          this.encounter = new Reference();
1094          return this.encounter;
1095        }
1096        else if (name.equals("sent")) {
1097          throw new FHIRException("Cannot call addChild on a primitive type Communication.sent");
1098        }
1099        else if (name.equals("received")) {
1100          throw new FHIRException("Cannot call addChild on a primitive type Communication.received");
1101        }
1102        else if (name.equals("reason")) {
1103          return addReason();
1104        }
1105        else if (name.equals("subject")) {
1106          this.subject = new Reference();
1107          return this.subject;
1108        }
1109        else if (name.equals("requestDetail")) {
1110          this.requestDetail = new Reference();
1111          return this.requestDetail;
1112        }
1113        else
1114          return super.addChild(name);
1115      }
1116
1117  public String fhirType() {
1118    return "Communication";
1119
1120  }
1121
1122      public Communication copy() {
1123        Communication dst = new Communication();
1124        copyValues(dst);
1125        if (identifier != null) {
1126          dst.identifier = new ArrayList<Identifier>();
1127          for (Identifier i : identifier)
1128            dst.identifier.add(i.copy());
1129        };
1130        dst.category = category == null ? null : category.copy();
1131        dst.sender = sender == null ? null : sender.copy();
1132        if (recipient != null) {
1133          dst.recipient = new ArrayList<Reference>();
1134          for (Reference i : recipient)
1135            dst.recipient.add(i.copy());
1136        };
1137        if (payload != null) {
1138          dst.payload = new ArrayList<CommunicationPayloadComponent>();
1139          for (CommunicationPayloadComponent i : payload)
1140            dst.payload.add(i.copy());
1141        };
1142        if (medium != null) {
1143          dst.medium = new ArrayList<CodeableConcept>();
1144          for (CodeableConcept i : medium)
1145            dst.medium.add(i.copy());
1146        };
1147        dst.status = status == null ? null : status.copy();
1148        dst.encounter = encounter == null ? null : encounter.copy();
1149        dst.sent = sent == null ? null : sent.copy();
1150        dst.received = received == null ? null : received.copy();
1151        if (reason != null) {
1152          dst.reason = new ArrayList<CodeableConcept>();
1153          for (CodeableConcept i : reason)
1154            dst.reason.add(i.copy());
1155        };
1156        dst.subject = subject == null ? null : subject.copy();
1157        dst.requestDetail = requestDetail == null ? null : requestDetail.copy();
1158        return dst;
1159      }
1160
1161      protected Communication typedCopy() {
1162        return copy();
1163      }
1164
1165      @Override
1166      public boolean equalsDeep(Base other) {
1167        if (!super.equalsDeep(other))
1168          return false;
1169        if (!(other instanceof Communication))
1170          return false;
1171        Communication o = (Communication) other;
1172        return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true)
1173           && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true)
1174           && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true)
1175           && compareDeep(received, o.received, true) && compareDeep(reason, o.reason, true) && compareDeep(subject, o.subject, true)
1176           && compareDeep(requestDetail, o.requestDetail, true);
1177      }
1178
1179      @Override
1180      public boolean equalsShallow(Base other) {
1181        if (!super.equalsShallow(other))
1182          return false;
1183        if (!(other instanceof Communication))
1184          return false;
1185        Communication o = (Communication) other;
1186        return compareValues(status, o.status, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true)
1187          ;
1188      }
1189
1190      public boolean isEmpty() {
1191        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty())
1192           && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty())
1193           && (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty())
1194           && (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (reason == null || reason.isEmpty())
1195           && (subject == null || subject.isEmpty()) && (requestDetail == null || requestDetail.isEmpty())
1196          ;
1197      }
1198
1199  @Override
1200  public ResourceType getResourceType() {
1201    return ResourceType.Communication;
1202   }
1203
1204  @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" )
1205  public static final String SP_IDENTIFIER = "identifier";
1206  @SearchParamDefinition(name="request", path="Communication.requestDetail", description="CommunicationRequest producing this message", type="reference" )
1207  public static final String SP_REQUEST = "request";
1208  @SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" )
1209  public static final String SP_SENDER = "sender";
1210  @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" )
1211  public static final String SP_SUBJECT = "subject";
1212  @SearchParamDefinition(name="patient", path="Communication.subject", description="Focus of message", type="reference" )
1213  public static final String SP_PATIENT = "patient";
1214  @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" )
1215  public static final String SP_RECIPIENT = "recipient";
1216  @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" )
1217  public static final String SP_RECEIVED = "received";
1218  @SearchParamDefinition(name="medium", path="Communication.medium", description="A channel of communication", type="token" )
1219  public static final String SP_MEDIUM = "medium";
1220  @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" )
1221  public static final String SP_ENCOUNTER = "encounter";
1222  @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" )
1223  public static final String SP_CATEGORY = "category";
1224  @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" )
1225  public static final String SP_SENT = "sent";
1226  @SearchParamDefinition(name="status", path="Communication.status", description="in-progress | completed | suspended | rejected | failed", type="token" )
1227  public static final String SP_STATUS = "status";
1228
1229}