Skip to main content
POST
/
prontuario
Create Medical Record
curl --request POST \
  --url https://api.example.com/prontuario/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "paciente_id": 123
}
'
{
  "id": 1,
  "paciente_id": 1,
  "lista_consultas": [],
  "lista_prescricoes": [],
  "lista_exames": []
}
Creates a new medical record (prontuário) for a patient. Only administrators with superuser permissions can create medical records. Each patient can only have one medical record.

Authentication

Requires a valid JWT token with superuser permissions. Include the token in the Authorization header:
Authorization: Bearer <your_token>

Request Body

paciente_id
integer
required
The ID of the patient for whom the medical record is being created

Response

id
integer
The unique identifier of the created medical record
paciente_id
integer
The ID of the patient associated with this medical record
lista_consultas
array
List of consultations associated with this medical record (empty on creation)
lista_prescricoes
array
List of prescriptions associated with this medical record (empty on creation)
lista_exames
array
List of exams associated with this medical record (empty on creation)

Example Request

curl -X POST https://api.vidaplus.com/prontuario/ \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "paciente_id": 1
  }'

Example Response

{
  "id": 1,
  "paciente_id": 1,
  "lista_consultas": [],
  "lista_prescricoes": [],
  "lista_exames": []
}

Error Responses

{
  "detail": "Paciente não encontrado."
}
{
  "detail": "Prontuário já existe para este paciente."
}
{
  "detail": "Apenas usuários com permissão de administrador podem criar prontuários."
}

Notes

  • Only superusers can create medical records
  • Each patient can only have one medical record
  • The patient must exist in the system before creating their medical record
  • Upon creation, the medical record will have empty lists for consultations, prescriptions, and exams

Build docs developers (and LLMs) love