package models

type DialysisParameter 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"`
	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
	BedId        int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
	PatientId    int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
	ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
	ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
	ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
	ModeId       int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
	Status       int64 `gorm:"column:status" json:"status" form:"status"`
	CreatedTime  int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
	UpdatedTime  int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`

	MonitorPatients MonitorPatients `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            MonitorDialysisOrder    `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
	Prescription             DialysisPrescription    `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"prescription"`
	AssessmentBeforeDislysis PredialysisEvaluation   `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"assessment_before_dislysis"`
	AssessmentAfterDislysis  AssessmentAfterDislysis `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"assessment_after_dislysis"`
	MonitoringRecord         []MonitoringRecord      `gorm:"ForeignKey:MonitoringDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"monitoring_record"`
}

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

type XtWarehouseOutInfo struct {
	ID                      int64   `gorm:"column:id" json:"id" form:"id"`
	WarehouseOutId          int64   `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
	GoodId                  int64   `gorm:"column:good_id" json:"good_id" form:"good_id"`
	GoodTypeId              int64   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
	WarehousingOutTarget    int64   `gorm:"column:warehousing_out_target" json:"warehousing_out_target" form:"warehousing_out_target"`
	Count                   int64   `gorm:"column:count" json:"count" form:"count"`
	Price                   float64 `gorm:"column:price" json:"price" form:"price"`
	TotalPrice              float64 `gorm:"column:total_price" json:"total_price" form:"total_price"`
	ProductDate             int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
	ExpiryDate              int64   `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
	Mtime                   int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
	Ctime                   int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
	Status                  int64   `gorm:"column:status" json:"status" form:"status"`
	OrgId                   int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
	Remark                  string  `gorm:"column:remark" json:"remark" form:"remark"`
	IsCancel                int64   `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
	WarehouseOutOrderNumber string  `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
	Type                    int64   `gorm:"column:type" json:"type" form:"type"`
	Dealer                  int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
	Manufacturer            int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
	IsSys                   int64   `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
	SysRecordTime           int64   `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
	TypeName                string  `gorm:"column:type_name" json:"type_name" form:"type_name"`
	SpecificationName       string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
}

type XtAutomaticReduceDetail struct {
	ID                      int64  `gorm:"column:id" json:"id" form:"id"`
	WarehouseOutId          int64  `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
	WarehouseOutOrderNumber string `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
	PatientId               int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
	Ctime                   int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
	Mtime                   int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
	Status                  int64  `gorm:"column:status" json:"status" form:"status"`
	RecordTime              int64  `gorm:"column:record_time" json:"record_time" form:"record_time"`
	OrgId                   int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
	GoodId                  int64  `gorm:"column:good_id" json:"good_id" form:"good_id"`
	GoodTypeId              int64  `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
	Count                   int64  `gorm:"column:count" json:"count" form:"count"`
	TypeName                string `gorm:"column:type_name" json:"type_name" form:"type_name"`
	SpecificationName       string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
}

type DialysisPrescriptionCount struct {
	PatientId     int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
	Count         int64 `gorm:"column:count" json:"count" form:"count"`
	OrgId         int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
	RecordDate    int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
	Anticoagulant int64 `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
}

type BloodAutomaticReduceDetail struct {
	ID                      int64  `gorm:"column:id" json:"id" form:"id"`
	WarehouseOutId          int64  `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
	WarehouseOutOrderNumber string `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
	PatientId               int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
	Ctime                   int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
	Mtime                   int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
	Status                  int64  `gorm:"column:status" json:"status" form:"status"`
	RecordTime              int64  `gorm:"column:record_time" json:"record_time" form:"record_time"`
	OrgId                   int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
	GoodId                  int64  `gorm:"column:good_id" json:"good_id" form:"good_id"`
	GoodTypeId              int64  `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
	Count                   int64  `gorm:"column:count" json:"count" form:"count"`
}

func (BloodAutomaticReduceDetail) TableName() string {
	return "xt_automatic_reduce_detail"
}

type XtScheduleTwo struct {
	ID        int64  `gorm:"column:id" json:"id" form:"id"`
	ModeId    int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
	PatientId int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
	Name      string `gorm:"column:name" json:"name" form:"name"`
}

func (XtScheduleTwo) TableName() string {

	return "xt_schedule"
}

type DialysisPrescriptionParameter 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"`
	PatientId                  int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
	Anticoagulant              int64   `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
	AnticoagulantShouji        float64 `gorm:"column:anticoagulant_shouji" json:"anticoagulant_shouji" form:"anticoagulant_shouji"`
	AnticoagulantWeichi        float64 `gorm:"column:anticoagulant_weichi" json:"anticoagulant_weichi" form:"anticoagulant_weichi"`
	AnticoagulantZongliang     float64 `gorm:"column:anticoagulant_zongliang" json:"anticoagulant_zongliang" form:"anticoagulant_zongliang"`
	ModeId                     int64   `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
	TargetUltrafiltration      float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration" form:"target_ultrafiltration"`
	BloodFlowVolume            float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus" form:"dialyzer_perfusion_apparatus"`
}

func (DialysisPrescriptionParameter) TableName() string {

	return "xt_dialysis_prescription"
}

type PredialysisEvaluationParameter 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"`
	DryWeight                   float64 `gorm:"column:dry_weight" json:"dry_weight"`
	WeightAfterLastTransparency float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency"`
	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
	AdditionalWeight            float64 `gorm:"column:additional_weight" json:"additional_weight"`
	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
	SymptomBeforeDialysis       string  `gorm:"column:symptom_before_dialysis" json:"symptom_before_dialysis"`
	SystolicBloodPressure       float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure"`
}

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