Firmar el CDA de una atención o informe
POST
/firma/cda
const url = 'https://ponspre.medicinainteligente.ai/firma/cda';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"tipo":"atencion","id":"1058","nivel":"2"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://ponspre.medicinainteligente.ai/firma/cda \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "tipo": "atencion", "id": "1058", "nivel": "2" }'El CDA de la atención o del informe en un sobre SignedClinicalDocument firmado (XMLDSig), en el nivel pedido (por defecto 2). Si ese nivel no se puede, sale el siguiente posible y el header X-CDA-Nivel dice cuál.
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»Media typeapplication/json
FirmaCdaIn
object
tipo
required
Tipo
string
id
required
Id
string
nivel
Nivel
string
Examples
Examplecapturado
Pedido real
{ "tipo": "atencion", "id": "1058", "nivel": "2"}Responses
Sección titulada «Responses»Éxito
Media typeapplication/xml
Examples
Examplecapturado
Respuesta real
<?xml version='1.0' encoding='UTF-8'?><SignedClinicalDocument xmlns="urn:salud.uy/2014/signed-clinical-document" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 signed-clinical-documentV2_5.xsd"><ClinicalDocument xmlns="urn:hl7-org:v3"> <typeId extension="POCD_HD000040" root="2.16.840.1.113883.1.3"/> <id root="2.16.858.0.999999.99999.1058"/> <code code="34108-1" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="hoja de consulta no urgente"/> <title>hoja de consulta no urgente</title> <effectiveTime value="20260719100500-0300"/> <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/> <languageCode code="es-UY"/> <recordTarget> <patientRole> <id extension="41234567" root="2.16.858.1.858.68909"/> <patient> <name> <given>Juan Carlos</given> <family>Rodríguez Núñez</family> </name> <administrativeGenderCode code="1" codeSystem="2.16.858.2.10000675.69600" displayName="Masculino"/> <birthTime value="19720315"/> </patient> </patientRole> </recordTarget> <author> <time value="20260719093000-0300"/> <assignedAuthor> <id extension="11982" root="2.16.858.2.10000675.69586"/> <assignedPerson> <name> <given>Roberto</given> <family>Fernández</family> </name> </assignedPerson> <representedOrganization> <id root="2.16.858.0.999999.99999"/> <name>Policlínica Fernández & Asociados</name> </representedOrganization> </assignedAuthor> </author> <author> <time value="20260719093000-0300"/> <assignedAuthor> <id root="2.16.858.0.999999.99999"/> <assignedAuthoringDevice> <softwareName>Ingesta FHIR UY</softwareName> </assignedAuthoringDevice> <representedOrganization> <id root="2.16.858.0.999999.99999"/> <name>Policlínica Fernández & Asociados</name> </representedOrganization> </assignedAuthor> </author> <custodian> <assignedCustodian> <representedCustodianOrganization> <id root="2.16.858.0.999999.99999"/> <name>Policlínica Fernández & Asociados</name> </representedCustodianOrganization> </assignedCustodian> </custodian> <componentOf> <encompassingEncounter classCode="ENC"> <code code="6821000179104" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="hoja de consulta no urgente centralizada - policlínica"/> <effectiveTime xsi:type="IVL_TS"> <low value="20260719093000-0300"/> <high value="20260719100000-0300"/> </effectiveTime> <location typeCode="LOC"> <healthCareFacility classCode="SDLOC"> <code code="700232004" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="servicio de medicina general"/> </healthCareFacility> </location> </encompassingEncounter> </componentOf> <component> <structuredBody> <component> <section> <code code="10154-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Chief complaint Narrative - Reported"/> <title>Motivo de consulta</title> <text> <paragraph>Control de diabetes mellitus tipo 2 y ajuste de medicación</paragraph> </text> </section> </component> <component> <section> <code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Evaluation note"/> <title>Informe del médico</title> <text> <paragraph>Paciente con diabetes tipo 2 mal controlada. Refiere abandono parcial de la dieta y sedentarismo en los últimos meses. Se realiza glucemia capilar en consultorio y se ajusta la metformina. Control con laboratorio en 30 días.</paragraph> </text> </section> </component> <component> <section> <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list - Reported"/> <title>Diagnósticos</title> <text> <paragraph>Diabetes mellitus tipo 2 mal controlada (SNOMED CT 44054006)</paragraph> </text> </section> </component> <component> <section> <code code="8716-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Vital signs note"/> <title>Signos vitales</title> <text> <list> <item>Temperatura: 36.5 °C</item> <item>Frecuencia cardíaca: 76 lpm</item> <item>Frecuencia respiratoria: 16 rpm</item> <item>Saturación de O2: 98 %</item> <item>Presión sistólica: 135 mmHg</item> <item>Presión diastólica: 82 mmHg</item> </list> </text> </section> </component> <component> <section> <code code="47519-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of Procedures Document"/> <title>Procedimientos</title> <text> <paragraph>Medición de glucemia capilar (2026-07-19 09:35:00-03:00)</paragraph> </text> </section> </component> <component> <section> <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of Medication use Narrative"/> <title>Medicación</title> <text> <list> <item>Indicada al alta: Metformina 850 mg — 1 comprimido, oral, cada 12 horas, con las comidas</item> <item>Indicada al alta: Glibenclamida 5 mg — 1 comprimido, oral, una vez al día, antes del desayuno</item> </list> </text> </section> </component> </structuredBody> </component></ClinicalDocument><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/><ds:DigestValue>EqK4VmMgR1U/FtZJUsZXdoj51rCMYAV/iIuIsZF/85rxI39ZKGO4+i+S+WS9M/hNQd+gf3J21zjkmGlvmYwG7a==</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>EqK4VmMgR1U/FtZJUsZXdoj51rCMYAV/iIuIsZF/85rxI39ZKGO4+i+S+WS9M/hNQd+gf3J21zjkmGlvmYwG7axqNyYAjL3Kxh7YBDHwi0Tyj2gPgV8czhh/KFU0pmLmnLPw2XtiCBt/FhbHLRn+84VjGE6HUuI+0nt73mYv1fQDHHM5eY64FQWDcuIdnPlk7HPIZyhr84aDfTv2i2QgfJCnBExf7iR50xAYFl7QwpAOqB3bBquchM14HY7ToxSIfpBeeubl6aTyAjRME/uhU1J80w+Uk7WzJEvhdENZ2m18DbrdXd8nRKmBo05eryH9T2Ji25m0NbD2bekTRUw/Hj==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDHTCCAgWgAwIBAgIUK2IAeBp8m2Ohmf+Mpv0bRQ3SR5UwDQYJKoZIhvcNAQELBQAwHjEcMBoGA1UEAwwTRkhJUiBJbmdlc3RhIFVZIERFVjAeFw0yNjA3MjEwMDMxMzRaFw0yODA3MjAwMDMxMzRaMB4xHDAaBgNVBAMME0ZISVIgSW5nZXN0YSBVWSBERVYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCPLNNvMgitrs61qDXnul1LMjDT6hWSNopMBFeChWV1+PUI5KmlPGQYLdaEel1/Glf40t+SK6HEkBj2DIqcnMTPTMS22IbejXKvlwSK1m9gVszRtzEbW1iGLIurS93uC+8qXuJ/R5i0TldppP/1u0lgOSRhV+svCZLKuvBV6/9/ZYf/8FuLhmVU2WMSGL6a1Hl+C3SGtw8AHfZOJH3BOLZOJFy0IS+VECaTTTzPDPl0AItsrRf4M6XsptZnvpwPG2DtKAiLd8V67TrJNH7/Y30uOyecgXixpdMJuondkMsdgKJJ1w6v9ue3dN+7lYx0tjlSi6dlPSul9hhK4RaIlnUZAgMBAAGjUzBRMB0GA1UdDgQWBBRAqYYhDzMlGG1e1flzn/ORPdk+QTAfBgNVHSMEGDAWgBRAqYYhDzMlGG1e1flzn/ORPdk+QTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAaaxTkADV328IrtNsGtS7nLpxWrwJipqXHRSZYM3bhZcqWcQ+gvMEYXCaptOwle0VN6Xi8rRWTYqFBXhI/Tl5InIYWebF9JvLAP9cQlB9H4vPsCfYhQj2eycEeMy7qAOFobgIbhWmP4La/rhkq1lH7OfrqySDaLiR7LIFbntYh5zem9dK+/+KSuHXcJWL17BJ9GHJXrIqnXmRBZbqeUPrsgIwJXThxuw6sc+3eOT1qCSvSXWLbW+wCuXksxrK9h5195jKCrnKRzf9P5sHHBFztnS8FqyrsfoMw/DQu+AherN+YbbZ6Xztqx3A7dipTuZxjLDxosAGsqjD4EC98bXsn</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></SignedClinicalDocument>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>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}