Summary
SDC questionnaires can declare sourceStructureMap for Tier-5 extraction. HAIstack defines StructureMapExtractor in pkg/sdc but does not ship a StructureMap execution engine. Extraction fails when a questionnaire references a map and no runtime is plugged in.
Problem
QuestionnaireExtractor routes to StructureMapExtractor when sourceStructureMap is set
- Default runtime wires
QuestionnaireExtractor without StructureMap.Run
- Error today:
StructureMap runtime is unavailable for <canonical>
- Definition/template extraction covers many cases, but map-based extraction is a normative SDC path
Proposed scope
Implement a StructureMap runtime (suggested: pkg/structuremap or separate module) that:
- Loads StructureMap resources (store / registry / canonical resolution)
- Executes map groups/rules against Questionnaire + QuestionnaireResponse inputs
- Produces FHIR resources for transaction bundle entries
- Integrates via existing
StructureMapExtractor.Run hook
Integration points
pkg/sdc/assembly.go — StructureMapExtractor
pkg/sdc/extraction.go — QuestionnaireExtractor.StructureMap
pkg/runtime/wire.go — optional default wiring when maps are present
modules/sdc/examples/extraction-template.json — example map artifact
Out of scope (initial)
- Full FHIR R4/R5 StructureMap transform catalog parity on day one
- CQL transforms inside maps (depends on CQL library issue)
Acceptance criteria
Related
Summary
SDC questionnaires can declare
sourceStructureMapfor Tier-5 extraction. HAIstack definesStructureMapExtractorinpkg/sdcbut does not ship a StructureMap execution engine. Extraction fails when a questionnaire references a map and no runtime is plugged in.Problem
QuestionnaireExtractorroutes toStructureMapExtractorwhensourceStructureMapis setQuestionnaireExtractorwithoutStructureMap.RunStructureMap runtime is unavailable for <canonical>Proposed scope
Implement a StructureMap runtime (suggested:
pkg/structuremapor separate module) that:StructureMapExtractor.RunhookIntegration points
pkg/sdc/assembly.go—StructureMapExtractorpkg/sdc/extraction.go—QuestionnaireExtractor.StructureMappkg/runtime/wire.go— optional default wiring when maps are presentmodules/sdc/examples/extraction-template.json— example map artifactOut of scope (initial)
Acceptance criteria
QuestionnaireExtractoruses runtime whensourceStructureMapis configuredTestQuestionnaireExtractorUsesMetadatawith a real engineRelated
pkg/sdc/assembly.go(StructureMapExtractor)pkg/sdc/gaps_test.go(stubRunexample)