Skip to main content
POST
/
diagnosis
curl -X POST http://localhost:8080/diagnosis \
  -H "Content-Type: application/json" \
  -d '{
    "descricao": "Patient presents symptoms of acute bronchitis with persistent cough",
    "data": "2024-03-15",
    "consulta": {
      "consultationId": "123e4567-e89b-12d3-a456-426614174000"
    },
    "cid": "J20.9"
  }'
{
  "id": "987fcdeb-51a2-43f7-9c8d-7e5f6a8b9c0d",
  "descricao": "Patient presents symptoms of acute bronchitis with persistent cough",
  "data": "2024-03-15",
  "consulta": {
    "consultationId": "123e4567-e89b-12d3-a456-426614174000",
    "dateTime": "2024-03-15T10:30:00",
    "duracaoMinutos": 60,
    "isUrgent": false,
    "observation": "Regular checkup"
  },
  "cid": "J20.9"
}
Creates a new diagnosis record for a medical consultation.

Request Body

descricao
string
required
Detailed description of the diagnosis
data
string
required
Date of the diagnosis in ISO format (YYYY-MM-DD)Example: "2024-03-15"
consulta
object
required
The consultation associated with this diagnosis
consultationId
string
required
UUID of the consultation
cid
string
required
International Classification of Diseases (CID) codeExample: "A00.0"

Response

id
string
Auto-generated UUID for the diagnosis
descricao
string
Description of the diagnosis
data
string
Date of the diagnosis in ISO format
consulta
object
The associated consultation object with full details
cid
string
CID code assigned to the diagnosis
curl -X POST http://localhost:8080/diagnosis \
  -H "Content-Type: application/json" \
  -d '{
    "descricao": "Patient presents symptoms of acute bronchitis with persistent cough",
    "data": "2024-03-15",
    "consulta": {
      "consultationId": "123e4567-e89b-12d3-a456-426614174000"
    },
    "cid": "J20.9"
  }'
{
  "id": "987fcdeb-51a2-43f7-9c8d-7e5f6a8b9c0d",
  "descricao": "Patient presents symptoms of acute bronchitis with persistent cough",
  "data": "2024-03-15",
  "consulta": {
    "consultationId": "123e4567-e89b-12d3-a456-426614174000",
    "dateTime": "2024-03-15T10:30:00",
    "duracaoMinutos": 60,
    "isUrgent": false,
    "observation": "Regular checkup"
  },
  "cid": "J20.9"
}

Error Responses

400 Bad Request
string
Returned when the consultation is invalid or doesn’t existResponse body: "Consulta inválida."

Notes

  • The id field is auto-generated and should not be included in the request
  • The consultation must exist in the database before creating a diagnosis
  • All fields marked as required must be provided in the request body
  • The data field should be in ISO date format (YYYY-MM-DD)
  • The cid field should follow the International Classification of Diseases standard

Build docs developers (and LLMs) love