Skip to content

Export profile base interface alongside the profile class#68

Merged
aartaka merged 9 commits intomainfrom
export-profile-override-interfaces
Feb 9, 2026
Merged

Export profile base interface alongside the profile class#68
aartaka merged 9 commits intomainfrom
export-profile-override-interfaces

Conversation

@aartaka
Copy link
Contributor

@aartaka aartaka commented Feb 9, 2026

I was testing CCDA generation and writing tests for it. And I noticed that CCDA profile classes are exported, while interfaces behind them aren’t. Test snippet (added as an extra file in examples/typescript-ccda/):

import type * as CCDA from "./fhir-types/hl7-cda-us-ccda";
import type * as FHIR from "./fhir-types/hl7-fhir-r4-core";

function medicationStatementToMedicationActivity (stat: FHIR.MedicationStatement): CCDA.MedicationActivity | null {
    return null;
}

it fails with CCDA.MedicationActivity not being found.


With this PR, package index.ts has all the necessary type exports, like

export type { MedicationActivity } from "./profiles/MedicationActivity";

This was problematic because e.g.
MedicationActivity CCDA interface wasn’t exported,
while MedicationActivityProfile class was.
The fix gets all non-empty base interfaces
and generated exports for them.

I also tried “export * from "./profiles"”,
but it seems to not work the way I expect.
@aartaka aartaka requested a review from ryukzak February 9, 2026 12:53
Copy link
Collaborator

@ryukzak ryukzak left a comment

Choose a reason for hiding this comment

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

LGTM except comment. Also, please, fix CI.

@aartaka aartaka merged commit 0fad278 into main Feb 9, 2026
29 checks passed
@ryukzak ryukzak deleted the export-profile-override-interfaces branch February 9, 2026 15:47
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.

2 participants