Skip to content

JSON Schema V2

Do Le Long An edited this page Aug 20, 2024 · 1 revision

JSON Schema Documentation

This JSON schema defines the structure of patient information in a medical record. The schema is used to ensure that the data follows a specific format, making it easier to manage and validate.

Schema Structure

Example

  • Mock Data
void main() {
  runApp(MaterialApp(
    home: PatientDataDisplay(
      patientData: {
        "patient_name": "John Doe",
        "patient_dob": "01/01/90",
        "patient_gender": "Male",
        "Demographics_of_patient": {
          "Marital_status": "Single",
          "Ethnicity": "Caucasian",
          "Occupation": "Engineer",
        },
        "Past_medical_history": {
          "Medical_history": "Hypertension",
          "Surgical_history": "Appendectomy",
        },
        "Current_medications_and_drug_allergies": {
          "Drug_allergy": "Penicillin",
          "Prescribed_medications": "Lisinopril",
          "Recently_prescribed_medications": "Amlodipine",
        },
        "Mental_state_examination": {
          "Appearance_and_behavior": "Calm and cooperative",
          "Speech_and_thoughts": "Clear and coherent",
          "Mood": "Stable",
          "Thoughts": "Positive",
        },
        "Physical_examination": {
          "Blood_pressure": "120/80 mmHg",
          "Pulse_rate": "72 bpm",
          "Temperature": "98.6 F",
        },
        "note": "Patient is responding well to treatment.",
      },
    ),
  ));
}
  • Mock Widget
import 'package:flutter/material.dart';

class PatientDataDisplay extends StatelessWidget {
  final Map<String, dynamic> patientData;

  PatientDataDisplay({required this.patientData});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Patient Information"),
      ),
      body: ListView(
        children: [
          ListTile(
            title: Text("Patient Name"),
            subtitle: Text(patientData["patient_name"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Date of Birth"),
            subtitle: Text(patientData["patient_dob"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Gender"),
            subtitle: Text(patientData["patient_gender"] ?? "N/A"),
          ),
          // Demographics of Patient
          ListTile(
            title: Text("Marital Status"),
            subtitle: Text(patientData["Demographics_of_patient"]?["Marital_status"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Ethnicity"),
            subtitle: Text(patientData["Demographics_of_patient"]?["Ethnicity"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Occupation"),
            subtitle: Text(patientData["Demographics_of_patient"]?["Occupation"] ?? "N/A"),
          ),
          // Past Medical History
          ListTile(
            title: Text("Medical History"),
            subtitle: Text(patientData["Past_medical_history"]?["Medical_history"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Surgical History"),
            subtitle: Text(patientData["Past_medical_history"]?["Surgical_history"] ?? "N/A"),
          ),
          // Current Medications and Drug Allergies
          ListTile(
            title: Text("Drug Allergy"),
            subtitle: Text(patientData["Current_medications_and_drug_allergies"]?["Drug_allergy"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Prescribed Medications"),
            subtitle: Text(patientData["Current_medications_and_drug_allergies"]?["Prescribed_medications"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Recently Prescribed Medications"),
            subtitle: Text(patientData["Current_medications_and_drug_allergies"]?["Recently_prescribed_medications"] ?? "N/A"),
          ),
          // Mental State Examination
          ListTile(
            title: Text("Appearance and Behavior"),
            subtitle: Text(patientData["Mental_state_examination"]?["Appearance_and_behavior"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Speech and Thoughts"),
            subtitle: Text(patientData["Mental_state_examination"]?["Speech_and_thoughts"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Mood"),
            subtitle: Text(patientData["Mental_state_examination"]?["Mood"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Thoughts"),
            subtitle: Text(patientData["Mental_state_examination"]?["Thoughts"] ?? "N/A"),
          ),
          // Physical Examination
          ListTile(
            title: Text("Blood Pressure"),
            subtitle: Text(patientData["Physical_examination"]?["Blood_pressure"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Pulse Rate"),
            subtitle: Text(patientData["Physical_examination"]?["Pulse_rate"] ?? "N/A"),
          ),
          ListTile(
            title: Text("Temperature"),
            subtitle: Text(patientData["Physical_examination"]?["Temperature"] ?? "N/A"),
          ),
          // Additional Notes
          ListTile(
            title: Text("Note"),
            subtitle: Text(patientData["note"] ?? "N/A"),
          ),
        ],
      ),
    );
  }
}

Root Object

  • Type: object
  • Properties:
    • patient_name: The name of the patient.
      • Type: string
    • patient_dob: The date of birth of the patient in the format MM/DD/YY.
      • Type: string
      • Pattern: ^\d{2}/\d{2}/\d{2}$
    • patient_gender: The gender of the patient.
      • Type: string
    • Demographics_of_patient: Demographic information of the patient.
      • Type: object
      • Properties:
        • Marital_status: Marital status of the patient.
          • Type: string
        • Ethnicity: Ethnicity of the patient.
          • Type: string
        • Occupation: Occupation of the patient.
          • Type: string
    • Past_medical_history: The medical history of the patient.
      • Type: object
      • Properties:
        • Medical_history: A summary of the patient's medical history.
          • Type: string
        • Surgical_history: A summary of the patient's surgical history.
          • Type: string
    • Current_medications_and_drug_allergies: Current medications and drug allergies of the patient.
      • Type: object
      • Properties:
        • Drug_allergy: Known drug allergies.
          • Type: string
        • Prescribed_medications: Medications currently prescribed to the patient.
          • Type: string
        • Recently_prescribed_medications: Medications recently prescribed to the patient.
          • Type: string
    • Mental_state_examination: The mental state examination of the patient.
      • Type: object
      • Properties:
        • Appearance_and_behavior: Description of the patient's appearance and behavior.
          • Type: string
        • Speech_and_thoughts: Description of the patient's speech and thoughts.
          • Type: string
        • Mood: Description of the patient's mood.
          • Type: string
        • Thoughts: Description of the patient's thoughts.
          • Type: string
    • Physical_examination: The physical examination results of the patient.
      • Type: object
      • Properties:
        • Blood_pressure: The patient's blood pressure.
          • Type: string
        • Pulse_rate: The patient's pulse rate.
          • Type: string
        • Temperature: The patient's body temperature.
          • Type: string
    • note: Any additional notes related to the patient's health.
      • Type: string

Required Properties

The following properties are required in the JSON object:

  • patient_name
  • patient_gender
  • Demographics_of_patient
  • Past_medical_history
  • Current_medications_and_drug_allergies
  • Mental_state_examination
  • Physical_examination
  • note

This schema ensures that all essential patient information is captured and structured in a consistent format.