Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatching an event here allows custom modules to modify the C-CDA #7253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DennisonWilliams
Copy link
Contributor

Dispatching an event here allows custom modules to modify the C-CDA before it is saved

Fixes #7252

Short description of what this resolves:

This change allows authors of custom modules to change a C-CDA before it is saved to file.

Changes proposed in this pull request:

Dispatch a service event before the C-CDA is saved by the documents subsystem

Copy link
Sponsor Member

@adunsulag adunsulag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked it over, everything looks fine from what I can see. I haven't pulled the code down to test it yet.

@@ -3378,6 +3391,19 @@ public function logCCDA($pid, $encounter, $content, $time, $status, $user_id, $d

$mimeType = "text/xml";

// Let listeners know we are about to save a C-CDA
$send = array("CCDA" => $content, 'pid' => $pid);
$event = new ServiceSaveEvent($patientService, $send);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using the CDADocumentService in your ServiceSaveEvent. The PatientService has a number of listeners in it and those listeners will have a problem if it receives a non patient record.

If you use the CDADocumentService and your $send represents a ccda table record entry then just changing the CCDA column to be ccda_content should make it so everything plays nice in the event system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event for C-CDA generration
3 participants