Ir al contenido

Previsualizar un informe de laboratorio sin guardar

POST
/laboratorio/preview
curl --request POST \
--url https://ponspre.medicinainteligente.ai/laboratorio/preview \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "paciente": { "tipo_documento": "CI", "numero_documento": "51234890", "pais_iso3166": 858, "primer_nombre": "María", "segundo_nombre": "Elena", "primer_apellido": "Castro", "segundo_apellido": "Sosa", "sexo": "F", "fecha_nacimiento": "1968-11-04" }, "profesional": { "numero_documento": "29876543", "primer_nombre": "Laura", "primer_apellido": "Silva", "matricula": "9876" }, "organizacion": { "nombre": "Laboratorio BioAnalítica Uruguay", "rut": "210007778888" }, "solicitante": { "numero_documento": "33445566", "primer_nombre": "Carlos", "primer_apellido": "Gómez", "matricula": "12345" }, "fecha_muestra": "2026-07-20T07:45:00", "fecha_informe": "2026-07-20T14:30:00", "tipo_muestra": "sangre venosa", "examenes": [ { "nombre": "Hemoglobina", "codigo_loinc": "718-7", "valor": "11.8", "unidad": "g/dL", "rango_referencia": "12.0 - 16.0 g/dL", "observaciones": null }, { "nombre": "Hematocrito", "codigo_loinc": "4544-3", "valor": "35", "unidad": "%", "rango_referencia": "37 - 47 %", "observaciones": null }, { "nombre": "Glucemia", "codigo_loinc": "2345-7", "valor": "126", "unidad": "mg/dL", "rango_referencia": "70 - 110 mg/dL", "observaciones": "Muestra obtenida en ayunas de 10 horas" } ], "conclusion": "Hemoglobina y hematocrito por debajo del límite inferior de referencia, compatibles con anemia leve. Glucemia en ayunas elevada (126 mg/dL): correlacionar con clínica y antecedentes; considerar diabetes mellitus tipo 2." }'

Recibe el mismo cuerpo que POST /laboratorio y devuelve el Bundle de transacción FHIR que se guardaría, sin guardarlo.

Media typeapplication/json
InformeLaboratorioIn
object
paciente
required
PacienteIn
object
tipo_documento
TipoDocumento
string
default: CI
Allowed values: CI PASAPORTE CC
numero_documento
required
Numero Documento
string
pais_iso3166
Pais Iso3166

Código ISO-3166 numérico. Uruguay=858

integer
default: 858
primer_nombre
required
Primer Nombre
string
segundo_nombre
Any of:
string
primer_apellido
Any of:
string
segundo_apellido
Any of:
string
sexo
Sexo
string
default: DESCONOCIDO
Allowed values: M F OTRO DESCONOCIDO
fecha_nacimiento
Any of:
string format: date
telefono
Any of:
string
direccion
Any of:
string
ciudad
Any of:
string
departamento
Any of:
string
profesional
required
ProfesionalIn

Profesional que valida el informe

object
numero_documento
Any of:
string
primer_nombre
required
Primer Nombre
string
/\S/
primer_apellido
required
Primer Apellido
string
/\S/
matricula
Any of:
string
organizacion
required
OrganizacionIn

El laboratorio

object
nombre
required
Nombre

Nombre de la institución

string
rut
Any of:
string
solicitante
Any of:
ProfesionalIn
object
numero_documento
Any of:
string
primer_nombre
required
Primer Nombre
string
/\S/
primer_apellido
required
Primer Apellido
string
/\S/
matricula
Any of:
string
identificador
Any of:
string
/^[^|]+\|[^|]+$/
fecha_muestra
required
Fecha Muestra

Toma/extracción de la muestra (ISO 8601)

string format: date-time
fecha_informe
Any of:
string format: date-time
tipo_muestra
Any of:
string
examenes
required
Examenes
Array<object>
>= 1 items
ResultadoExamenIn
object
nombre
required
Nombre

Nombre del examen

string
codigo_loinc
Any of:
string
valor
required
Valor

Resultado tal cual lo informa el laboratorio

