Compile and check an IG’s translation CodeSystem supplements

Compile the IG’s CodeSystems with every input/fsh/translations/<locale>.fsh CodeSystem supplement in a throw-away FSHOnly SUSHI project, require 0 SUSHI errors, and check that each supplement’s base CodeSystem is the IG’s own, its codes are a subset of the base’s, its language is the file’s locale, and every CodeSystem id is unique. SUSHI is the version ig-toolchain.env pins, installed from scripts/sushi/package-lock.json with install scripts off; the FHIR core package is pinned by sha512; SUSHI runs with no network.

Skills it satisfies

A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.

fhir-validation

Source: fhir-harness/skills/content/fhir-ig-authoring/fhir-validation.md.

Also satisfied by: fsh-cone.

input [1..1]output [1..1]sushiResult [0..1]publisherResult [0..1]conformanceResults [0..*]fhir-validation«skill»fhir-validationinput : FHIRValidationInput [1..1]output : FHIRValidationOutput [1..1]FHIRValidationInput«json-schema»FHIRValidationInputigRoot : string [1..1]validationLevel : "sushi-only" | "publisher-qa" | "full" [0..1]targetProfiles : string[] [0..*]FHIRValidationOutput«json-schema»FHIRValidationOutputoverallStatus : "pass" | "warnings" | "errors" [1..1]sushiResult : FHIRValidationOutput.sushiResult [0..1]publisherResult : FHIRValidationOutput.publisherResult [0..1]conformanceResults : FHIRValidationOutput.conformanceRes… [0..*]FHIRValidationOutput.sushiResult«json-schema»FHIRValidationOutput.sushiResultstatus : string [0..1]errors : integer [0..1]warnings : integer [0..1]FHIRValidationOutput.publisherResult«json-schema»FHIRValidationOutput.publisherResultstatus : string [0..1]qaHtmlPath : string [0..1]errorCount : integer [0..1]warningCount : integer [0..1]infoCount : integer [0..1]FHIRValidationOutput.conformanceResults«json-schema»FHIRValidationOutput.conformanceResultsresource : string [0..1]profile : string [0..1]status : "conformant" | "non-conformant" [0..1]issues : string[] [0..*]

input — fhir-harness/schemas/skills/fhir-validation/input.schema.json

fieldtyperequireddescription
igRootstringyesPath to the IG repository root.
validationLevelsushi-only \| publisher-qa \| fullLevel of validation to perform.
targetProfilesstring[]Specific CRMI profiles to validate against (Shareable, Publishable, Computable, Executable).

output — fhir-harness/schemas/skills/fhir-validation/output.schema.json

fieldtyperequireddescription
overallStatuspass \| warnings \| errorsyes
sushiResultobject
publisherResultobject
conformanceResultsobject[]

Inputs and outputs

Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.

porttyperequireddescriptionconstraint
inigRootRepoPathThe IG root; default the working directory. Only paths its contentTypes.ig.include declares are read.string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments.
injsonFlagPrint the result as JSON.boolean · A boolean switch — projects to a bare flag, with no value word
outverdictTextExit 0 pass or not applicable, 1 findings (each named with its file), 2 could not run. Could-not-run is never a pass.string · A short single-line human string. Not admissible as a command-line argument.

Processes and tasks

Steps this Tool can carry out, because each names a skill it satisfies:

processsteplanevia skill
Incremental IG buildValidate the cone (fhir_validate)Publisher + validator services (JVM)fhir-validation
L3 FHIR IG pipelineValidate against profilesBuild pipeline — SUSHI · validator · IG Publisherfhir-validation

How it is deployed and reached

  • Command line. From the repository root: bun run fhir-harness/scripts/check-translation-supplements.ts.
  • GitHub Actions. 2 workflow line(s) run its command:
workflowline
fhir-harness/.github/workflows/translation-supplements.yml84[ -f fhir-harness/scripts/check-translation-supplements.ts ] \\
fhir-harness/.github/workflows/translation-supplements.yml111run: bun run fhir-harness/scripts/check-translation-supplements.ts "$IG_ROOT" --tarballs "$RUNNER_TEMP/fhir-tarballs"

As an API: its operation in the OpenAPI document and the MCP tool list of its layer.

installcli: npm ci --ignore-scripts --no-audit --no-fund --prefix fhir-harness/scripts/sushi
runtimebun, node, npm
networkyes

When a host it reaches is refused:

host / errorremedy
registry.npmjs.orgnone: SUSHI and the FHIR core package both come from npm. Without it, pass --sushi an installed SUSHI of the pinned version and --tarballs a directory holding the core tarball; both are still verified.
when to choose it
whenA pull request changes an IG’s CodeSystems or its translation supplements, and the IG build is not run on it.
limitsCompiles only CodeSystems, Aliases and RuleSets with the supplements: a base CodeSystem written as an Instance, or one from another package, is reported as missing.
costOne SUSHI run of a few seconds; the first run fetches the pinned FHIR core package (megabytes).

What it is made of

Linked data

The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/fhir-harness/tools/check-translation-supplements.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.

{
  "@context": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.context.jsonld",
  "@id": "https://litlfred.github.io/folio-assistant/fhir-harness/tools/check-translation-supplements.jsonld",
  "@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
  "partOf": "https://litlfred.github.io/folio-assistant/fhir-harness/fhir-harness.jsonld",
  "name": "check-translation-supplements",
  "title": "Compile and check an IG's translation CodeSystem supplements",
  "description": "Compile the IG's CodeSystems with every `input/fsh/translations/<locale>.fsh` CodeSystem supplement in a throw-away FSHOnly SUSHI project, require 0 SUSHI errors, and check that each supplement's base CodeSystem is the IG's own, its codes are a subset of the base's, its language is the file's locale, and every CodeSystem id is unique. SUSHI is the version `ig-toolchain.env` pins, installed from `scripts/sushi/package-lock.json` with install scripts off; the FHIR core package is pinned by sha512; SUSHI runs with no network.",
  "install": {
    "cli": "npm ci --ignore-scripts --no-audit --no-fund --prefix fhir-harness/scripts/sushi"
  },
  "invoke": {
    "shell": "bun run fhir-harness/scripts/check-translation-supplements.ts"
  },
  "io": {
    "inputs": [
      {
        "name": "igRoot",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
        "description": "The IG root; default the working directory. Only paths its `contentTypes.ig.include` declares are read.",
        "required": false,
        "arg": {
          "positional": 0
        }
      },
      {
        "name": "json",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
        "description": "Print the result as JSON.",
        "required": false,
        "arg": {
          "flag": "--json"
        }
      }
    ],
    "outputs": [
      {
        "name": "verdict",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Text",
        "description": "Exit 0 pass or not applicable, 1 findings (each named with its file), 2 could not run. Could-not-run is never a pass."
      }
    ]
  },
  "satisfies": [
    "fhir-validation"
  ],
  "requirements": {
    "runtime": [
      "bun",
      "node",
      "npm"
    ],
    "network": true
  },
  "remedies": [
    {
      "host": "registry.npmjs.org",
      "none": "SUSHI and the FHIR core package both come from npm. Without it, pass `--sushi` an installed SUSHI of the pinned version and `--tarballs` a directory holding the core tarball; both are still verified."
    }
  ],
  "selection": {
    "when": "A pull request changes an IG's CodeSystems or its translation supplements, and the IG build is not run on it.",
    "limits": "Compiles only CodeSystems, Aliases and RuleSets with the supplements: a base CodeSystem written as an Instance, or one from another package, is reported as missing.",
    "cost": "One SUSHI run of a few seconds; the first run fetches the pinned FHIR core package (megabytes)."
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev