Skip to content
shinrenpanPublic

About

Siming (司命) — the Daoist deity who governs life and lifespan, keeper of the record of every mortal's days. A fitting name for a server that keeps the record of every patient's health.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Siming

CI

A high-performance FHIR R4 server written in Swift. Designed for Taiwan healthcare — TW Core IG compliant, one-command deployment, built-in resource browser.

Stack: Hummingbird 2 (SwiftNIO) · PostgresNIO (no ORM) · FHIRModels

Quick start

Docker (one-command)

Requires Docker Desktop. Works on macOS, Linux, and Windows.

git clone https://github.com/shinrenpan/Siming.git
cd Siming
bash scripts/setup.sh

Server ready at http://localhost:8080 · FHIR Browser at http://localhost:8080/ui

setup.sh pulls the prebuilt image ghcr.io/shinrenpan/siming (linux/amd64 and linux/arm64, FHIR packages included) — nothing is compiled. It follows latest; pin a release with SIMING_VERSION=1.6.0 in .env. Images are published from v1.5.0 on.

Docker, built from source

bash scripts/setup.sh --build

Fetches the FHIR packages and compiles this checkout (docker compose up --build). The release build needs more than 8 GB of memory available to Docker. On a smaller VM (Colima, Docker Desktop with a low limit) the compiler is killed with signal 9; set SWIFT_BUILD_FLAGS="-j 1 -Xswiftc -no-whole-module-optimization" in .env before running it (or pass it as --build-arg to a manual docker build). Even then the last few large files leave little headroom — stop other containers on the same VM while it builds.

macOS (native, for development)

Requires Swift 6.2+ and Docker (for Postgres only).

bash scripts/fetch-packages.sh   # one-time
bash scripts/run-macOS.sh

Scope

Siming is a clinical data server — it stores and searches clinical resources for small clinics. It is not a terminology server: CodeSystem/ValueSet CRUD and operations ($expand, $lookup) are out of scope. Terminology validation is handled by the optional HL7 Validator sidecar.

Capabilities

  • 27 FHIR R4 resource types — CRUD, search, history, compartment, transaction bundle (PractitionerRole indexes practitioner only — see notes)
  • TW Core IG v1.0.0 — 9/9 profiles validated; $validate with optional HL7 Validator sidecar
  • Search — chained, _has, _include/_revinclude, _summary, _elements, cursor pagination
  • Security — SMART on FHIR JWT bearer (opt-in, setup), per-IP rate limiting (opt-in), CORS
  • Built-in browser — GET /ui — CRUD for all resource types, JSON editor, response-time indicator
  • Observability — Prometheus metrics (GET /metrics), X-Request-ID trace header
  • Generated search — search extractors are generated from the loaded FHIR packages, not hand-written; changing the IG is a package swap + regenerate, no handler rewrites (details)

→ Full documentation · Roadmap — known gaps and what is deliberately not planned

Benchmarks

Release build · 5 000 patients · both servers on PostgreSQL. See benchmarks/README.md.

Scenario Siming HAPI FHIR Ratio
GET /Patient/:id 15 515 RPS 6 883 RPS 2.25×
GET /Patient?name=Wang 2 512 RPS 1 627 RPS 1.54×

License

MIT — see LICENSE.


Built with Claude Code

About

Siming (司命) — the Daoist deity who governs life and lifespan, keeper of the record of every mortal's days. A fitting name for a server that keeps the record of every patient's health.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages