On this page

0001 Authoring format and versioning

  • Status: accepted
  • Date: 2026-12-05
  • Issue: OPE-10

Decision​

OpenOrchid Core is a FHIR implementation guide, written in FHIR Shorthand and built into a FHIR package.

PointDecision
Authoring formatFHIR Shorthand (FSH) for profiles, invariants and examples. Markdown for the rules and decisions.
Build toolSUSHI 3.21.1, pinned in package.json, run by npm run build. Snapshots come from SUSHI's --snapshot.
Where the source livespackages/spec in this repository, a new folder that no upstream Medplum file touches.
Package nameca.openorchid.core
Canonical URL basehttps://openorchid.ca/fhir/core. Each profile is <base>/StructureDefinition/<id>.
Version schemeSemantic versioning, MAJOR.MINOR.PATCH, set once in sushi-config.yaml.
Infoway packagesCA Core+ ca.infoway.io.core 1.2.1-dft, pinned exactly, with the dependencies listed in sushi-config.yaml.
Rules beside the profilesrules/*.md, decisions/*.md and CHANGELOG.md go into the package under package/other/, so one versioned file holds all of it.

The build reads every package from vendor/ folders: the Canadian packages from packages/canada (whose manifest pins them), and the FHIR R4 base and FHIR tooling packages from packages/spec/vendor (pinned in build-packages.json). It checks each file's SHA-256, gives SUSHI a package cache filled from those files, and fails if SUSHI downloads anything. SUSHI also asks the npm registry for its own latest version; that check fails quietly without a network and does not affect the output.

The build writes dist/ca.openorchid.core-<version>.tgz, the same files unpacked in dist/package/, and dist/install/, batches of conditional updates that install the profiles into a server, as the Canadian packages are installed.

Why​

  • FSH is the standard way to write FHIR profiles, and CA Core+ is itself an implementation guide. A profile written in FSH reads close to the rule it states, and an Infoway reviewer can read it.
  • SUSHI runs on Node, like the rest of this repository. The HL7 IG Publisher, which renders implementation guides as web pages, needs Java and downloads terminology while it runs; the spec pages are rendered by our docs site instead (OPE-54).
  • The server validates against a StructureDefinition's snapshot, so the package carries snapshots.
  • A FHIR package is what servers, validators and other tools already install, and it carries its own version.

What a version number means​

An app pins one version of the spec. What counts as a change, from the point of view of an app built on it:

  • Major (2.0.0): a change after which a record or request that passed the old version can fail, or a reader can no longer rely on something the old version guaranteed. Making an element required, narrowing a value set or a type, adding an invariant to an existing profile, removing or renaming a profile, changing a canonical URL or a health card system, adding a rule an app must newly keep, and making a required element optional (a reader could have relied on it).
  • Minor (1.1.0): additions that change nothing for an app that already conforms. A new profile, a new optional extension, a new rule that applies only to a new profile or a new kind of app, a check for a format the rules already required.
  • Patch (1.0.1): wording, examples and fixes that change no validation result for any record.

Versions before 1.0.0 are drafts: any change can come in any version, and no app should be built to them for production. The canonical URL base, the package name and the domain (OPE-32) must be final before 1.0.0, because changing them afterwards is a major change.

A released version never changes. npm run release copies the built package into releases/<version>/ and records its checksum. The docs site renders each version's pages, and serves its package for download, from that copy, so later changes on the main branch cannot change a released version, and a test fails if the copy is edited. The commit that adds the copy is tagged spec-v<version>, which marks the source it was built from.

Following Infoway's releases​

The pins move only through the procedure in packages/canada/README.md, after the weekly version check (OPE-63) files an issue. When a CA Core+ pin moves, npm run build and npm test in packages/spec show whether every OpenOrchid example still passes both its OpenOrchid profile and the new CA Core+ profile. The spec takes a new version with the pin: major if any record that passed before can now fail, otherwise minor.

Consequences​

  • The spec builds with no network, from one command, and the same inputs give the same package contents. The .tgz file itself differs from build to build, because tar records file times.
  • The package adds about 13 MB to the repository for the FHIR R4 base package in vendor/.
  • SUSHI's snapshots are not byte for byte the IG Publisher's. The tests validate every example with the server's own validator, which is the one that matters for apps on OpenOrchid.