FHIR Extensions Pack
5.1.0-snapshot1 - Working Copy International flag

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

StructureMap: FML Conversion for MolecularSequence: R4 to R5

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

FMLConversionforMolecularSequenceR4toR5

/// url = 'http://hl7.org/fhir/StructureMap/MolecularSequence4to5'
/// name = 'MolecularSequence4to5'
/// title = 'FML Conversion for MolecularSequence: R4 to R5'
/// status = 'active'

conceptmap "orientationType" {
  prefix s = "http://hl7.org/fhir/4.0/orientation-type"
  prefix t = "http://hl7.org/fhir/orientation-type"

  s:sense - t:sense
  s:antisense - t:antisense
}

conceptmap "sequenceType" {
  prefix s = "http://hl7.org/fhir/4.0/sequence-type"
  prefix t = "http://hl7.org/fhir/sequence-type"

  s:aa - t:aa
  s:dna - t:dna
  s:rna - t:rna
}

conceptmap "strandType" {
  prefix s = "http://hl7.org/fhir/4.0/strand-type"
  prefix t = "http://hl7.org/fhir/strand-type"

  s:watson - t:watson
  s:crick - t:crick
}

uses "http://hl7.org/fhir/4.0/StructureDefinition/MolecularSequence" alias MolecularSequenceR4 as source
uses "http://hl7.org/fhir/StructureDefinition/MolecularSequence" alias MolecularSequenceR5 as target

imports "http://hl7.org/fhir/StructureMap/*4to5"

group MolecularSequence(source src : MolecularSequenceR4, target tgt : MolecularSequenceR5) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.type as v -> tgt.type = translate(v, '#sequenceType', 'code');
  src.patient -> tgt.subject;
  src.specimen -> tgt.specimen; // src.focus -> tgt.focus;
  src.device -> tgt.device;
  src.performer -> tgt.performer;
  src.referenceSeq as s -> tgt.relative as t then MolecularSequenceReferenceSeq(s, t); // src.literal as s -> tgt.literal as t, t.observedSeq = s;
  src.variant as s -> tgt.relative as t then MolecularSequenceVariant(s, t);
}

group MolecularSequenceReferenceSeq(source src, target tgt) extends BackboneElement {
  src.chromosome as s where code = '1' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21254-0',  tcc.display = 'Chromosome 1';
  src.chromosome as s where code = '2' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21255-7',  tcc.display = 'Chromosome 2';
  src.chromosome as s where code = '3' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21256-5',  tcc.display = 'Chromosome 3';
  src.chromosome as s where code = '4' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21257-3',  tcc.display = 'Chromosome 4';
  src.chromosome as s where code = '5' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21258-1',  tcc.display = 'Chromosome 5';
  src.chromosome as s where code = '6' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21259-9',  tcc.display = 'Chromosome 6';
  src.chromosome as s where code = '7' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21260-7',  tcc.display = 'Chromosome 7';
  src.chromosome as s where code = '8' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21261-5',  tcc.display = 'Chromosome 8';
  src.chromosome as s where code = '9' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21262-3',  tcc.display = 'Chromosome 9';
  src.chromosome as s where code = '10' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21263-1',  tcc.display = 'Chromosome 10';
  src.chromosome as s where code = '11' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21264-9',  tcc.display = 'Chromosome 11';
  src.chromosome as s where code = '12' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21265-6',  tcc.display = 'Chromosome 12';
  src.chromosome as s where code = '13' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21266-4',  tcc.display = 'Chromosome 13';
  src.chromosome as s where code = '14' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21267-2',  tcc.display = 'Chromosome 14';
  src.chromosome as s where code = '15' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21268-0',  tcc.display = 'Chromosome 15';
  src.chromosome as s where code = '16' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21269-8',  tcc.display = 'Chromosome 16';
  src.chromosome as s where code = '17' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21270-6',  tcc.display = 'Chromosome 17';
  src.chromosome as s where code = '18' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21271-4',  tcc.display = 'Chromosome 18';
  src.chromosome as s where code = '19' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21272-2',  tcc.display = 'Chromosome 19';
  src.chromosome as s where code = '20' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21273-0',  tcc.display = 'Chromosome 20';
  src.chromosome as s where code = '21' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21274-8',  tcc.display = 'Chromosome 21';
  src.chromosome as s where code = '22' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21275-5',  tcc.display = 'Chromosome 22';
  src.chromosome as s where code = 'X' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21276-3',  tcc.display = 'Chromosome X';
  src.chromosome as s where code = 'Y' ->  tgt.startingSequence as t,  t.chromosome = create('CodeableConcept') as tc,  tc.coding = create('Coding') as tcc,  tcc.system = 'http://loinc.org',  tcc.code = 'LA21277-1',  tcc.display = 'Chromosome Y';
  src.referenceSeqId : CodeableConcept as s ->  tgt.startingSequence as t,  t.sequence = s;
  src.referenceSeqPointer : Reference as s ->  tgt.startingSequence as t,  t.sequence = s;
  src.referenceSeqString : string as s ->  tgt.startingSequence as t,  t.sequence = s;
  src.windowStart : integer as s ->  tgt.startingSequence as t,  t.windowStart = s;
  src.windowEnd : integer as s ->  tgt.startingSequence as t,  t.windowEnd = s;
  src.orientation as v ->  tgt.startingSequence as t,  t.orientation = translate(v, '#orientationType', 'code');
  src.strand as v ->  tgt.startingSequence as t,  t.strand = translate(v, '#strandType', 'code');
}

group MolecularSequenceVariant(source src, target tgt) extends BackboneElement {
  src.start : integer as s ->  tgt.edit as t,  t.start = s;
  src.end : integer as s ->  tgt.edit as t,  t.end = s;
  src.observedAllele as s ->  tgt.edit as t,  t.replacementSequence = s;
  src.referenceAllele as s ->  tgt.edit as t,  t.replacedSequence = s;
}