0.2.0 - ci-build

OKTonFHIR - Local Development build (v0.2.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

StructureMap: OktMessageEpisodeOfCare (Experimental)

Official URL: http://hl7.no/fhir/ig/okt/StructureMap/OktMessage-EpisodeOfCare Version: 0.2.0
Draft as of 2025-11-14 Computable Name: OktMessageEpisodeOfCare

Map OktMessage to EpisodeOfCare

map "http://hl7.no/fhir/ig/okt/StructureMap/OktMessage-EpisodeOfCare" = "OktMessageEpisodeOfCare"

// Map OktMessage to EpisodeOfCare

uses "http://hl7.no/fhir/ig/okt/StructureDefinition/OktMessage" alias NhnOktMessage as source
uses "http://hl7.no/fhir/ig/okt/StructureDefinition/OktEpisodeOfCare" alias FhirEpisodeOfCare as target

group OktMessageToEpisodeOfCare(source source : NhnOktMessage, target target : FhirEpisodeOfCare) <<types>> {
  source.weeklyExtent as weeklyExtent ->  target.extension = create('Extension') as weeklyExtentExtensionVariable,  weeklyExtentExtensionVariable.url = 'http://hl7.no/fhir/ig/okt/StructureDefinition/WeeklyExtentRatio',  weeklyExtentExtensionVariable.value = create('Ratio') as weeklyExtentExtensionVariableValueRatio,  weeklyExtentExtensionVariableValueRatio.numerator = create('Quantity') as numeratorVariable,  numeratorVariable.value = weeklyExtent,  numeratorVariable.unit = 'h',  numeratorVariable.system = 'http://unitsofmeasure.org',  numeratorVariable.code = 'h',  weeklyExtentExtensionVariableValueRatio.denominator = create('Quantity') as denominatorVariable,  denominatorVariable.value = '1',  denominatorVariable.unit = 'wk',  denominatorVariable.system = 'http://unitsofmeasure.org',  denominatorVariable.code = 'wk' "mapWeeklyExtent";
  source.serviceDescription as serviceDescription ->  target.extension = create('Extension') as descrExtensionVariable,  descrExtensionVariable.url = 'http://hl7.no/fhir/ig/okt/StructureDefinition/ServiceDescriptionMarkdown',  descrExtensionVariable.value = create('markdown') as descrExtensionVariableValueMd,  descrExtensionVariableValueMd.value = serviceDescription "mapServiceDescription";
  source where temporaryCessation != true ->  target.status = create('code') as statusVariable,  statusVariable.value = 'active' "mapStatus";
  source where temporaryCessation = true ->  target.status = create('code') as statusVariable,  statusVariable.value = 'onhold' "mapStatus";
  source.stayType as stayType -> target.type = cc('http://hl7.no/fhir/ig/okt/CodeSystem/OktStayTypeCs', stayType) as typeVariable "mapStayType";
  source -> target.period = create('Period') as period then {
    source.startDate as startDate -> period.start = startDate "setStart";
    source.endDate as endDate -> period.end = endDate "setEnd";
  } "mapPeriod";
}