string
unidad
Any of:
string
rango_referencia
Any of:
string
observaciones
Any of:
string
conclusion
Any of:
string

Examples

Examplecapturado

Pedido real

{
"paciente": {
"tipo_documento": "CI",
"numero_documento": "51234890",
"pais_iso3166": 858,
"primer_nombre": "María",
"segundo_nombre": "Elena",
"primer_apellido": "Castro",
"segundo_apellido": "Sosa",
"sexo": "F",
"fecha_nacimiento": "1968-11-04"
},
"profesional": {
"numero_documento": "29876543",
"primer_nombre": "Laura",
"primer_apellido": "Silva",
"matricula": "9876"
},
"organizacion": {
"nombre": "Laboratorio BioAnalítica Uruguay",
"rut": "210007778888"
},
"solicitante": {
"numero_documento": "33445566",
"primer_nombre": "Carlos",
"primer_apellido": "Gómez",
"matricula": "12345"
},
"fecha_muestra": "2026-07-20T07:45:00",
"fecha_informe": "2026-07-20T14:30:00",
"tipo_muestra": "sangre venosa",
"examenes": [
{
"nombre": "Hemoglobina",
"codigo_loinc": "718-7",
"valor": "11.8",
"unidad": "g/dL",
"rango_referencia": "12.0 - 16.0 g/dL",
"observaciones": null
},
{
"nombre": "Hematocrito",
"codigo_loinc": "4544-3",
"valor": "35",
"unidad": "%",
"rango_referencia": "37 - 47 %",
"observaciones": null
},
{
"nombre": "Glucemia",
"codigo_loinc": "2345-7",
"valor": "126",
"unidad": "mg/dL",
"rango_referencia": "70 - 110 mg/dL",
"observaciones": "Muestra obtenida en ayunas de 10 horas"
}
],
"conclusion": "Hemoglobina y hematocrito por debajo del límite inferior de referencia, compatibles con anemia leve. Glucemia en ayunas elevada (126 mg/dL): correlacionar con clínica y antecedentes; considerar diabetes mellitus tipo 2."
}

Éxito

Media typeapplication/json

Examples

Examplecapturado

Respuesta real

