package models

//药房表
type Pharmary 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"`
	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"`
	RecordDate  int64	`gorm:"column:record_date" json:"record_date" form:"record_date"`
}

func (Pharmary)TableName() string {
	return "sgj_xt.xt_pharmacy"
}

type XtErrs struct {
	OrgId			int64	`gorm:"column:org_id" json:"org_id" form:"org_id"`
	Route			string	`gorm:"column:route" json:"route" form:"route"`
	Parameter		string	`gorm:"column:parameter" json:"parameter" form:"parameter"`
	Text_err		string	`gorm:"column:text_err" json:"text_err" form:"text_err"`
}
func (XtErrs)TableName() string {
	return "sgj_xt.xt_errs"
}

//病人
type TmpPatient struct {
	PatientID int64
	Name string
	DialysisNo string	//透析号
}

//药品信息
type PharmacyContent struct {
	Name string		//名称
	SingleDosage string //单次用量
	Usage string	//用法
	Frequency string //频率
	Days string	//天数
	Total string //总量
	Doctor string	//开立医生
	DataSources string	//数据来源
	Remarks string	//备注
}
//发药明细列表
type DispensingList struct {
	PatientID int64	//	患者id
	Name string	//患者姓名
	DoctorId	int64	//医生id
	DoctorName string	//医生姓名
	RecordTime	int64	//发药时间(转化前)
	RecordDate 	string	//发药时间(转化后)
}
type PrescripDetailsList struct {
	Name string //处方名
	Id int64	//处方id
	Pres []*PrescripDetails
}
//处方详情
type PrescripDetails struct {
	Drugname string		//药品名称
	SingleDosage string //单次用量
	Usage string	//用法
	Frequency string //频率
	Days string	//天数
	Total string //总量
	UnitPrice string//单价
	Remarks string	//备注
}
//临时医嘱
type StatOrder struct {
	StartTime string//开始时间
	Name string//医嘱名称
	Specifications string //药品规格
	PreQuantity string//开药数量
	SingleDosage string//单次用量
	RouteOfAdministration string//给药途径
	ExecutionFrequency string//执行频率
}
//退库用的结构体
type SpecialForStock struct {
	BatchNumber 		string	`json:"batch_number"`
	BatchNumberId		int64	`json:"batch_number_id"`
	Dealer				string	`json:"dealer"`
	DrugId				int64	`json:"drug_id"`
	DrugName			string	`json:"drug_name"`
	DrugType			int64	`json:"drug_type"`
	DrugWarehouseInfo	interface{}	`json:"drug_warehouse_info"`
	ExpiryDate			string	`json:"expiry_date"`
	LastPrice			float64	`json:"last_price"`
	Manufacturer		string	`json:"manufacturer"`
	MaxUnit				string	`json:"max_unit"`
	MinUnit				string	`json:"min_unit"`
	Name 				string	`json:"name"`
	Price 				string	`json:"price"`
	ProductDate			string	`json:"product_date"`
	RegisterAccount		string	`json:"register_account"`
	Remark				string	`json:"remark"`
	RetailPrice			string	`json:"retail_price"`
	ReturnCount			string	`json:"return_count"`

}
//药品发药药品列表
type ListOfDrugs struct {
	ID int64	`json:"id"`		//药品id
	Name string	`json:"name"`	//药品 名称
	Specifications string	`json:"specifications"` //规格
	Stock string	`json:"stock"`  //库存（当前的仓库库存）
}
//病人信息
type PatientInformation struct {
	Id			string  `json:"id"`//hid表示his_doctor_advice_info的id ,xid表示xt_doctor_advice的id
	Name 		string  `json:"name"`//患者姓名
	SingleDosage string	`json:"single_dosage"` //单次用量
	Usage string		`json:"usage"`//用法
	Frequency string `json:"frequency"`//频率
	Days string	`json:"days"`//天数
	Total string `json:"total"`//总量
	DataSources string	`json:"data_sources"`//数据来源
	People	string	`json:"people"`//领药人
}
type HisDoctorAdviceInfoL 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"`
	HisPatientId          int64                  `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
	AdviceType            int64                  `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
	AdviceDate            int64                  `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
	StartTime             int64                  `gorm:"column:start_time" json:"start_time" form:"start_time"`
	AdviceName            string                 `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
	AdviceDesc            string                 `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
	ReminderDate          int64                  `gorm:"column:reminder_date" json:"reminder_date" form:"reminder_date"`
	SingleDose            float64                `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
	SingleDoseUnit        string                 `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
	PrescribingNumber     float64                `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
	PrescribingNumberUnit string                 `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
	DeliveryWay           string                 `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
	ExecutionFrequency    string                 `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
	AdviceDoctor          int64                  `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
	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"`
	AdviceAffirm          string                 `gorm:"column:advice_affirm" json:"advice_affirm" form:"advice_affirm"`
	Remark                string                 `gorm:"column:remark" json:"remark" form:"remark"`
	StopTime              int64                  `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
	StopReason            string                 `gorm:"column:stop_reason" json:"stop_reason" form:"stop_reason"`
	StopDoctor            int64                  `gorm:"column:stop_doctor" json:"stop_doctor" form:"stop_doctor"`
	StopState             int64                  `gorm:"column:stop_state" json:"stop_state" form:"stop_state"`
	ParentId              int64                  `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
	ExecutionTime         int64                  `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
	ExecutionStaff        int64                  `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
	ExecutionState        int64                  `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
	Checker               int64                  `gorm:"column:checker" json:"checker" form:"checker"`
	RecordDate            int64                  `gorm:"column:record_date" json:"record_date" form:"record_date"`
	DialysisOrderId       int64                  `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
	CheckTime             int64                  `gorm:"column:check_time" json:"check_time" form:"check_time"`
	CheckState            int64                  `gorm:"column:check_state" json:"check_state" form:"check_state"`
	DrugSpec              float64                `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
	DrugSpecUnit          string                 `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
	Groupno               int64                  `gorm:"column:groupno" json:"groupno" form:"groupno"`
	RemindType            int64                  `gorm:"column:remind_type" json:"remind_type" form:"remind_type"`
	FrequencyType         int64                  `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
	DayCount              int64                  `gorm:"column:day_count" json:"day_count" form:"day_count"`
	WeekDay               string                 `gorm:"column:week_day" json:"week_day" form:"week_day"`
	TemplateId            string                 `gorm:"column:template_id" json:"template_id" form:"template_id"`
	Modifier              int64                  `gorm:"column:modifier" json:"modifier" form:"modifier"`
	DrugId                int64                  `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
	Price                 float64                `gorm:"column:price" json:"price" form:"price"`
	PrescriptionId        int64                  `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
	MedListCodg           string                 `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
	FeedetlSn             string                 `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
	Day                   int64                  `gorm:"column:day" json:"day" form:"day"`
	Diagnosis             int64                  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
	Way                   int64                  `gorm:"column:way" json:"way" form:"way"`
	HospApprFlag          int64                  `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
	LmtUsedFlag           int64                  `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
	IsMedicine			  int64					 `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
	People				  int64					 `gorm:"column:people" json:"people" form:"people"`
	DispensingTime		  int64					 `gorm:"column:dispensing_time" json:"dispensing_time" form:"dispensing_time"`
}

