ServiceRequestSGHI5
type: StructureMap
node role: treeRoot
id:
  v: ServiceRequestSGHI5
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap ServiceRequestSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/ServiceRequestSGHI5'#xD; /// name = 'ServiceRequestSGHI5'#xD; /// title = 'ServiceRequest Transforms: R4 → SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/ServiceRequest" alias ServiceRequestR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/servicerequest" alias SGHIServiceRequest as target#xD; #xD; group SGHIServiceRequest(source src : ServiceRequestR4, target tgt : SGHIServiceRequest) <<type+>> {#xD; src.id as uuid -> tgt.id = uuid;#xD; src.active -> tgt.active = 'true';#xD; src.language as sl -> tgt.language = sl;#xD; src.authoredOn as sa -> tgt.authoredOn = sa;#xD; src where text.exists().not() -> tgt.text = create('Narrative') as tgt_n then {#xD; src -> tgt_n.status = 'generated' "settextstatus";#xD; src -> tgt_n.div = ' Generated text ' "settextdiv";#xD; } "createhardcodedtext";#xD; src -> tgt.text = create('Narrative') as ttt then {#xD; src.text as st then {#xD; st.status as s -> ttt.status = s;#xD; st.div as d -> ttt.div = (' ' + d + ' ') "wraptextinhtml";#xD; };#xD; } "setting text";#xD; src.id as s_id -> tgt.identifier = create('Identifier') as t_ident then {#xD; s_id as uuid -> t_ident.value = uuid "copyid";#xD; src -> t_ident.use = 'official' "setuse";#xD; src -> t_ident.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "setsystem";#xD; src -> t_ident.type = create('CodeableConcept') as t_type then {#xD; src -> t_type.coding = create('Coding') as t_code then {#xD; src -> t_code.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "typesystem";#xD; src -> t_code.code = 'fhir-id' "typecode";#xD; src -> t_code.display = 'FHIR Id' "typedisplay";#xD; } "initcoding";#xD; } "inittype";#xD; src.meta as sm then {#xD; sm.tag last as st -> t_ident.assigner = create('Reference') as ta then TransformAssigner(st, ta);#xD; } "setting …
url:
  v: https://fhir.slade360.co.ke/fhir/StructureMap/ServiceRequestSGHI5
  l: ServiceRequestSGHI5
version:
  v: 0.1.0
name:
  v: ServiceRequestSGHI5
title:
  v: ServiceRequest Transforms: R4 → SGHI R5
status:
  v: active
date:
  v: 2026-05-21T09:38:13+00:00
publisher:
  v: Kathurima Kimathi
contact:
  name:
    v: Kathurima Kimathi
  telecom:
    system:
      v: url
    value:
      v: https://www.linkedin.com/in/kathurima-kimathi/
  telecom:
    system:
      v: email
contact:
  name:
    v: Oscar John
  telecom:
    system:
      v: email
    use:
      v: work
contact:
  name:
    v: Kennedy Omondi
  telecom:
    system:
      v: email
    use:
      v: work
description:
  v: ServiceRequestTransformsR4SGHIR5
structure:
  url:
    v: http://hl7.org/fhir/4.0/StructureDefinition/ServiceRequest
    l: ServiceRequest
  mode:
    v: source
  alias:
    v: ServiceRequestR4
structure:
  url:
    v: https://fhir.slade360.co.ke/fhir/StructureDefinition/servicerequest
    l: servicerequest
  mode:
    v: target
  alias:
    v: SGHIServiceRequest
group:
  name:
    v: SGHIServiceRequest
  type mode:
    v: type-and-types
  input:
    name:
      v: src
    type:
      v: ServiceRequestR4
    mode:
      v: source
  input:
    name:
      v: tgt
    type:
      v: SGHIServiceRequest
    mode:
      v: target
  rule:
    name:
      v: id
    source:
      context:
        v: src
      element:
        v: id
      variable:
        v: uuid
    target:
      context:
        v: tgt
      element:
        v: id
      transform:
        v: copy
      parameter:
        value: Id
  rule:
    name:
      v: active
    source:
      context:
        v: src
      element:
        v: active
    target:
      context:
        v: tgt
      element:
        v: active
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: language
    source:
      context:
        v: src
      element:
        v: language
      variable:
        v: sl
    target:
      context:
        v: tgt
      element:
        v: language
      transform:
        v: copy
      parameter:
        value: Id
  rule:
    name:
      v: authoredOn
    source:
      context:
        v: src
      element:
        v: authoredOn
      variable:
        v: sa
    target:
      context:
        v: tgt
      element:
        v: authoredOn
      transform:
        v: copy
      parameter:
        value: Id
  rule:
    name:
      v: createhardcodedtext
    source:
      context:
        v: src
      condition:
        v: text.exists().not()
    target:
      context:
        v: tgt
      element:
        v: text
      variable:
        v: tgt_n
      transform:
        v: create
      parameter:
        value: String
    rule:
      name:
        v: settextstatus
    rule:
      name:
        v: settextdiv
  rule:
    name:
      v: setting text
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      element:
        v: text
      variable:
        v: ttt
      transform:
        v: create
      parameter:
        value: String

Id
v: uuid

String
v: true

Id
v: sl

Id
v: sa

String
v: Narrative

v: src

v: tgt_n

v: status

v: copy

value: String
  v: generated

v: src

v: tgt_n

v: div

v: copy

value: String
  v: Generated text

String
v: Narrative

name:
  v: text
source:
  context:
    v: src
  element:
    v: text
  variable:
    v: st
rule:
  name:
    v: status
  source:
    context:
      v: st
    element:
      v: status
    variable:
      v: s
  target:
    context:
      v: ttt
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: Id
        v: s
rule:
  name:
    v: wraptextinhtml
  source:
    context:
      v: st
    element:
      v: div
    variable:
      v: d
  target:
    context:
      v: ttt
    element:
      v: div
    transform:
      v: evaluate
    parameter:
      value: String
        v: ' ' + d + ' '

name:
  v: addfhirididentifier
source:
  context:
    v: src
  element:
    v: id
  variable:
    v: s_id
target:
  context:
    v: tgt
  element:
    v: identifier
  variable:
    v: t_ident
  transform:
    v: create
  parameter:
    value: String
      v: Identifier
rule:
  name:
    v: copyid
  source:
    context:
      v: s_id
    variable:
      v: uuid
  target:
    context:
      v: t_ident
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: Id
        v: uuid
rule:
  name:
    v: setuse
  source:
    context:
      v: src
  target:
    context:
      v: t_ident
    element:
      v: use
    transform:
      v: copy
    parameter:
      value: String
        v: official
rule:
  name:
    v: setsystem
  source:
    context:
      v: src
  target:
    context:
      v: t_ident
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem
rule:
  name:
    v: inittype
  source:
    context:
      v: src
  target:
    context:
      v: t_ident
    element:
      v: type
    variable:
      v: t_type
    transform:
      v: create
    parameter:
      value: String
        v: CodeableConcept
  rule:
    name:
      v: initcoding
    source:
      context:
        v: src
    target:
      context:
        v: t_type
      element:
        v: coding
      variable:
        v: t_code
      transform:
        v: create
      parameter:
        value: String
    rule:
      name:
        v: typesystem
    rule:
      name:
        v: typecode
    rule:
      name:
        v: typedisplay
rule:
  name:
    v: setting owner
  source:
    context:
      v: src
    element:
      v: meta
    variable:
      v: sm
  rule:
    name:
      v: tag
    source:
      context:
        v: sm
      element:
        v: tag
      list mode:
        v: last
      variable:
        v: st
    target:
      context:
        v: t_ident
      element:
        v: assigner
      variable:
        v: ta
      transform:
        v: create
      parameter:
        value: String
    dependent:
      name:
        v: TransformAssigner
      parameter:
        value: Id
      parameter:
        value: Id
documentation:
  v: Create identifier

String
v: Coding

v: src

v: t_code

v: system

v: copy

v: src

v: t_code

v: code

v: copy

value: String
  v: fhir-id

v: src

v: t_code

v: display

v: copy

value: String
  v: FHIR Id

String
v: Reference

Id
v: st

Id
v: ta

name:
  v: set profile in meta
source:
  context:
    v: src
  element:
    v: meta
  variable:
    v: s_meta
target:
  context:
    v: tgt
  element:
    v: meta
  variable:
    v: t_meta
rule:
  name:
    v: lastUpdated
  source:
    context:
      v: s_meta
    element:
      v: lastUpdated
    variable:
      v: sl
  target:
    context:
      v: t_meta
    element:
      v: lastUpdated
    transform:
      v: copy
    parameter:
      value: Id
        v: sl
rule:
  name:
    v: language
  source:
    context:
      v: s_meta
    element:
      v: language
    variable:
      v: sl
  target:
    context:
      v: t_meta
    element:
      v: language
    transform:
      v: copy
    parameter:
      value: Id
        v: sl
rule:
  name:
    v: tags
  source:
    context:
      v: s_meta
    element:
      v: tags
    variable:
      v: st
  target:
    context:
      v: t_meta
    element:
      v: tags
    transform:
      v: copy
    parameter:
      value: Id
        v: st
rule:
  name:
    v: setprofileinmeta
  source:
    context:
      v: src
    element:
      v: meta
    variable:
      v: sp
    condition:
      v: profile.exists().not()
  target:
    context:
      v: t_meta
    element:
      v: profile
    transform:
      v: copy
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/StructureDefinition/servicerequest

name:
  v: coppying status
source:
  context:
    v: src
  condition:
    v: status != 'finished'
rule:
  name:
    v: status
  source:
    context:
      v: src
    element:
      v: status
    variable:
      v: sd
  target:
    context:
      v: tgt
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: Id
        v: sd

name:
  v: settingR5status
source:
  context:
    v: src
  condition:
    v: status = 'finished'
target:
  context:
    v: tgt
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: String
      v: completed

name:
  v: dateTime
source:
  context:
    v: src
  element:
    v: dateTime
  variable:
    v: sd
target:
  context:
    v: tgt
  element:
    v: date
  transform:
    v: copy
  parameter:
    value: Id
      v: sd

name:
  v: basedOn
source:
  context:
    v: src
  element:
    v: basedOn
  variable:
    v: sb
target:
  context:
    v: tgt
  element:
    v: basedOn
  variable:
    v: tb
dependent:
  name:
    v: TransformReference
  parameter:
    value: Id
      v: sb
  parameter:
    value: Id
      v: tb

name:
  v: category
source:
  context:
    v: src
  element:
    v: category
  variable:
    v: scat
target:
  context:
    v: tgt
  element:
    v: category
  variable:
    v: tcat
rule:
  name:
    v: coding
  source:
    context:
      v: scat
    element:
      v: coding
    variable:
      v: d
    condition:
      v: d.system.exists().not()
  target:
    context:
      v: tcat
    element:
      v: coding
    transform:
      v: translate
    parameter:
      value: Id
        v: d
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoFHIRCategoryCodeBindingsMap
    parameter:
      value: String
        v: Coding
rule:
  name:
    v: coding
  source:
    context:
      v: scat
    element:
      v: coding
    variable:
      v: d
    condition:
      v: d.system.exists()
  target:
    context:
      v: tcat
    element:
      v: coding
    variable:
      v: tcoding
    transform:
      v: create
    parameter:
      value: String
        v: Coding
  rule:
    name:
      v: code
    source:
      context:
        v: d
      element:
        v: code
      variable:
        v: d
    target:
      context:
        v: tcoding
      element:
        v: code
      transform:
        v: translate
      parameter:
        value: Id
      parameter:
        value: String
      parameter:
        value: String
  rule:
    name:
      v: code
    source:
      context:
        v: d
      element:
        v: code
      variable:
        v: d
    target:
      context:
        v: tcoding
      element:
        v: system
      transform:
        v: translate
      parameter:
        value: Id
      parameter:
        value: String
      parameter:
        value: String
  rule:
    name:
      v: code
    source:
      context:
        v: d
      element:
        v: code
      variable:
        v: d
    target:
      context:
        v: tcoding
      element:
        v: display
      transform:
        v: translate
      parameter:
        value: Id
      parameter:
        value: String
      parameter:
        value: String
  rule:
    name:
      v: code
    source:
      context:
        v: d
      element:
        v: code
      variable:
        v: d
    target:
      context:
        v: tcat
      element:
        v: text
      transform:
        v: translate
      parameter:
        value: Id
      parameter:
        value: String
      parameter:
        value: String

Id
v: d

String
v: code

Id
v: d

String
v: system

Id
v: d

String
v: display

Id
v: d

String
v: display

name:
  v: encounter
source:
  context:
    v: src
  element:
    v: encounter
  variable:
    v: se
target:
  context:
    v: tgt
  element:
    v: encounter
  variable:
    v: te
dependent:
  name:
    v: TransformReference
  parameter:
    value: Id
      v: se
  parameter:
    value: Id
      v: te

name:
  v: requester
source:
  context:
    v: src
  element:
    v: requester
  variable:
    v: sr
target:
  context:
    v: tgt
  element:
    v: requester
  variable:
    v: tr
dependent:
  name:
    v: TransformReference
  parameter:
    value: Id
      v: sr
  parameter:
    value: Id
      v: tr

name:
  v: subject
source:
  context:
    v: src
  element:
    v: subject
  variable:
    v: sbb
target:
  context:
    v: tgt
  element:
    v: subject
  variable:
    v: tbb
dependent:
  name:
    v: TransformReference
  parameter:
    value: Id
      v: sbb
  parameter:
    value: Id
      v: tbb

name:
  v: performer
source:
  context:
    v: src
  element:
    v: performer
  variable:
    v: sp
target:
  context:
    v: tgt
  element:
    v: performer
  variable:
    v: tp
dependent:
  name:
    v: TransformReference
  parameter:
    value: Id
      v: sp
  parameter:
    value: Id
      v: tp

name:
  v: settingperformer
source:
  context:
    v: src
  condition:
    v: performer.exists().not()
rule:
  name:
    v: setting performer
  source:
    context:
      v: src
    element:
      v: meta
    variable:
      v: sm
  rule:
    name:
      v: tag
    source:
      context:
        v: sm
      element:
        v: tag
      list mode:
        v: last
      variable:
        v: sp
    target:
      context:
        v: tgt
      element:
        v: performer
      variable:
        v: tp
      transform:
        v: create
      parameter:
        value: String
    dependent:
      name:
        v: TransformAssigner
      parameter:
        value: Id
      parameter:
        value: Id

String
v: Reference

Id
v: sp

Id
v: tp

name:
  v: settingrequester
source:
  context:
    v: src
  condition:
    v: requester.exists().not()
rule:
  name:
    v: setting requester
  source:
    context:
      v: src
    element:
      v: meta
    variable:
      v: sm
  rule:
    name:
      v: tag
    source:
      context:
        v: sm
      element:
        v: tag
      list mode:
        v: last
      variable:
        v: sr
    target:
      context:
        v: tgt
      element:
        v: requester
      variable:
        v: tr
      transform:
        v: create
      parameter:
        value: String
    dependent:
      name:
        v: TransformAssigner
      parameter:
        value: Id
      parameter:
        value: Id

String
v: Reference

Id
v: sr

Id
v: tr

name:
  v: priority
source:
  context:
    v: src
  element:
    v: priority
  variable:
    v: sp
target:
  context:
    v: tgt
  element:
    v: priority
  transform:
    v: copy
  parameter:
    value: Id
      v: sp

name:
  v: intent
source:
  context:
    v: src
  element:
    v: intent
  variable:
    v: sti
target:
  context:
    v: tgt
  element:
    v: intent
  transform:
    v: copy
  parameter:
    value: Id
      v: sti

name:
  v: translate codeableConcept to CodeableReference in R5
source:
  context:
    v: src
target:
  context:
    v: tgt
  element:
    v: code
  variable:
    v: trf
  transform:
    v: create
  parameter:
    value: String
      v: CodeableReference
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: scc
  target:
    context:
      v: trf
    element:
      v: concept
    variable:
      v: tcc
    transform:
      v: create
    parameter:
      value: String
        v: CodeableConcept
  dependent:
    name:
      v: TranslateCoding
    parameter:
      value: Id
        v: scc
    parameter:
      value: Id
        v: tcc

name:
  v: setting reason
source:
  context:
    v: src
