Ir al contenido

Previsualizar una prescripción sin guardar

POST
/prescripciones/preview
curl --request POST \
--url https://ponspre.medicinainteligente.ai/prescripciones/preview \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "paciente": { "tipo_documento": "CI", "numero_documento": "49876543", "pais_iso3166": 858, "primer_nombre": "Valentina", "segundo_nombre": null, "primer_apellido": "Olivera", "segundo_apellido": "Bentancor", "sexo": "F", "fecha_nacimiento": "1993-09-08" }, "profesional": { "numero_documento": "33445566", "primer_nombre": "Carlos", "primer_apellido": "Gómez", "matricula": "12345" }, "organizacion": { "nombre": "Consultorio Médico Punta Carretas", "rut": "210004445555" }, "fecha": "2026-07-20T10:30:00", "medicamentos": [ { "farmaco": "Enalapril 10 mg", "codigo_dnma": null, "via": "oral", "cantidad": "1 comprimido", "duracion_dias": 30, "frecuencia": "cada 12 horas", "momento": null }, { "farmaco": "Atorvastatina 20 mg", "codigo_dnma": null, "via": "oral", "cantidad": "1 comprimido", "duracion_dias": 30, "frecuencia": "cada 24 horas", "momento": "por la noche" }, { "farmaco": "Ácido acetilsalicílico 100 mg", "codigo_dnma": null, "via": "oral", "cantidad": "1 comprimido", "duracion_dias": 30, "frecuencia": "cada 24 horas", "momento": "con el almuerzo" } ] }'

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

Media typeapplication/json
PrescripcionIn
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

Prescriptor

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

Institución donde se prescribe

object
nombre
required
Nombre

Nombre de la institución

string
rut
Any of:
string
fecha
required
Fecha

Fecha de la prescripción (ISO 8601)

string format: date-time
medicamentos
required
Medicamentos
Array<object>
>= 1 items
MedicacionAltaIn
object
farmaco
required
Farmaco
string
codigo_dnma
Any of:
string
via
required
Via
string
cantidad
required
Cantidad
string
duracion_dias
required
Duracion Dias
integer
frecuencia
required
Frecuencia
string
momento
Any of:
string
repeticiones
Any of:
integer
intervalo_dispensacion_dias
Any of:
integer
>= 1
vigencia_dias
Any of:
integer
>= 1
identificador
Any of:
string
atencion_id
Any of:
string

Examples

Examplecapturado

Pedido real

{
"paciente": {
"tipo_documento": "CI",
"numero_documento": "49876543",
"pais_iso3166": 858,
"primer_nombre": "Valentina",
"segundo_nombre": null,
"primer_apellido": "Olivera",
"segundo_apellido": "Bentancor",
"sexo": "F",
"fecha_nacimiento": "1993-09-08"
},
"profesional": {
"numero_documento": "33445566",
"primer_nombre": "Carlos",
"primer_apellido": "Gómez",
"matricula": "12345"
},
"organizacion": {
"nombre": "Consultorio Médico Punta Carretas",
"rut": "210004445555"
},
"fecha": "2026-07-20T10:30:00",
"medicamentos": [
{
"farmaco": "Enalapril 10 mg",
"codigo_dnma": null,
"via": "oral",
"cantidad": "1 comprimido",
"duracion_dias": 30,
"frecuencia": "cada 12 horas",
"momento": null
},
{
"farmaco": "Atorvastatina 20 mg",
"codigo_dnma": null,
"via": "oral",
"cantidad": "1 comprimido",
"duracion_dias": 30,
"frecuencia": "cada 24 horas",
"momento": "por la noche"
},
{
"farmaco": "Ácido acetilsalicílico 100 mg",
"codigo_dnma": null,
"via": "oral",
"cantidad": "1 comprimido",
"duracion_dias": 30,
"frecuencia": "cada 24 horas",
"momento": "con el almuerzo"
}
]
}

Éxito

Media typeapplication/json

Examples

Examplecapturado

Respuesta real

{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000108",
"resource": {
"resourceType": "Patient",
"identifier": [
{
"use": "official",
"system": "urn:oid:2.16.858.1.858.68909",
"value": "49876543"
}
],
"name": [
{
"use": "official",
"given": [
"Valentina"
],
"family": "Olivera Bentancor"
}
],
"gender": "female",
"birthDate": "1993-09-08"
},
"request": {
"method": "POST",
"url": "Patient",
"ifNoneExist": "identifier=urn:oid:2.16.858.1.858.68909|49876543&_tag:not=urn:pons:hcen|paciente-institucion"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000109",
"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-000000000110",
"resource": {
"resourceType": "Organization",
"name": "Consultorio Médico Punta Carretas",
"type": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
"code": "prov",
"display": "Healthcare Provider"
}
]
}
],
"identifier": [
{
"system": "urn:uy:rut",
"value": "210004445555"
}
]
},
"request": {
"method": "POST",
"url": "Organization",
"ifNoneExist": "identifier=urn:uy:rut|210004445555"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000111",
"resource": {
"resourceType": "MedicationRequest",
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"text": "Enalapril 10 mg"
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000108"
},
"authoredOn": "2026-07-20T10:30:00-03:00",
"dosageInstruction": [
{
"text": "1 comprimido, oral, cada 12 horas",
"route": {
"text": "oral"
}
}
],
"dispenseRequest": {
"expectedSupplyDuration": {
"value": 30,
"unit": "d",
"system": "http://unitsofmeasure.org",
"code": "d"
}
},
"requester": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000109"
}
},
"request": {
"method": "POST",
"url": "MedicationRequest"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000112",
"resource": {
"resourceType": "MedicationRequest",
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"text": "Atorvastatina 20 mg"
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000108"
},
"authoredOn": "2026-07-20T10:30:00-03:00",
"dosageInstruction": [
{
"text": "1 comprimido, oral, cada 24 horas, por la noche",
"route": {
"text": "oral"
}
}
],
"dispenseRequest": {
"expectedSupplyDuration": {
"value": 30,
"unit": "d",
"system": "http://unitsofmeasure.org",
"code": "d"
}
},
"requester": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000109"
}
},
"request": {
"method": "POST",
"url": "MedicationRequest"
}
},
{
"fullUrl": "urn:uuid:00000000-0000-4000-9000-000000000113",
"resource": {
"resourceType": "MedicationRequest",
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"text": "Ácido acetilsalicílico 100 mg"
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000108"
},
"authoredOn": "2026-07-20T10:30:00-03:00",
"dosageInstruction": [
{
"text": "1 comprimido, oral, cada 24 horas, con el almuerzo",
"route": {
"text": "oral"
}
}
],
"dispenseRequest": {
"expectedSupplyDuration": {
"value": 30,
"unit": "d",
"system": "http://unitsofmeasure.org",
"code": "d"
}
},
"requester": {
"reference": "urn:uuid:00000000-0000-4000-9000-000000000109"
}
},
"request": {
"method": "POST",
"url": "MedicationRequest"
}
}
]
}

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"
}
]
}