Guía de Implementación de Homologación Regional (PH4H) de Costa Rica
0.1.0 - ci-build Costa Rica bandera

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.

: CRComun

Estado de las normas de la página: Draft

xml bruto | Descargar


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

</span><span style="color: navy">// </span><span style="color: green">Identificador: el system pasa de URI a OID (ConceptMap cr-sistema-identificador-oid, opción (a) de la</span>
<span style="color: navy">// </span><span style="color: green">homologación) y el tipo conserva solo el coding de HL7 v2-0203, que entienden los demás países.</span>

<b>group </b>Identificador<span style="color: navy">(</span><b>source</b> <span style="color: maroon">id</span><span style="color: navy"> : </span>Identifier, <b>target</b> <span style="color: maroon">ti</span><span style="color: navy"> : </span>Identifier<span style="color: navy">)</span><span style="color: navy"> {
</span>  id.use<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ti.use = <span style="color: maroon">v</span><span style="color: navy">;</span>
  id.type<b> as </b><span style="color: maroon">st</span><span style="color: navy"><b> -&gt; </b></span>ti.type<b> as </b><span style="color: maroon">tt</span><b> then</b><span style="color: navy"> {
</span>    st.coding<b> as </b><span style="color: maroon">sc</span><b> where </b><span style="color: navy">(</span>system = 'http://terminology.hl7.org/CodeSystem/v2-0203'<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span>tt.coding<b> as </b><span style="color: maroon">c</span><b> then </b>Codificacion<span style="color: navy">(</span><span style="color: maroon">sc</span><span style="color: navy">, </span><span style="color: maroon">c</span><span style="color: navy">)</span> <i>&quot;v2&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  id.system<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>ti.system = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: blue">'https://hl7.or.cr/fhir/ph4h/ConceptMap/cr-sistema-identificador-oid'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><span style="color: navy">;</span>
  id.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ti.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
  id.period<b> as </b><span style="color: maroon">p</span><span style="color: navy"><b> -&gt; </b></span>ti.period<b> as </b><span style="color: maroon">tp</span><b> then </b>Periodo<span style="color: navy">(</span><span style="color: maroon">p</span><span style="color: navy">, </span><span style="color: maroon">tp</span><span style="color: navy">)</span><span style="color: navy">;</span>
  id.assigner<b> as </b><span style="color: maroon">a</span><span style="color: navy"><b> -&gt; </b></span>ti.assigner<b> as </b><span style="color: maroon">ta</span><b> then </b>Referencia<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><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">Referencia: se conserva la referencia. Si es lógica (por identificador), su system también pasa a OID y se</span>
<span style="color: navy">// </span><span style="color: green">agrega el tipo de HL7 v2-0203, porque con el OID del país el system ya no distingue el tipo de identificador.</span>
<b>group </b>Referencia<span style="color: navy">(</span><b>source</b> <span style="color: maroon">r</span><span style="color: navy"> : </span>Reference, <b>target</b> <span style="color: maroon">tr</span><span style="color: navy"> : </span>Reference<span style="color: navy">)</span><span style="color: navy"> {
</span>  r.reference<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tr.reference = <span style="color: maroon">v</span><span style="color: navy">;</span>
  r.type<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tr.type = <span style="color: maroon">v</span><span style="color: navy">;</span>
  r.identifier<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -&gt; </b></span>tr.identifier<b> as </b><span style="color: maroon">ti</span><b> then</b><span style="color: navy"> {
</span>    id.type<b> as </b><span style="color: maroon">t</span><span style="color: navy"><b> -&gt; </b></span>ti.type<b> as </b><span style="color: maroon">tt</span><b> then </b>Concepto<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> <i>&quot;tipoExplicito&quot;</i><span style="color: navy">;</span>
    id<b> where </b><span style="color: navy">(</span>type.exists().not() and system.startsWith('https://hl7.or.cr/fhir/sid/pasaporte/')<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span> ti.type<b> as </b><span style="color: maroon">tt</span><span style="color: navy">, </span> tt.coding<b> as </b><span style="color: maroon">c</span><b> then</b><span style="color: navy"> {
</span>      id<span style="color: navy"><b> -&gt; </b></span> c.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/v2-0203'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'PPN'</span> <i>&quot;ppn&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;tipoPasaporte&quot;</i><span style="color: navy">;</span>
    id<b> where </b><span style="color: navy">(</span>type.exists().not() and system.startsWith('https://hl7.or.cr/fhir/sid/pasaporte/').not()<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span> ti.type<b> as </b><span style="color: maroon">tt</span><span style="color: navy">, </span> tt.coding<b> as </b><span style="color: maroon">c</span><b> then</b><span style="color: navy"> {
</span>      id.system<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span> c.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/v2-0203'</span><span style="color: navy">, </span> c.code = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: blue">'https://hl7.or.cr/fhir/ph4h/ConceptMap/cr-sistema-identificador-tipo'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span> <i>&quot;v2&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;tipoDelSystem&quot;</i><span style="color: navy">;</span>
    id.system<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>ti.system = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: blue">'https://hl7.or.cr/fhir/ph4h/ConceptMap/cr-sistema-identificador-oid'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><span style="color: navy">;</span>
    id.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ti.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  r.display<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tr.display = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>Concepto<span style="color: navy">(</span><b>source</b> <span style="color: maroon">cc</span><span style="color: navy"> : </span>CodeableConcept, <b>target</b> <span style="color: maroon">tc</span><span style="color: navy"> : </span>CodeableConcept<span style="color: navy">)</span><span style="color: navy"> {
</span>  cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy"><b> -&gt; </b></span>tc.coding<b> as </b><span style="color: maroon">t</span><b> then </b>Codificacion<span style="color: navy">(</span><span style="color: maroon">c</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span><span style="color: navy">;</span>
  cc.text<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tc.text = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>Codificacion<span style="color: navy">(</span><b>source</b> <span style="color: maroon">c</span><span style="color: navy"> : </span>Coding, <b>target</b> <span style="color: maroon">t</span><span style="color: navy"> : </span>Coding<span style="color: navy">)</span><span style="color: navy"> {
</span>  c.system<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>t.system = <span style="color: maroon">v</span><span style="color: navy">;</span>
  c.version<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>t.version = <span style="color: maroon">v</span><span style="color: navy">;</span>
  c.code<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>t.code = <span style="color: maroon">v</span><span style="color: navy">;</span>
  c.display<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>t.display = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>Nombre<span style="color: navy">(</span><b>source</b> <span style="color: maroon">n</span><span style="color: navy"> : </span>HumanName, <b>target</b> <span style="color: maroon">tn</span><span style="color: navy"> : </span>HumanName<span style="color: navy">)</span><span style="color: navy"> {
</span>  n.use<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tn.use = <span style="color: maroon">v</span><span style="color: navy">;</span>
  n.text<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tn.text = <span style="color: maroon">v</span><span style="color: navy">;</span>
  n.family<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tn.family = <span style="color: maroon">v</span><span style="color: navy">;</span>
  n.given<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tn.given = <span style="color: maroon">v</span><span style="color: navy">;</span>
  n.prefix<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tn.prefix = <span style="color: maroon">v</span><span style="color: navy">;</span>
  n.suffix<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tn.suffix = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>Telecom<span style="color: navy">(</span><b>source</b> <span style="color: maroon">t</span><span style="color: navy"> : </span>ContactPoint, <b>target</b> <span style="color: maroon">tt</span><span style="color: navy"> : </span>ContactPoint<span style="color: navy">)</span><span style="color: navy"> {
</span>  t.system<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tt.system = <span style="color: maroon">v</span><span style="color: navy">;</span>
  t.value<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
  t.use<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tt.use = <span style="color: maroon">v</span><span style="color: navy">;</span>
  t.rank<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tt.rank = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">Dirección: el país pasa de alfa-3 a alfa-2 (ConceptMap cr-pais-alfa3-alfa2 de la IG terminológica).</span>
<span style="color: navy">// </span><span style="color: green">Provincia, cantón y distrito van con su código de la DTA; el barrio, en la extensión estándar precinct.</span>
<b>group </b>Direccion<span style="color: navy">(</span><b>source</b> <span style="color: maroon">a</span><span style="color: navy"> : </span>Address, <b>target</b> <span style="color: maroon">ta</span><span style="color: navy"> : </span>Address<span style="color: navy">)</span><span style="color: navy"> {
</span>  a.extension<b> as </b><span style="color: maroon">e</span><b> where </b><span style="color: navy">(</span>url = 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-precinct'<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span>ta.extension<b> as </b><span style="color: maroon">te</span><b> then</b><span style="color: navy"> {
</span>    e.url<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>te.url = <span style="color: maroon">v</span><span style="color: navy">;</span>
    e.value<span style="color: navy"> : </span>string<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>te.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;precinct&quot;</i><span style="color: navy">;</span>
  a.use<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.use = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.text<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.text = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.line<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.line = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.city<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.city = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.district<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.district = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.state<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.state = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.postalCode<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.postalCode = <span style="color: maroon">v</span><span style="color: navy">;</span>
  a.country<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>ta.country = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">v</span><span style="color: navy">, </span><span style="color: blue">'https://hl7.or.cr/fhir/terminology/ConceptMap/cr-pais-alfa3-alfa2'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>Periodo<span style="color: navy">(</span><b>source</b> <span style="color: maroon">p</span><span style="color: navy"> : </span>Period, <b>target</b> <span style="color: maroon">tp</span><span style="color: navy"> : </span>Period<span style="color: navy">)</span><span style="color: navy"> {
</span>  p.start<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tp.start = <span style="color: maroon">v</span><span style="color: navy">;</span>
  p.end<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tp.end = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="draft">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical
                        value="https://hl7.or.cr/fhir/ph4h/ImplementationGuide/hl7.fhir.cr.ph4h"/>
      </extension>
    </valueCode>
  </extension>
  <url value="https://hl7.or.cr/fhir/ph4h/StructureMap/CRComun"/>
  <version value="0.1.0"/>
  <name value="CRComun"/>
  <status value="draft"/>
  <date value="2026-10-06T00:22:41-06:00"/>
  <publisher value="Iniciativa HL7 Costa Rica"/>
  <contact>
    <name value="Iniciativa HL7 Costa Rica"/>
    <telecom>
      <system value="url"/>
      <value value="https://hl7.or.cr"/>
    </telecom>
  </contact>
  <description
               value="Identificador: el system pasa de URI a OID (ConceptMap cr-sistema-identificador-oid, opción (a) de la
homologación) y el tipo conserva solo el coding de HL7 v2-0203, que entienden los demás países."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="CR"/>
      <display value="Costa Rica"/>
    </coding>
  </jurisdiction>
  <group>
    <name value="Identificador"/>
    <typeMode value="none"/>
    <input>
      <name value="id"/>
      <type value="Identifier"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ti"/>
      <type value="Identifier"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="use"/>
      <source>
        <context value="id"/>
        <element value="use"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ti"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="type"/>
      <source>
        <context value="id"/>
        <element value="type"/>
        <variable value="st"/>
      </source>
      <target>
        <context value="ti"/>
        <contextType value="variable"/>
        <element value="type"/>
        <variable value="tt"/>
      </target>
      <rule>
        <name value="v2"/>
        <source>
          <context value="st"/>
          <element value="coding"/>
          <variable value="sc"/>
          <condition
                     value="system = 'http://terminology.hl7.org/CodeSystem/v2-0203'"/>
        </source>
        <target>
          <context value="tt"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="c"/>
        </target>
        <dependent>
          <name value="Codificacion"/>
          <variable value="sc"/>
          <variable value="c"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="system"/>
      <source>
        <context value="id"/>
        <element value="system"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="ti"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="translate"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueString
                       value="https://hl7.or.cr/fhir/ph4h/ConceptMap/cr-sistema-identificador-oid"/>
        </parameter>
        <parameter>
          <valueString value="code"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value"/>
      <source>
        <context value="id"/>
        <element value="value"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ti"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="period"/>
      <source>
        <context value="id"/>
        <element value="period"/>
        <variable value="p"/>
      </source>
      <target>
        <context value="ti"/>
        <contextType value="variable"/>
        <element value="period"/>
        <variable value="tp"/>
      </target>
      <dependent>
        <name value="Periodo"/>
        <variable value="p"/>
        <variable value="tp"/>
      </dependent>
    </rule>
    <rule>
      <name value="assigner"/>
      <source>
        <context value="id"/>
        <element value="assigner"/>
        <variable value="a"/>
      </source>
      <target>
        <context value="ti"/>
        <contextType value="variable"/>
        <element value="assigner"/>
        <variable value="ta"/>
      </target>
      <dependent>
        <name value="Referencia"/>
        <variable value="a"/>
        <variable value="ta"/>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="Referencia"/>
    <typeMode value="none"/>
    <documentation
                   value="Referencia: se conserva la referencia. Si es lógica (por identificador), su system también pasa a OID y se
agrega el tipo de HL7 v2-0203, porque con el OID del país el system ya no distingue el tipo de identificador."/>
    <input>
      <name value="r"/>
      <type value="Reference"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tr"/>
      <type value="Reference"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="reference"/>
      <source>
        <context value="r"/>
        <element value="reference"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tr"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="type"/>
      <source>
        <context value="r"/>
        <element value="type"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tr"/>
        <contextType value="variable"/>
        <element value="type"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="identifier"/>
      <source>
        <context value="r"/>
        <element value="identifier"/>
        <variable value="id"/>
      </source>
      <target>
        <context value="tr"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="ti"/>
      </target>
      <rule>
        <name value="tipoExplicito"/>
        <source>
          <context value="id"/>
          <element value="type"/>
          <variable value="t"/>
        </source>
        <target>
          <context value="ti"/>
          <contextType value="variable"/>
          <element value="type"/>
          <variable value="tt"/>
        </target>
        <dependent>
          <name value="Concepto"/>
          <variable value="t"/>
          <variable value="tt"/>
        </dependent>
      </rule>
      <rule>
        <name value="tipoPasaporte"/>
        <source>
          <context value="id"/>
          <condition
                     value="type.exists().not() and system.startsWith('https://hl7.or.cr/fhir/sid/pasaporte/')"/>
        </source>
        <target>
          <context value="ti"/>
          <contextType value="variable"/>
          <element value="type"/>
          <variable value="tt"/>
        </target>
        <target>
          <context value="tt"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="c"/>
        </target>
        <rule>
          <name value="ppn"/>
          <source>
            <context value="id"/>
          </source>
          <target>
            <context value="c"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
            </parameter>
          </target>
          <target>
            <context value="c"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="PPN"/>
            </parameter>
          </target>
        </rule>
      </rule>
      <rule>
        <name value="tipoDelSystem"/>
        <source>
          <context value="id"/>
          <condition
                     value="type.exists().not() and system.startsWith('https://hl7.or.cr/fhir/sid/pasaporte/').not()"/>
        </source>
        <target>
          <context value="ti"/>
          <contextType value="variable"/>
          <element value="type"/>
          <variable value="tt"/>
        </target>
        <target>
          <context value="tt"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="c"/>
        </target>
        <rule>
          <name value="v2"/>
          <source>
            <context value="id"/>
            <element value="system"/>
            <variable value="s"/>
          </source>
          <target>
            <context value="c"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
            </parameter>
          </target>
          <target>
            <context value="c"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="s"/>
            </parameter>
            <parameter>
              <valueString
                           value="https://hl7.or.cr/fhir/ph4h/ConceptMap/cr-sistema-identificador-tipo"/>
            </parameter>
            <parameter>
              <valueString value="code"/>
            </parameter>
          </target>
        </rule>
      </rule>
      <rule>
        <name value="system"/>
        <source>
          <context value="id"/>
          <element value="system"/>
          <variable value="s"/>
        </source>
        <target>
          <context value="ti"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="translate"/>
          <parameter>
            <valueId value="s"/>
          </parameter>
          <parameter>
            <valueString
                         value="https://hl7.or.cr/fhir/ph4h/ConceptMap/cr-sistema-identificador-oid"/>
          </parameter>
          <parameter>
            <valueString value="code"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="value"/>
        <source>
          <context value="id"/>
          <element value="value"/>
          <variable value="v"/>
        </source>
        <target>
          <context value="ti"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="v"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="display"/>
      <source>
        <context value="r"/>
        <element value="display"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tr"/>
        <contextType value="variable"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="Concepto"/>
    <typeMode value="none"/>
    <input>
      <name value="cc"/>
      <type value="CodeableConcept"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tc"/>
      <type value="CodeableConcept"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="coding"/>
      <source>
        <context value="cc"/>
        <element value="coding"/>
        <variable value="c"/>
      </source>
      <target>
        <context value="tc"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="Codificacion"/>
        <variable value="c"/>
        <variable value="t"/>
      </dependent>
    </rule>
    <rule>
      <name value="text"/>
      <source>
        <context value="cc"/>
        <element value="text"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tc"/>
        <contextType value="variable"/>
        <element value="text"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="Codificacion"/>
    <typeMode value="none"/>
    <input>
      <name value="c"/>
      <type value="Coding"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="t"/>
      <type value="Coding"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="system"/>
      <source>
        <context value="c"/>
        <element value="system"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="t"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="version"/>
      <source>
        <context value="c"/>
        <element value="version"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="t"/>
        <contextType value="variable"/>
        <element value="version"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code"/>
      <source>
        <context value="c"/>
        <element value="code"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="t"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="display"/>
      <source>
        <context value="c"/>
        <element value="display"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="t"/>
        <contextType value="variable"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="Nombre"/>
    <typeMode value="none"/>
    <input>
      <name value="n"/>
      <type value="HumanName"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tn"/>
      <type value="HumanName"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="use"/>
      <source>
        <context value="n"/>
        <element value="use"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tn"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="text"/>
      <source>
        <context value="n"/>
        <element value="text"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tn"/>
        <contextType value="variable"/>
        <element value="text"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="family"/>
      <source>
        <context value="n"/>
        <element value="family"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tn"/>
        <contextType value="variable"/>
        <element value="family"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="given"/>
      <source>
        <context value="n"/>
        <element value="given"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tn"/>
        <contextType value="variable"/>
        <element value="given"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="prefix"/>
      <source>
        <context value="n"/>
        <element value="prefix"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tn"/>
        <contextType value="variable"/>
        <element value="prefix"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="suffix"/>
      <source>
        <context value="n"/>
        <element value="suffix"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tn"/>
        <contextType value="variable"/>
        <element value="suffix"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="Telecom"/>
    <typeMode value="none"/>
    <input>
      <name value="t"/>
      <type value="ContactPoint"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tt"/>
      <type value="ContactPoint"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="system"/>
      <source>
        <context value="t"/>
        <element value="system"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tt"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value"/>
      <source>
        <context value="t"/>
        <element value="value"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tt"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="use"/>
      <source>
        <context value="t"/>
        <element value="use"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tt"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="rank"/>
      <source>
        <context value="t"/>
        <element value="rank"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tt"/>
        <contextType value="variable"/>
        <element value="rank"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="Direccion"/>
    <typeMode value="none"/>
    <documentation
                   value="Dirección: el país pasa de alfa-3 a alfa-2 (ConceptMap cr-pais-alfa3-alfa2 de la IG terminológica).
Provincia, cantón y distrito van con su código de la DTA; el barrio, en la extensión estándar precinct."/>
    <input>
      <name value="a"/>
      <type value="Address"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ta"/>
      <type value="Address"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="precinct"/>
      <source>
        <context value="a"/>
        <element value="extension"/>
        <variable value="e"/>
        <condition
                   value="url = 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-precinct'"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="extension"/>
        <variable value="te"/>
      </target>
      <rule>
        <name value="url"/>
        <source>
          <context value="e"/>
          <element value="url"/>
          <variable value="v"/>
        </source>
        <target>
          <context value="te"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="v"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="value"/>
        <source>
          <context value="e"/>
          <type value="string"/>
          <element value="value"/>
          <variable value="v"/>
        </source>
        <target>
          <context value="te"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="v"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="use"/>
      <source>
        <context value="a"/>
        <element value="use"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="text"/>
      <source>
        <context value="a"/>
        <element value="text"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="text"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="line"/>
      <source>
        <context value="a"/>
        <element value="line"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="line"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="city"/>
      <source>
        <context value="a"/>
        <element value="city"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="city"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="district"/>
      <source>
        <context value="a"/>
        <element value="district"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="district"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="state"/>
      <source>
        <context value="a"/>
        <element value="state"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="state"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="postalCode"/>
      <source>
        <context value="a"/>
        <element value="postalCode"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="postalCode"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="country"/>
      <source>
        <context value="a"/>
        <element value="country"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="ta"/>
        <contextType value="variable"/>
        <element value="country"/>
        <transform value="translate"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
        <parameter>
          <valueString
                       value="https://hl7.or.cr/fhir/terminology/ConceptMap/cr-pais-alfa3-alfa2"/>
        </parameter>
        <parameter>
          <valueString value="code"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="Periodo"/>
    <typeMode value="none"/>
    <input>
      <name value="p"/>
      <type value="Period"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tp"/>
      <type value="Period"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="start"/>
      <source>
        <context value="p"/>
        <element value="start"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tp"/>
        <contextType value="variable"/>
        <element value="start"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="end"/>
      <source>
        <context value="p"/>
        <element value="end"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tp"/>
        <contextType value="variable"/>
        <element value="end"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
  </group>
</StructureMap>