package models

type NewVMMonitorDialysisSchedule struct {
	ID           int64 `gorm:"column:id" json:"id"`
	UserOrgId    int64 `gorm:"column:user_org_id" json:"user_org_id"`
	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id"`
	BedId        int64 `gorm:"column:bed_id" json:"bed_id"`
	PatientId    int64 `gorm:"column:patient_id" json:"patient_id"`
	ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date"`
	ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type"`
	ModeId       int64 `gorm:"column:mode_id" json:"mode_id"`
	Status       int64 `gorm:"column:status" json:"status"`

	MonitorPatients VMMonitorPatients `gorm:"ForeignKey:PatientId" json:"patient"`
	DeviceNumber    DeviceNumber      `gorm:"ForeignKey:BedId" json:"device_number"`
	DeviceZone      DeviceZone        `gorm:"ForeignKey:PartitionId" json:"device_zone"`
	TreatmentMode   TreatmentMode     `gorm:"ForeignKey:ModeId" json:"treatment_mode"`

	DialysisOrder            VMMonitorDialysisOrder    `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"dialysis_order"`
	Prescription             VMDialysisPrescription    `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"prescription"`
	AssessmentBeforeDislysis VMPredialysisEvaluation   `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_before_dislysis"`
	AssessmentAfterDislysis  VMAssessmentAfterDislysis `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"assessment_after_dislysis"`
	MonitoringRecord         []VMMonitoringRecord      `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
}

func (NewVMMonitorDialysisSchedule) TableName() string {
	return "xt_schedule"
}

type VMMonitorPatients struct {
	ID         int64  `gorm:"column:id" json:"id" form:"id"`
	UserOrgId  int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
	Name       string `gorm:"column:name" json:"name" form:"name"`
	Status     int64  `gorm:"column:status" json:"status" form:"status"`
	DialysisNo string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
}

func (VMMonitorPatients) TableName() string {
	return "xt_patients"
}

type VMMonitorDialysisOrder struct {
	ID           int64        `gorm:"column:id" json:"id"`
	DialysisDate int64        `gorm:"column:dialysis_date" json:"dialysis_date"`
	UserOrgId    int64        `gorm:"column:user_org_id" json:"user_org_id"`
	PatientId    int64        `gorm:"column:patient_id" json:"patient_id"`
	BedID        int64        `gorm:"column:bed_id" json:"bed_id"`
	Status       int64        `gorm:"column:status" json:"status"`
	DeviceNumber DeviceNumber `gorm:"ForeignKey:BedId" json:"device_number"`
}

func (VMMonitorDialysisOrder) TableName() string {
	return "xt_dialysis_order"
}

type VMDialysisPrescription struct {
	ID                    int64   `gorm:"column:id" json:"id"`
	UserOrgId             int64   `gorm:"column:user_org_id" json:"user_org_id"`
	PatientId             int64   `gorm:"column:patient_id" json:"patient_id"`
	Status                int64   `gorm:"column:status" json:"status"`
	RecordDate            int64   `gorm:"column:record_date" json:"record_date"`
	TargetUltrafiltration float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration"`
}

func (VMDialysisPrescription) TableName() string {
	return "xt_dialysis_prescription"
}

type VMPredialysisEvaluation struct {
	ID             int64   `gorm:"column:id" json:"id"`
	UserOrgId      int64   `gorm:"column:user_org_id" json:"user_org_id"`
	PatientId      int64   `gorm:"column:patient_id" json:"patient_id"`
	AssessmentDate int64   `gorm:"column:assessment_date" json:"assessment_date"`
	WeighingBefore float64 `gorm:"column:weighing_before" json:"weighing_before"`
	WeightBefore   float64 `gorm:"column:weight_before" json:"weight_before"`
	Status         int64   `gorm:"column:status" json:"status"`
}

func (VMPredialysisEvaluation) TableName() string {
	return "xt_assessment_before_dislysis"
}

type VMAssessmentAfterDislysis struct {
	ID             int64   `gorm:"column:id" json:"id"`
	UserOrgId      int64   `gorm:"column:user_org_id" json:"user_org_id"`
	PatientId      int64   `gorm:"column:patient_id" json:"patient_id"`
	AssessmentDate int64   `gorm:"column:assessment_date" json:"assessment_date"`
	WeightAfter    float64 `gorm:"column:weight_after" json:"weight_after"`
	Status         int64   `gorm:"column:status" json:"status"`
}

func (VMAssessmentAfterDislysis) TableName() string {
	return "xt_assessment_after_dislysis"
}

type VMMonitoringRecord struct {
	ID                     int64   `gorm:"column:id" json:"id"`
	UserOrgId              int64   `gorm:"column:user_org_id" json:"user_org_id"`
	PatientId              int64   `gorm:"column:patient_id" json:"patient_id"`
	MonitoringDate         int64   `gorm:"column:monitoring_date" json:"monitoring_date"`
	SystolicBloodPressure  float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure"`
	DiastolicBloodPressure float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure"`
	Status                 int64   `gorm:"column:status" json:"status"`
}

func (VMMonitoringRecord) TableName() string {
	return "xt_monitoring_record"
}
