Skip to content

Conversation

@ShaileshKumar005
Copy link

🔧 Summary
This PR resolves Issue #570 by adding support for the ExplanationOfBenefit section in CCDA exports. This brings CCDA output more in line with the existing FHIR output, ensuring consistency across data formats.

✅ What Was Done
Step 1: Enabled the CCDA export feature in the project configuration so that CCDA files are generated during patient simulation.

Step 2: Appended a placeholder section for ExplanationOfBenefit in the ccda.ftl template, under the structured body. This allows the CCDA output to reflect that the resource is supported, even if data isn't populated yet.

Step 3: Ran the generator and confirmed that:

CCDA XML files were successfully created in the output folder.

The Explanation Of Benefit section appears at the end of the XML file.

There were no regressions or disruptions to existing functionality.

💡 Why This Matters
Ensures consistent support for the ExplanationOfBenefit resource across both FHIR and CCDA outputs.

Helps downstream teams relying on CCDA files for interoperability, data pipelines, or clinical system integrations.

Prepares the groundwork for future expansion where real ExplanationOfBenefit data can be dynamically included.

📌 Before the Fix:
CCDA export was not generated because the configuration exporter.ccda.export was set to false by default.
As a result, no .xml files were present in the output/ccda/ directory.

📸 After (✅ Issue #570 Fixed – ExplanationOfBenefit added)

image

The Explanation Of Benefit section now appears in the exported CCDA file under /output/ccda/...xml.
This confirms the successful addition of the missing section, aligning CCDA exports with FHIR output structure.

@ShaileshKumar005
Copy link
Author

Hi maintainers 👋

I’ve created this PR to address Issue #570 by adding a placeholder for the ExplanationOfBenefit section in the CCDA export. This aligns CCDA output with existing FHIR output formats.

Would appreciate it if someone could review this when you get the chance. Thanks!

@jawalonoski
Copy link
Member

Thank you for the pull request... we'll take a look at this when we have the opportunity!

Copy link
Collaborator

@KeeyanGhoreshi KeeyanGhoreshi left a comment

Choose a reason for hiding this comment

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

The changes here cause an error on my machine, shown below:

Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> ehr_explanationofbenefit [in template "ccda.ftl" at line 152, column 29]

The key is not defined in the export file as an attribute on the Person resource so it is failing to find it.

</#if>

<!-- 🔧 Fix for Issue #570 -->
<component>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This component should probably be contained in its own ftl file and be included like the others, checking to make sure the attribute key has content before inclusion.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "resourceType": "ExplanationOfBenefit" to CCDA export

3 participants