Skip to content

ICD-11 post-coordination microservice: normalize codes and generate names/descriptions (with optional AI phrasing) #2416

@filiperochalopes

Description

@filiperochalopes

User story

As a user, I want a microservice that normalizes ICD-11 post-coordinated codes and generates names/descriptions for them so post-coordinated concepts can be created consistently and with readable text.

Use case

Submit an ICD-11 post-coordinated code(s) (possibly with multiple stem codes and extension codes) and receive:

  1. a normalized code ordered by WHO Simple Tabulation rules, and
  2. generated title/description (concatenated and optionally AI-rephrased).

Requirements

  • Normalize ICD-11 post-coordinated codes using the ordering rules from WHO Simple Tabulation.
  • Use SQLite to store and query the Simple Tabulation reference for fast lookup and ordering.
  • Provide an import flow to load the Simple Tabulation spreadsheet into the SQLite database.
  • Generate name/description outputs for a post-coordinated code:
    • A basic concatenated version (no AI)
    • An optional AI-generated “more human” phrasing that reorders words to improve readability (e.g., “chronic knee injury” vs “knee injury chronic”).
  • Add a cache table to store and reuse previously generated responses.
  • Support an argument/flag to enable the AI-generated phrasing, and return both versions when enabled.
  • Use OpenRouter API (with free models) for the optional AI phrasing.
  • Should create the code with the name for reference in the OCL Lookup Repo

Acceptance criteria

  • Given a post-coordinated ICD-11 code, the service returns a normalized code ordered according to WHO Simple Tabulation.
  • Given the same input code, repeated requests can be served from the cache table.
  • Given AI phrasing is disabled, the service returns the concatenated name/description only.
  • Given AI phrasing is enabled, the service returns both the concatenated output and an AI-generated phrasing output.
  • Simple Tabulation data can be imported from the provided spreadsheet into SQLite and used for ordering/lookup.

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions