Medical Record

Extract patient info, diagnosis, medications, and provider.

Schema Key

medical-record

Usage

Use this template when creating a schema via the API or SDK:

const schema = await client.schemas.create('my-workspace', {
  schemaKey: 'medical-record',
  name: 'Medical Record',
  definition: { /* see definition below */ },
});

Definition

{
  "type": "object",
  "properties": {
    "patient": {
      "type": "object",
      "description": "Patient information.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Full name of the patient."
        },
        "date_of_birth": {
          "type": "object",
          "description": "Patient date of birth.",
          "properties": {
            "year": {
              "type": "integer",
              "description": "Year (e.g. 1985)."
            },
            "month": {
              "type": "integer",
              "description": "Month (1-12).",
              "minimum": 1,
              "maximum": 12
            },
            "day": {
              "type": "integer",
              "description": "Day of the month.",
              "minimum": 1,
              "maximum": 31
            }
          },
          "required": [
            "year",
            "month",
            "day"
          ],
          "additionalProperties": false
        },
        "gender": {
          "type": "string",
          "description": "Gender of the patient."
        },
        "patient_id": {
          "type": "string",
          "description": "Patient identifier or medical record number."
        }
      },
      "required": [
        "name",
        "date_of_birth"
      ],
      "additionalProperties": false
    },
    "visit_date": {
      "type": "object",
      "description": "Date of the medical visit.",
      "properties": {
        "year": {
          "type": "integer",
          "description": "Year (e.g. 2024)."
        },
        "month": {
          "type": "integer",
          "description": "Month (1-12).",
          "minimum": 1,
          "maximum": 12
        },
        "day": {
          "type": "integer",
          "description": "Day of the month.",
          "minimum": 1,
          "maximum": 31
        }
      },
      "required": [
        "year",
        "month",
        "day"
      ],
      "additionalProperties": false
    },
    "provider": {
      "type": "object",
      "description": "Healthcare provider information.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the attending physician or provider."
        },
        "specialty": {
          "type": "string",
          "description": "Medical specialty (e.g. Cardiology, General Practice)."
        },
        "facility": {
          "type": "string",
          "description": "Name of the hospital or clinic."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "diagnoses": {
      "type": "array",
      "description": "List of diagnoses.",
      "items": {
        "type": "object",
        "properties": {
          "condition": {
            "type": "string",
            "description": "Name or description of the diagnosed condition."
          },
          "icd_code": {
            "type": "string",
            "description": "ICD code if provided."
          }
        },
        "required": [
          "condition"
        ],
        "additionalProperties": false
      }
    },
    "medications": {
      "type": "array",
      "description": "List of prescribed medications.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the medication."
          },
          "dosage": {
            "type": "string",
            "description": "Dosage (e.g. 500mg)."
          },
          "frequency": {
            "type": "string",
            "description": "Frequency of administration (e.g. Twice daily)."
          },
          "duration": {
            "type": "string",
            "description": "Duration of treatment (e.g. 14 days)."
          }
        },
        "required": [
          "name",
          "dosage",
          "frequency"
        ],
        "additionalProperties": false
      }
    },
    "vitals": {
      "type": "object",
      "description": "Vital signs recorded during the visit.",
      "properties": {
        "blood_pressure": {
          "type": "string",
          "description": "Blood pressure reading (e.g. 120/80 mmHg)."
        },
        "heart_rate": {
          "type": "integer",
          "description": "Heart rate in beats per minute."
        },
        "temperature": {
          "type": "number",
          "description": "Body temperature."
        },
        "weight": {
          "type": "number",
          "description": "Weight in kilograms."
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "notes": {
      "type": "string",
      "description": "Additional clinical notes or observations."
    }
  },
  "required": [
    "patient",
    "visit_date",
    "provider",
    "diagnoses"
  ],
  "additionalProperties": false
}