Publisert - 12.05.2026

Conversion Mapping

This document describes how upstream SHI FHIR resources PlanDefinition and ActivityDefinition are mapped into TreatmentGroup.

PlanDefinition + ActivityDefinition → TreatmentGroup

TreatmentGroup contains treatment alternatives and indications valid for specified regions. TreatmentAlternative contains rank and reference to one or more medicinal products.

Source Output field Logic
PlanDefinition.Identifier[0].Value id First identifier value
PlanDefinition.Name name Direct mapping
PlanDefinition.Description description Direct mapping
PlanDefinition.Extension or PlanDefinition.Type diseaseGroup First checks for an extension with URL containing "diseaseGroup" and uses its ValueString (other value types are ignored). Falls back to Type.Text or Type.Coding[0].Display
PlanDefinition.UseContext[].ValueCodeableConcept.Coding[] jurisdictions Filters for codings where System equals urn:oid:2.16.578.1.12.4.1.102 (RHF OID)
PlanDefinition.EffectivePeriod validityPeriod Direct mapping (Period with start and end as YYYY-MM-DD strings)
PlanDefinition.LastReviewDate reviewDate Direct mapping (YYYY-MM-DD string)
PlanDefinition.Goal[].Addresses[] indications Flattened list of CodeableConcepts from all goals
PlanDefinition.Action[] + ActivityDefinition lookup treatmentAlternatives See below

Treatment Alternative Resolution

Each PlanDefinitionAction is resolved to a TreatmentAlternative:

  1. DefinitionCanonical is used to look up the corresponding ActivityDefinition from a dictionary keyed by identifier value.
  2. Lookup tries exact match first, then falls back to matching the last URL segment.
  3. Rank is extracted from the action's extensions (URL containing "rank"). Falls back to the action's position index (1-based).
Source Output field
Action extension with "rank" URL, or position index rank
ActivityDefinition.Identifier[0].Value, or DefinitionCanonical as fallback treatmentId
ActivityDefinition.Name, or Action.Description as fallback name
ActivityDefinition.Description description
ActivityDefinition.ArticleNumbers medicines

Medicine References from ActivityDefinition

Each entry in ActivityDefinition.ArticleNumbers becomes a MedicinalReference. The reference and display fields are null for FEST-sourced medicines:

{
  "reference": null,
  "type": "FEST/LegemiddelPakning",
  "identifier": {
    "system": "FEST/Varenummer",
    "value": "<article number>"
  },
  "display": null
}

Søk i Utviklerportalen

Søket er fullført!