How worldhealthorganization/smart-anc works
This project is a FHIR Implementation Guide for the WHO Antenatal Care Guidelines (FHIR R4). In essence, it is not a conventional “full-stack” web application but an artifact repository for defining clinical knowledge (profiles, libraries, measures, plan definitions, questionnaires, and related FHIR resources) that are processed by the HL7 IG Publisher to generate an implementation guide.
Main Components
• Input Artifacts Repository: Represented by the large “input” folder. This includes numerous subfolders for clinical content:
– CQL files (input/cql) for clinical logic.
– Profiles and structure definitions (input/profiles, input/resources, vocabulary, etc.) representing FHIR resource constraints.
– Bundles (bundles, bundlegen folders) and plan/measure definitions.
• Build and Integration Scripts: At the top-level, you see various build scripts (e.g. _genOnce, _updatePublisher, and other .sh/.bat files) that drive the process. Also note the .github/workflows folder that contains CI/CD configuration for automated builds.
• Template Layer: The “templates/liquid” folder that holds Liquid templates to generate documentation and IG pages.
• Publisher and Output Generation: The FHIR IG Publisher tooling (downloadable via _updatePublisher script) that consumes the input artifacts and Liquid templates to generate the final output in the output folder. The output is then deployed to the build.fhir.org IG location.
• External Services: The published IG is hosted on a public URL (http://build.fhir.org/ig/WorldHealthOrganization/smart-anc/). GitHub actions in the CI/CD pipeline trigger build events and deploy updated guides.
Representing Relationships and Data Flow
• The build pipeline (triggered either manually via the provided scripts or automatically through GitHub workflows) calls the “FHIR IG Publisher” tool. This component processes the input artifacts (CQL, profiles, resources, etc.), and combines them with the Liquid templates.
• The FHIR IG Publisher produces the final “Output IG” (located in the output folder) which is then deployed to the public FHIR IG website.
Architectural Patterns and Design Principles
• Separation of concerns is observed by dividing artifact input, build processing, templating/rendering, and publication/deployment.
• The system follows a pipeline architecture: source files → processing scripts → transformation (via IG Publisher and Liquid templates) → final publication.
• Integration is automated via CI/CD (GitHub workflows) which is a critical design principle for ensuring updated guidelines are automatically built and published.
Technologies/Frameworks
• HL7 FHIR IG Publisher: The central engine that ingests the input and generates the IG.
• Liquid Templating Engine: Used for customizing the output documentation and IG pages.
• GitHub Actions/Workflows: Automate the build and publication process.
• Build Scripts (Shell and Batch): For local builds and updates.