Skip to content

Releases: dnlbox/fhir-test-data

v0.3.0

Choose a tag to compare

@dnlbox dnlbox released this 09 Jul 19:59

Added

  • Bundle recipes: generate bundle --recipe <file> now accepts user-defined YAML or JSON recipes for deterministic, pipeline-oriented Bundle generation. Recipes define ordered resources, aliases, field overrides, and reference wiring while keeping clinical meaning user-owned.
  • Public recipe API: createBundleFromRecipe(recipe, options) plus exported recipe types.
  • Starter recipe examples under examples/recipes/ for lab result, condition plus medication, and diagnostic workup bundle shapes.

Full changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@dnlbox dnlbox released this 01 Jun 19:27

What's Changed

  • chore(deps): upgrade commander to v14 by @dnlbox in #1
  • chore(deps): migrate to pnpm 11 by @dnlbox in #2
  • docs: migrate to shared @fhir-toolkit/docs-theme by @dnlbox in #3
  • chore: release version 0.2.0 by @dnlbox in #4
  • fix(ci): add NODE_AUTH_TOKEN env for npm publish by @dnlbox in #5
  • fix(ci): use node lts and restore registry-url for OIDC trusted publish by @dnlbox in #6

New Contributors

  • @dnlbox made their first contribution in #1

Full Changelog: v0.1.3...v0.2.0

v0.1.3

Choose a tag to compare

@dnlbox dnlbox released this 24 Apr 19:20

Changes

Added

  • createEncounterBuilder — R4/R4B/R5 Encounter with HL7 v3 ActCode class, SNOMED CT type, status-consistent period, and optional subject reference. R5 adapter converts class to CodeableConcept array per spec.
  • createDiagnosticReportBuilder — R4/R4B/R5 DiagnosticReport with LOINC report code, HL7 v2-0074 category (matched to code), and optional subject reference.
  • missing-status fault — removes status from any resource; triggers a required-field warning in fhir-resource-diff validate
  • invalid-status-value fault — sets status to a string outside the resource's value set; triggers a status-value warning in fhir-resource-diff validate
  • CLI: generate encounter and generate diagnostic-report commands
  • llms.txt with full API reference, locale table, and companion tool cross-references

Changed

  • README: added "What is FHIR?" intro, Encounter and DiagnosticReport in the resource description, ecosystem table with all three sister tools, pipeline integration examples, and Development section

Full changelog: https://github.com/dnlbox/fhir-test-data/blob/main/CHANGELOG.md

v0.1.2

Choose a tag to compare

@dnlbox dnlbox released this 22 Mar 00:35

Fixed

  • Deno compatibility — tsup/esbuild silently strips the node: prefix from
    built-in imports in the bundle output, so import { createRequire } from "node:module"
    became import { createRequire } from "module" in the dist files, which Deno rejects.
    The real fix eliminates the createRequire import entirely: the package version is now
    read from package.json at build time in tsup.config.ts and injected as
    __PACKAGE_VERSION__ via esbuild's define option. The version becomes a plain inlined
    string in the bundle with no runtime Node.js built-in import.

v0.1.1

Choose a tag to compare

@dnlbox dnlbox released this 22 Mar 00:09

Fixed

  • CLI version flag — the version string passed to Commander was hardcoded as "0.1.0".
    It now uses createRequire(import.meta.url) to load the version field from package.json
    at runtime, so -V always reflects the published package version.
  • --count validation (spec 29)generate --count 0, --count -1, and --count abc
    now exit with code 1 and a clear error message to stderr instead of silently outputting an
    empty array. Numeric values are displayed unquoted; non-numeric strings are quoted.
    Example: Error: --count must be a positive integer, got 0
  • --annotate pipeline hint (spec 30) — When --annotate is used and stdout is a TTY
    (interactive terminal), a hint is printed to stderr explaining that piping to
    fhir-resource-diff validate requires extracting .resource first via jq '.resource'.
    The hint is suppressed when stdout is piped — it never appears in pipe output.
    The --annotate help text now documents the { resource, notes } wrapper shape and the
    required jq workaround for pipeline use.

v0.1.0

Choose a tag to compare

@dnlbox dnlbox released this 20 Mar 23:57

Added

  • Fluent builder API — immutable method chaining for all resource types.
    Each builder method returns a new instance; chains are composable and safe to
    reuse across tests.
  • Patient builder — generates Patient resources with locale-appropriate
    identifiers, names, addresses, telecom, gender, birthDate, and communication
    entries.
  • Practitioner builder — generates Practitioner resources with locale-appropriate
    professional identifiers, names with title prefixes, work email, and MD qualification.
  • PractitionerRole builder — links a Practitioner to an Organization with a
    coded role and specialty.
  • Organization builder — generates Organization resources with locale-appropriate
    identifiers, names, addresses, and telecom.
  • Observation builder — generates LOINC-coded Observation resources (vital signs
    and lab results) with realistic valueQuantity ranges and UCUM units. Requires a
    subject reference.
  • Condition builder — generates SNOMED-CT-coded Condition resources with clinical
    status and onset date. Requires a subject reference.
  • AllergyIntolerance builder — generates SNOMED-CT-coded AllergyIntolerance
    resources with type, category, criticality, and reaction. Requires a subject
    reference.
  • MedicationStatement builder — generates MedicationStatement resources with
    a medication code, status, and effective period. Requires a subject reference.
  • Bundle builder — composes all resource types into a single FHIR Bundle with
    automatic reference wiring. All internal references use urn:uuid: format.
    Supports transaction, collection, and searchset bundle types.
  • FHIR multi-version support — all builders accept .fhirVersion("R4" | "R4B" | "R5").
    Default is "R4". R4B is structurally identical to R4 for all generated resources.
    R5 applies two structural adaptations:
    • MedicationStatementMedicationUsage: resource type renamed, medication field
      restructured from medicationCodeableConcept to medication.concept.
    • AllergyIntolerance.type: changed from a plain code string to a CodeableConcept
      with a coding array.
  • Seeded deterministic generation — the .seed(n) method guarantees that the
    same seed always produces the same output, across runs, machines, and Node versions.
    Built on a seedable PRNG with no Math.random() dependency.
  • 14 locales — country-specific name pools, address formats, and identifier systems
    for: us, uk, au, ca, de, fr, nl, in, jp, kr, sg, br, mx, za.
  • Check-digit-validated identifiers — all patient and practitioner identifiers
    pass their country's official check-digit algorithm: Luhn (AU, FR, US), Modulus 11
    (UK NHS), Verhoeff (IN Aadhaar), 11-proef (NL BSN), Modulus 97 (FR NIR),
    Modulus 10 (DE LANR).
  • Fault injection — the fhir-test-data/faults subpath export allows generating
    intentionally invalid resources for testing error paths, validation pipelines, and
    rejection behaviour.
  • CLI generate commandfhir-test-data generate <type> produces resources to
    stdout or a file directory. Supports --locale, --count, --seed, --fhir-version,
    --output, --format (json/ndjson), --pretty / --no-pretty.
  • Browser-safe coresrc/core/ has no Node.js API imports and runs in browsers,
    Deno, and Cloudflare Workers without configuration.