> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telepatia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Establecer contexto de consulta

> Establece el contexto de consulta para la sesión de un paciente.



## OpenAPI

````yaml /es/scribe-api/openapi.json post /v1/set-consultation-context
openapi: 3.1.0
info:
  title: Scribe Public API
  description: >-
    API REST externa para integrarte con la plataforma Telepatia. Autentícate
    con API keys, establece el contexto de consulta y obtén las sesiones de
    scribe.
  version: 0.1.0
servers:
  - url: https://scribe-api.telepatia.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /v1/set-consultation-context:
    post:
      tags:
        - Consultation
      summary: Establecer contexto de consulta
      description: Establece el contexto de consulta para la sesión de un paciente.
      operationId: api_consultation_context_set_post_v1_set_consultation_context_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetConsultationContextRequest'
            example:
              clinicalContext:
                allergies:
                  - code:
                      system: ATC
                      value: J01CE01
                    id: ALG-881
                    name: Penicillin
                    note: Hives and facial swelling
                conditions:
                  - code:
                      system: ICD10
                      value: I10
                    id: CD-120
                    name: Essential hypertension
                  - code:
                      system: ICD10
                      value: E11
                    id: CD-121
                    name: Type 2 diabetes mellitus
                currentEncounter:
                  chiefComplaint: Severe headache for 2 days, worse in the morning
                  class: EMERGENCY
                  diagnoses:
                    - code:
                        system: ICD10
                        value: R51
                      id: DG-9001-1
                      name: Headache
                  id: ATD-9001
                  note: >-
                    08:50 triage: alert and oriented, no focal deficit. 09:20 ER
                    physician: head CT ordered.
                  procedures:
                    - id: PX-9001-1
                      name: Head CT without contrast
                  startedAt: '2026-10-15T08:40:00-05:00'
                  triagePriority: Yellow - urgent
                  vitals:
                    diastolicBloodPressure: 102
                    heartRate: 92
                    measuredAt: '2026-10-15T08:55:00-05:00'
                    oxygenSaturation: 97
                    painScore: 8
                    respiratoryRate: 18
                    systolicBloodPressure: 168
                    temperature: 36.8
                medications:
                  - code:
                      system: ATC
                      value: C09CA01
                    id: RX-4410
                    name: Losartan 50 mg, 1 tablet daily
                  - code:
                      system: ATC
                      value: A10BA02
                    id: RX-4411
                    name: Metformin 850 mg, 1 tablet every 12 hours
                  - code:
                      system: ATC
                      value: C07AA05
                    id: RX-4412
                    name: Propranolol 40 mg, 1 tablet every 12 hours
                  - id: RX-3982
                    name: Captopril 25 mg
                    status: INACTIVE
                previousEncounters:
                  - diagnoses:
                      - code:
                          system: ICD10
                          value: G43.0
                        id: DG-7120-1
                        name: Migraine without aura
                    id: ATD-7120
                    note: >-
                      Neurology visit. Started propranolol 40 mg every 12 hours.
                      Follow-up in 3 months.
                    startedAt: '2025-05-02'
                  - class: EMERGENCY
                    diagnoses:
                      - code:
                          system: ICD10
                          value: N39.0
                        id: DG-6044-1
                        name: Urinary tract infection
                    id: ATD-6044
                    note: >-
                      Emergency room. Dysuria for 3 days, no fever.
                      Nitrofurantoin for 7 days.
                    startedAt: '2024-11-18'
              consultationInternalId: CONSULT-12345
              idCountry: COLOMBIA
              idType: PASSPORT
              idValue: A12345678
              institutionalBranchId: b1f2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
              internalCode: MRN-000123
              medicalRecordConfigurationId: mrc_a1b2c3d4e5f6g7h8
              name: John Doe
              notes: Patient prefers morning appointments. Allergic to penicillin.
              pastMedicalHistory: >-
                Hypertension diagnosed 2020. Diabetes Type 2 controlled with
                metformin.
              scribeSessionModality: IN_PERSON
        required: true
      responses:
        '200':
          description: Respuesta exitosa
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetConsultationContextResponse'
              example:
                consultationInternalId: CONSULT-12345
                success: true
        '400':
          description: >-
            Solicitud incorrecta — parámetros inválidos, fallos de validación o
            campos faltantes.
          content:
            application/json:
              examples:
                parameter_missing:
                  summary: Falta un campo obligatorio
                  value:
                    error:
                      type: invalid_request_error
                      code: parameter_missing
                      message: name is required.
                      param: name
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                parameter_invalid:
                  summary: Valor de campo inválido
                  value:
                    error:
                      type: invalid_request_error
                      code: parameter_invalid
                      message: >-
                        idCountry must be a valid country name, ISO alpha-2, or
                        ISO alpha-3 code.
                      param: idCountry
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                account_invalid:
                  summary: Cuenta inválida
                  value:
                    error:
                      type: invalid_request_error
                      code: account_invalid
                      message: Account has no valid authId.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: No autorizado — falta la API key o no es válida.
          content:
            application/json:
              examples:
                authentication_required:
                  summary: API key inválida o faltante
                  value:
                    error:
                      type: authentication_error
                      code: authentication_required
                      message: Invalid API key.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Prohibido — la API key no tiene permiso para realizar esta
            operación.
          content:
            application/json:
              examples:
                permission_denied:
                  summary: No tienes permiso sobre este recurso
                  value:
                    error:
                      type: permission_error
                      code: permission_denied
                      message: You do not have permission to access this resource.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                permission_denied_role:
                  summary: El rol de la cuenta de la API key no permite esta operación
                  value:
                    error:
                      type: permission_error
                      code: permission_denied
                      message: >-
                        Your API key is not allowed to create accounts. Account
                        creation requires an institutional API key; this key is
                        scoped to a doctor account.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No encontrado — el recurso solicitado no existe.
          content:
            application/json:
              examples:
                resource_not_found:
                  summary: Configuración de historia clínica no encontrada
                  value:
                    error:
                      type: invalid_request_error
                      code: resource_not_found
                      message: Medical record configuration not found.
                      param: medicalRecordConfigurationId
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflicto — el recurso ya existe o está en un estado en conflicto.
          content:
            application/json:
              examples:
                resource_conflict:
                  summary: consultationInternalId ya está en uso
                  value:
                    error:
                      type: invalid_request_error
                      code: resource_conflict
                      message: >-
                        consultationInternalId is already in use by a different
                        consultation.
                      param: consultationInternalId
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                resource_not_active:
                  summary: >-
                    La configuración de historia clínica existe, pero no está
                    activa
                  value:
                    error:
                      type: invalid_request_error
                      code: resource_not_active
                      message: >-
                        Medical record configuration 'mrc_a1b2c3d4e5f6g7h8' is
                        not active yet.
                      param: medicalRecordConfigurationId
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Contenido demasiado grande
          content:
            application/json:
              examples:
                request_too_large:
                  summary: clinicalContext supera el tamaño máximo admitido
                  value:
                    error:
                      type: invalid_request_error
                      code: request_too_large
                      message: >-
                        clinicalContext exceeds the maximum supported size
                        (1032192 bytes).
                      param: clinicalContext
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Servicio no disponible — una dependencia externa no está disponible.
          content:
            application/json:
              examples:
                service_unavailable:
                  summary: No se pudo establecer el contexto de consulta
                  value:
                    error:
                      type: api_error
                      code: service_unavailable
                      message: >-
                        Failed to set consultation context. Please try again
                        later.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    SetConsultationContextRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Name
          examples:
            - John Doe
        idCountry:
          anyOf:
            - $ref: '#/components/schemas/IdCountry'
            - type: 'null'
          examples:
            - CO
        idType:
          anyOf:
            - $ref: '#/components/schemas/IdType'
            - type: 'null'
          examples:
            - CC
        idValue:
          anyOf:
            - type: string
              maxLength: 50
              minLength: 1
            - type: 'null'
          title: Idvalue
          examples:
            - '123456789'
        patientId:
          anyOf:
            - type: string
              pattern: ^sp_[a-z0-9]{16}$
            - type: 'null'
          title: Patientid
          description: >-
            Id público de un paciente existente (sp_...). Si lo envías, se usa
            la identidad guardada del paciente y debes omitir los campos de
            identidad inline (name, idCountry, idType, idValue). Mutuamente
            excluyente con la identidad inline.
          examples:
            - sp_a1b2c3d4e5f6g7h8
        internalCode:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
            - type: 'null'
          title: Internalcode
          description: >-
            Tu propio código de paciente, único por institución. Busca un
            paciente existente por este código; si ninguno coincide, la
            identidad inline (name, idCountry, idType, idValue) crea y etiqueta
            al paciente al iniciar la sesión. Mutuamente excluyente con
            patientId.
          examples:
            - MRN-000123
        clinicalContext:
          anyOf:
            - $ref: '#/components/schemas/ClinicalContext'
            - type: 'null'
          description: >-
            Datos clínicos estructurados del paciente y de la atención:
            alergias, medicamentos, condiciones, la atención actual y las
            atenciones anteriores. Consulta
            /es/scribe-api/consultations#contexto-clínico. `currentEncounter.id`
            es el `Encounter.id` de la visita; la sesión de scribe se vincula a
            esa visita. Los demás campos necesitan una API key con
            `scribe:write` y una integración de EMR `scribe-api` activa en tu
            institución; si no, la llamada devuelve `403 permission_denied` y no
            escribe nada. Los nombres de los campos están en camelCase; un campo
            desconocido dentro del bloque devuelve `400`. Hay un solo paciente
            actual por API key de médico, así que gana la última llamada.
        notes:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Notes
          examples:
            - Patient reports headache
        pastMedicalHistory:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Pastmedicalhistory
          examples:
            - Hypertension, Diabetes Type 2
        consultationInternalId:
          anyOf:
            - type: string
              maxLength: 128
              pattern: ^[A-Za-z0-9_-]{1,128}$
            - type: 'null'
          title: Consultationinternalid
          examples:
            - CONSULT-12345
        scribeSessionModality:
          anyOf:
            - $ref: '#/components/schemas/ScribeSessionModality'
            - type: 'null'
          examples:
            - IN_PERSON
        institutionalBranchId:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Institutionalbranchid
          description: >-
            Id de la sede de la institución para esta consulta, que devuelve el
            endpoint de creación de sedes. Se registra en la sesión de scribe al
            crearla. Envía el id o el nombre.
          examples:
            - b1f2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
        institutionalBranch:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Institutionalbranch
          description: >-
            Nombre de la sede de la institución para esta consulta. Se resuelve
            cuando no se envía institutionalBranchId. Envía el id o el nombre.
          examples:
            - Sede Norte
        scribeSessionConfigurationId:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Scribesessionconfigurationid
          description: >-
            Id público de una configuración de sesión de scribe (`ssc_` + 16
            caracteres `[a-z0-9]`). Mutuamente excluyente con
            `medicalRecordConfigurationId` y `medicalRecordConfiguration`.
          examples:
            - ssc_a1b2c3d4e5f6g7h8
        medicalRecordConfigurationId:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Medicalrecordconfigurationid
          description: >-
            Id público de una configuración de historia clínica (`mrc_` + 16
            caracteres `[a-z0-9]`). Mutuamente excluyente con
            `scribeSessionConfigurationId` y `medicalRecordConfiguration`.
          examples:
            - mrc_a1b2c3d4e5f6g7h8
        medicalRecordConfiguration:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Medicalrecordconfiguration
          description: >-
            JSON inline de configuración de historia clínica con el nombre de la
            sección como clave (por ejemplo, 'chiefComplaint'). Se guarda
            automáticamente y se deduplica por hash de contenido; el id de
            configuración resuelto se adjunta al buffer de contexto del médico.
            Mutuamente excluyente con `medicalRecordConfigurationId` y
            `scribeSessionConfigurationId`.
      type: object
      title: SetConsultationContextRequest
      description: Cuerpo de solicitud para establecer el contexto de consulta.
      examples:
        - clinicalContext:
            allergies:
              - code:
                  system: ATC
                  value: J01CE01
                id: ALG-881
                name: Penicillin
                note: Hives and facial swelling
            conditions:
              - code:
                  system: ICD10
                  value: I10
                id: CD-120
                name: Essential hypertension
              - code:
                  system: ICD10
                  value: E11
                id: CD-121
                name: Type 2 diabetes mellitus
            currentEncounter:
              chiefComplaint: Severe headache for 2 days, worse in the morning
              class: EMERGENCY
              diagnoses:
                - code:
                    system: ICD10
                    value: R51
                  id: DG-9001-1
                  name: Headache
              id: ATD-9001
              note: >-
                08:50 triage: alert and oriented, no focal deficit. 09:20 ER
                physician: head CT ordered.
              procedures:
                - id: PX-9001-1
                  name: Head CT without contrast
              startedAt: '2026-10-15T08:40:00-05:00'
              triagePriority: Yellow - urgent
              vitals:
                diastolicBloodPressure: 102
                heartRate: 92
                measuredAt: '2026-10-15T08:55:00-05:00'
                oxygenSaturation: 97
                painScore: 8
                respiratoryRate: 18
                systolicBloodPressure: 168
                temperature: 36.8
            medications:
              - code:
                  system: ATC
                  value: C09CA01
                id: RX-4410
                name: Losartan 50 mg, 1 tablet daily
              - code:
                  system: ATC
                  value: A10BA02
                id: RX-4411
                name: Metformin 850 mg, 1 tablet every 12 hours
              - code:
                  system: ATC
                  value: C07AA05
                id: RX-4412
                name: Propranolol 40 mg, 1 tablet every 12 hours
              - id: RX-3982
                name: Captopril 25 mg
                status: INACTIVE
            previousEncounters:
              - diagnoses:
                  - code:
                      system: ICD10
                      value: G43.0
                    id: DG-7120-1
                    name: Migraine without aura
                id: ATD-7120
                note: >-
                  Neurology visit. Started propranolol 40 mg every 12 hours.
                  Follow-up in 3 months.
                startedAt: '2025-05-02'
              - class: EMERGENCY
                diagnoses:
                  - code:
                      system: ICD10
                      value: N39.0
                    id: DG-6044-1
                    name: Urinary tract infection
                id: ATD-6044
                note: >-
                  Emergency room. Dysuria for 3 days, no fever. Nitrofurantoin
                  for 7 days.
                startedAt: '2024-11-18'
          consultationInternalId: CONSULT-12345
          idCountry: COLOMBIA
          idType: PASSPORT
          idValue: A12345678
          institutionalBranchId: b1f2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
          internalCode: MRN-000123
          medicalRecordConfigurationId: mrc_a1b2c3d4e5f6g7h8
          name: John Doe
          notes: Patient prefers morning appointments. Allergic to penicillin.
          pastMedicalHistory: >-
            Hypertension diagnosed 2020. Diabetes Type 2 controlled with
            metformin.
          scribeSessionModality: IN_PERSON
        - consultationInternalId: CONSULT-12345
          idCountry: COLOMBIA
          idType: PASSPORT
          idValue: A12345678
          medicalRecordConfiguration:
            chiefComplaint:
              instructionSet:
                telepatiaPromptId: CHIEF_COMPLAINT
              schema:
                instructions: Chief complaint
                properties:
                  chiefComplaint:
                    instructions: Patient's own words
                    type: string
                type: object
          name: John Doe
          scribeSessionModality: IN_PERSON
        - consultationInternalId: CONSULT-12345
          idCountry: COLOMBIA
          idType: PASSPORT
          idValue: A12345678
          name: John Doe
          scribeSessionConfigurationId: ssc_a1b2c3d4e5f6g7h8
          scribeSessionModality: IN_PERSON
        - consultationInternalId: CONSULT-12345
          patientId: sp_a1b2c3d4e5f6g7h8
          scribeSessionConfigurationId: ssc_a1b2c3d4e5f6g7h8
          scribeSessionModality: IN_PERSON
        - consultationInternalId: CONSULT-12345
          institutionalBranchId: b1f2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
          internalCode: MRN-000123
          scribeSessionConfigurationId: ssc_a1b2c3d4e5f6g7h8
          scribeSessionModality: IN_PERSON
    SetConsultationContextResponse:
      properties:
        success:
          type: boolean
          title: Success
          examples:
            - true
        consultationInternalId:
          type: string
          title: Consultationinternalid
          examples:
            - CONSULT-12345
      type: object
      required:
        - success
        - consultationInternalId
      title: SetConsultationContextResponse
      description: Cuerpo de respuesta al establecer el contexto de consulta.
      examples:
        - consultationInternalId: CONSULT-12345
          success: true
    ErrorResponse:
      description: Sobre estandarizado de respuesta de error.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetailWithRequestId'
      required:
        - error
      title: ErrorResponse
      type: object
    IdCountry:
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CX
        - CC
        - CO
        - KM
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - CD
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IQ
        - IE
        - IR
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - XK
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - KP
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PA
        - PG
        - PY
        - CN
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - CG
        - GM
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - KR
        - SS
        - ES
        - LK
        - PS
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TH
        - MK
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - TZ
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
      title: IdCountry
      description: >-
        Códigos de país ISO 3166-1 alfa-2. Refleja el enum CountryCodes de
        tanjiro.
    IdType:
      type: string
      enum:
        - CC
        - TI
        - CE
        - RC
        - PASSPORT
        - RG
        - CPF
        - OTHER_DOC
      title: IdType
      description: Tipos de documento de identificación del paciente admitidos.
    ClinicalContext:
      properties:
        allergies:
          items:
            $ref: '#/components/schemas/ClinicalContextItem'
          type: array
          maxItems: 100
          title: Allergies
        medications:
          items:
            $ref: '#/components/schemas/ClinicalContextItem'
          type: array
          maxItems: 100
          title: Medications
        conditions:
          items:
            $ref: '#/components/schemas/ClinicalContextItem'
          type: array
          maxItems: 100
          title: Conditions
        noKnownAllergies:
          type: boolean
          title: Noknownallergies
          description: >-
            Un "sin alergias conocidas" explícito. Solo se permite cuando
            `allergies` no tiene ningún elemento `ACTIVE`.
          default: false
        noKnownMedications:
          type: boolean
          title: Noknownmedications
          description: >-
            Un "sin medicamentos conocidos" explícito. Solo se permite cuando
            `medications` no tiene ningún elemento `ACTIVE`.
          default: false
        currentEncounter:
          anyOf:
            - $ref: '#/components/schemas/CurrentEncounter'
            - type: 'null'
          description: >-
            La visita en la que el profesional de salud atiende a este paciente.
            La sesión de scribe se vincula a ella y lee su contexto clínico.
            Obligatorio cuando el bloque tiene cualquier otro campo.
        previousEncounters:
          items:
            $ref: '#/components/schemas/PreviousEncounter'
          type: array
          maxItems: 50
          title: Previousencounters
      additionalProperties: false
      type: object
      title: ClinicalContext
      description: >-
        Datos clínicos estructurados del paciente y de la atención: alergias,
        medicamentos, condiciones, la atención actual y las atenciones
        anteriores. Consulta /es/scribe-api/consultations#contexto-clínico.
    ScribeSessionModality:
      type: string
      enum:
        - IN_PERSON
        - TELEMEDICINE
        - DICTATION
      title: ScribeSessionModality
      description: Modalidades de sesión de scribe admitidas.
    ErrorDetailWithRequestId:
      description: >-
        Objeto de error de nivel superior: `ErrorDetail` más el id de
        correlación de la solicitud.


        Se mantiene como subclase y no como campo de `ErrorDetail` porque
        `ErrorDetail` también es la forma del error por elemento dentro de la
        respuesta de creación de cuentas en lote (`BatchAccountResult.error`),
        que se serializa incluyendo los nulls. Agregar el campo allí publicaría
        `"requestId": null` en un HTTP 200, y de todos modos solo hay un id de
        solicitud por lote: quien llama en lote lee el encabezado de respuesta
        `X-Request-ID`.
      properties:
        type:
          description: Categoría general del error, para un manejo de alto nivel.
          examples:
            - invalid_request_error
          title: Type
          type: string
        code:
          description: >-
            Código de error legible por máquina. Tu código debe decidir según
            este valor.
          examples:
            - parameter_invalid
          title: Code
          type: string
        message:
          description: Mensaje de error legible por humanos que termina en punto.
          examples:
            - >-
              idCountry must be a valid country name, ISO alpha-2, or ISO
              alpha-3 code.
          title: Message
          type: string
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: El campo de la solicitud que causó el error, si aplica.
          examples:
            - idCountry
          title: Param
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Contexto opcional, estructurado y legible por máquina, del error.
          examples:
            - pendingConsultations:
                - sessionId: abc123
                  url: https://...
          title: Details
        requestId:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Id único de esta solicitud, idéntico al encabezado de respuesta
            X-Request-ID. Inclúyelo cuando contactes a soporte.
          examples:
            - 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
          title: Requestid
      required:
        - type
        - code
        - message
      title: ErrorDetailWithRequestId
      type: object
    ClinicalContextItem:
      properties:
        id:
          type: string
          maxLength: 128
          minLength: 1
          title: Id
          description: >-
            Tu id interno del elemento. No cambia entre llamadas y es único
            dentro de una lista de un paciente. Cada llamada escribe el elemento
            según este id.
          examples:
            - ALG-881
        name:
          type: string
          maxLength: 500
          minLength: 1
          title: Name
          description: >-
            El texto que muestra la IA. Para un medicamento, incluye aquí la
            dosis y la frecuencia.
          examples:
            - Losartana 50 mg, 1 comprimido ao dia
        code:
          anyOf:
            - $ref: '#/components/schemas/ClinicalContextCode'
            - type: 'null'
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - ENTERED_IN_ERROR
          title: Status
          description: >-
            `ACTIVE` (por defecto): la IA muestra el elemento. `INACTIVE`:
            suspendido o resuelto; la IA no lo muestra. `ENTERED_IN_ERROR`:
            enviado por error; elimina el elemento.
          default: ACTIVE
        note:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Note
          description: Una nota corta que la IA muestra después del nombre.
      additionalProperties: false
      type: object
      required:
        - id
        - name
      title: ClinicalContextItem
      description: Una alergia, un medicamento, una condición o un diagnóstico.
    CurrentEncounter:
      properties:
        id:
          type: string
          maxLength: 128
          minLength: 1
          title: Id
          description: >-
            Tu id de la atención, por ejemplo el número de atención. Único en tu
            institución. Para la atención actual, el `Encounter.id` de la visita
            que enviaste para este paciente.
          examples:
            - ATD-9001
        class:
          anyOf:
            - type: string
              enum:
                - EMERGENCY
                - AMBULATORY
                - INPATIENT
            - type: 'null'
          title: Class
          description: >-
            `EMERGENCY`, `AMBULATORY` o `INPATIENT`. Usa `AMBULATORY` para
            telemedicina. Por defecto, en la primera escritura de la atención:
            `AMBULATORY`.
        diagnoses:
          items:
            $ref: '#/components/schemas/ClinicalContextItem'
          type: array
          maxItems: 50
          title: Diagnoses
        procedures:
          items:
            $ref: '#/components/schemas/ClinicalContextProcedure'
          type: array
          maxItems: 50
          title: Procedures
        note:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Note
          description: >-
            Todas las notas de la atención, en orden cronológico. `null` borra
            la nota guardada; si `note` no está presente, se conserva.
        startedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Startedat
          description: >-
            `YYYY-MM-DD`, o una fecha y hora ISO 8601 con su desfase UTC. Por
            defecto, en la primera escritura de la atención: el momento de la
            llamada.
          examples:
            - '2026-10-15T08:40:00-03:00'
        chiefComplaint:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Chiefcomplaint
        triagePriority:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Triagepriority
          description: Con los términos de tu escala de triage.
          examples:
            - Amarelo - urgente
        vitals:
          anyOf:
            - $ref: '#/components/schemas/EncounterVitals'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - id
      title: CurrentEncounter
      description: La visita en la que el profesional de salud atiende a este paciente.
    PreviousEncounter:
      properties:
        id:
          type: string
          maxLength: 128
          minLength: 1
          title: Id
          description: >-
            Tu id de la atención, por ejemplo el número de atención. Único en tu
            institución. Para la atención actual, el `Encounter.id` de la visita
            que enviaste para este paciente.
          examples:
            - ATD-9001
        class:
          anyOf:
            - type: string
              enum:
                - EMERGENCY
                - AMBULATORY
                - INPATIENT
            - type: 'null'
          title: Class
          description: >-
            `EMERGENCY`, `AMBULATORY` o `INPATIENT`. Usa `AMBULATORY` para
            telemedicina. Por defecto, en la primera escritura de la atención:
            `AMBULATORY`.
        diagnoses:
          items:
            $ref: '#/components/schemas/ClinicalContextItem'
          type: array
          maxItems: 50
          title: Diagnoses
        procedures:
          items:
            $ref: '#/components/schemas/ClinicalContextProcedure'
          type: array
          maxItems: 50
          title: Procedures
        note:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Note
          description: >-
            Todas las notas de la atención, en orden cronológico. `null` borra
            la nota guardada; si `note` no está presente, se conserva.
        startedAt:
          type: string
          title: Startedat
          description: '`YYYY-MM-DD`, o una fecha y hora ISO 8601 con su desfase UTC.'
          examples:
            - '2025-05-02'
      additionalProperties: false
      type: object
      required:
        - id
        - startedAt
      title: PreviousEncounter
      description: Una atención anterior de este paciente. Se guarda como finalizada.
    ClinicalContextCode:
      properties:
        system:
          type: string
          enum:
            - ICD10
            - ICD11
            - SNOMED
            - ATC
            - RXNORM
          title: System
          description: >-
            `ICD10` (condiciones y diagnósticos), `ICD11`, `SNOMED` (cualquier
            lista), `ATC` (medicamentos y alergias a medicamentos) o `RXNORM`
            (medicamentos).
          examples:
            - ICD10
        value:
          type: string
          maxLength: 64
          minLength: 1
          title: Value
          examples:
            - I10
      additionalProperties: false
      type: object
      required:
        - system
        - value
      title: ClinicalContextCode
      description: Un código de uno de los sistemas de codificación admitidos.
    ClinicalContextProcedure:
      properties:
        id:
          type: string
          maxLength: 128
          minLength: 1
          title: Id
          examples:
            - PX-9001-1
        name:
          type: string
          maxLength: 500
          minLength: 1
          title: Name
          examples:
            - Tomografia de crânio sem contraste
        code:
          anyOf:
            - $ref: '#/components/schemas/ClinicalContextCode'
            - type: 'null'
        status:
          anyOf:
            - type: string
              const: ENTERED_IN_ERROR
            - type: 'null'
          title: Status
          description: >-
            Solo `ENTERED_IN_ERROR`, para eliminar un procedimiento enviado por
            error.
      additionalProperties: false
      type: object
      required:
        - id
        - name
      title: ClinicalContextProcedure
      description: Un procedimiento de una atención. Toma la fecha de su atención.
    EncounterVitals:
      properties:
        measuredAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Measuredat
          description: >-
            Fecha y hora ISO 8601 con su desfase UTC. Por defecto: el momento de
            la llamada.
          examples:
            - '2026-10-15T08:55:00-03:00'
        systolicBloodPressure:
          anyOf:
            - type: number
              maximum: 300
              minimum: 20
            - type: 'null'
          title: Systolicbloodpressure
          description: mmHg.
        diastolicBloodPressure:
          anyOf:
            - type: number
              maximum: 300
              minimum: 20
            - type: 'null'
          title: Diastolicbloodpressure
          description: mmHg.
        heartRate:
          anyOf:
            - type: number
              maximum: 300
              minimum: 20
            - type: 'null'
          title: Heartrate
          description: Latidos por minuto.
        respiratoryRate:
          anyOf:
            - type: number
              maximum: 100
              minimum: 1
            - type: 'null'
          title: Respiratoryrate
          description: Respiraciones por minuto.
        temperature:
          anyOf:
            - type: number
              maximum: 45
              minimum: 25
            - type: 'null'
          title: Temperature
          description: Grados Celsius.
        oxygenSaturation:
          anyOf:
            - type: number
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Oxygensaturation
          description: Porcentaje.
        weight:
          anyOf:
            - type: number
              maximum: 500
              minimum: 0.2
            - type: 'null'
          title: Weight
          description: Kilogramos.
        height:
          anyOf:
            - type: number
              maximum: 260
              minimum: 20
            - type: 'null'
          title: Height
          description: Centímetros.
        bloodGlucose:
          anyOf:
            - type: number
              maximum: 2000
              minimum: 10
            - type: 'null'
          title: Bloodglucose
          description: mg/dL.
        painScore:
          anyOf:
            - type: number
              maximum: 10
              minimum: 0
            - type: 'null'
          title: Painscore
          description: Una escala de 0 a 10.
      additionalProperties: false
      type: object
      title: EncounterVitals
      description: El último conjunto de signos vitales de la atención actual.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key enviada como token Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.