{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mednode-in/json-schema/mednode-in-prescription-response-schema.json",
  "title": "PrescriptionResponse",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mednode-in-openapi.json#/components/schemas/PrescriptionResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "doctor_user_id": {
      "type": "integer",
      "title": "Doctor User Id"
    },
    "patient_user_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Patient User Id"
    },
    "patient_name": {
      "type": "string",
      "title": "Patient Name"
    },
    "patient_phone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Patient Phone"
    },
    "patient_age": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Patient Age"
    },
    "patient_gender": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Patient Gender"
    },
    "appointment_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appointment Id"
    },
    "diagnosis": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Diagnosis"
    },
    "vitals": {
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vitals"
    },
    "allergies_note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Allergies Note"
    },
    "rx_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rx Number"
    },
    "medications": {
      "items": {
        "$ref": "#/$defs/PrescriptionMedLine"
      },
      "type": "array",
      "title": "Medications"
    },
    "instructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instructions"
    },
    "follow_up_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Follow Up Date"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "expiry_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expiry Date"
    },
    "renewal_requested": {
      "type": "boolean",
      "title": "Renewal Requested",
      "default": false
    },
    "safety_check": {
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Safety Check"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "doctor_user_id",
    "patient_name",
    "status",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "PrescriptionMedLine": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "dosage": {
          "type": "string",
          "title": "Dosage"
        },
        "frequency": {
          "type": "string",
          "title": "Frequency"
        },
        "duration": {
          "type": "string",
          "title": "Duration"
        },
        "route": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Route"
        },
        "meal_timing": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Meal Timing"
        },
        "instructions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Instructions"
        }
      },
      "type": "object",
      "required": [
        "name",
        "dosage",
        "frequency",
        "duration"
      ],
      "title": "PrescriptionMedLine"
    }
  }
}