0.1.0 - Costa Rica flag

Guía de Implementación de Homologación Regional (PH4H) de Costa Rica - Versión en desarrollo (v0.1.0): borrador de trabajo de la Iniciativa HL7® Costa Rica, que puede cambiar sin aviso.

:

Page standards status: Draft

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="CRPatientToLACPatient"/>
  <language value="en"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap CRPatientToLACPatient</b></p><a name="CRPatientToLACPatient"> </a><a name="hcCRPatientToLACPatient"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>https://hl7.or.cr/fhir/ph4h/StructureMap/CRPatientToLACPatient<span style="color: navy">&quot; = &quot;</span>CRPatientToLACPatient<span style="color: navy">&quot;

</span><b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/5.0/StructureDefinition/Patient<span style="color: navy">&quot; </span><b>alias </b>Patient <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/4.0/StructureDefinition/Patient<span style="color: navy">&quot; </span><b>alias </b>PatientR4 <b>as </b><b>target</b>

<b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-CRComun.html" title="CRComun">https://hl7.or.cr/fhir/ph4h/StructureMap/CRComun</a><span style="color: navy">&quot;
</span>
<b>group </b>CRPatientToLACPatient<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>PatientR4<span style="color: navy">)</span><span style="color: navy"> {
</span>  src.id<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tgt.id = <span style="color: maroon">v</span><span style="color: navy">;</span>
  src<span style="color: navy"><b> -&gt; </b></span>tgt.meta<b> as </b><span style="color: maroon">m</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>m.profile = <span style="color: blue">'http://racsel.org/StructureDefinition/LACPatient'</span> <i>&quot;perfil&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;meta&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">// </span><span style="color: green">Pasaporte primero y luego los nacionales, como los slices international y national de LACPatient.</span>
  src.identifier<b> as </b><span style="color: maroon">id</span><b> where </b><span style="color: navy">(</span>(use = 'official') and type.coding.where((system = 'https://hl7.or.cr/fhir/terminology/CodeSystem/cr-tipo-identificacion') and (code = 'pasaporte')).exists()<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style="color: maroon">ti</span><b> then </b>Identificador<span style="color: navy">(</span><span style="color: maroon">id</span><span style="color: navy">, </span><span style="color: maroon">ti</span><span style="color: navy">)</span> <i>&quot;pasaporte&quot;</i><span style="color: navy">;</span>
  src.identifier<b> as </b><span style="color: maroon">id</span><b> where </b><span style="color: navy">(</span>(use = 'official') and type.coding.where((system = 'https://hl7.or.cr/fhir/terminology/CodeSystem/cr-tipo-identificacion') and (code in ('cedula-nacional' | 'dimex' | 'ccss'))).exists()<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style="color: maroon">ti</span><b> then </b>Identificador<span style="color: navy">(</span><span style="color: maroon">id</span><span style="color: navy">, </span><span style="color: maroon">ti</span><span style="color: navy">)</span> <i>&quot;nacional&quot;</i><span style="color: navy">;</span>
  src.name<b> as </b><span style="color: maroon">n</span><span style="color: navy"><b> -&gt; </b></span>tgt.name<b> as </b><span style="color: maroon">tn</span><b> then </b>Nombre<span style="color: navy">(</span><span style="color: maroon">n</span><span style="color: navy">, </span><span style="color: maroon">tn</span><span style="color: navy">)</span> <i>&quot;nombre&quot;</i><span style="color: navy">;</span>
  src.gender<b> as </b><span style="color: maroon">g</span><span style="color: navy"><b> -&gt; </b></span>tgt.gender = <span style="color: maroon">g</span> <i>&quot;sexo&quot;</i><span style="color: navy">;</span>
  src.birthDate<b> as </b><span style="color: maroon">b</span><span style="color: navy"><b> -&gt; </b></span>tgt.birthDate = <span style="color: maroon">b</span> <i>&quot;nacimiento&quot;</i><span style="color: navy">;</span>
  src.telecom<b> as </b><span style="color: maroon">t</span><span style="color: navy"><b> -&gt; </b></span>tgt.telecom<b> as </b><span style="color: maroon">tt</span><b> then </b>Telecom<span style="color: navy">(</span><span style="color: maroon">t</span><span style="color: navy">, </span><span style="color: maroon">tt</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.address<b> as </b><span style="color: maroon">a</span><span style="color: navy"><b> -&gt; </b></span>tgt.address<b> as </b><span style="color: maroon">ta</span><b> then </b>Direccion<span style="color: navy">(</span><span style="color: maroon">a</span><span style="color: navy">, </span><span style="color: maroon">ta</span><span style="color: navy">)</span> <i>&quot;direccion&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url
       value="https://hl7.or.cr/fhir/ph4h/StructureMap/CRPatientToLACPatient"/>
  <version value="0.1.0"/>
  <name value="CRPatientToLACPatient"/>
  <status value="draft"/>
  <date value="2026-09-30T16:04:28-06:00"/>
  <publisher value="HL7 Costa Rica"/>
  <contact>
    <name value="HL7 Costa Rica"/>
    <telecom>
      <system value="url"/>
      <value value="https://hl7.or.cr"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="CR"/>
      <display value="Costa Rica"/>
    </coding>
  </jurisdiction>
  <structure>
    <url value="http://hl7.org/fhir/5.0/StructureDefinition/Patient"/>
    <mode value="source"/>
    <alias value="Patient"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/4.0/StructureDefinition/Patient"/>
    <mode value="target"/>
    <alias value="PatientR4"/>
  </structure>
  <import value="https://hl7.or.cr/fhir/ph4h/StructureMap/CRComun"/>
  <group>
    <name value="CRPatientToLACPatient"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="Patient"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="PatientR4"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id"/>
      <source>
        <context value="src"/>
        <element value="id"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="meta"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="m"/>
      </target>
      <rule>
        <name value="perfil"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="m"/>
          <contextType value="variable"/>
          <element value="profile"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="http://racsel.org/StructureDefinition/LACPatient"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="pasaporte"/>
      <source>
        <context value="src"/>
        <element value="identifier"/>
        <variable value="id"/>
        <condition
                   value="(use = 'official') and type.coding.where((system = 'https://hl7.or.cr/fhir/terminology/CodeSystem/cr-tipo-identificacion') and (code = 'pasaporte')).exists()"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="ti"/>
      </target>
      <dependent>
        <name value="Identificador"/>
        <variable value="id"/>
        <variable value="ti"/>
      </dependent>
      <documentation
                     value="Pasaporte primero y luego los nacionales, como los slices international y national de LACPatient."/>
    </rule>
    <rule>
      <name value="nacional"/>
      <source>
        <context value="src"/>
        <element value="identifier"/>
        <variable value="id"/>
        <condition
                   value="(use = 'official') and type.coding.where((system = 'https://hl7.or.cr/fhir/terminology/CodeSystem/cr-tipo-identificacion') and (code in ('cedula-nacional' | 'dimex' | 'ccss'))).exists()"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="ti"/>
      </target>
      <dependent>
        <name value="Identificador"/>
        <variable value="id"/>
        <variable value="ti"/>
      </dependent>
    </rule>
    <rule>
      <name value="nombre"/>
      <source>
        <context value="src"/>
        <element value="name"/>
        <variable value="n"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="name"/>
        <variable value="tn"/>
      </target>
      <dependent>
        <name value="Nombre"/>
        <variable value="n"/>
        <variable value="tn"/>
      </dependent>
    </rule>
    <rule>
      <name value="sexo"/>
      <source>
        <context value="src"/>
        <element value="gender"/>
        <variable value="g"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="gender"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="g"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="nacimiento"/>
      <source>
        <context value="src"/>
        <element value="birthDate"/>
        <variable value="b"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="birthDate"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="b"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="telecom"/>
      <source>
        <context value="src"/>
        <element value="telecom"/>
        <variable value="t"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="telecom"/>
        <variable value="tt"/>
      </target>
      <dependent>
        <name value="Telecom"/>
        <variable value="t"/>
        <variable value="tt"/>
      </dependent>
    </rule>
    <rule>
      <name value="direccion"/>
      <source>
        <context value="src"/>
        <element value="address"/>
        <variable value="a"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="address"/>
        <variable value="ta"/>
      </target>
      <dependent>
        <name value="Direccion"/>
        <variable value="a"/>
        <variable value="ta"/>
      </dependent>
    </rule>
  </group>
</StructureMap>