target:
  context:
    v: tgt
  element:
    v: reason
  variable:
    v: tr
  transform:
    v: create
  parameter:
    value: String
      v: CodeableReference
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: scc
  target:
    context:
      v: tr
    element:
      v: concept
    variable:
      v: tcc
    transform:
      v: create
    parameter:
      value: String
        v: CodeableConcept
  dependent:
    name:
      v: TranslateCoding
    parameter:
      value: Id
        v: scc
    parameter:
      value: Id
        v: tcc

name:
  v: TransformAssigner
type mode:
  v: types
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: tgt
  mode:
    v: target
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: tgt
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: String
        v: Organization/
    parameter:
      value: Id
        v: code
rule:
  name:
    v: setting default display
  source:
    context:
      v: src
    condition:
      v: display.exists().not()
  target:
    context:
      v: tgt
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Unknown display
rule:
  name:
    v: display
  source:
    context:
      v: src
    element:
      v: display
    variable:
      v: d
  target:
    context:
      v: tgt
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: Id
        v: d
rule:
  name:
    v: code
  source:
    context:
      v: src
    element:
      v: code
    variable:
      v: dc
  target:
    context:
      v: tgt
    element:
      v: id
    transform:
      v: copy
    parameter:
      value: Id
        v: dc

name:
  v: TransformReference
type mode:
  v: types
input:
  name:
    v: src
  mode:
    v: source
input:
  name:
    v: tgt
  mode:
    v: target
rule:
  name:
    v: id
  source:
    context:
      v: src
    element:
      v: id
    variable:
      v: sid
  target:
    context:
      v: tgt
    element:
      v: id
    transform:
      v: copy
    parameter:
      value: Id
        v: sid
rule:
  name:
    v: reference
  source:
    context:
      v: src
    element:
      v: reference
    variable:
      v: sf
  target:
    context:
      v: tgt
    element:
      v: reference
    transform:
      v: copy
    parameter:
      value: Id
        v: sf
rule:
  name:
    v: display
  source:
    context:
      v: src
    element:
      v: display
    variable:
      v: sd
  target:
    context:
      v: tgt
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: Id
        v: sd
rule:
  name:
    v: setting display
  source:
    context:
      v: src
    condition:
      v: display.exists().not()
  target:
    context:
      v: tgt
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Unknown display

name:
  v: TranslateCoding
type mode:
  v: types
input:
  name:
    v: scc
  mode:
    v: source
input:
  name:
    v: tcc
  mode:
    v: target
rule:
  name:
    v: coding
  source:
    context:
      v: scc
    element:
      v: coding
    variable:
      v: d
    condition:
      v: d.system.exists().not()
  target:
    context:
      v: tcc
    element:
      v: coding
    transform:
      v: translate
    parameter:
      value: Id
        v: d
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCServiceRequestMap
    parameter:
      value: String
        v: Coding
rule:
  name:
    v: coding
  source:
    context:
      v: scc
    element:
      v: coding
    variable:
      v: scode
    condition:
      v: (scode.code = '1271').exists() and (scode.display = 'Pap smear/cytology')
  target:
    context:
      v: tcc
    element:
      v: coding
    variable:
      v: tcode
  rule:
    name:
      v: override code
    source:
      context:
        v: scode
    target:
      context:
        v: tcode
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: display
    source:
      context:
        v: scode
      element:
        v: display
      variable:
        v: d
    target:
      context:
        v: tcode
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: Id
  rule:
    name:
      v: overriedsystem
    source:
      context:
        v: scode
    target:
      context:
        v: tcode
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: coding
  source:
    context:
      v: scc
    element:
      v: coding
    variable:
      v: scode
    condition:
      v: (scode.code = '1271').exists() and (scode.display = 'HPV')
  target:
    context:
      v: tcc
    element:
      v: coding
    variable:
      v: tcode
  rule:
    name:
      v: override code
    source:
      context:
        v: scode
    target:
      context:
        v: tcode
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: settinghpvdisplay
    source:
      context:
        v: scode
    target:
      context:
        v: tcode
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: overriedsystem
    source:
      context:
        v: scode
    target:
      context:
        v: tcode
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: coding
  source:
    context:
      v: scc
    element:
      v: coding
    variable:
      v: scode
    condition:
      v: (scode.code = '1271').exists() and (scode.display = 'Mammogram')
  target:
    context:
      v: tcc
    element:
      v: coding
    variable:
      v: tcode
  rule:
    name:
      v: override code
    source:
      context:
        v: scode
    target:
      context:
        v: tcode
      element:
        v: code

