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
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
24 const EVENT_NAME
= "patient.ccda.view";
27 * @var int The database identifier for the generated ccda as stored in the ccda table
32 * @var int The database identifier for the ccda document stored in the database if it exists
37 * @var string The type of ccda document. Valid options are currently CCD/Referral/CCDA
42 * @var string The CCDA document content that is to be viewed / output to the screen by the final event consumer
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;
52 * @var string xml|html The output format we want to view the ccda in. Default is html for the human readable format
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
= "";
67 $this->documentId
= 0;
73 public function getCcdaId(): int
80 * @return PatientDocumentViewCCDAEvent
82 public function setCcdaId(int $ccdaId): PatientDocumentViewCCDAEvent
84 $this->ccdaId
= $ccdaId;
91 public function getDocumentId(): int
93 return $this->documentId
;
97 * @param int $documentId
98 * @return PatientDocumentViewCCDAEvent
100 public function setDocumentId(int $documentId): PatientDocumentViewCCDAEvent
102 $this->documentId
= $documentId;
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;
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;
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;
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;
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;