Initial Release
Generates an OpenAPI 3.0.3 document from the /metadata (CapabilityStatement) of a FHIR R4
server, inside InterSystems IRIS. Written for the InterSystems Community Bounty, idea
DPI-I-804.
One ObjectScript method, ##class(Forge.Api).Generate(baseUrl, outputFile), makes one request to
<baseUrl>/metadata and writes a JSON file. Paths and search parameters come only from what the
server declares. Declared features the generator does not describe (operations, profiles,
conditional interactions) become warnings. Headers for a protected /metadata go in the
FORGE_HEADERS_JSON environment variable.
Needs Docker with Compose v2 and about 30 GB of free disk space for the first build.
docker compose up -d --build --wait
This starts IRIS for Health Community with a demo FHIR R4 server at
http://localhost:52773/fhir/r4 and the generator in namespace USER.
docker compose exec -T iris iris session IRIS -U USER <<'EOF'
set sc = ##class(Forge.Api).Generate("http://localhost:52773/fhir/r4", "/tmp/fhir-r4-openapi.json")
write $select(sc: "OK", 1: $system.Status.GetErrorText(sc)), !
halt
EOF
docker compose cp iris:/tmp/fhir-r4-openapi.json out/
docker compose up -d swagger-ui
Then open http://localhost:8080.
./tests/smoke.sh
Needs openapi-spec-validator (pip install -r tests/requirements.txt).
MIT.