String
v: LA16047-5

Id
v: d

String
v: LP14836-8

String
v: Human papilloma virus

v: copy

value: String
  v: LA16046-7

name:
  v: display
source:
  context:
    v: scode
  element:
    v: display
  variable:
    v: d
target:
  context:
    v: tcode
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: Id
      v: d

name:
  v: overriedsystem
source:
  context:
    v: scode
target:
  context:
    v: tcode
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: scode
  condition:
    v: (scode.code = '1271').exists() and (scode.display = 'VIA')
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcode
rule:
  name:
    v: override code
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: LP404404-8
rule:
  name:
    v: settingdisplay
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Screening techniques | Cervix or Vagina | Cytology
rule:
  name:
    v: overriedsystem
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: scode
  condition:
    v: (scode.code = '1271').exists() and (scode.display = 'Biopsy')
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcode
rule:
  name:
    v: override code
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: LA15393-4
rule:
  name:
    v: settingdisplay
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Biopsy
rule:
  name:
    v: overriedsystem
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: scode
  condition:
    v: (scode.code = '1271').exists() and (scode.display = 'Ultrasound')
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcode
rule:
  name:
    v: override code
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: 24630-6
rule:
  name:
    v: settingdisplay
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: US Chest
rule:
  name:
    v: overriedsystem
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: scode
  condition:
    v: (scode.code = '1271').exists() and (scode.display = 'MRI')
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcode
rule:
  name:
    v: override code
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: 30794-2
rule:
  name:
    v: settingdisplay
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: MR Breast
rule:
  name:
    v: overriedsystem
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: scode
  condition:
    v: (scode.code = '1271').exists() and (scode.display = 'Prostate Specific Antigen - Serum')
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcode
rule:
  name:
    v: override code
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: 32465-7
rule:
  name:
    v: settingdisplay
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Physical findings of Prostate
rule:
  name:
    v: overriedsystem
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: scode
  condition:
    v: (scode.code = '1271').exists() and (scode.display = 'Prostate Specific Antigen - Whole Blood')
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcode
rule:
  name:
    v: override code
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: LP15247-7
rule:
  name:
    v: settingdisplay
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Whole Blood
rule:
  name:
    v: overriedsystem
  source:
    context:
      v: scode
  target:
    context:
      v: tcode
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://loinc.org

name:
  v: coding
source:
  context:
    v: scc
  element:
    v: coding
  variable:
    v: d
  condition:
    v: d.system.exists()
target:
  context:
    v: tcc
  element:
    v: coding
  variable:
    v: tcoding
  transform:
    v: create
  parameter:
    value: String
      v: Coding
rule:
  name:
    v: code
  source:
    context:
      v: d
    element:
      v: code
    variable:
      v: d
  target:
    context:
      v: tcoding
    element:
      v: code
    transform:
      v: translate
    parameter:
      value: Id
        v: d
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCServiceRequestMap
    parameter:
      value: String
        v: code
rule:
  name:
    v: code
  source:
    context:
      v: d
    element:
      v: code
    variable:
      v: d
  target:
    context:
      v: tcoding
    element:
      v: system
    transform:
      v: translate
    parameter:
      value: Id
        v: d
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCServiceRequestMap
    parameter:
      value: String
        v: system
rule:
  name:
    v: code
  source:
    context:
      v: d
    element:
      v: code
    variable:
      v: d
  target:
    context:
      v: tcoding
    element:
      v: display
    transform:
      v: translate
    parameter:
      value: Id
        v: d
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCServiceRequestMap
    parameter:
      value: String
        v: display
rule:
  name:
    v: code
  source:
    context:
      v: d
    element:
      v: code
    variable:
      v: d
  target:
    context:
      v: tcoding
    element:
      v: text
    transform:
      v: translate
    parameter:
      value: Id
        v: d
    parameter:
      value: String
        v: https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCServiceRequestMap
    parameter:
      value: String
        v: display