How aphp/fhir-mapbuilder works
Project type and purpose
• This is a two‑part developer tool:
– A Visual Studio Code extension (TypeScript) that provides language support (syntax highlighting, snippets, completions, on‑the‑fly validation) for a custom FHIR mapping language (FML).
– A Java Spring Boot application (fhir‑mapbuilder‑validation) that implements the core validation/compilation/translation engine as a REST API (or launched as a standalone JAR).
• Together they form a “full‑stack” IDE integration: the extension is the UI/client and the Spring Boot service is the backend validation engine.
File structure
Top‑level
• .github/workflows – CI/CD pipelines (build, test, release, publish)
• vscode‑extension/ – VS Code extension project
• fhir‑mapbuilder‑validation/ – Spring Boot validation engine
In vscode‑extension/
• src/extension.ts – entry point for the VS Code extension host
• FmlCompletionProvider.ts – supplies code completion items
• FmlValidation.ts – orchestrates validation requests
• MapBuilderJavaProcess.ts – spawns or manages the JAR process
• MapBuilderValidationApi.ts – issues HTTP requests to the local Spring Boot server
• MapBuilderWatcher.ts – watches FML files for changes
• constants/, Models.ts, utils.ts – shared types and constants
• syntaxes/, snippets/ – grammar & snippet definitions
In fhir‑mapbuilder‑validation/
• src/main/java/fr/aphp/mapbuilder/MatchBoxApplication.java – Spring Boot bootstrap
• config/MatchboxEngineConfig.java – DI and engine configuration
• controller/HealthController.java, MatchBoxController.java, ShutdownController.java – REST endpoints
• service/MatchBoxService.java – core validation business logic
• model/*.java – representation of errors (ParsingError, ValidationError, etc.)
• utils/FileUtils.java – file handling
• src/main/resources/application.yaml – server configuration
README for additional insights
• Confirms the two‑module structure
• Describes build flow:
– mvn package ⇒ produces fhir‑mapbuilder‑validation.jar
– Move the JAR into vscode‑extension/target
– npm install + vsce package ⇒ .vsix
• Runtime flow:
– Run Spring Boot: mvn spring‑boot:run
– Launch VS Code extension host (F5)