What it does

Validate FHIR JSON

Calls a remote FHIR $validate endpoint, parses OperationOutcome results, and prints a structured report with severity, category, and best-effort line numbers.

Scan Health IT logs

Summarizes error and warning counts, supports error-only printing, and includes JSON output mode for scripting.

Readable at scale

Issues are grouped by severity, code, and message, with theme summaries to keep large bundles manageable.

Quickstart

Validate FHIR resources

cargo run -- validate examples/patient.json --base-url https://server.fire.ly
cargo run -- validate examples/patient-bad.json --base-url https://server.fire.ly

Scan health IT logs

cargo run -- scan demo-healthit.log
cargo run -- scan demo-healthit.log --errors-only
cargo run -- scan demo-healthit.log --json

Prefer the binary? Download the latest release on GitHub or build from source with cargo build --release.

Example outputs

PASS (examples/patient.json)

FHIR Validation
--------------
File: examples/patient.json
Base: https://server.fire.ly
Validate: https://server.fire.ly/Patient/$validate
HTTP: 200 OK
Issues: 1 (errors: 0, warnings: 0, info: 1)
Total: 1 issues in 1 categories
Result: PASS ✅
Themes:
  1. General (x1)

Top Issue Groups:
- information | informational | The operation was successful (x1)

Issue Categories (severity/code/message):
- information | informational | The operation was successful (1): information: 1
  1. [information] The operation was successful

FAIL (examples/patient-bad.json)

FHIR Validation
--------------
File: examples/patient-bad.json
Base: https://server.fire.ly
Validate: https://server.fire.ly/Patient/$validate
HTTP: 200 OK
Issues: 1 (errors: 1, warnings: 0, info: 0)
Total: 1 issues in 1 categories
Result: FAIL ❌
Themes:
  1. General (x1)

Top Issue Groups:
- error | code-invalid | Code 'invalid-gender-value' does not exist in the value set 'AdministrativeGender' (http://hl7.org/fhir/ValueSet/administrative-gender), but the binding is of strength 'required' (x1)

Issue Categories (severity/code/message):
- error | code-invalid | Code 'invalid-gender-value' does not exist in the value set 'AdministrativeGender' (http://hl7.org/fhir/ValueSet/administrative-gender), but the binding is of strength 'required' (1): error: 1
  1. [error] Code 'invalid-gender-value' does not exist in the value set 'AdministrativeGender' (http://hl7.org/fhir/ValueSet/administrative-gender), but the binding is of strength 'required'
     expression: Patient.gender[0]

Error: "FHIR validation failed"

Synthea testing guidance

Synthea bundles often rely on US Core and other implementation guide profiles. If the validation server does not have those packages installed, you will see errors like "Unable to resolve reference to profile ...". ClinLogix groups these under the theme Profile resolution (missing profiles on server) while preserving category grouping and JSON path expressions.

Generate Synthea data (optional)

./run_synthea -p 1

Install Synthea from https://github.com/synthetichealth/synthea and copy a bundle JSON into synthea/.

Validate bundles

for f in synthea/*.json; do
    cargo run -- validate "$f" --base-url https://server.fire.ly
done

Pipefail verification

set -o pipefail; for f in synthea/*.json; do
    cargo run -- validate "$f" --base-url https://server.fire.ly
done | rg -n "Themes:|Profile resolution|Validate:"; echo $?

Alternative validators: https://server.fire.ly, https://hapi.fhir.org/baseR4, or a local validator with US Core packages installed.

How to enable GitHub Pages

  1. GitHub repo → Settings → Pages.
  2. Source: Deploy from a branch.
  3. Branch: main (or default) + folder: /docs.
  4. Save and copy the generated URL.
  5. Repo main page → About → Website → paste the Pages URL.

Project website: https://princey9.github.io/clinlogix/. README: https://github.com/Princey9/clinlogix#readme.