Skip to content

Testing a terminology server

This page shows how to test a FHIR terminology server (for example one serving SNOMED CT) with FHIR Frog, using the worked example examples/terminology-test-ig in the fhir-frog-mcp repository. Everything here was run against the public CSIRO Ontoserver (https://r4.ontoserver.csiro.au/fhir), read-only.

What you can test today

Searches: that a code system is served and has the edition you expect, that a value set is discoverable, and that unknown systems give an empty result and not an error. The script below does exactly that and is safe to run against a shared server, because it never writes.

{
  "resourceType": "TestScript",
  "id": "term-server-basics",
  "url": "http://fhirfrog.org/fhir/terminology-tests/TestScript/term-server-basics",
  "name": "TermServerBasics",
  "title": "Terminology server basics (read-only)",
  "status": "draft",
  "test": [
    {
      "id": "snomed-served",
      "name": "SNOMED CT is served and has an Australian edition",
      "action": [
        {
          "operation": {
            "type": { "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes", "code": "search" },
            "resource": "CodeSystem",
            "params": "?url=http://snomed.info/sct",
            "encodeRequestUrl": true,
            "responseId": "snomed-cs"
          }
        },
        { "assert": { "responseCode": "200", "warningOnly": false } },
        { "assert": { "expression": "Bundle.entry.resource.ofType(CodeSystem).where(version.contains('/32506021000036107/')).exists()", "warningOnly": false } }
      ]
    }
  ]
}

Run it, with your server instead of the public one if you like:

frog_run_local(scriptPath: "examples/terminology-test-ig/input/resources/term-server-basics.json", serverUrl: "https://r4.ontoserver.csiro.au/fhir", confirm: true)

confirm: true is required because the target is not a local server; the script itself only searches. Register a server you test often with frog_server_register and use server: "<name>" afterwards (Server specifications).

What you cannot test yet

The checks a terminology specialist wants most are FHIR operations: $lookup (display and designations of a code), $validate-code, $expand (does a value set contain the right concepts), $subsumes, $translate. The test engine cannot run them:

Attempt Result
operation.type.code: "operation" Operation not supported: operation
operation given only as operation.url engine error (a null-pointer failure inside the engine)
capabilities (to read the CapabilityStatement) Operation not supported: capabilities

So today FHIR Frog can check that a terminology server is up and serves the right code systems, but not that its operations return the right answers. This is recorded as an upstream gap (UG-016) in the fhir-frog-mcp repository. If your terminology testing matters to you, tell the FHIR Frog team which operations come first: that is what the upstream request will say.

Where to go next