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.
\r\nmap "https://hl7.or.cr/fhir/ph4h/StructureMap/CRPatientToLACPatient" = "CRPatientToLACPatient"\r\n\r\nuses "http://hl7.org/fhir/5.0/StructureDefinition/Patient" alias Patient as source\r\nuses "http://hl7.org/fhir/4.0/StructureDefinition/Patient" alias PatientR4 as target\r\n\r\nimports "https://hl7.or.cr/fhir/ph4h/StructureMap/CRComun"\r\n\r\ngroup CRPatientToLACPatient(source src : Patient, target tgt : PatientR4) {\r\n src.id as v -> tgt.id = v;\r\n src -> tgt.meta as m then {\r\n src -> m.profile = 'http://racsel.org/StructureDefinition/LACPatient' "perfil";\r\n } "meta";\r\n // Pasaporte primero y luego los nacionales, como los slices international y national de LACPatient.\r\n src.identifier as id where ((use = 'official') and type.coding.where((system = 'https://hl7.or.cr/fhir/terminology/CodeSystem/cr-tipo-identificacion') and (code = 'pasaporte')).exists()) -> tgt.identifier as ti then Identificador(id, ti) "pasaporte";\r\n src.identifier as id where ((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()) -> tgt.identifier as ti then Identificador(id, ti) "nacional";\r\n src.name as n -> tgt.name as tn then Nombre(n, tn) "nombre";\r\n src.gender as g -> tgt.gender = g "sexo";\r\n src.birthDate as b -> tgt.birthDate = b "nacimiento";\r\n src.telecom as t -> tgt.telecom as tt then Telecom(t, tt);\r\n src.address as a -> tgt.address as ta then Direccion(a, ta) "direccion";\r\n}\r\n\r\n "},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft","_valueCode":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom","valueCanonical":"https://hl7.or.cr/fhir/ph4h/ImplementationGuide/hl7.fhir.cr.ph4h"}]}}],"url":"https://hl7.or.cr/fhir/ph4h/StructureMap/CRPatientToLACPatient","version":"0.1.0","name":"CRPatientToLACPatient","status":"draft","date":"2026-10-06T00:22:41-06:00","publisher":"Iniciativa HL7 Costa Rica","contact":[{"name":"Iniciativa HL7 Costa Rica","telecom":[{"system":"url","value":"https://hl7.or.cr"}]}],"jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"CR","display":"Costa Rica"}]}],"structure":[{"url":"http://hl7.org/fhir/5.0/StructureDefinition/Patient","mode":"source","alias":"Patient"},{"url":"http://hl7.org/fhir/4.0/StructureDefinition/Patient","mode":"target","alias":"PatientR4"}],"import":["https://hl7.or.cr/fhir/ph4h/StructureMap/CRComun"],"group":[{"name":"CRPatientToLACPatient","typeMode":"none","input":[{"name":"src","type":"Patient","mode":"source"},{"name":"tgt","type":"PatientR4","mode":"target"}],"rule":[{"name":"id","source":[{"context":"src","element":"id","variable":"v"}],"target":[{"context":"tgt","contextType":"variable","element":"id","transform":"copy","parameter":[{"valueId":"v"}]}]},{"name":"meta","source":[{"context":"src"}],"target":[{"context":"tgt","contextType":"variable","element":"meta","variable":"m"}],"rule":[{"name":"perfil","source":[{"context":"src"}],"target":[{"context":"m","contextType":"variable","element":"profile","transform":"copy","parameter":[{"valueString":"http://racsel.org/StructureDefinition/LACPatient"}]}]}]},{"name":"pasaporte","source":[{"context":"src","element":"identifier","variable":"id","condition":"(use = 'official') and type.coding.where((system = 'https://hl7.or.cr/fhir/terminology/CodeSystem/cr-tipo-identificacion') and (code = 'pasaporte')).exists()"}],"target":[{"context":"tgt","contextType":"variable","element":"identifier","variable":"ti"}],"dependent":[{"name":"Identificador","variable":["id","ti"]}],"documentation":"Pasaporte primero y luego los nacionales, como los slices international y national de LACPatient."},{"name":"nacional","source":[{"context":"src","element":"identifier","variable":"id","condition":"(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()"}],"target":[{"context":"tgt","contextType":"variable","element":"identifier","variable":"ti"}],"dependent":[{"name":"Identificador","variable":["id","ti"]}]},{"name":"nombre","source":[{"context":"src","element":"name","variable":"n"}],"target":[{"context":"tgt","contextType":"variable","element":"name","variable":"tn"}],"dependent":[{"name":"Nombre","variable":["n","tn"]}]},{"name":"sexo","source":[{"context":"src","element":"gender","variable":"g"}],"target":[{"context":"tgt","contextType":"variable","element":"gender","transform":"copy","parameter":[{"valueId":"g"}]}]},{"name":"nacimiento","source":[{"context":"src","element":"birthDate","variable":"b"}],"target":[{"context":"tgt","contextType":"variable","element":"birthDate","transform":"copy","parameter":[{"valueId":"b"}]}]},{"name":"telecom","source":[{"context":"src","element":"telecom","variable":"t"}],"target":[{"context":"tgt","contextType":"variable","element":"telecom","variable":"tt"}],"dependent":[{"name":"Telecom","variable":["t","tt"]}]},{"name":"direccion","source":[{"context":"src","element":"address","variable":"a"}],"target":[{"context":"tgt","contextType":"variable","element":"address","variable":"ta"}],"dependent":[{"name":"Direccion","variable":["a","ta"]}]}]}]}
]]>