Skip to content

Improve displayed terminology titles #465

@Frontman50

Description

@Frontman50

To improve how terminology systems are displayed, the formatting logic will be moved from the UI to the terminology_systems.json generated by the fhir-ontology-generator.

This means the UI should no longer apply its own name formatting.
See related discussion: fhir-ontology-generator#344

  1. Remove the formatting applied in the UI:
    (see TerminologySystemDictionary.ts#L26)
private createDictionary(entries: CodeSystemEntry[]): Record<string, string> {
    return entries.reduce((acc, entry) => {
      const key = entry.name.toUpperCase().replace(/[-\s]/g, '_');   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      acc[key] = entry.url;
      return acc;
    }, {} as Record<string, string>);
  }
  1. Implement the changes to the terminology systems entry structure and the backend response structure:
    Currently:
[
  {
    "url": "http://fhir.de/CodeSystem/bfarm/alpha-id",
    "name": "alpha-id"
  },
  {
    "url": "http://loinc.org",
    "name": "loinc.org"
  },
]

After:

[
  {
    "url": "http://fhir.de/CodeSystem/bfarm/alpha-id",
    "display": {
      "original": "Alpha-ID",
      "translations": [
        {
          "language": "en",
          "value": "Alpha-ID"
        },
        {
          "language": "de",
          "value": "Alpha-ID"
        }
      ]
    }
  },
  {
    "url": "http://loinc.org",
    "display": {
      "original": "LOINC",
      "translations": [
        {
          "language": "en",
          "value": "LOINC"
        },
        {
          "language": "de",
          "value": "LOINC"
        }
      ]
    }
  },
]

Related issues:
feasibility-backend#708
fhir-ontology-generator#344

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions