Amy-Term

Amy-Term User Guide

This guide explains how to operate Amy-Term in a production environment. The system manages local terminologies, FHIR-like terminology APIs, ValueSets, ConceptMaps, ATC and SNOMED CT.

Complete API Reference (OpenAPI / Swagger)

Amy-Term exposes a fully documented REST API using FastAPI OpenAPI. While this guide shows the most common and recommended calls, the complete and authoritative API reference is available via the built-in Swagger UI.

GET http://localhost:8000/docs

The OpenAPI interface allows you to:

  • Browse all available endpoints (FHIR, admin, federation, tools)
  • Inspect request and response schemas
  • Execute live API calls directly from the browser
  • View authentication requirements per endpoint

Important:
The examples shown in this documentation are curated usage patterns. If an endpoint exists in /docs, it is supported, even if it is not shown explicitly here.

At a glance

  • Upload Excel / CSV / JSON / NDJSON
  • Browse and curate CodeSystems, ValueSets and ConceptMaps
  • Use Tools & Designer for interactive ValueSet/ConceptMap authoring
  • Integrate SNOMED CT via Snowstorm
  • Expose FHIR-style APIs for CodeSystem/ValueSet/ConceptMap operations
  • Export selected artefacts for offline regional deployment (federation bundles)

Route Model

The platform exposes two route families for the same terminology content.

  • Human-facing UI routes: use /ui/... aliases such as /ui/codesystems, /ui/valuesets, and /ui/conceptmaps.
  • FHIR API routes: use /fhir/CodeSystem/..., /fhir/ValueSet/..., and /fhir/ConceptMap/... for standards-based integration.
  • The older UI paths like /codesystems and /valuesets still work for backward compatibility.
Examples
UI versus FHIR API
GET /ui/codesystems
GET /ui/valuesets
GET /fhir/CodeSystem/$lookup?system=http://fhir.de/CodeSystem/atc-gkv&code=A02AA05
GET /fhir/ValueSet/$expand?url=http://example.org/fhir/ValueSet/test

1. Purpose

Amy-Term is a self-contained terminology platform designed for national and enterprise deployments, including environments with intermittent connectivity.

What it provides

  • Internal persistence for CodeSystems, Concepts, ValueSets and ConceptMaps
  • FHIR-style terminology operations (such as $lookup, $expand, $translate)
  • SNOMED CT integration (Snowstorm proxy browser and related operations)
  • Federation to export selected artefacts and replicate to regional nodes
FHIR base URL check (example)
Use your deployment base URL.
GET /fhir/metadata
Accept: application/fhir+json
Health check (if enabled in your app)
If you have a dedicated endpoint, prefer it.
GET /health
Accept: application/json

2. Roles and access

Amy-Term distinguishes between viewer and admin roles. Viewer users can browse and use most read APIs, while admin users can import, curate and export.

Typical access patterns

  • Viewer: browse CodeSystems/ValueSets/ConceptMaps, run searches, use FHIR terminology operations
  • Admin: import content, manage artefacts, run federation capture, export bundles, configure node identity
Session-based UI usage
If not authenticated, you should be redirected to the login page.
GET /codesystems
GET /valuesets
GET /tools

3. CodeSystems

A CodeSystem is where the concepts (codes) live. Examples include ICD-10-GM, OPS, LOINC, ATC, and local code lists.

UI

  • Browse and manage: /codesystems
  • View concepts (where implemented): follow the UI actions from the CodeSystems list
FHIR $lookup (CodeSystem)
Returns properties and display for a code.
GET /fhir/CodeSystem/$lookup?system=http://fhir.de/CodeSystem/atc-gkv&code=A02AA05
Accept: application/fhir+json
FHIR $lookup (with version)
Include version if you manage multiple versions.
GET /fhir/CodeSystem/$lookup?system=http://fhir.de/CodeSystem/atc-gkv&version=2025&code=A02AA05
Accept: application/fhir+json

If you support a local CodeSystem URL, you can use that as the system parameter.

4. ValueSets

A ValueSet is a curated selection of codes (typically from one or more CodeSystems). It is used for searching, validation, and decision logic.

UI

  • Browse and edit: /valuesets
  • Design studio (recommended for authoring): /tools
FHIR $expand (ValueSet)
Expand by canonical URL.
GET /fhir/ValueSet/$expand?url=http://amterm.local/fhir/ValueSet/example
Accept: application/fhir+json
FHIR $validate-code (ValueSet)
Validate membership of a code in a ValueSet.
GET /fhir/ValueSet/$validate-code?url=http://amterm.local/fhir/ValueSet/example&system=http://fhir.de/CodeSystem/atc-gkv&code=A02AA05
Accept: application/fhir+json

If your installation supports paging parameters for expand, use them for large ValueSets.

5. ConceptMaps

ConceptMaps define mappings between code systems (for example ICD-10-GM → SNOMED CT, or local codes → national codes). Amy-Term supports ConceptMap authoring and translation operations.

UI

  • ConceptMap authoring: /tools (Tools & Designer)
  • ConceptMap list (where implemented): link from Tools & Designer
FHIR $translate (ConceptMap)
Translate a code from source to target system.
GET /fhir/ConceptMap/$translate?source=http://fhir.de/CodeSystem/icd-10-gm&target=http://snomed.info/sct&code=F20.0
Accept: application/fhir+json
FHIR $translate (explicit ConceptMap url)
Use this if you want to select a specific mapping set.
GET /fhir/ConceptMap/$translate?url=http://amterm.local/fhir/ConceptMap/icd10gm-to-snomed&code=F20.0
Accept: application/fhir+json

6. ATC (German GKV/WIdO and WHO)

ATC is supported as a normal CodeSystem with optional enrichment properties (for example German therapeutic headings and DDD text). Use the ATC browser to search by code or display and to access $lookup.

UI

  • ATC browser: /atc/browser
  • ATC import (admin): /atc/import
ATC search (UI query parameters)
Search is independent of level: use q only.
GET /atc/browser?q=A02AA05
GET /atc/browser?q=omeprazole
GET /atc/browser?system=http://fhir.de/CodeSystem/atc-gkv&q=A02AA05
ATC $lookup enrichment (FHIR)
DDD and German headings appear as additional properties when stored.
GET /fhir/CodeSystem/$lookup?system=http://fhir.de/CodeSystem/atc-gkv&code=A02AA05
Accept: application/fhir+json

7. SNOMED CT (Snowstorm integration)

SNOMED CT is typically integrated through Snowstorm. Amy-Term provides a UI entry point and proxy endpoints depending on your setup.

UI

  • SNOMED browser: /snomed
  • Branch management and expansions: use your SNOMED tooling pages (if enabled)
SNOMED concept search (example API shape)
Exact endpoint depends on your implementation.
GET /snomed/search?term=schizophrenia&limit=20
Accept: application/json
Postcoordination / ECL hints
Use `/tools/designer` → SNOMED postcoord tab.
Example ECLs:
  • <<404684003 – all clinical findings.
  • <<404684003 & 363698007=36225008 – clinical findings with finding site = liver.
  • <<404684003 & 363698007=363713009 – finding site = pancreas.
  • ^ 263495000 | 373873005 – two explicit codes.

Use the “Normalize expression” button to call /snomed/expressions/transform before searching; the UI puts the normalized expression back into the ECL field so you can expand it reliably.

If your SNOMED integration runs through a dedicated Snowstorm service, you will also monitor that stack (Elasticsearch/Snowstorm).

8. Federation (central → regional distribution)

Federation is used to export and replicate selected CodeSystems, ValueSets and ConceptMaps. This is designed for offline or intermittently connected regions.

Important operational model

  • Capture the artefacts you want to distribute: /federation/capture
  • Export bundles from the captured set: /federation/bundles/export
  • Apply bundles on regional nodes: /federation/bundles/apply
Capture (UI)
Select only what you want to export; do not export everything.
GET /federation/capture
Export bundle (central)
Optionally sign the bundle if you use HS256.
GET /federation/bundles/export?namespace=default&mode=artifacts&limit=200&include_payload=true&sign=true
Accept: application/json
Pull from central (regional)
Regional nodes can pull when connected.
POST /federation/pull/run?central_base_url=https://central.example.org&namespace=default&limit=500&apply_to_store=true&store_artifacts=true
Accept: application/json
Apply bundle (offline / store-and-forward)
Used when transferring bundles via file, USB or other offline means.
POST /federation/bundles/apply?direction=import&store_artifacts=true&apply_to_store=true
Content-Type: application/json

{
  "bundle": {
    "bundleType": "federation",
    "manifest": { },
    "artifacts": [ ]
  }
}

9. Metrics and monitoring

Use the metrics dashboard to monitor usage, request volumes and operational errors. Ensure you also monitor your database and (if enabled) Snowstorm/Elasticsearch.

UI

  • Metrics dashboard: /metrics
Example: basic smoke checks (operator routine)
Run these after deployments or imports.
GET /codesystems
GET /valuesets
GET /atc/browser?q=A02AA05
GET /fhir/metadata
GET /fhir/CodeSystem/$lookup?system=http://fhir.de/CodeSystem/atc-gkv&code=A02AA05

10. Troubleshooting

Common symptoms

  • 422 validation error when searching: typically duplicate query parameters or invalid parameter types.
  • Not authenticated JSON response: prefer redirecting to login for UI routes.
  • Slow browsing: enable paging and ensure indexes exist on large tables.

422 on ATC browser search

If you see a request like ...&limit=20...&limit=50, FastAPI will reject it with 422 because the query parameter appears twice. Ensure your forms and links only include each parameter once.

Correct search call
Only one limit parameter.
GET /atc/browser?q=A02AA05&limit=50&offset=0

Authentication for UI routes

UI pages should redirect to the login page if the session is not active. API endpoints should return JSON errors.