新增问诊病例,患者列表(未完成)
This commit is contained in:
@@ -13,11 +13,11 @@ type OrderInquiryCase struct {
|
||||
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id" json:"patient_id"`
|
||||
OrderInquiryId int64 `gorm:"column:order_inquiry_id;type:bigint(19);comment:订单-问诊id;NOT NULL" json:"order_inquiry_id"`
|
||||
FamilyId int64 `gorm:"column:family_id;type:bigint(19);comment:家庭成员id" json:"family_id"`
|
||||
Relation int `gorm:"column:relation;type:tinyint(1);default:1;comment:与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )" json:"relation"`
|
||||
Status int `gorm:"column:status;type:tinyint(1);default:1;comment:状态(1:正常 2:删除)" json:"status"`
|
||||
Relation *int `gorm:"column:relation;type:tinyint(1);default:1;comment:与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )" json:"relation"`
|
||||
Status *int `gorm:"column:status;type:tinyint(1);default:1;comment:状态(1:正常 2:删除)" json:"status"`
|
||||
Name string `gorm:"column:name;type:varchar(50);comment:患者名称" json:"name"`
|
||||
Sex int `gorm:"column:sex;type:tinyint(1);default:0;comment:患者性别(0:未知 1:男 2:女)" json:"sex"`
|
||||
Age int `gorm:"column:age;type:int(11);comment:患者年龄" json:"age"`
|
||||
Sex *int `gorm:"column:sex;type:tinyint(1);default:0;comment:患者性别(0:未知 1:男 2:女)" json:"sex"`
|
||||
Age *int `gorm:"column:age;type:int(11);comment:患者年龄" json:"age"`
|
||||
Height string `gorm:"column:height;type:varchar(100);comment:身高(cm)" json:"height"`
|
||||
Weight string `gorm:"column:weight;type:varchar(100);comment:体重(kg)" json:"weight"`
|
||||
DiseaseClassId int64 `gorm:"column:disease_class_id;type:bigint(19);comment:疾病分类id-系统" json:"disease_class_id"`
|
||||
@@ -25,13 +25,13 @@ type OrderInquiryCase struct {
|
||||
DiagnosisDate LocalTime `gorm:"column:diagnosis_date;type:datetime;comment:确诊日期" json:"diagnosis_date"`
|
||||
DiseaseDesc string `gorm:"column:disease_desc;type:text;comment:病情描述(主诉)" json:"disease_desc"`
|
||||
DiagnoseImages string `gorm:"column:diagnose_images;type:varchar(1000);comment:复诊凭证(多个使用逗号分隔)" json:"diagnose_images"`
|
||||
IsAllergyHistory int `gorm:"column:is_allergy_history;type:tinyint(1);comment:是否存在过敏史(0:否 1:是)" json:"is_allergy_history"`
|
||||
IsAllergyHistory *int `gorm:"column:is_allergy_history;type:tinyint(1);comment:是否存在过敏史(0:否 1:是)" json:"is_allergy_history"`
|
||||
AllergyHistory string `gorm:"column:allergy_history;type:varchar(255);comment:过敏史描述" json:"allergy_history"`
|
||||
IsFamilyHistory int `gorm:"column:is_family_history;type:tinyint(1);comment:是否存在家族病史(0:否 1:是)" json:"is_family_history"`
|
||||
IsFamilyHistory *int `gorm:"column:is_family_history;type:tinyint(1);comment:是否存在家族病史(0:否 1:是)" json:"is_family_history"`
|
||||
FamilyHistory string `gorm:"column:family_history;type:varchar(255);comment:家族病史描述" json:"family_history"`
|
||||
IsPregnant int `gorm:"column:is_pregnant;type:tinyint(1);comment:是否备孕、妊娠、哺乳期(0:否 1:是)" json:"is_pregnant"`
|
||||
IsPregnant *int `gorm:"column:is_pregnant;type:tinyint(1);comment:是否备孕、妊娠、哺乳期(0:否 1:是)" json:"is_pregnant"`
|
||||
Pregnant string `gorm:"column:pregnant;type:varchar(255);comment:备孕、妊娠、哺乳期描述" json:"pregnant"`
|
||||
IsTaboo int `gorm:"column:is_taboo;type:tinyint(1);comment:是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在" json:"is_taboo"`
|
||||
IsTaboo *int `gorm:"column:is_taboo;type:tinyint(1);comment:是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在" json:"is_taboo"`
|
||||
Model
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// PatientFamilyHealth 患者家庭成员信息表-健康情况
|
||||
type PatientFamilyHealth struct {
|
||||
FamilyHealthId int64 `gorm:"column:family_health_id;type:bigint(19);primary_key;comment:主键id" json:"family_health_id"`
|
||||
FamilyId int64 `gorm:"column:family_id;type:bigint(19);comment:家庭成员id" json:"family_id"`
|
||||
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id" json:"patient_id"`
|
||||
DiseaseClassId int64 `gorm:"column:disease_class_id;type:bigint(19);comment:疾病分类id-系统" json:"disease_class_id"`
|
||||
DiseaseClassName string `gorm:"column:disease_class_name;type:varchar(255);comment:疾病名称-系统" json:"disease_class_name"`
|
||||
DiagnosisDate LocalTime `gorm:"column:diagnosis_date;type:date;comment:确诊日期" json:"diagnosis_date"`
|
||||
DiagnosisHospital string `gorm:"column:diagnosis_hospital;type:varchar(255);comment:确诊医院" json:"diagnosis_hospital"`
|
||||
IsTakeMedicine *int `gorm:"column:is_take_medicine;type:tinyint(1);comment:正在服药(0:否 1:是)" json:"is_take_medicine"`
|
||||
DrugsName string `gorm:"column:drugs_name;type:varchar(255);comment:正在服药名称" json:"drugs_name"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *PatientFamilyHealth) TableName() string {
|
||||
return "gdxz_patient_family_health"
|
||||
}
|
||||
|
||||
func (m *PatientFamilyHealth) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.FamilyHealthId == 0 {
|
||||
m.FamilyHealthId = global.Snowflake.Generate().Int64()
|
||||
}
|
||||
|
||||
m.CreatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
|
||||
|
||||
m.UpdatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// PatientFamilyPersonal 患者家庭成员信息表-个人情况
|
||||
type PatientFamilyPersonal struct {
|
||||
FamilyPersonalId int64 `gorm:"column:family_personal_id;type:bigint(19);primary_key;comment:主键id" json:"family_personal_id"`
|
||||
FamilyId int64 `gorm:"column:family_id;type:bigint(19);comment:信息表id" json:"family_id"`
|
||||
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id" json:"patient_id"`
|
||||
IsAllergyHistory *int `gorm:"column:is_allergy_history;type:tinyint(1);comment:是否存在过敏史(0:否 1:是)" json:"is_allergy_history"`
|
||||
AllergyHistory string `gorm:"column:allergy_history;type:varchar(255);comment:过敏史描述" json:"allergy_history"`
|
||||
IsFamilyHistory *int `gorm:"column:is_family_history;type:tinyint(1);comment:是否存在家族病史(0:否 1:是)" json:"is_family_history"`
|
||||
FamilyHistory string `gorm:"column:family_history;type:varchar(255);comment:家族病史描述" json:"family_history"`
|
||||
IsPregnant *int `gorm:"column:is_pregnant;type:tinyint(1);comment:是否备孕、妊娠、哺乳期(0:否 1:是)" json:"is_pregnant"`
|
||||
Pregnant string `gorm:"column:pregnant;type:varchar(255);comment:备孕、妊娠、哺乳期描述" json:"pregnant"`
|
||||
IsOperation *int `gorm:"column:is_operation;type:tinyint(1);comment:是否存在手术(0:否 1:是)" json:"is_operation"`
|
||||
Operation string `gorm:"column:operation;type:varchar(255);comment:手术描述" json:"operation"`
|
||||
DrinkWineStatus *int `gorm:"column:drink_wine_status;type:tinyint(1);comment:饮酒状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒酒)" json:"drink_wine_status"`
|
||||
SmokeStatus *int `gorm:"column:smoke_status;type:tinyint(1);comment:吸烟状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒烟)" json:"smoke_status"`
|
||||
ChemicalCompoundStatus *int `gorm:"column:chemical_compound_status;type:tinyint(1);comment:化合物状态(1:从不 2:偶尔 3:经常 4:每天)" json:"chemical_compound_status"`
|
||||
ChemicalCompoundDescribe string `gorm:"column:chemical_compound_describe;type:varchar(255);comment:化合物描述" json:"chemical_compound_describe"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *PatientFamilyPersonal) TableName() string {
|
||||
return "gdxz_patient_family_personal"
|
||||
}
|
||||
|
||||
func (m *PatientFamilyPersonal) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.FamilyPersonalId == 0 {
|
||||
m.FamilyPersonalId = global.Snowflake.Generate().Int64()
|
||||
}
|
||||
|
||||
m.CreatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
|
||||
|
||||
m.UpdatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
|
||||
|
||||
return nil
|
||||
}
|
||||
+11
-10
@@ -8,16 +8,17 @@ import (
|
||||
|
||||
// UserPatient 用户-患者表
|
||||
type UserPatient struct {
|
||||
PatientId int64 `gorm:"column:patient_id;type:bigint(19);primary_key;comment:主键id" json:"patient_id"`
|
||||
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id;NOT NULL" json:"user_id"`
|
||||
UserName string `gorm:"column:user_name;type:varchar(100);comment:用户名称" json:"user_name"`
|
||||
OpenId string `gorm:"column:open_id;type:varchar(100);comment:微信open_id" json:"open_id"`
|
||||
UnionId string `gorm:"column:union_id;type:varchar(100);comment:微信开放平台唯一标识" json:"union_id"`
|
||||
WxSessionKey string `gorm:"column:wx_session_key;type:varchar(255);comment:微信会话密钥" json:"wx_session_key"`
|
||||
Status int `gorm:"column:status;type:tinyint(1);default:1;comment:状态(0:禁用 1:正常 2:删除)" json:"status"`
|
||||
IdcardStatus int `gorm:"column:idcard_status;type:tinyint(1);default:0;comment:实名认证状态(0:未认证 1:认证通过 2:认证失败)" json:"idcard_status"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||
User *User `gorm:"foreignKey:UserId;references:user_id" json:"user"` // 用户
|
||||
PatientId int64 `gorm:"column:patient_id;type:bigint(19);primary_key;comment:主键id" json:"patient_id"`
|
||||
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id;NOT NULL" json:"user_id"`
|
||||
UserName string `gorm:"column:user_name;type:varchar(100);comment:用户名称" json:"user_name"`
|
||||
OpenId string `gorm:"column:open_id;type:varchar(100);comment:微信open_id" json:"open_id"`
|
||||
UnionId string `gorm:"column:union_id;type:varchar(100);comment:微信开放平台唯一标识" json:"union_id"`
|
||||
WxSessionKey string `gorm:"column:wx_session_key;type:varchar(255);comment:微信会话密钥" json:"wx_session_key"`
|
||||
Status int `gorm:"column:status;type:tinyint(1);default:1;comment:状态(0:禁用 1:正常 2:删除)" json:"status"`
|
||||
IdcardStatus int `gorm:"column:idcard_status;type:tinyint(1);default:0;comment:实名认证状态(0:未认证 1:认证通过 2:认证失败)" json:"idcard_status"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||
User *User `gorm:"foreignKey:UserId;references:user_id" json:"user"` // 用户
|
||||
PatientFamily []*PatientFamily `gorm:"foreignKey:PatientId;references:patient_id" json:"patient_family"` // 家庭成员
|
||||
Model
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user