{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000090",
"resource": {
"resourceType": "Patient",
"identifier": [
{
"use": "official",
"system": "urn:oid:2.16.858.1.858.68909",
"value": "51234890"
}
],
"name": [
{
"use": "official",
"given": [
"María",
"Elena"
],
"family": "Castro Sosa"
}
],
"gender": "female",
"birthDate": "1968-11-04"
},
"request": {
"method": "POST",
"url": "Patient",
"ifNoneExist": "identifier=urn:oid:2.16.858.1.858.68909|51234890&_tag:not=urn:pons:hcen|paciente-institucion"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000091",
"resource": {
"resourceType": "Practitioner",
"identifier": [
{
"use": "official",
"system": "urn:oid:2.16.858.1.858.68909",
"value": "29876543"
},
{
"use": "official",
"system": "urn:uy:matricula-profesional",
"value": "9876"
}
],
"name": [
{
"use": "official",
"given": [
"Laura"
],
"family": "Silva"
}
]
},
"request": {
"method": "POST",
"url": "Practitioner",
"ifNoneExist": "identifier=urn:oid:2.16.858.1.858.68909|29876543"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000092",
"resource": {
"resourceType": "Organization",
"name": "Laboratorio BioAnalítica Uruguay",
"type": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
"code": "prov",
"display": "Healthcare Provider"
}
]
}
],
"identifier": [
{
"system": "urn:uy:rut",
"value": "210007778888"
}
]
},
"request": {
"method": "POST",
"url": "Organization",
"ifNoneExist": "identifier=urn:uy:rut|210007778888"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000093",
"resource": {
"resourceType": "Practitioner",
"identifier": [
{
"use": "official",
"system": "urn:oid:2.16.858.1.858.68909",
"value": "33445566"
},
{
"use": "official",
"system": "urn:uy:matricula-profesional",
"value": "12345"
}
],
"name": [
{
"use": "official",
"given": [
"Carlos"
],
"family": "Gómez"
}
]
},
"request": {
"method": "POST",
"url": "Practitioner",
"ifNoneExist": "identifier=urn:oid:2.16.858.1.858.68909|33445566"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000094",
"resource": {
"resourceType": "ServiceRequest",
"status": "completed",
"intent": "order",
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000090"
},
"authoredOn": "2026-07-20T07:45:00-03:00",
"requester": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000093"
}
},
"request": {
"method": "POST",
"url": "ServiceRequest"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000095",
"resource": {
"resourceType": "Specimen",
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000090"
},
"collection": {
"collectedDateTime": "2026-07-20T07:45:00-03:00"
},
"type": {
"text": "sangre venosa"
}
},
"request": {
"method": "POST",
"url": "Specimen"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000096",
"resource": {
"resourceType": "Observation",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
]
}
],
"code": {
"text": "Hemoglobina",
"coding": [
{
"system": "http://loinc.org",
"code": "718-7"
}
]
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000090"
},
"specimen": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000095"
},
"effectiveDateTime": "2026-07-20T07:45:00-03:00",
"valueQuantity": {
"value": 11.8,
"unit": "g/dL",
"system": "http://unitsofmeasure.org",
"code": "g/dL"
},
"referenceRange": [
{
"text": "12.0 - 16.0 g/dL"
}
]
},
"request": {
"method": "POST",
"url": "Observation"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000097",
"resource": {
"resourceType": "Observation",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
]
}
],
"code": {
"text": "Hematocrito",
"coding": [
{
"system": "http://loinc.org",
"code": "4544-3"
}
]
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000090"
},
"specimen": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000095"
},
"effectiveDateTime": "2026-07-20T07:45:00-03:00",
"valueQuantity": {
"value": 35,
"unit": "%",
"system": "http://unitsofmeasure.org",
"code": "%"
},
"referenceRange": [
{
"text": "37 - 47 %"
}
]
},
"request": {
"method": "POST",
"url": "Observation"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000098",
"resource": {
"resourceType": "Observation",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
]
}
],
"code": {
"text": "Glucemia",
"coding": [
{
"system": "http://loinc.org",
"code": "2345-7"
}
]
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000090"
},
"specimen": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000095"
},
"effectiveDateTime": "2026-07-20T07:45:00-03:00",
"valueQuantity": {
"value": 126,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"referenceRange": [
{
"text": "70 - 110 mg/dL"
}
],
"note": [
{
"text": "Muestra obtenida en ayunas de 10 horas"
}
]
},
"request": {
"method": "POST",
"url": "Observation"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000099",
"resource": {
"resourceType": "DiagnosticReport",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0074",
"code": "LAB",
"display": "Laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "11502-2",
"display": "Laboratory report"
}
],
"text": "Informe de laboratorio"
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000090"
},
"basedOn": [
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000094"
}
],
"specimen": [
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000095"
}
],
"result": [
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000096"
},
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000097"
},
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000098"
}
],
"performer": [
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000091"
},
{
"reference": "urn:uuid:00000000-0000-4000-9000-000000000092"
}
],
"effectiveDateTime": "2026-07-20T07:45:00-03:00",
"issued": "2026-07-20T14:30:00-03:00",
"conclusion": "Hemoglobina y hematocrito por debajo del límite inferior de referencia, compatibles con anemia leve. Glucemia en ayunas elevada (126 mg/dL): correlacionar con clínica y antecedentes; considerar diabetes mellitus tipo 2."
},
"request": {
"method": "POST",
"url": "DiagnosticReport"
}
}
]
}

Falta la API key, no es válida o fue revocada.

Media typeapplication/json

Examples

Examplecapturado

Respuesta real

{
"detail": "Falta la API key, no es válida o fue revocada (header X-API-Key o Authorization: Bearer)"
}

La key no tiene el alcance que pide esta operación.

Media typeapplication/json

Examples

Examplecapturado

Respuesta real

{
"detail": "La API key no tiene el alcance 'entrada'"
}

Error de validación

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}