func (HisDoctorAdviceInfoL) TableName() string {
	return "sgj_xt.his_doctor_advice_info"
}

type XtDoctorAdviceL 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"`
	AdviceType            int64   `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
	AdviceDate            int64   `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
	StartTime             int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
	AdviceName            string  `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
	AdviceDesc            string  `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
	ReminderDate          int64   `gorm:"column:reminder_date" json:"reminder_date" form:"reminder_date"`
	SingleDose            float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
	SingleDoseUnit        string  `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
	PrescribingNumber     float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
	PrescribingNumberUnit string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
	DeliveryWay           string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
	ExecutionFrequency    string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
	AdviceDoctor          int64   `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
	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"`
	AdviceAffirm          string  `gorm:"column:advice_affirm" json:"advice_affirm" form:"advice_affirm"`
	Remark                string  `gorm:"column:remark" json:"remark" form:"remark"`
	StopTime              int64   `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
	StopReason            string  `gorm:"column:stop_reason" json:"stop_reason" form:"stop_reason"`
	StopDoctor            int64   `gorm:"column:stop_doctor" json:"stop_doctor" form:"stop_doctor"`
	StopState             int64   `gorm:"column:stop_state" json:"stop_state" form:"stop_state"`
	ParentId              int64   `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
	ExecutionTime         int64   `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
	ExecutionStaff        int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
	ExecutionState        int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
	Checker               int64   `gorm:"column:checker" json:"checker" form:"checker"`
	RecordDate            int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
	DialysisOrderId       int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
	CheckTime             int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
	CheckState            int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
	DrugSpec              float64 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
	DrugSpecUnit          string  `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
	Groupno               int64   `gorm:"column:groupno" json:"groupno" form:"groupno"`
	RemindType            int64   `gorm:"column:remind_type" json:"remind_type" form:"remind_type"`
	FrequencyType         int64   `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
	DayCount              int64   `gorm:"column:day_count" json:"day_count" form:"day_count"`
	WeekDay               string  `gorm:"column:week_day" json:"week_day" form:"week_day"`
	TemplateId            string  `gorm:"column:template_id" json:"template_id" form:"template_id"`
	UserName              string  `gorm:"column:user_name" json:"user_name" form:"user_name"`
	CheckerName           string  `gorm:"column:user_name" json:"name" form:"name"`
	Modifier              int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
	IsMedicine			  int64	  `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
	People				  int64	  `gorm:"column:people" json:"people" form:"people"`
	DispensingTime		  int64	  `gorm:"column:dispensing_time" json:"dispensing_time" form:"dispensing_time"`
}

func (XtDoctorAdviceL) TableName() string {
	return "sgj_xt.xt_doctor_advice"
}
type TmpTTT struct {
	PatientID int64
}
type TmpLLL struct {
	DrugId    int64
}
type TmpID struct {
	Id    int64
	DispensingTime int64
}
type TmpAdviceDoctor  struct {
	AdviceDoctor    int64
}
