New Fixes (#7770)
[openemr.git] / src / Events / PatientDocuments / PatientDocumentViewCCDAEvent.php
blob4703c96cbcf8f6a07874b57c1c8e916a1b61f3f3
1 <?php
3 /**
4 * PatientDocumentViewCCDAEvent is fired when a ccda document (CCD/CCR/etc) is being viewed in the system. Consumers
5 * of the event can transform the content of the CCDA before it is displayed to the end user or downloaded.
7 * The format field can be used to determine whether the output will be a xml, or html document allowing consumers to
8 * modify the contents.
10 * @package openemr
11 * @link http://www.open-emr.org
12 * @author Stephen Nielson <snielson@discoverandchange.com>
13 * @copyright Copyright (c) 2022 Discover and Change <snielson@discoverandchange.com>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
17 namespace OpenEMR\Events\PatientDocuments;
19 class PatientDocumentViewCCDAEvent
21 /**
22 * Name of the event
24 const EVENT_NAME = "patient.ccda.view";
26 /**
27 * @var int The database identifier for the generated ccda as stored in the ccda table
29 private $ccdaId;
31 /**
32 * @var int The database identifier for the ccda document stored in the database if it exists
34 private $documentId;
36 /**
37 * @var string The type of ccda document. Valid options are currently CCD/Referral/CCDA
39 private $ccdaType;
41 /**
42 * @var string The CCDA document content that is to be viewed / output to the screen by the final event consumer
44 private $content;
46 /**
47 * @var string The path to the stylesheet that was last used to transform the content (empty if no stylesheet was used)
49 private $stylesheetPath;
51 /**
52 * @var string xml|html The output format we want to view the ccda in. Default is html for the human readable format
54 private $format;
56 /**
57 * @var boolean True if the ccda should ignore the user preferences (trimming, sort order, etc). Default false
59 private $ignoreUserPreferences;
61 public function __construct()
63 $this->format = "html";
64 $this->ignoreUserPreferences = false;
65 $this->stylesheetPath = "";
66 $this->ccdaId = 0;
67 $this->documentId = 0;
70 /**
71 * @return int
73 public function getCcdaId(): int
75 return $this->ccdaId;
78 /**
79 * @param int $ccdaId
80 * @return PatientDocumentViewCCDAEvent
82 public function setCcdaId(int $ccdaId): PatientDocumentViewCCDAEvent
84 $this->ccdaId = $ccdaId;
85 return $this;
88 /**
89 * @return int
91 public function getDocumentId(): int
93 return $this->documentId;
96 /**
97 * @param int $documentId
98 * @return PatientDocumentViewCCDAEvent
100 public function setDocumentId(int $documentId): PatientDocumentViewCCDAEvent
102 $this->documentId = $documentId;
103 return $this;
107 * @return string
109 public function getStylesheetPath(): string
111 return $this->stylesheetPath;
115 * @param string $stylesheetPath
116 * @return PatientDocumentViewCCDAEvent
118 public function setStylesheetPath(string $stylesheetPath): PatientDocumentViewCCDAEvent
120 $this->stylesheetPath = $stylesheetPath;
121 return $this;
125 * @return string
127 public function getCcdaType(): string
129 return $this->ccdaType;
133 * @param string $ccdaType
134 * @return PatientDocumentViewCCDAEvent
136 public function setCcdaType(string $ccdaType): PatientDocumentViewCCDAEvent
138 $this->ccdaType = $ccdaType;
139 return $this;
143 * @return string
145 public function getContent(): string
147 return $this->content;
151 * @param string $content
152 * @return PatientDocumentViewCCDAEvent
154 public function setContent(string $content): PatientDocumentViewCCDAEvent
156 $this->content = $content;
157 return $this;
161 * @return string
163 public function getFormat(): string
165 return $this->format;
169 * @param string $format
170 * @return PatientDocumentViewCCDAEvent
172 public function setFormat(string $format): PatientDocumentViewCCDAEvent
174 $this->format = $format;
175 return $this;
179 * @return bool
181 public function shouldIgnoreUserPreferences(): bool
183 return $this->ignoreUserPreferences;
187 * @param bool $ignoreUserPreferences
188 * @return PatientDocumentViewCCDAEvent
190 public function setIgnoreUserPreferences(bool $ignoreUserPreferences): PatientDocumentViewCCDAEvent
192 $this->ignoreUserPreferences = $ignoreUserPreferences;
193 return $this;