{
  "openapi": "3.0.0",
  "info": {
    "title": "paciente-backend",
    "version": "1.0.0",
    "description": "Server from paciente-app docmovi",
    "contact": {}
  },
  "paths": {
    "/api/v1/whatsapp-aipa/post-call": {
      "post": {
        "x-controller-name": "WhatsAppPostCallController",
        "x-operation-name": "sendWhatsappPostCallAIPA",
        "tags": [
          "WhatsAppPostCallController"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Solicitud procesada y enviada a WhatsApp",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "messageId": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Falta una key requerida en el payload"
          },
          "401": {
            "description": "Authorization Bearer token inválido o ausente"
          },
          "422": {
            "description": "phoneNumber con formato inválido (no E.164)"
          },
          "502": {
            "description": "Meta rechazó el envío",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "number"
                    },
                    "metaError": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "number"
                        },
                        "type": {
                          "type": "string"
                        },
                        "errorData": {
                          "type": "object",
                          "properties": {
                            "messagingProduct": {
                              "type": "string"
                            },
                            "details": {
                              "type": "string"
                            }
                          }
                        },
                        "fbtraceId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "externalId": {
                    "type": "string"
                  },
                  "phoneNumber": {
                    "type": "string"
                  },
                  "patient": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rut": {
                        "type": "string"
                      }
                    }
                  },
                  "holder": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rut": {
                        "type": "string"
                      }
                    }
                  },
                  "requester": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rut": {
                        "type": "string"
                      }
                    }
                  },
                  "fullAddress": {
                    "type": "string"
                  },
                  "clinicalSummary": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "serviceOrderNumber": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "WhatsAppPostCallController.sendWhatsappPostCallAIPA"
      }
    },
    "/api/v2/whatsapp-aipa/post-call": {
      "post": {
        "x-controller-name": "WhatsAppPostCallController",
        "x-operation-name": "sendWhatsappPostCallAIPAV2",
        "tags": [
          "WhatsAppPostCallController"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Solicitud procesada y enviada a WhatsApp (plantilla v2)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "messageId": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Falta una key requerida en el payload"
          },
          "401": {
            "description": "Authorization Bearer token inválido o ausente"
          },
          "422": {
            "description": "phoneNumber con formato inválido (no E.164)"
          },
          "502": {
            "description": "Meta rechazó el envío",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "number"
                    },
                    "metaError": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "number"
                        },
                        "type": {
                          "type": "string"
                        },
                        "errorData": {
                          "type": "object",
                          "properties": {
                            "messagingProduct": {
                              "type": "string"
                            },
                            "details": {
                              "type": "string"
                            }
                          }
                        },
                        "fbtraceId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "externalId": {
                    "type": "string"
                  },
                  "phoneNumber": {
                    "type": "string"
                  },
                  "patient": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rut": {
                        "type": "string"
                      }
                    }
                  },
                  "holder": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rut": {
                        "type": "string"
                      }
                    }
                  },
                  "requester": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rut": {
                        "type": "string"
                      }
                    }
                  },
                  "fullAddress": {
                    "type": "string"
                  },
                  "clinicalSummary": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "serviceOrderNumber": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "WhatsAppPostCallController.sendWhatsappPostCallAIPAV2"
      }
    },
    "/appointments/patient/{patientId}": {
      "get": {
        "x-controller-name": "AppointmentController",
        "x-operation-name": "find",
        "tags": [
          "AppointmentController"
        ],
        "responses": {
          "200": {
            "description": "Array of Appointments for the patient and their beneficiaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Appointment"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        ],
        "operationId": "AppointmentController.find"
      }
    },
    "/atenciones/count": {
      "get": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "count",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "200": {
            "description": "Atenciones model count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Atenciones.WhereFilter",
                  "additionalProperties": true,
                  "x-typescript-type": "@loopback/repository#Where<Atenciones>"
                }
              }
            }
          }
        ],
        "operationId": "AtencionesController.count"
      }
    },
    "/atenciones/{atencionId}/documents": {
      "get": {
        "x-controller-name": "AtencionesConversationsController",
        "x-operation-name": "getSignedDocuments",
        "tags": [
          "AtencionesConversationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Get signed document links for an atencion"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "atencionId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "AtencionesConversationsController.getSignedDocuments"
      }
    },
    "/atenciones/{id}": {
      "put": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "replaceById",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Atenciones PUT success"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Atenciones"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "AtencionesController.replaceById"
      },
      "patch": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "updateById",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Atenciones PATCH success"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AtencionesPartial"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "AtencionesController.updateById"
      },
      "get": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "findById",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "200": {
            "description": "Atenciones model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AtencionesWithRelations"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Atenciones.Filter"
                }
              }
            }
          }
        ],
        "operationId": "AtencionesController.findById"
      }
    },
    "/atenciones": {
      "post": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "create",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "200": {
            "description": "Atenciones model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Atenciones"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewAtenciones"
              }
            }
          }
        },
        "operationId": "AtencionesController.create"
      },
      "patch": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "updateAll",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "200": {
            "description": "Atenciones PATCH success count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Atenciones.WhereFilter",
                  "additionalProperties": true,
                  "x-typescript-type": "@loopback/repository#Where<Atenciones>"
                }
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AtencionesPartial"
              }
            }
          }
        },
        "operationId": "AtencionesController.updateAll"
      },
      "get": {
        "x-controller-name": "AtencionesController",
        "x-operation-name": "find",
        "tags": [
          "AtencionesController"
        ],
        "responses": {
          "200": {
            "description": "Array of Atenciones model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AtencionesWithRelations"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Atenciones.Filter1"
                }
              }
            }
          }
        ],
        "operationId": "AtencionesController.find"
      }
    },
    "/conversations/upload-file": {
      "post": {
        "x-controller-name": "ConversationsMessagesController",
        "x-operation-name": "uploadFile",
        "tags": [
          "ConversationsMessagesController"
        ],
        "responses": {
          "200": {
            "description": "Return value of ConversationsMessagesController.uploadFile"
          }
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          },
          "description": "Request body for multipart/form-data based file upload",
          "required": true
        },
        "operationId": "ConversationsMessagesController.uploadFile"
      }
    },
    "/conversations/{id}/messages/{messageId}/agreeMessageAppointment": {
      "post": {
        "x-controller-name": "ConversationsMessagesController",
        "x-operation-name": "agreeMessageAppointment",
        "tags": [
          "ConversationsMessagesController"
        ],
        "responses": {
          "200": {
            "description": "Conversations.Messages agreeMessageAppointment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "messageId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ConversationsMessagesController.agreeMessageAppointment"
      }
    },
    "/conversations/{id}/messages/{messageId}/agreeMessageConsent": {
      "post": {
        "x-controller-name": "ConversationsMessagesController",
        "x-operation-name": "patch",
        "tags": [
          "ConversationsMessagesController"
        ],
        "responses": {
          "200": {
            "description": "Conversations.Messages agreeMessageConsent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "messageId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ConversationsMessagesController.patch"
      }
    },
    "/conversations/{id}/messages": {
      "post": {
        "x-controller-name": "ConversationsMessagesController",
        "x-operation-name": "create",
        "tags": [
          "ConversationsMessagesController"
        ],
        "responses": {
          "200": {
            "description": "Conversations model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messages"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewMessagesInConversations"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ConversationsMessagesController.create"
      },
      "get": {
        "x-controller-name": "ConversationsMessagesController",
        "x-operation-name": "find",
        "tags": [
          "ConversationsMessagesController"
        ],
        "responses": {
          "200": {
            "description": "Array of Conversations has many Messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Messages"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ConversationsMessagesController.find"
      }
    },
    "/conversations/{id}": {
      "patch": {
        "x-controller-name": "ConversationsController",
        "x-operation-name": "updateConversation",
        "tags": [
          "ConversationsController"
        ],
        "responses": {
          "204": {
            "description": "Conversations PATCH success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationsPartial"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationsPartial"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ConversationsController.updateConversation"
      }
    },
    "/files/signed-url": {
      "post": {
        "x-controller-name": "FileUploadController",
        "x-operation-name": "getSignedUrl",
        "tags": [
          "FileUploadController"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Get signed URL for S3 object"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "operationId": "FileUploadController.getSignedUrl"
      }
    },
    "/files/{id}": {
      "get": {
        "x-controller-name": "FileUploadController",
        "x-operation-name": "getFile",
        "tags": [
          "FileUploadController"
        ],
        "responses": {
          "200": {
            "description": "Return value of FileUploadController.getFile"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "FileUploadController.getFile"
      }
    },
    "/files": {
      "post": {
        "x-controller-name": "FileUploadController",
        "x-operation-name": "fileUpload",
        "tags": [
          "FileUploadController"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "File upload response with S3 URL"
          }
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          },
          "description": "Request body for multipart/form-data based file upload",
          "required": true
        },
        "operationId": "FileUploadController.fileUpload"
      }
    },
    "/logs": {
      "post": {
        "x-controller-name": "LogsController",
        "x-operation-name": "create",
        "tags": [
          "LogsController"
        ],
        "responses": {
          "200": {
            "description": "Logs model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Logs"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewLogs"
              }
            }
          }
        },
        "operationId": "LogsController.create"
      },
      "get": {
        "x-controller-name": "LogsController",
        "x-operation-name": "find",
        "tags": [
          "LogsController"
        ],
        "responses": {
          "200": {
            "description": "Array of Logs model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LogsWithRelations"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Logs.Filter"
                }
              }
            }
          }
        ],
        "operationId": "LogsController.find"
      }
    },
    "/ping/discord-alert": {
      "get": {
        "x-controller-name": "PingController",
        "x-operation-name": "pingDiscordAlert",
        "tags": [
          "PingController"
        ],
        "responses": {
          "202": {
            "description": "Queue a temporary Discord general alert for manual testing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "deployType": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "message",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "PingController.pingDiscordAlert"
      }
    },
    "/ping": {
      "get": {
        "x-controller-name": "PingController",
        "x-operation-name": "ping",
        "tags": [
          "PingController"
        ],
        "responses": {
          "200": {
            "description": "Ping Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResponse"
                }
              }
            }
          }
        },
        "operationId": "PingController.ping"
      }
    },
    "/scheduler/ping": {
      "post": {
        "x-controller-name": "SchedulerController",
        "x-operation-name": "schedulePingJob",
        "tags": [
          "SchedulerController"
        ],
        "responses": {
          "200": {
            "description": "Job programado exitosamente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobScheduledResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error al programar job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PingJobRequest"
              }
            }
          },
          "description": "Datos para programar un ping job",
          "required": true
        },
        "operationId": "SchedulerController.schedulePingJob"
      }
    },
    "/scripts/documents/normalize": {
      "patch": {
        "x-controller-name": "ScriptsController",
        "x-operation-name": "normalizeAllUserDocuments",
        "tags": [
          "ScriptsController"
        ],
        "responses": {
          "200": {
            "description": "Uppercase all document values; for RUT documents also apply cleanRut.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updatedUsers": {
                      "type": "number"
                    },
                    "updatedDocuments": {
                      "type": "number"
                    },
                    "skippedUsers": {
                      "type": "number"
                    },
                    "errors": {
                      "type": "number"
                    },
                    "errorUsers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "modifiedUserIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "ScriptsController.normalizeAllUserDocuments"
      }
    },
    "/scripts/documents/repair-rut-using-legacy": {
      "patch": {
        "x-controller-name": "ScriptsController",
        "x-operation-name": "repairRutUsingLegacy",
        "tags": [
          "ScriptsController"
        ],
        "responses": {
          "200": {
            "description": "Repair invalid RUT values in profileV2.documents using legacy profile (rut + digitoVerificadorRut). No normalization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updatedUsers": {
                      "type": "number"
                    },
                    "updatedDocuments": {
                      "type": "number"
                    },
                    "skippedUsers": {
                      "type": "number"
                    },
                    "errors": {
                      "type": "number"
                    },
                    "errorUsers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "modifiedUserIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "ScriptsController.repairRutUsingLegacy"
      }
    },
    "/scripts/profilev2/generate-from-legacy": {
      "patch": {
        "x-controller-name": "ScriptsController",
        "x-operation-name": "generateProfileV2FromLegacy",
        "tags": [
          "ScriptsController"
        ],
        "responses": {
          "200": {
            "description": "Generate profileV2 for users that have legacy profile but no profileV2.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scannedUsers": {
                      "type": "number"
                    },
                    "updatedUsers": {
                      "type": "number"
                    },
                    "skippedUsers": {
                      "type": "number"
                    },
                    "errors": {
                      "type": "number"
                    },
                    "errorUsers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "modifiedUserIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "ScriptsController.generateProfileV2FromLegacy"
      }
    },
    "/send-2fa": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "send2FA",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Send 2FA code to user phone number via SMS or WhatsApp"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "phoneNumber": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "whatsapp"
                    ]
                  }
                },
                "required": [
                  "email",
                  "phoneNumber",
                  "method"
                ]
              }
            }
          }
        },
        "operationId": "UsersController.send2FA"
      }
    },
    "/send-evaluation-post-attention-notification": {
      "post": {
        "x-controller-name": "NotificationController",
        "x-operation-name": "sendEvaluationPostAttentionNotification",
        "tags": [
          "NotificationController"
        ],
        "responses": {
          "200": {
            "description": "Resultado del envío o programación del recordatorio post atención.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta exitosa de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Indica que la operación se ejecutó correctamente."
                    },
                    "message": {
                      "type": "string",
                      "description": "Mensaje descriptivo entregado cuando la operación resulta exitosa."
                    },
                    "template": {
                      "type": "string",
                      "description": "Plantilla utilizada para la notificación."
                    },
                    "userId": {
                      "type": "string",
                      "description": "ID del usuario destinatario (si aplica)."
                    },
                    "sent": {
                      "type": "number",
                      "description": "Cantidad de notificaciones enviadas exitosamente."
                    },
                    "errors": {
                      "type": "number",
                      "description": "Cantidad de errores durante el envío."
                    },
                    "invalidTokens": {
                      "type": "number",
                      "description": "Cantidad de tokens inválidos encontrados."
                    },
                    "tokensCount": {
                      "type": "number",
                      "description": "Cantidad total de tokens procesados."
                    },
                    "scheduledFor": {
                      "type": "string",
                      "description": "Fecha/hora programada para el envío (si aplica)."
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp de cuando se procesó la solicitud."
                    },
                    "searchMethod": {
                      "type": "string",
                      "enum": [
                        "userIds",
                        "filters"
                      ],
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    },
                    "familyMembers": {
                      "type": "number",
                      "description": "Cantidad de familiares incluidos (solo para notificaciones grupales)."
                    },
                    "skipped": {
                      "type": "boolean",
                      "description": "Indica si la operación fue omitida (ej: evaluación ya completada)."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Razón por la cual la operación fue omitida."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Error de validación: plantilla inválida o falta `conversationId`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Usuario destinatario no encontrado o la encuesta ya fue respondida.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "Error inesperado al procesar la notificación post atención.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template",
                  "data"
                ],
                "properties": {
                  "template": {
                    "type": "string",
                    "enum": [
                      "generic",
                      "testResults",
                      "surveyPostAttention",
                      "surveyPostAttentionReminderUnaswered",
                      "chatMessage",
                      "attentionMessage",
                      "enCamino",
                      "medicoLlamando"
                    ],
                    "description": "Identificador de la plantilla de notificación disponible. Los valores permitidos se encuentran en la columna enum."
                  },
                  "userId": {
                    "type": "string",
                    "description": "Identificador del usuario destino. Alternativamente se puede enviar `pushToken`."
                  },
                  "pushToken": {
                    "type": "string",
                    "description": "Token Expo del destinatario. Si no se indica, se buscará a partir del `userId`."
                  },
                  "executorId": {
                    "type": "string",
                    "description": "Identificador del usuario que solicita la acción. Se utiliza para auditoría."
                  },
                  "data": {
                    "type": "object",
                    "description": "Valores dinámicos que se mezclarán con la plantilla seleccionada. Se aceptan propiedades adicionales.",
                    "additionalProperties": true,
                    "required": [
                      "conversationId"
                    ],
                    "properties": {
                      "conversationId": {
                        "type": "string",
                        "description": "Identificador de la conversación asociada a la atención. Se usa para verificar si la encuesta ya fue respondida."
                      }
                    }
                  },
                  "customizations": {
                    "type": "object",
                    "description": "Permite sobreescribir campos puntuales de la plantilla (por ejemplo título o cuerpo) sin perder el resto de la configuración por defecto.",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Título personalizado a mostrar en la notificación."
                      },
                      "body": {
                        "type": "string",
                        "description": "Mensaje personalizado a mostrar en la notificación."
                      }
                    },
                    "additionalProperties": true
                  },
                  "delayTime": {
                    "type": "string",
                    "description": "Tiempo relativo que Agenda entiende para programar la notificación (ej: `5 minutes`, `2 hours`)."
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "userId"
                    ]
                  },
                  {
                    "required": [
                      "pushToken"
                    ]
                  }
                ],
                "description": "Solicitud para enviar el recordatorio de encuesta posterior a una atención. `data.conversationId` es obligatorio para validar si la encuesta ya fue respondida."
              },
              "examples": {
                "default": {
                  "summary": "Enviar recordatorio de encuesta",
                  "value": {
                    "template": "surveyPostAttentionReminderUnaswered",
                    "userId": "f3a1f65b-160c-4b94-9f8f-b99e8e7bdabc",
                    "executorId": "system",
                    "data": {
                      "conversationId": "conversation-123"
                    },
                    "delayTime": "15 minutes"
                  }
                }
              }
            }
          },
          "description": "Programa o envía de inmediato el recordatorio de encuesta posterior a una atención cuando no ha sido respondida.",
          "required": true
        },
        "operationId": "NotificationController.sendEvaluationPostAttentionNotification"
      }
    },
    "/send-group-notification": {
      "post": {
        "x-controller-name": "NotificationController",
        "x-operation-name": "sendGroupNotification",
        "tags": [
          "NotificationController"
        ],
        "responses": {
          "200": {
            "description": "Resultado del envío o programación de la notificación grupal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta exitosa de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Indica que la operación se ejecutó correctamente."
                    },
                    "message": {
                      "type": "string",
                      "description": "Mensaje descriptivo entregado cuando la operación resulta exitosa."
                    },
                    "template": {
                      "type": "string",
                      "description": "Plantilla utilizada para la notificación."
                    },
                    "userId": {
                      "type": "string",
                      "description": "ID del usuario destinatario (si aplica)."
                    },
                    "sent": {
                      "type": "number",
                      "description": "Cantidad de notificaciones enviadas exitosamente."
                    },
                    "errors": {
                      "type": "number",
                      "description": "Cantidad de errores durante el envío."
                    },
                    "invalidTokens": {
                      "type": "number",
                      "description": "Cantidad de tokens inválidos encontrados."
                    },
                    "tokensCount": {
                      "type": "number",
                      "description": "Cantidad total de tokens procesados."
                    },
                    "scheduledFor": {
                      "type": "string",
                      "description": "Fecha/hora programada para el envío (si aplica)."
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp de cuando se procesó la solicitud."
                    },
                    "searchMethod": {
                      "type": "string",
                      "enum": [
                        "userIds",
                        "filters"
                      ],
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    },
                    "familyMembers": {
                      "type": "number",
                      "description": "Cantidad de familiares incluidos (solo para notificaciones grupales)."
                    },
                    "skipped": {
                      "type": "boolean",
                      "description": "Indica si la operación fue omitida (ej: evaluación ya completada)."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Razón por la cual la operación fue omitida."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Error de validación: plantilla inválida o faltan `userIds` / `filters`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "No se encontraron usuarios válidos según los criterios enviados.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "Ocurrió un error inesperado al enviar la notificación grupal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template"
                ],
                "properties": {
                  "template": {
                    "type": "string",
                    "enum": [
                      "generic",
                      "testResults",
                      "surveyPostAttention",
                      "surveyPostAttentionReminderUnaswered",
                      "chatMessage",
                      "attentionMessage",
                      "enCamino",
                      "medicoLlamando"
                    ],
                    "description": "Identificador de la plantilla de notificación disponible. Los valores permitidos se encuentran en la columna enum."
                  },
                  "userIds": {
                    "type": "array",
                    "description": "Listado explícito de usuarios (IDs) a los que se debe enviar la notificación.",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1
                  },
                  "filters": {
                    "type": "object",
                    "description": "Filtros avanzados para seleccionar destinatarios en notificaciones grupales.",
                    "properties": {
                      "comuna": {
                        "type": "string",
                        "description": "Filtra usuarios por comuna (ignorado si se envía `Todas las comunas`)."
                      },
                      "planName": {
                        "type": "string",
                        "enum": [
                          "Con Plan",
                          "Sin Plan",
                          "Enviar a todos"
                        ],
                        "description": "Permite segmentar usuarios según si tienen plan activo, sin plan o incluir a todos."
                      },
                      "sexo": {
                        "type": "string",
                        "description": "Filtra usuarios por sexo. Usa `Enviar a todos` para no aplicar este filtro."
                      }
                    },
                    "additionalProperties": false
                  },
                  "executorId": {
                    "type": "string",
                    "description": "Identificador del usuario que solicita la acción. Se utiliza para auditoría."
                  },
                  "data": {
                    "type": "object",
                    "description": "Valores dinámicos que se mezclarán con la plantilla seleccionada. Se aceptan propiedades adicionales.",
                    "additionalProperties": true
                  },
                  "customizations": {
                    "type": "object",
                    "description": "Permite sobreescribir campos puntuales de la plantilla (por ejemplo título o cuerpo) sin perder el resto de la configuración por defecto.",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Título personalizado a mostrar en la notificación."
                      },
                      "body": {
                        "type": "string",
                        "description": "Mensaje personalizado a mostrar en la notificación."
                      }
                    },
                    "additionalProperties": true
                  },
                  "delayTime": {
                    "type": "string",
                    "description": "Tiempo relativo que Agenda entiende para programar la notificación (ej: `5 minutes`, `2 hours`)."
                  },
                  "includeFamilyMembers": {
                    "type": "boolean",
                    "description": "Cuando es `true` y el filtro es `Con Plan`, también agrega a los familiares asociados a los titulares."
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "userIds"
                    ]
                  },
                  {
                    "required": [
                      "filters"
                    ]
                  }
                ]
              },
              "examples": {
                "byUserIds": {
                  "summary": "Enviar a una lista de usuarios",
                  "value": {
                    "template": "generic",
                    "userIds": [
                      "f3a1f65b-160c-4b94-9f8f-b99e8e7bdabc",
                      "9243cafa-9f70-4db2-93fb-17b7769e0a9c"
                    ],
                    "data": {
                      "redirect": "/promotions"
                    }
                  }
                },
                "byFilters": {
                  "summary": "Segmentar por filtros",
                  "value": {
                    "template": "testResults",
                    "filters": {
                      "comuna": "Las Condes",
                      "planName": "Con Plan"
                    },
                    "includeFamilyMembers": true,
                    "delayTime": "2 hours"
                  }
                }
              }
            }
          },
          "description": "Envía o programa notificaciones a múltiples usuarios, ya sea mediante IDs concretos o filtros avanzados.",
          "required": true
        },
        "operationId": "NotificationController.sendGroupNotification"
      }
    },
    "/send-individual-notification": {
      "post": {
        "x-controller-name": "NotificationController",
        "x-operation-name": "sendIndividualNotification",
        "tags": [
          "NotificationController"
        ],
        "responses": {
          "200": {
            "description": "Resultado del envío o programación de una notificación individual.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta exitosa de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Indica que la operación se ejecutó correctamente."
                    },
                    "message": {
                      "type": "string",
                      "description": "Mensaje descriptivo entregado cuando la operación resulta exitosa."
                    },
                    "template": {
                      "type": "string",
                      "description": "Plantilla utilizada para la notificación."
                    },
                    "userId": {
                      "type": "string",
                      "description": "ID del usuario destinatario (si aplica)."
                    },
                    "sent": {
                      "type": "number",
                      "description": "Cantidad de notificaciones enviadas exitosamente."
                    },
                    "errors": {
                      "type": "number",
                      "description": "Cantidad de errores durante el envío."
                    },
                    "invalidTokens": {
                      "type": "number",
                      "description": "Cantidad de tokens inválidos encontrados."
                    },
                    "tokensCount": {
                      "type": "number",
                      "description": "Cantidad total de tokens procesados."
                    },
                    "scheduledFor": {
                      "type": "string",
                      "description": "Fecha/hora programada para el envío (si aplica)."
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp de cuando se procesó la solicitud."
                    },
                    "searchMethod": {
                      "type": "string",
                      "enum": [
                        "userIds",
                        "filters"
                      ],
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    },
                    "familyMembers": {
                      "type": "number",
                      "description": "Cantidad de familiares incluidos (solo para notificaciones grupales)."
                    },
                    "skipped": {
                      "type": "boolean",
                      "description": "Indica si la operación fue omitida (ej: evaluación ya completada)."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Razón por la cual la operación fue omitida."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Error de validación: plantilla inválida o destinatario no especificado.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Usuario destinatario no encontrado.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "Ocurrió un error inesperado al enviar la notificación.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template"
                ],
                "properties": {
                  "template": {
                    "type": "string",
                    "enum": [
                      "generic",
                      "testResults",
                      "surveyPostAttention",
                      "surveyPostAttentionReminderUnaswered",
                      "chatMessage",
                      "attentionMessage",
                      "enCamino",
                      "medicoLlamando"
                    ],
                    "description": "Identificador de la plantilla de notificación disponible. Los valores permitidos se encuentran en la columna enum."
                  },
                  "userId": {
                    "type": "string",
                    "description": "Identificador del usuario destino. Alternativamente se puede enviar `pushToken`."
                  },
                  "pushToken": {
                    "type": "string",
                    "description": "Token Expo del destinatario. Si no se indica, se buscará a partir del `userId`."
                  },
                  "executorId": {
                    "type": "string",
                    "description": "Identificador del usuario que solicita la acción. Se utiliza para auditoría."
                  },
                  "data": {
                    "type": "object",
                    "description": "Valores dinámicos que se mezclarán con la plantilla seleccionada. Se aceptan propiedades adicionales.",
                    "additionalProperties": true
                  },
                  "customizations": {
                    "type": "object",
                    "description": "Permite sobreescribir campos puntuales de la plantilla (por ejemplo título o cuerpo) sin perder el resto de la configuración por defecto.",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Título personalizado a mostrar en la notificación."
                      },
                      "body": {
                        "type": "string",
                        "description": "Mensaje personalizado a mostrar en la notificación."
                      }
                    },
                    "additionalProperties": true
                  },
                  "delayTime": {
                    "type": "string",
                    "description": "Tiempo relativo que Agenda entiende para programar la notificación (ej: `5 minutes`, `2 hours`)."
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "userId"
                    ]
                  },
                  {
                    "required": [
                      "pushToken"
                    ]
                  }
                ]
              },
              "examples": {
                "byUserId": {
                  "summary": "Enviar notificación por `userId`",
                  "value": {
                    "template": "generic",
                    "userId": "f3a1f65b-160c-4b94-9f8f-b99e8e7bdabc",
                    "executorId": "admin-user-id",
                    "data": {
                      "redirect": "/myAttentions"
                    }
                  }
                },
                "byPushToken": {
                  "summary": "Enviar notificación directo mediante `pushToken`",
                  "value": {
                    "template": "chatMessage",
                    "pushToken": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
                    "customizations": {
                      "title": "Nuevo mensaje",
                      "body": "Revisa tu bandeja de chat"
                    }
                  }
                }
              }
            }
          },
          "description": "Envía una notificación individual usando una plantilla predefinida. Debe proporcionarse `userId` o `pushToken`.",
          "required": true
        },
        "operationId": "NotificationController.sendIndividualNotification"
      }
    },
    "/signin": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "signin",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Users signin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credentials"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Credentials"
              }
            }
          }
        },
        "operationId": "UsersController.signin"
      }
    },
    "/signinid": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "signinId",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Users signin",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identification": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "documentType": {
                    "type": "string",
                    "enum": [
                      "RUT",
                      "DNI",
                      "PASSPORT"
                    ]
                  }
                },
                "required": [
                  "identification",
                  "password",
                  "documentType"
                ]
              }
            }
          }
        },
        "operationId": "UsersController.signinId"
      }
    },
    "/signout": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "signout",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "User signed out successfully"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "userId",
                  "token"
                ]
              }
            }
          }
        },
        "operationId": "UsersController.signout"
      }
    },
    "/support/create-ticket": {
      "post": {
        "x-controller-name": "SupportController",
        "x-operation-name": "createTicket",
        "tags": [
          "SupportController"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "ticketId": {
                      "type": "number"
                    },
                    "documentId": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Support ticket created successfully (with or without file)"
          }
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          },
          "description": "Request body for multipart/form-data based file upload",
          "required": true
        },
        "operationId": "SupportController.createTicket"
      }
    },
    "/users/check-email-for-register": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "checkEmail",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Check if email exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exists": {
                      "type": "boolean"
                    },
                    "mensaje": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "exists",
                    "mensaje"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "operationId": "UsersController.checkEmail"
      }
    },
    "/users/clinical-records": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getUsersHistoriaClinica",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Array of Users Historia Clinica",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "userId": {
                        "type": "string"
                      },
                      "historiaClinica": {
                        "type": "object"
                      },
                      "allergies": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "description": "Array of user IDs",
          "required": true
        },
        "operationId": "UsersController.getUsersHistoriaClinica"
      }
    },
    "/users/contracts/active": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getActiveContracts",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Fetch active contracts for given RUTs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "rut": {
                        "type": "string"
                      },
                      "contracts": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "description": "Array of RUTs to fetch active contracts",
          "required": true
        },
        "operationId": "UsersController.getActiveContracts"
      }
    },
    "/users/contracts/charge": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "chargeContract",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Charge a contract for a given client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "number"
                    },
                    "contract": {
                      "type": "object"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contractId",
                  "clientId"
                ],
                "properties": {
                  "contractId": {
                    "type": "string"
                  },
                  "clientId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "description": "Payload to charge a contract",
          "required": true
        },
        "operationId": "UsersController.chargeContract"
      }
    },
    "/users/password-recovery/perform": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "recoverPassword",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Reset user password",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "password"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 6
                  }
                }
              }
            }
          }
        },
        "operationId": "UsersController.recoverPassword"
      }
    },
    "/users/password-recovery/request": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "requestPasswordRecovery",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Request password recovery",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "operationId": "UsersController.requestPasswordRecovery"
      }
    },
    "/users/push-token": {
      "post": {
        "x-controller-name": "NotificationController",
        "x-operation-name": "updatePushToken",
        "tags": [
          "NotificationController"
        ],
        "responses": {
          "200": {
            "description": "Token de notificaciones actualizado correctamente.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta exitosa de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Indica que la operación se ejecutó correctamente."
                    },
                    "message": {
                      "type": "string",
                      "description": "Mensaje descriptivo entregado cuando la operación resulta exitosa."
                    },
                    "template": {
                      "type": "string",
                      "description": "Plantilla utilizada para la notificación."
                    },
                    "userId": {
                      "type": "string",
                      "description": "ID del usuario destinatario (si aplica)."
                    },
                    "sent": {
                      "type": "number",
                      "description": "Cantidad de notificaciones enviadas exitosamente."
                    },
                    "errors": {
                      "type": "number",
                      "description": "Cantidad de errores durante el envío."
                    },
                    "invalidTokens": {
                      "type": "number",
                      "description": "Cantidad de tokens inválidos encontrados."
                    },
                    "tokensCount": {
                      "type": "number",
                      "description": "Cantidad total de tokens procesados."
                    },
                    "scheduledFor": {
                      "type": "string",
                      "description": "Fecha/hora programada para el envío (si aplica)."
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp de cuando se procesó la solicitud."
                    },
                    "searchMethod": {
                      "type": "string",
                      "enum": [
                        "userIds",
                        "filters"
                      ],
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    },
                    "familyMembers": {
                      "type": "number",
                      "description": "Cantidad de familiares incluidos (solo para notificaciones grupales)."
                    },
                    "skipped": {
                      "type": "boolean",
                      "description": "Indica si la operación fue omitida (ej: evaluación ya completada)."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Razón por la cual la operación fue omitida."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "El token proporcionado no es válido o faltan campos requeridos en la solicitud.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "El usuario indicado no existe.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "Error inesperado al guardar el token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Respuesta de error de los endpoints de notificaciones.",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ],
                      "description": "Indica que la operación falló."
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        }
                      ],
                      "description": "Detalle del error. Puede ser un string o un objeto con información adicional."
                    },
                    "searchMethod": {
                      "type": "string",
                      "description": "Método de búsqueda utilizado (solo para notificaciones grupales)."
                    },
                    "requestedUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios solicitados (solo para notificaciones grupales)."
                    },
                    "validUsers": {
                      "type": "number",
                      "description": "Cantidad de usuarios válidos encontrados (solo para notificaciones grupales)."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "pushToken"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "Identificador único del usuario que recibe la notificación."
                  },
                  "pushToken": {
                    "type": "string",
                    "description": "Token de Expo (`ExponentPushToken[...]`) asociado al dispositivo del usuario.",
                    "pattern": "^ExponentPushToken\\[.+\\]$"
                  }
                }
              },
              "examples": {
                "default": {
                  "summary": "Guardar token Expo",
                  "value": {
                    "userId": "f3a1f65b-160c-4b94-9f8f-b99e8e7bdabc",
                    "pushToken": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"
                  }
                }
              }
            }
          },
          "description": "Registra o actualiza el token push de un usuario para permitir el envío de notificaciones.",
          "required": true
        },
        "operationId": "NotificationController.updatePushToken"
      }
    },
    "/users/{id}/allergies": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserAllergies",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "User allergies update success"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string"
                  },
                  "selectedOptions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "category",
                  "selectedOptions"
                ]
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserAllergies"
      },
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getUserAllergies",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User allergies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "medication": {
                      "type": "object",
                      "properties": {
                        "allergies": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "food": {
                      "type": "object",
                      "properties": {
                        "allergies": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "environment": {
                      "type": "object",
                      "properties": {
                        "allergies": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UsersController.getUserAllergies"
      }
    },
    "/users/{id}/beneficiaries": {
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getUserBeneficiaries",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User beneficiaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UsersController.getUserBeneficiaries"
      }
    },
    "/users/{id}/clinical-record": {
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getUserHistoriaClinica",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User Historia Clinica",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "historiaClinica": {
                      "type": "object"
                    },
                    "allergies": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UsersController.getUserHistoriaClinica"
      }
    },
    "/users/{patientId}/contratacion-info": {
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getContratacionInfoByPatientId",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Contratacion information for a patient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UsersController.getContratacionInfoByPatientId"
      }
    },
    "/users/{id}/conversations": {
      "post": {
        "x-controller-name": "UsersConversationsController",
        "x-operation-name": "create",
        "tags": [
          "UsersConversationsController"
        ],
        "responses": {
          "200": {
            "description": "Users model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversations"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fromButton"
                ],
                "properties": {
                  "familiarId": {
                    "type": "string",
                    "nullable": true
                  },
                  "fromButton": {
                    "type": "string",
                    "enum": [
                      "VIDEOLLAMADA",
                      "PRESENCIAL"
                    ]
                  },
                  "preAttentions": {
                    "type": "array",
                    "nullable": true
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersConversationsController.create"
      },
      "get": {
        "x-controller-name": "UsersConversationsController",
        "x-operation-name": "find",
        "tags": [
          "UsersConversationsController"
        ],
        "responses": {
          "200": {
            "description": "Array of Users has many Conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Conversations"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        ],
        "operationId": "UsersConversationsController.find"
      }
    },
    "/users/{id}/documents": {
      "get": {
        "x-controller-name": "UsersConversationsController",
        "x-operation-name": "findDocument",
        "tags": [
          "UsersConversationsController"
        ],
        "responses": {
          "200": {
            "description": "Array of Atencion model instances with documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Conversations"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        ],
        "operationId": "UsersConversationsController.findDocument"
      }
    },
    "/users/{id}/exercise": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserExerciseHabits",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User exercise habits update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserExerciseHabits"
      }
    },
    "/users/{id}/familyMembers": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "addFamily",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Add Family Members model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewUsers"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.addFamily"
      }
    },
    "/users/{id}/general-info": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserGeneralInfo",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User general information update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "height": {
                    "type": "string"
                  },
                  "weight": {
                    "type": "string"
                  }
                },
                "required": [
                  "weight",
                  "height"
                ]
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserGeneralInfo"
      }
    },
    "/users/{id}/habits": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserHabits",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User habits update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserHabits"
      }
    },
    "/users/{id}/hospitalizations-history": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserHospitalizationsHistory",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User hospitalizations history update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserHospitalizationsHistory"
      }
    },
    "/users/{id}/medical-history": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserMedicalHistory",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User medical history update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserMedicalHistory"
      }
    },
    "/users/{id}/medications": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserMedications",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User medications update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserMedications"
      }
    },
    "/users/{id}/nutrition": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserNutritionHabits",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User nutrition habits update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserNutritionHabits"
      }
    },
    "/users/{_id}/password": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "changePassword",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "User password updated successfully"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "originalPassword": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "originalPassword",
                  "password"
                ]
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.changePassword"
      }
    },
    "/users/{id}/profile": {
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "allProfileUsers",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Profile Users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "emails": {
                          "type": "string"
                        },
                        "roles": {
                          "type": "object"
                        },
                        "profileV2": {
                          "type": "object"
                        },
                        "familiaresIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "familiares": {
                          "type": "array"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users.Filter"
                }
              }
            }
          }
        ],
        "operationId": "UsersController.allProfileUsers"
      }
    },
    "/users/{id}/surgical-history": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateUserSurgicalHistory",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "User surgical history update success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateUserSurgicalHistory"
      }
    },
    "/users/{id}/update-avatar": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateAvatar",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Update user avatar and return updated profileV2",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "profileV2": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "avatar": {
                    "type": "string"
                  }
                },
                "required": [
                  "avatar"
                ]
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateAvatar"
      }
    },
    "/users/{id}/userData": {
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "getUserData",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Comprehensive user data including profile, allergies, clinical history, and beneficiaries."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UsersController.getUserData"
      }
    },
    "/users/{id}": {
      "patch": {
        "x-controller-name": "UsersController",
        "x-operation-name": "updateById",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "204": {
            "description": "Users PATCH success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersWithRelations"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsersPartial"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UsersController.updateById"
      },
      "get": {
        "x-controller-name": "UsersController",
        "x-operation-name": "findById",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Users model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersWithRelations"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users.Filter"
                }
              }
            }
          }
        ],
        "operationId": "UsersController.findById"
      }
    },
    "/users": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "create",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Users model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Users"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewUsers"
              }
            }
          }
        },
        "operationId": "UsersController.create"
      }
    },
    "/verify-2fa": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "verify2FA",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Verify 2FA code submitted by the user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "code"
                ]
              }
            }
          }
        },
        "operationId": "UsersController.verify2FA"
      }
    },
    "/verify-phone": {
      "post": {
        "x-controller-name": "UsersController",
        "x-operation-name": "verifyPhone",
        "tags": [
          "UsersController"
        ],
        "responses": {
          "200": {
            "description": "Verify phone number submitted by the user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "codePhone": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "phone",
                  "codePhone"
                ]
              }
            }
          }
        },
        "operationId": "UsersController.verifyPhone"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Users": {
        "title": "Users",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "object"
          },
          "roles": {
            "type": "object"
          },
          "familiaresIds": {
            "type": "object"
          },
          "services": {
            "type": "object"
          },
          "profile": {
            "type": "object"
          },
          "profilev2": {
            "type": "object"
          },
          "accessCountry": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "pushNotifications": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "deviceId": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "default": true
              }
            }
          }
        },
        "required": [
          "services",
          "profile",
          "username"
        ],
        "additionalProperties": true
      },
      "NewUsers": {
        "title": "NewUsers",
        "type": "object",
        "description": "(tsType: Omit<Users, '_id'>, schemaOptions: { title: 'NewUsers', exclude: [ '_id' ] })",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "object"
          },
          "roles": {
            "type": "object"
          },
          "familiaresIds": {
            "type": "object"
          },
          "services": {
            "type": "object"
          },
          "profile": {
            "type": "object"
          },
          "profilev2": {
            "type": "object"
          },
          "accessCountry": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "pushNotifications": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "deviceId": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "default": true
              }
            }
          }
        },
        "required": [
          "services",
          "profile",
          "username"
        ],
        "additionalProperties": true,
        "x-typescript-type": "Omit<Users, '_id'>"
      },
      "MessagesWithRelations": {
        "title": "MessagesWithRelations",
        "type": "object",
        "description": "(tsType: MessagesWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "createdAt": {
            "type": "number"
          },
          "isConsent": {
            "type": "boolean"
          },
          "urlConsent": {
            "type": "string"
          },
          "isConsentAccepted": {
            "type": "boolean"
          },
          "isViewed": {
            "type": "boolean"
          },
          "meetAppointmentId": {
            "type": "string"
          },
          "isFile": {
            "type": "boolean"
          },
          "isPayment": {
            "type": "boolean"
          },
          "haveConfirmationButton": {
            "type": "boolean"
          },
          "confirmed": {
            "type": "boolean"
          },
          "isAppointment": {
            "type": "boolean"
          },
          "consentAcceptedAt": {
            "type": "number"
          },
          "consentAcceptedBy": {
            "type": "string"
          }
        },
        "required": [
          "conversationId",
          "senderId"
        ],
        "additionalProperties": true,
        "x-typescript-type": "MessagesWithRelations"
      },
      "ConversationsWithRelations": {
        "title": "ConversationsWithRelations",
        "type": "object",
        "description": "(tsType: ConversationsWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "familiarId": {
            "type": "string"
          },
          "fromButton": {
            "type": "string",
            "enum": [
              "Telemed",
              "Moviclinic"
            ]
          },
          "senderId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "atencionDispatched": {
            "type": "boolean"
          },
          "videocallActive": {
            "type": "boolean"
          },
          "isAtencionClosedByMedico": {
            "type": "boolean"
          },
          "isAtencionClosedByParamedico": {
            "type": "boolean"
          },
          "isCancelled": {
            "type": "boolean"
          },
          "isFirstAttention": {
            "type": "boolean"
          },
          "numberOfPreviousAttentions": {
            "type": "number"
          },
          "firstMessageByPatientAt": {
            "type": "number"
          },
          "consentSentAt": {
            "type": "number"
          },
          "consentAcceptedAt": {
            "type": "number"
          },
          "atencion": {
            "type": "object"
          },
          "isOpen": {
            "type": "boolean"
          },
          "accessCountry": {
            "type": "string"
          },
          "isVideoCallFinished": {
            "type": "boolean"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessagesWithRelations"
            }
          }
        },
        "required": [
          "fromButton"
        ],
        "additionalProperties": true,
        "x-typescript-type": "ConversationsWithRelations"
      },
      "AllergyIntoleranceWithRelations": {
        "title": "AllergyIntoleranceWithRelations",
        "type": "object",
        "description": "(tsType: AllergyIntoleranceWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "resourceType": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "allergy",
              "intolerance"
            ]
          },
          "category": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "food",
                "medication",
                "environment",
                "biologic"
              ]
            }
          },
          "criticality": {
            "type": "string",
            "enum": [
              "low",
              "high",
              "unable-to-assess"
            ]
          },
          "patient": {
            "type": "object",
            "properties": {
              "reference": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "identifier": {
                "type": "string"
              }
            }
          },
          "code": {
            "type": "object",
            "properties": {
              "coding": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "system": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "display": {
                      "type": "string"
                    }
                  }
                }
              },
              "text": {
                "type": "string"
              }
            }
          },
          "note": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "authorReference": {
                  "type": "object",
                  "properties": {
                    "reference": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "identifier": {
                      "type": "string"
                    }
                  }
                },
                "authorString": {
                  "type": "string"
                },
                "time": {
                  "type": "string",
                  "format": "date-time"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "reaction": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "manifestation": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "coding": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "system": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            },
                            "display": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "text": {
                        "type": "string"
                      }
                    }
                  }
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "mild",
                    "moderate",
                    "severe"
                  ]
                },
                "description": {
                  "type": "string"
                }
              }
            }
          },
          "isNote": {
            "type": "boolean"
          }
        },
        "required": [
          "userId",
          "resourceType",
          "type",
          "category",
          "patient",
          "code"
        ],
        "additionalProperties": true,
        "x-typescript-type": "AllergyIntoleranceWithRelations"
      },
      "UsersWithRelations": {
        "title": "UsersWithRelations",
        "type": "object",
        "description": "(tsType: UsersWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "object"
          },
          "roles": {
            "type": "object"
          },
          "familiaresIds": {
            "type": "object"
          },
          "services": {
            "type": "object"
          },
          "profile": {
            "type": "object"
          },
          "profilev2": {
            "type": "object"
          },
          "accessCountry": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "pushNotifications": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "deviceId": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "conversations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationsWithRelations"
            }
          },
          "allergyIntolerances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AllergyIntoleranceWithRelations"
            }
          }
        },
        "required": [
          "services",
          "profile",
          "username"
        ],
        "additionalProperties": true,
        "x-typescript-type": "UsersWithRelations"
      },
      "UsersPartial": {
        "title": "UsersPartial",
        "type": "object",
        "description": "(tsType: Partial<Users>, schemaOptions: { partial: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "object"
          },
          "roles": {
            "type": "object"
          },
          "familiaresIds": {
            "type": "object"
          },
          "services": {
            "type": "object"
          },
          "profile": {
            "type": "object"
          },
          "profilev2": {
            "type": "object"
          },
          "accessCountry": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "pushNotifications": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "deviceId": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "default": true
              }
            }
          }
        },
        "additionalProperties": true,
        "x-typescript-type": "Partial<Users>"
      },
      "Credentials": {
        "title": "Credentials",
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "password"
        ],
        "additionalProperties": false
      },
      "Conversations": {
        "title": "Conversations",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "familiarId": {
            "type": "string"
          },
          "fromButton": {
            "type": "string",
            "enum": [
              "Telemed",
              "Moviclinic"
            ]
          },
          "senderId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "atencionDispatched": {
            "type": "boolean"
          },
          "videocallActive": {
            "type": "boolean"
          },
          "isAtencionClosedByMedico": {
            "type": "boolean"
          },
          "isAtencionClosedByParamedico": {
            "type": "boolean"
          },
          "isCancelled": {
            "type": "boolean"
          },
          "isFirstAttention": {
            "type": "boolean"
          },
          "numberOfPreviousAttentions": {
            "type": "number"
          },
          "firstMessageByPatientAt": {
            "type": "number"
          },
          "consentSentAt": {
            "type": "number"
          },
          "consentAcceptedAt": {
            "type": "number"
          },
          "atencion": {
            "type": "object"
          },
          "isOpen": {
            "type": "boolean"
          },
          "accessCountry": {
            "type": "string"
          },
          "isVideoCallFinished": {
            "type": "boolean"
          }
        },
        "required": [
          "fromButton"
        ],
        "additionalProperties": true
      },
      "Logs": {
        "title": "Logs",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "typeAction": {
            "type": "string"
          },
          "codeResponse": {
            "type": "number"
          },
          "executorRole": {
            "type": "string"
          },
          "executorId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "data": {
            "type": "object"
          },
          "showData": {
            "type": "boolean"
          },
          "connectionData": {
            "type": "object"
          },
          "executedAt": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "NewLogs": {
        "title": "NewLogs",
        "type": "object",
        "description": "(tsType: Omit<Logs, '_id'>, schemaOptions: { title: 'NewLogs', exclude: [ '_id' ] })",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "typeAction": {
            "type": "string"
          },
          "codeResponse": {
            "type": "number"
          },
          "executorRole": {
            "type": "string"
          },
          "executorId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "data": {
            "type": "object"
          },
          "showData": {
            "type": "boolean"
          },
          "connectionData": {
            "type": "object"
          },
          "executedAt": {
            "type": "number"
          }
        },
        "additionalProperties": true,
        "x-typescript-type": "Omit<Logs, '_id'>"
      },
      "LogsWithRelations": {
        "title": "LogsWithRelations",
        "type": "object",
        "description": "(tsType: LogsWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "typeAction": {
            "type": "string"
          },
          "codeResponse": {
            "type": "number"
          },
          "executorRole": {
            "type": "string"
          },
          "executorId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "data": {
            "type": "object"
          },
          "showData": {
            "type": "boolean"
          },
          "connectionData": {
            "type": "object"
          },
          "executedAt": {
            "type": "number"
          }
        },
        "additionalProperties": true,
        "x-typescript-type": "LogsWithRelations"
      },
      "ConversationsPartial": {
        "title": "ConversationsPartial",
        "type": "object",
        "description": "(tsType: Partial<Conversations>, schemaOptions: { partial: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "familiarId": {
            "type": "string"
          },
          "fromButton": {
            "type": "string",
            "enum": [
              "Telemed",
              "Moviclinic"
            ]
          },
          "senderId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "atencionDispatched": {
            "type": "boolean"
          },
          "videocallActive": {
            "type": "boolean"
          },
          "isAtencionClosedByMedico": {
            "type": "boolean"
          },
          "isAtencionClosedByParamedico": {
            "type": "boolean"
          },
          "isCancelled": {
            "type": "boolean"
          },
          "isFirstAttention": {
            "type": "boolean"
          },
          "numberOfPreviousAttentions": {
            "type": "number"
          },
          "firstMessageByPatientAt": {
            "type": "number"
          },
          "consentSentAt": {
            "type": "number"
          },
          "consentAcceptedAt": {
            "type": "number"
          },
          "atencion": {
            "type": "object"
          },
          "isOpen": {
            "type": "boolean"
          },
          "accessCountry": {
            "type": "string"
          },
          "isVideoCallFinished": {
            "type": "boolean"
          }
        },
        "additionalProperties": true,
        "x-typescript-type": "Partial<Conversations>"
      },
      "Messages": {
        "title": "Messages",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "createdAt": {
            "type": "number"
          },
          "isConsent": {
            "type": "boolean"
          },
          "urlConsent": {
            "type": "string"
          },
          "isConsentAccepted": {
            "type": "boolean"
          },
          "isViewed": {
            "type": "boolean"
          },
          "meetAppointmentId": {
            "type": "string"
          },
          "isFile": {
            "type": "boolean"
          },
          "isPayment": {
            "type": "boolean"
          },
          "haveConfirmationButton": {
            "type": "boolean"
          },
          "confirmed": {
            "type": "boolean"
          },
          "isAppointment": {
            "type": "boolean"
          },
          "consentAcceptedAt": {
            "type": "number"
          },
          "consentAcceptedBy": {
            "type": "string"
          }
        },
        "required": [
          "conversationId",
          "senderId"
        ],
        "additionalProperties": true
      },
      "NewMessagesInConversations": {
        "title": "NewMessagesInConversations",
        "type": "object",
        "description": "(tsType: @loopback/repository-json-schema#Optional<Omit<Messages, '_id'>, 'conversationId'>, schemaOptions: { title: 'NewMessagesInConversations', exclude: [ '_id' ], optional: [ 'conversationId' ] })",
        "properties": {
          "conversationId": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "createdAt": {
            "type": "number"
          },
          "isConsent": {
            "type": "boolean"
          },
          "urlConsent": {
            "type": "string"
          },
          "isConsentAccepted": {
            "type": "boolean"
          },
          "isViewed": {
            "type": "boolean"
          },
          "meetAppointmentId": {
            "type": "string"
          },
          "isFile": {
            "type": "boolean"
          },
          "isPayment": {
            "type": "boolean"
          },
          "haveConfirmationButton": {
            "type": "boolean"
          },
          "confirmed": {
            "type": "boolean"
          },
          "isAppointment": {
            "type": "boolean"
          },
          "consentAcceptedAt": {
            "type": "number"
          },
          "consentAcceptedBy": {
            "type": "string"
          }
        },
        "required": [
          "senderId"
        ],
        "additionalProperties": true,
        "x-typescript-type": "@loopback/repository-json-schema#Optional<Omit<Messages, '_id'>, 'conversationId'>"
      },
      "Atenciones": {
        "title": "Atenciones",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "sequentialId": {
            "type": "number"
          },
          "medicoId": {
            "type": "string"
          },
          "paramedicoId": {
            "type": "string"
          },
          "codigoTelefonico": {
            "type": "string"
          },
          "telefono": {
            "type": "string"
          },
          "rut": {
            "type": "string"
          },
          "digitoVerificadorRut": {
            "type": "string"
          },
          "nacionalidad": {
            "type": "string"
          },
          "sexo": {
            "type": "string"
          },
          "fechaDeNacimiento": {
            "type": "string"
          },
          "paciente": {
            "type": "string"
          },
          "pacienteId": {
            "type": "string"
          },
          "sendEmail": {
            "type": "boolean"
          },
          "requestedByPatientAt": {
            "type": "number"
          },
          "tipoPago": {
            "type": "string"
          },
          "medico": {
            "type": "object"
          },
          "tipo": {
            "type": "string"
          },
          "domicilio": {
            "type": "string"
          },
          "comuna": {
            "type": "string"
          },
          "pacienteEmail": {
            "type": "string"
          },
          "observaciones": {
            "type": "string"
          },
          "sintomas": {
            "type": "string"
          },
          "montoPago": {
            "type": "string"
          },
          "horaInicio": {
            "type": "string"
          },
          "horaFin": {
            "type": "string"
          },
          "pacienteNombreSocial": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "firstMessageByOperatorAt": {
            "type": "number"
          },
          "firstReplyByOperatorAt": {
            "type": "number"
          },
          "edad": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "statusMedico": {
            "type": "number"
          },
          "statusParamedico": {
            "type": "number"
          },
          "medicalRecord": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "signosVitales": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesMedicas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "diagnosticos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "impresionMedico": {
            "type": "string"
          },
          "impresionParamedico": {
            "type": "string"
          },
          "indicacionesNoFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesComplementariasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "takenByMedicoAt": {
            "type": "number"
          },
          "videollamadaMarks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "hallazgosExamenFisico": {
            "type": "string"
          },
          "observacionesProfesionalNoMédico": {
            "type": "string"
          },
          "indicacionesReposo": {
            "type": "object"
          },
          "closedByMedicoAt": {
            "type": "number"
          },
          "videollamada": {
            "type": "object"
          },
          "closedByParamedicoAt": {
            "type": "number"
          },
          "procedimientos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "medicoId"
        ],
        "additionalProperties": true
      },
      "NewAtenciones": {
        "title": "NewAtenciones",
        "type": "object",
        "description": "(tsType: Omit<Atenciones, '_id'>, schemaOptions: { title: 'NewAtenciones', exclude: [ '_id' ] })",
        "properties": {
          "sequentialId": {
            "type": "number"
          },
          "medicoId": {
            "type": "string"
          },
          "paramedicoId": {
            "type": "string"
          },
          "codigoTelefonico": {
            "type": "string"
          },
          "telefono": {
            "type": "string"
          },
          "rut": {
            "type": "string"
          },
          "digitoVerificadorRut": {
            "type": "string"
          },
          "nacionalidad": {
            "type": "string"
          },
          "sexo": {
            "type": "string"
          },
          "fechaDeNacimiento": {
            "type": "string"
          },
          "paciente": {
            "type": "string"
          },
          "pacienteId": {
            "type": "string"
          },
          "sendEmail": {
            "type": "boolean"
          },
          "requestedByPatientAt": {
            "type": "number"
          },
          "tipoPago": {
            "type": "string"
          },
          "medico": {
            "type": "object"
          },
          "tipo": {
            "type": "string"
          },
          "domicilio": {
            "type": "string"
          },
          "comuna": {
            "type": "string"
          },
          "pacienteEmail": {
            "type": "string"
          },
          "observaciones": {
            "type": "string"
          },
          "sintomas": {
            "type": "string"
          },
          "montoPago": {
            "type": "string"
          },
          "horaInicio": {
            "type": "string"
          },
          "horaFin": {
            "type": "string"
          },
          "pacienteNombreSocial": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "firstMessageByOperatorAt": {
            "type": "number"
          },
          "firstReplyByOperatorAt": {
            "type": "number"
          },
          "edad": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "statusMedico": {
            "type": "number"
          },
          "statusParamedico": {
            "type": "number"
          },
          "medicalRecord": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "signosVitales": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesMedicas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "diagnosticos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "impresionMedico": {
            "type": "string"
          },
          "impresionParamedico": {
            "type": "string"
          },
          "indicacionesNoFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesComplementariasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "takenByMedicoAt": {
            "type": "number"
          },
          "videollamadaMarks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "hallazgosExamenFisico": {
            "type": "string"
          },
          "observacionesProfesionalNoMédico": {
            "type": "string"
          },
          "indicacionesReposo": {
            "type": "object"
          },
          "closedByMedicoAt": {
            "type": "number"
          },
          "videollamada": {
            "type": "object"
          },
          "closedByParamedicoAt": {
            "type": "number"
          },
          "procedimientos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "medicoId"
        ],
        "additionalProperties": true,
        "x-typescript-type": "Omit<Atenciones, '_id'>"
      },
      "AtencionesWithRelations": {
        "title": "AtencionesWithRelations",
        "type": "object",
        "description": "(tsType: AtencionesWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "sequentialId": {
            "type": "number"
          },
          "medicoId": {
            "type": "string"
          },
          "paramedicoId": {
            "type": "string"
          },
          "codigoTelefonico": {
            "type": "string"
          },
          "telefono": {
            "type": "string"
          },
          "rut": {
            "type": "string"
          },
          "digitoVerificadorRut": {
            "type": "string"
          },
          "nacionalidad": {
            "type": "string"
          },
          "sexo": {
            "type": "string"
          },
          "fechaDeNacimiento": {
            "type": "string"
          },
          "paciente": {
            "type": "string"
          },
          "pacienteId": {
            "type": "string"
          },
          "sendEmail": {
            "type": "boolean"
          },
          "requestedByPatientAt": {
            "type": "number"
          },
          "tipoPago": {
            "type": "string"
          },
          "medico": {
            "type": "object"
          },
          "tipo": {
            "type": "string"
          },
          "domicilio": {
            "type": "string"
          },
          "comuna": {
            "type": "string"
          },
          "pacienteEmail": {
            "type": "string"
          },
          "observaciones": {
            "type": "string"
          },
          "sintomas": {
            "type": "string"
          },
          "montoPago": {
            "type": "string"
          },
          "horaInicio": {
            "type": "string"
          },
          "horaFin": {
            "type": "string"
          },
          "pacienteNombreSocial": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "firstMessageByOperatorAt": {
            "type": "number"
          },
          "firstReplyByOperatorAt": {
            "type": "number"
          },
          "edad": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "statusMedico": {
            "type": "number"
          },
          "statusParamedico": {
            "type": "number"
          },
          "medicalRecord": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "signosVitales": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesMedicas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "diagnosticos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "impresionMedico": {
            "type": "string"
          },
          "impresionParamedico": {
            "type": "string"
          },
          "indicacionesNoFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesComplementariasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "takenByMedicoAt": {
            "type": "number"
          },
          "videollamadaMarks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "hallazgosExamenFisico": {
            "type": "string"
          },
          "observacionesProfesionalNoMédico": {
            "type": "string"
          },
          "indicacionesReposo": {
            "type": "object"
          },
          "closedByMedicoAt": {
            "type": "number"
          },
          "videollamada": {
            "type": "object"
          },
          "closedByParamedicoAt": {
            "type": "number"
          },
          "procedimientos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "medicoId"
        ],
        "additionalProperties": true,
        "x-typescript-type": "AtencionesWithRelations"
      },
      "AtencionesPartial": {
        "title": "AtencionesPartial",
        "type": "object",
        "description": "(tsType: Partial<Atenciones>, schemaOptions: { partial: true })",
        "properties": {
          "_id": {
            "type": "string"
          },
          "sequentialId": {
            "type": "number"
          },
          "medicoId": {
            "type": "string"
          },
          "paramedicoId": {
            "type": "string"
          },
          "codigoTelefonico": {
            "type": "string"
          },
          "telefono": {
            "type": "string"
          },
          "rut": {
            "type": "string"
          },
          "digitoVerificadorRut": {
            "type": "string"
          },
          "nacionalidad": {
            "type": "string"
          },
          "sexo": {
            "type": "string"
          },
          "fechaDeNacimiento": {
            "type": "string"
          },
          "paciente": {
            "type": "string"
          },
          "pacienteId": {
            "type": "string"
          },
          "sendEmail": {
            "type": "boolean"
          },
          "requestedByPatientAt": {
            "type": "number"
          },
          "tipoPago": {
            "type": "string"
          },
          "medico": {
            "type": "object"
          },
          "tipo": {
            "type": "string"
          },
          "domicilio": {
            "type": "string"
          },
          "comuna": {
            "type": "string"
          },
          "pacienteEmail": {
            "type": "string"
          },
          "observaciones": {
            "type": "string"
          },
          "sintomas": {
            "type": "string"
          },
          "montoPago": {
            "type": "string"
          },
          "horaInicio": {
            "type": "string"
          },
          "horaFin": {
            "type": "string"
          },
          "pacienteNombreSocial": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "senderId": {
            "type": "string"
          },
          "firstMessageByOperatorAt": {
            "type": "number"
          },
          "firstReplyByOperatorAt": {
            "type": "number"
          },
          "edad": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "statusMedico": {
            "type": "number"
          },
          "statusParamedico": {
            "type": "number"
          },
          "medicalRecord": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "signosVitales": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesMedicas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "diagnosticos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "impresionMedico": {
            "type": "string"
          },
          "impresionParamedico": {
            "type": "string"
          },
          "indicacionesNoFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasInmediatas": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesFarmacologicasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "indicacionesComplementariasPostAtencion": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "takenByMedicoAt": {
            "type": "number"
          },
          "videollamadaMarks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "hallazgosExamenFisico": {
            "type": "string"
          },
          "observacionesProfesionalNoMédico": {
            "type": "string"
          },
          "indicacionesReposo": {
            "type": "object"
          },
          "closedByMedicoAt": {
            "type": "number"
          },
          "videollamada": {
            "type": "object"
          },
          "closedByParamedicoAt": {
            "type": "number"
          },
          "procedimientos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "additionalProperties": true,
        "x-typescript-type": "Partial<Atenciones>"
      },
      "Appointment": {
        "title": "Appointment",
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "data": {
            "type": "object"
          },
          "patientId": {
            "type": "string"
          },
          "appointmentDatetime": {
            "type": "string",
            "format": "date-time"
          },
          "rawAppointmentDatetime": {
            "type": "string",
            "format": "date-time"
          },
          "updateAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "simplybookNoteId": {
            "type": "string"
          },
          "whatsappAction": {
            "type": "string"
          },
          "calendarId": {
            "type": "string"
          }
        },
        "required": [
          "createdBy",
          "conversationId",
          "data",
          "patientId",
          "appointmentDatetime",
          "rawAppointmentDatetime",
          "updateAt",
          "status"
        ],
        "additionalProperties": true
      },
      "loopback.Count": {
        "type": "object",
        "title": "loopback.Count",
        "x-typescript-type": "@loopback/repository#Count",
        "properties": {
          "count": {
            "type": "number"
          }
        }
      },
      "Atenciones.Filter": {
        "type": "object",
        "title": "Atenciones.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "boolean"
                  },
                  "sequentialId": {
                    "type": "boolean"
                  },
                  "medicoId": {
                    "type": "boolean"
                  },
                  "paramedicoId": {
                    "type": "boolean"
                  },
                  "codigoTelefonico": {
                    "type": "boolean"
                  },
                  "telefono": {
                    "type": "boolean"
                  },
                  "rut": {
                    "type": "boolean"
                  },
                  "digitoVerificadorRut": {
                    "type": "boolean"
                  },
                  "nacionalidad": {
                    "type": "boolean"
                  },
                  "sexo": {
                    "type": "boolean"
                  },
                  "fechaDeNacimiento": {
                    "type": "boolean"
                  },
                  "paciente": {
                    "type": "boolean"
                  },
                  "pacienteId": {
                    "type": "boolean"
                  },
                  "sendEmail": {
                    "type": "boolean"
                  },
                  "requestedByPatientAt": {
                    "type": "boolean"
                  },
                  "tipoPago": {
                    "type": "boolean"
                  },
                  "medico": {
                    "type": "boolean"
                  },
                  "tipo": {
                    "type": "boolean"
                  },
                  "domicilio": {
                    "type": "boolean"
                  },
                  "comuna": {
                    "type": "boolean"
                  },
                  "pacienteEmail": {
                    "type": "boolean"
                  },
                  "observaciones": {
                    "type": "boolean"
                  },
                  "sintomas": {
                    "type": "boolean"
                  },
                  "montoPago": {
                    "type": "boolean"
                  },
                  "horaInicio": {
                    "type": "boolean"
                  },
                  "horaFin": {
                    "type": "boolean"
                  },
                  "pacienteNombreSocial": {
                    "type": "boolean"
                  },
                  "conversationId": {
                    "type": "boolean"
                  },
                  "senderName": {
                    "type": "boolean"
                  },
                  "senderId": {
                    "type": "boolean"
                  },
                  "firstMessageByOperatorAt": {
                    "type": "boolean"
                  },
                  "firstReplyByOperatorAt": {
                    "type": "boolean"
                  },
                  "edad": {
                    "type": "boolean"
                  },
                  "createdAt": {
                    "type": "boolean"
                  },
                  "statusMedico": {
                    "type": "boolean"
                  },
                  "statusParamedico": {
                    "type": "boolean"
                  },
                  "medicalRecord": {
                    "type": "boolean"
                  },
                  "signosVitales": {
                    "type": "boolean"
                  },
                  "indicacionesMedicas": {
                    "type": "boolean"
                  },
                  "diagnosticos": {
                    "type": "boolean"
                  },
                  "impresionMedico": {
                    "type": "boolean"
                  },
                  "impresionParamedico": {
                    "type": "boolean"
                  },
                  "indicacionesNoFarmacologicasPostAtencion": {
                    "type": "boolean"
                  },
                  "indicacionesInmediatas": {
                    "type": "boolean"
                  },
                  "indicacionesFarmacologicasInmediatas": {
                    "type": "boolean"
                  },
                  "indicacionesFarmacologicasPostAtencion": {
                    "type": "boolean"
                  },
                  "indicacionesComplementariasPostAtencion": {
                    "type": "boolean"
                  },
                  "takenByMedicoAt": {
                    "type": "boolean"
                  },
                  "videollamadaMarks": {
                    "type": "boolean"
                  },
                  "hallazgosExamenFisico": {
                    "type": "boolean"
                  },
                  "observacionesProfesionalNoMédico": {
                    "type": "boolean"
                  },
                  "indicacionesReposo": {
                    "type": "boolean"
                  },
                  "closedByMedicoAt": {
                    "type": "boolean"
                  },
                  "videollamada": {
                    "type": "boolean"
                  },
                  "closedByParamedicoAt": {
                    "type": "boolean"
                  },
                  "procedimientos": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "_id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Atenciones.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Atenciones>"
      },
      "Atenciones.Filter1": {
        "type": "object",
        "title": "Atenciones.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "Atenciones.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "boolean"
                  },
                  "sequentialId": {
                    "type": "boolean"
                  },
                  "medicoId": {
                    "type": "boolean"
                  },
                  "paramedicoId": {
                    "type": "boolean"
                  },
                  "codigoTelefonico": {
                    "type": "boolean"
                  },
                  "telefono": {
                    "type": "boolean"
                  },
                  "rut": {
                    "type": "boolean"
                  },
                  "digitoVerificadorRut": {
                    "type": "boolean"
                  },
                  "nacionalidad": {
                    "type": "boolean"
                  },
                  "sexo": {
                    "type": "boolean"
                  },
                  "fechaDeNacimiento": {
                    "type": "boolean"
                  },
                  "paciente": {
                    "type": "boolean"
                  },
                  "pacienteId": {
                    "type": "boolean"
                  },
                  "sendEmail": {
                    "type": "boolean"
                  },
                  "requestedByPatientAt": {
                    "type": "boolean"
                  },
                  "tipoPago": {
                    "type": "boolean"
                  },
                  "medico": {
                    "type": "boolean"
                  },
                  "tipo": {
                    "type": "boolean"
                  },
                  "domicilio": {
                    "type": "boolean"
                  },
                  "comuna": {
                    "type": "boolean"
                  },
                  "pacienteEmail": {
                    "type": "boolean"
                  },
                  "observaciones": {
                    "type": "boolean"
                  },
                  "sintomas": {
                    "type": "boolean"
                  },
                  "montoPago": {
                    "type": "boolean"
                  },
                  "horaInicio": {
                    "type": "boolean"
                  },
                  "horaFin": {
                    "type": "boolean"
                  },
                  "pacienteNombreSocial": {
                    "type": "boolean"
                  },
                  "conversationId": {
                    "type": "boolean"
                  },
                  "senderName": {
                    "type": "boolean"
                  },
                  "senderId": {
                    "type": "boolean"
                  },
                  "firstMessageByOperatorAt": {
                    "type": "boolean"
                  },
                  "firstReplyByOperatorAt": {
                    "type": "boolean"
                  },
                  "edad": {
                    "type": "boolean"
                  },
                  "createdAt": {
                    "type": "boolean"
                  },
                  "statusMedico": {
                    "type": "boolean"
                  },
                  "statusParamedico": {
                    "type": "boolean"
                  },
                  "medicalRecord": {
                    "type": "boolean"
                  },
                  "signosVitales": {
                    "type": "boolean"
                  },
                  "indicacionesMedicas": {
                    "type": "boolean"
                  },
                  "diagnosticos": {
                    "type": "boolean"
                  },
                  "impresionMedico": {
                    "type": "boolean"
                  },
                  "impresionParamedico": {
                    "type": "boolean"
                  },
                  "indicacionesNoFarmacologicasPostAtencion": {
                    "type": "boolean"
                  },
                  "indicacionesInmediatas": {
                    "type": "boolean"
                  },
                  "indicacionesFarmacologicasInmediatas": {
                    "type": "boolean"
                  },
                  "indicacionesFarmacologicasPostAtencion": {
                    "type": "boolean"
                  },
                  "indicacionesComplementariasPostAtencion": {
                    "type": "boolean"
                  },
                  "takenByMedicoAt": {
                    "type": "boolean"
                  },
                  "videollamadaMarks": {
                    "type": "boolean"
                  },
                  "hallazgosExamenFisico": {
                    "type": "boolean"
                  },
                  "observacionesProfesionalNoMédico": {
                    "type": "boolean"
                  },
                  "indicacionesReposo": {
                    "type": "boolean"
                  },
                  "closedByMedicoAt": {
                    "type": "boolean"
                  },
                  "videollamada": {
                    "type": "boolean"
                  },
                  "closedByParamedicoAt": {
                    "type": "boolean"
                  },
                  "procedimientos": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "_id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Atenciones.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Atenciones>"
      },
      "Logs.Filter": {
        "type": "object",
        "title": "Logs.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "Logs.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "boolean"
                  },
                  "createdAt": {
                    "type": "boolean"
                  },
                  "typeAction": {
                    "type": "boolean"
                  },
                  "codeResponse": {
                    "type": "boolean"
                  },
                  "executorRole": {
                    "type": "boolean"
                  },
                  "executorId": {
                    "type": "boolean"
                  },
                  "userId": {
                    "type": "boolean"
                  },
                  "data": {
                    "type": "boolean"
                  },
                  "showData": {
                    "type": "boolean"
                  },
                  "connectionData": {
                    "type": "boolean"
                  },
                  "executedAt": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "_id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Logs.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Logs>"
      },
      "PingResponse": {
        "type": "object",
        "title": "PingResponse",
        "properties": {
          "greeting": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "agenda": {
            "type": "string"
          },
          "headers": {
            "type": "object",
            "properties": {
              "Content-Type": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "JobScheduledResponse": {
        "type": "object",
        "title": "JobScheduledResponse",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "jobType": {
            "type": "string"
          },
          "scheduledFor": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "JobErrorResponse": {
        "type": "object",
        "title": "JobErrorResponse",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "PingJobRequest": {
        "type": "object",
        "title": "PingJobRequest",
        "properties": {
          "message": {
            "type": "string",
            "description": "Mensaje personalizado para el ping job",
            "example": "Ping de prueba desde API"
          },
          "delayTime": {
            "type": "string",
            "description": "Cuándo ejecutar el job (formato de Agenda.js)",
            "example": "10 seconds",
            "default": "10 seconds"
          }
        }
      },
      "Users.ScopeFilter": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            ]
          },
          "include": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false,
        "title": "Users.ScopeFilter"
      },
      "Users.IncludeFilter.Items": {
        "title": "Users.IncludeFilter.Items",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "conversations",
              "allergyIntolerances"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/Users.ScopeFilter"
          }
        }
      },
      "Users.Filter": {
        "type": "object",
        "title": "Users.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "boolean"
                  },
                  "createdAt": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "boolean"
                  },
                  "roles": {
                    "type": "boolean"
                  },
                  "familiaresIds": {
                    "type": "boolean"
                  },
                  "services": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "boolean"
                  },
                  "profilev2": {
                    "type": "boolean"
                  },
                  "accessCountry": {
                    "type": "boolean"
                  },
                  "username": {
                    "type": "boolean"
                  },
                  "pushNotifications": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "_id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Users.Fields"
          },
          "include": {
            "title": "Users.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Users.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Users>"
      }
    }
  },
  "servers": [
    {
      "url": "https://api-paciente.docmovi.com"
    }
  ],
  "security": [
    {
      "jwt": []
    }
  ]
}