FHIR Extensions Pack
5.1.0 - 5.1.0 (April 2024) International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0: Release 5.1) based on FHIR (HL7® FHIR® Standard) v5.0.0. This is the current published version. For a full list of available versions, see the Directory of published versions

StructureMap: FML Conversion for TestReport: R5 to R4B

Official URL: http://hl7.org/fhir/StructureMap/TestReport5to4B Version: 5.1.0
Standards status: Trial-use Maturity Level: 1 Computable Name: TestReport5to4B

FMLConversionforTestReportR5toR4B

/// url = 'http://hl7.org/fhir/StructureMap/TestReport5to4B'
/// name = 'TestReport5to4B'
/// title = 'FML Conversion for TestReport: R5 to R4B'
/// status = 'active'

conceptmap "TestReportActionResult" {
  prefix s = "http://hl7.org/fhir/report-action-result-codes"
  prefix t = "http://hl7.org/fhir/4.3/report-action-result-codes"

  s:pass - t:pass
  s:skip - t:skip
  s:fail - t:fail
  s:warning - t:warning
  s:error - t:error
}

conceptmap "TestReportParticipantType" {
  prefix s = "http://hl7.org/fhir/report-participant-type"
  prefix t = "http://hl7.org/fhir/4.3/report-participant-type"

  s:"test-engine" - t:"test-engine"
  s:client - t:client
  s:server - t:server
}

conceptmap "TestReportResult" {
  prefix s = "http://hl7.org/fhir/report-result-codes"
  prefix t = "http://hl7.org/fhir/4.3/report-result-codes"

  s:pass - t:pass
  s:fail - t:fail
  s:pending - t:pending
}

conceptmap "TestReportStatus" {
  prefix s = "http://hl7.org/fhir/report-status-codes"
  prefix t = "http://hl7.org/fhir/4.3/report-status-codes"

  s:completed - t:completed
  s:"in-progress" - t:"in-progress"
  s:waiting - t:waiting
  s:stopped - t:stopped
  s:"entered-in-error" - t:"entered-in-error"
}

uses "http://hl7.org/fhir/StructureDefinition/TestReport" alias TestReportR5 as source
uses "http://hl7.org/fhir/4.3/StructureDefinition/TestReport" alias TestReportR4B as target

imports "http://hl7.org/fhir/StructureMap/*5to4B"

group TestReport(source src : TestReportR5, target tgt : TestReportR4B) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.name -> tgt.name;
  src.status as v -> tgt.status = translate(v, '#TestReportStatus', 'code');
  src.testScript -> tgt.testScript;
  src.result as v -> tgt.result = translate(v, '#TestReportResult', 'code');
  src.score -> tgt.score;
  src.tester -> tgt.tester;
  src.issued -> tgt.issued;
  src.participant as s -> tgt.participant as t then TestReportParticipant(s, t);
  src.setup as s -> tgt.setup as t then TestReportSetup(s, t);
  src.test as s -> tgt.test as t then TestReportTest(s, t);
  src.teardown as s -> tgt.teardown as t then TestReportTeardown(s, t);
}

group TestReportParticipant(source src, target tgt) extends BackboneElement {
  src.type as v -> tgt.type = translate(v, '#TestReportParticipantType', 'code');
  src.uri -> tgt.uri;
  src.display -> tgt.display;
}

group TestReportSetup(source src, target tgt) extends BackboneElement {
  src.action as s -> tgt.action as t then TestReportSetupAction(s, t);
}

group TestReportSetupAction(source src, target tgt) extends BackboneElement {
  src.operation as s -> tgt.operation as t then TestReportSetupActionOperation(s, t);
  src.assert as s -> tgt.assert as t then TestReportSetupActionAssert(s, t);
}

group TestReportSetupActionOperation(source src, target tgt) extends BackboneElement {
  src.result as v -> tgt.result = translate(v, '#TestReportActionResult', 'code');
  src.message -> tgt.message;
  src.detail -> tgt.detail;
}

group TestReportSetupActionAssert(source src, target tgt) extends BackboneElement {
  src.result as v -> tgt.result = translate(v, '#TestReportActionResult', 'code');
  src.message -> tgt.message;
  src.detail -> tgt.detail;
}

// group TestReportSetupActionAssertRequirement(source src, target tgt) extends BackboneElement {
// src.link : uri -> tgt.link;
// src.link : canonical -> tgt.link;
// }
group TestReportTest(source src, target tgt) extends BackboneElement {
  src.name -> tgt.name;
  src.description -> tgt.description;
  src.action as s -> tgt.action as t then TestReportTestAction(s, t);
}

group TestReportTestAction(source src, target tgt) extends BackboneElement {
  src.operation as s -> tgt.operation as t then TestReportSetupActionOperation(s, t);
  src.assert as s -> tgt.assert as t then TestReportSetupActionAssert(s, t);
}

group TestReportTeardown(source src, target tgt) extends BackboneElement {
  src.action as s -> tgt.action as t then TestReportTeardownAction(s, t);
}

group TestReportTeardownAction(source src, target tgt) extends BackboneElement {
  src.operation as s -> tgt.operation as t then TestReportSetupActionOperation(s, t);
}