Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FerchoSG/healthcare-web/llms.txt

Use this file to discover all available pages before exploring further.

The medical records API stores the clinical content produced during each patient visit. Records support general vitals and diagnosis fields, and extend to specialty-specific modules: OB/GYN (gynoRecord), dental charting (dentalRecords), and prescriptions. All authenticated endpoints require a valid Authorization bearer token and x-clinic-id header. PDF generation requires an explicit manual fetch because the binary response is handled outside the standard JSON client.

GET /patients/:id/medical-records

Retrieve all medical records for a patient. Path parameters
id
string
required
UUID of the patient.
ResponseMedicalRecord[]
id
string
UUID of the medical record.
clinic_id
string
UUID of the owning clinic.
patient_id
string
UUID of the patient.
doctor_id
string
UUID of the attending doctor.
appointment_id
string | null
UUID of the linked appointment, or null if the record was created independently.
vitals
object | null
Free-form object containing vital signs (e.g., blood pressure, heart rate, temperature, weight). Structure is not enforced by the API.
diagnosis
string | null
Free-text diagnosis.
treatment_plan
string | null
Free-text treatment plan.
createdAt
string
ISO 8601 creation timestamp.
updatedAt
string
ISO 8601 last-updated timestamp.
doctor
object
patient
object
gynoRecord
object | null
OB/GYN data, or null if not applicable.
dentalRecords
DentalRecord[]
Array of dental chart entries. Empty array when not applicable.
prescriptions
Prescription[]
Array of prescriptions issued on this record. Empty array when none.
curl --request GET \
  --url http://localhost:3001/patients/p_abc123/medical-records \
  --header "Authorization: Bearer <token>" \
  --header "x-clinic-id: <clinic_id>"

POST /medical-records

Create a new medical record for a patient. The record supports specialty-specific nested objects; include only the fields relevant to the clinic’s active specialty modules. Request body
patient_id
string
required
UUID of the patient.
doctor_id
string
required
UUID of the attending doctor.
appointment_id
string
UUID of the appointment this record is associated with.
vitals
object
Free-form object for vital signs (e.g., { "blood_pressure": "120/80", "temperature_c": 36.5 }).
diagnosis
string
Free-text clinical diagnosis.
treatment_plan
string
Free-text treatment plan.
gynoRecord
object
OB/GYN-specific data. Include when the clinic has the OB/GYN specialty module enabled.
dentalRecords
object[]
Dental chart entries. Include when the clinic has the dental specialty module enabled.
prescription
object
Prescription to attach to this record.
ResponseMedicalRecord The newly created medical record. See field definitions in the GET /patients/:id/medical-records section above.
curl --request POST \
  --url http://localhost:3001/medical-records \
  --header "Authorization: Bearer <token>" \
  --header "x-clinic-id: <clinic_id>" \
  --header "Content-Type: application/json" \
  --data '{
    "patient_id": "p_abc123",
    "doctor_id": "d_def456",
    "appointment_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "vitals": { "blood_pressure": "130/85", "temperature_c": 37.1 },
    "diagnosis": "Hipertensión arterial leve",
    "treatment_plan": "Cambios en dieta y ejercicio. Control en 1 mes.",
    "prescription": {
      "medications": [
        { "name": "Enalapril", "dosage": "10mg", "frequency": "Una vez al día" }
      ],
      "additional_notes": "Tomar en ayunas"
    }
  }'

GET /medical-records/:id/pdf

Download a medical record as a PDF file. This endpoint returns a binary blob and must be called with a manual fetch — it is not handled by the standard JSON API client.
The PDF endpoint requires the same Authorization: Bearer <token> and x-clinic-id headers as authenticated JSON endpoints, but you must call it with a raw fetch request and read the response as a Blob.
Path parameters
id
string
required
UUID of the medical record.
ResponseBlob (application/pdf) A binary PDF file suitable for downloading or opening in the browser.
# Download and save the PDF
curl --request GET \
  --url http://localhost:3001/medical-records/mr_xyz789/pdf \
  --header "Authorization: Bearer <token>" \
  --header "x-clinic-id: <clinic_id>" \
  --output expediente.pdf
// JavaScript example using fetch
const response = await fetch(
  'http://localhost:3001/medical-records/mr_xyz789/pdf',
  {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer <token>',
      'x-clinic-id': '<clinic_id>',
    },
  }
);

if (!response.ok) {
  throw new Error('No se pudo generar el PDF del expediente');
}

const blob = await response.blob();
const url = URL.createObjectURL(blob);
window.open(url);

Build docs developers (and LLMs) love