Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.fhiron.cl/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

POST https://fhiron.cl/api/validate

Headers

HeaderRequeridoDescripción
Content-Typeapplication/json
X-API-KeyAPI key del tenant. Disponible en fhiron.cl/dashboard/settings.

Request body

Cualquier recurso FHIR R4 válido como JSON. Bridge detecta el resourceType y busca el perfil CL Core correspondiente automáticamente.

Ejemplo — Patient

curl -X POST https://fhiron.cl/api/validate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $FHIRON_API_KEY" \
  -d '{
    "resourceType": "Patient",
    "identifier": [{
      "system": "https://hl7chile.cl/fhir/ig/clcore/CodeSystem/CSIdentificadores",
      "value": "12.345.678-5"
    }],
    "name": [{ "family": "Pérez", "given": ["María"] }]
  }'

Response

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "details": {
        "text": "El RUN no debe incluir puntos. Formato esperado: 12345678-5 (perfil RUNcl · CL Core v1.9.3)."
      },
      "expression": ["Patient.identifier[0].value"],
      "diagnostics": "{\"code\":\"cl-run-01\",\"why\":\"...\",\"profileUrl\":\"...\",\"quickFix\":{\"jsonPointer\":\"/identifier/0/value\",\"replacement\":\"12345678-5\"}}"
    }
  ]
}
Si el recurso es válido, issue[] viene vacío y el HTTP status es 200.

Códigos HTTP

CódigoSignificado
200Validación ejecutada. Revisar issue[] para los problemas encontrados.
400JSON inválido o falta resourceType.
401X-API-Key ausente, inválida o revocada.
429Cuota mensual del plan agotada. Ver headers X-RateLimit-*.
5xxError de gateway o validador. Reintentar con backoff exponencial.

Rate limits

Cada plan tiene una cuota mensual de validaciones. Los headers de respuesta incluyen:
  • X-RateLimit-Limit — cuota total del mes.
  • X-RateLimit-Remaining — validaciones restantes.
  • X-RateLimit-Reset — timestamp Unix del próximo reseteo.
Las tools offline del MCP (fhiron_fhir_lint_local, fhiron_fhir_lint_run, fhiron_fhir_apply_quickfix, fhiron_get_example, fhiron_search_terminology, fhiron_explain_code) no consumen cuota: se ejecutan localmente en el connector.

Idempotencia

POST /api/validate es idempotente. El mismo body produce el mismo output. No hay efectos colaterales: el recurso no se persiste (ver Stateless Gateway).