HL7 FHIR Costa Rica - Core
0.0.1-ballot - ci-build
HL7 FHIR Costa Rica - Core, published by Iniciativa HL7 Costa Rica. This guide is not an authorized publication; it is the continuous build for version 0.0.1-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7-cr/core/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |

GAUDÍ (Generador de Autoridad de Documento por Unidad de Identificación) es una solución tecnológica de acceso electrónico que permite realizar una serie de funcionalidades con su tarjeta de firma digital, tales como firmar y validar documentos y la autenticación de los suscriptores. Le ofrece una serie de funcionalidades que le permiten autenticarse y realizar firmas.
Ademas es el sistema oficial de sellado de tiempo del Banco Central de Costa Rica. Proporciona un mecanismo confiable y legalmente reconocido para sellar documentos electrónicos, incluyendo recursos FHIR, con una marca temporal verificable e irrefutable.
En el contexto de interoperabilidad clínica FHIR, GAUDÍ garantiza que los documentos clínicos digitales (Bundles de tipo "document") pueden ser sellados con una prueba de existencia e integridad reconocida legalmente.
GAUDÍ opera bajo:
┌─────────────────────────────────────────────────────────┐
│ Banco Central de Costa Rica │
│ Sistema de Sellado de Tiempo Oficial │
│ │
│ ✓ Autoridad Certificadora Nacional reconocida │
│ ✓ Infraestructura PKI de clase alta │
│ ✓ Disponibilidad 24/7/365 │
│ ✓ Sincronización UTC con servidores internacionales │
│ ✓ Auditoría permanente e inmutable │
└─────────────────────────────────────────────────────────┘
Solo los Bundles de tipo "document" pueden ser sellados con GAUDÍ:
Bundle {
type = #document ← Único tipo soportado para sellado
composition = Reference(Composition) ← Referencia obligatoria
entry[0] = Composition
entry[1] = Patient
entry[2..n] = Recursos clínicos (Observation, Medication, etc.)
signature = Signature ← Elemento opcional para GAUDÍ
}
{
"resourceType": "Bundle",
"type": "document",
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:3e4130b9-e5ed-4b90-80c8-4b12f5d7f5f5"
},
"timestamp": "2026-01-20T10:30:00-06:00",
"entry": [
{
"fullUrl": "urn:uuid:composition-001",
"resource": {
"resourceType": "Composition",
"type": {
"coding": [{
"system": "http://loinc.org",
"code": "34840-9",
"display": "Neurology Consultation note"
}]
},
"subject": { "reference": "Patient/..." },
"date": "2026-01-20",
"author": [ { "reference": "Practitioner/..." } ],
"title": "Documento Clínico - Consulta de Neurología",
"section": [ { "entry": [...] } ]
}
},
{ "fullUrl": "urn:uuid:patient-001", "resource": { ... } },
{ "fullUrl": "urn:uuid:observation-001", "resource": { ... } }
],
"signature": {
"type": [{
"system": "urn:iso-std:iec:61208:2012#urn:adoc:sigform:gaudi",
"code": "GAUDI-TSA"
}],
"when": "2026-01-20T10:35:00Z",
"who": {
"reference": "Organization/laboratorio-nacional",
"display": "Laboratorio Nacional de Referencia"
},
"onBehalfOf": {
"reference": "Organization/ministerio-salud",
"display": "Ministerio de Salud de Costa Rica"
},
"sigFormat": "application/gaudi+json",
"data": "MIIDxDCC...base64-encoded-gaudi-signature..."
}
}
Profesional Clínico
↓
Crea Composición con datos clínicos
↓
Agrupa recursos en Bundle tipo "document"
↓
Bundle listo para sellado
Bundle JSON Canonizado
↓
Calcular SHA-256 del contenido
↓
Generar hash verificable
POST https://urlfake-gaud.fi.cr/api/v1/sello-temporal
Solicitud:
{
"documento": {
"hash": "d4735d7e98...sha256...",
"algoritmo": "SHA256",
"tipo": "documento-clinico-fhir",
"institucion": "laboratorio-nacional",
"paciente-hash": "hash-del-identificador-paciente"
},
"metadatos": {
"tipos-recursos": ["Composition", "Patient", "Observation"],
"timestamp-local": "2026-01-20T10:30:00-06:00"
}
}
Respuesta:
{
"sello": {
"timestamp": "2026-01-20T10:35:00.123Z",
"referencia": "GAUDI-2026-BCR-001234",
"certificado": "MIIFXzCCA0e...X.509 certificate...",
"cadena-confianza": ["Certificado BCR", "Certificado Raíz"],
"algoritmo": "SHA256withRSA"
},
"validacion": {
"estado": "SELLADO",
"tokens-registrados": 1,
"proxima-validacion": "2026-01-20T10:36:00Z"
}
}
El sello GAUDÍ se añade al elemento Bundle.signature con:
Bundle con Sello GAUDÍ
↓
Transmisión segura (TLS/HTTPS)
↓
Sistema receptor
↓
Validación de sello (verificación de integridad)
| Estado | Significado | Acción |
|---|---|---|
| SELLADO | Documento válido con sello GAUDÍ vigente | Aceptar documento |
| EXPIRADO | Sello vencido (rara vez ocurre) | Solicitar resello |
| REVOCADO | Certificado revocado | Rechazar documento |
| NO_VERIFICADO | No tiene sello GAUDÍ | Requerir sellado |
┌──────────────────────────────────────┐
│ Laboratorio Nacional │
│ Resultado de Prueba COVID-19 │
├──────────────────────────────────────┤
│ ✓ Bundledocument con Observation │
│ ✓ Datos del paciente (Patient) │
│ ✓ Organización responsable │
│ ✓ Sellado con GAUDÍ │
│ ✓ Referencia: GAUDI-2026-BCR-0046 │
│ ✓ Timestamp: 2026-01-20T10:35:00 │
├──────────────────────────────────────┤
│ ESTADO: ÍNTEGRO Y VERIFICADO │
└──────────────────────────────────────┘
┌──────────────────────────────────────┐
│ Clínica Médica Central │
│ Nota de Consulta - Cardiología │
├──────────────────────────────────────┤
│ ✓ Composition: Estructura clínic │
│ ✓ Observaciones diagnósticas │
│ ✓ Medicamentos prescritos │
│ ✓ Firma del médico (dentro de Comp.) │
│ ✓ Sello GAUDÍ en Bundle │
│ ✓ Cadena de confianza completa │
├──────────────────────────────────────┤
│ ESTADO: VÁLIDO LEGALMENTE │
└──────────────────────────────────────┘
┌──────────────────────────────────────┐
│ Instituto Médico Legal │
│ Informe de Autopsia (Documento) │
├──────────────────────────────────────┤
│ ✓ Bundle document con datos completos│
│ ✓ Múltiples observaciones clínicas │
│ ✓ Sellado GAUDÍ (prueba de tiempo) │
│ ✓ No repudiable │
│ ✓ Válido como prueba forense │
├──────────────────────────────────────┤
│ ESTADO: LEGAL Y ADMISIBLE │
└──────────────────────────────────────┘
┌─────────────────┐
│ Sistema Clínico │
│ (EHR/HIS) │
└────────┬────────┘
│
Crea documento
│
↓
┌─────────────────────────────────────┐
│ Generador FHIR │
│ - Composition │
│ - Bundle type=document │
└────────┬────────────────────────────┘
│
Serializa como JSON
│
↓
┌─────────────────────────────────────┐
│ Cliente GAUDÍ │
│ - Calcula hash SHA-256 │
│ - Solicita sello a BCR │
│ - Incorpora respuesta │
└────────┬────────────────────────────┘
│
Documento con sello
│
↓
┌─────────────────────────────────────┐
│ Almacenamiento / Intercambio │
│ - Base de datos clínica │
│ - Portal del paciente │
│ - Envío a otras instituciones │
└─────────────────────────────────────┘
Por definir
Por definir