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