新增上报处方平台接口
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// OrderPrescriptionIcd 订单-处方关联疾病表
|
||||
type OrderPrescriptionIcd struct {
|
||||
PrescriptionIcdId int64 `gorm:"column:prescription_icd_id;type:bigint(19);primary_key;comment:主键id" json:"prescription_icd_id"`
|
||||
OrderPrescriptionId int64 `gorm:"column:order_prescription_id;type:bigint(19);comment:订单-处方id" json:"order_prescription_id"`
|
||||
IcdId int64 `gorm:"column:icd_id;type:bigint(19);comment:疾病id(icd)" json:"icd_id"`
|
||||
IcdName string `gorm:"column:icd_name;type:varchar(255);comment:疾病名称(icd)" json:"icd_name"`
|
||||
IcdCode string `gorm:"column:icd_code;type:varchar(255);comment:icd编码" json:"icd_code"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *OrderPrescriptionIcd) TableName() string {
|
||||
return "gdxz_order_prescription_icd"
|
||||
}
|
||||
|
||||
func (m *OrderPrescriptionIcd) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.PrescriptionIcdId == 0 {
|
||||
m.PrescriptionIcdId = 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,49 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Product 商品表
|
||||
type Product struct {
|
||||
ProductId int64 `gorm:"column:product_id;type:bigint(19);primary_key;comment:主键id" json:"product_id"`
|
||||
ProductPlatformId int64 `gorm:"column:product_platform_id;type:bigint(19);comment:处方平台商品id" json:"product_platform_id"`
|
||||
ProductName string `gorm:"column:product_name;type:varchar(255);comment:商品名称" json:"product_name"`
|
||||
CommonName string `gorm:"column:common_name;type:varchar(100);comment:商品通用名" json:"common_name"`
|
||||
ProductPrice float64 `gorm:"column:product_price;type:decimal(10,2);comment:商品价格" json:"product_price"`
|
||||
MnemonicCode string `gorm:"column:mnemonic_code;type:varchar(50);comment:商品助记码(首字母简拼)" json:"mnemonic_code"`
|
||||
ProductType int `gorm:"column:product_type;type:tinyint(4);default:1;comment:药品类型(0:未知 1:中成药 2:西药)" json:"product_type"`
|
||||
ProductPlatformCode string `gorm:"column:product_platform_code;type:varchar(100);comment:处方平台商品编码" json:"product_platform_code"`
|
||||
ProductPharmacyCode string `gorm:"column:product_pharmacy_code;type:varchar(100);comment:第三方药店商品编码" json:"product_pharmacy_code"`
|
||||
ProductCoverImg string `gorm:"column:product_cover_img;type:varchar(255);comment:商品封面图" json:"product_cover_img"`
|
||||
ProductSpec string `gorm:"column:product_spec;type:varchar(255);comment:商品规格" json:"product_spec"`
|
||||
LicenseNumber string `gorm:"column:license_number;type:varchar(30);comment:批准文号" json:"license_number"`
|
||||
Manufacturer string `gorm:"column:manufacturer;type:varchar(255);comment:生产厂家" json:"manufacturer"`
|
||||
SingleUnit string `gorm:"column:single_unit;type:varchar(50);comment:单次剂量(例:1次1包)" json:"single_unit"`
|
||||
SingleUse string `gorm:"column:single_use;type:varchar(50);comment:单次用法(例:口服)" json:"single_use"`
|
||||
PackagingUnit string `gorm:"column:packaging_unit;type:varchar(20);comment:基本包装单位(例:盒/瓶)" json:"packaging_unit"`
|
||||
FrequencyUse string `gorm:"column:frequency_use;type:varchar(50);comment:使用频率(例:1天3次)" json:"frequency_use"`
|
||||
AvailableDays float64 `gorm:"column:available_days;type:float(10,2);comment:可用天数(3)" json:"available_days"`
|
||||
ProductRemarks string `gorm:"column:product_remarks;type:varchar(255);comment:商品备注" json:"product_remarks"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *Product) TableName() string {
|
||||
return "gdxz_product"
|
||||
}
|
||||
|
||||
func (m *Product) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.ProductId == 0 {
|
||||
m.ProductId = 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"
|
||||
)
|
||||
|
||||
// UserPharmacist 用户-药师表
|
||||
type UserPharmacist struct {
|
||||
PharmacistId int64 `gorm:"column:pharmacist_id;type:bigint(19);primary_key;comment:主键id" json:"pharmacist_id"`
|
||||
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id" json:"user_id"`
|
||||
UserName string `gorm:"column:user_name;type:varchar(50);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"`
|
||||
IsOnline int `gorm:"column:is_online;type:tinyint(1);default:0;comment:是否在线(0:不在线 1:在线)" json:"is_online"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||
PharmacistTitle int `gorm:"column:pharmacist_title;type:tinyint(1);comment:职称" json:"pharmacist_title"`
|
||||
DepartmentCustomId int64 `gorm:"column:department_custom_id;type:bigint(19);comment:科室id-自定义" json:"department_custom_id"`
|
||||
DepartmentCustomName string `gorm:"column:department_custom_name;type:varchar(100);comment:科室名称(如未自己输入,填入标准科室名称)" json:"department_custom_name"`
|
||||
DepartmentCustomMobile string `gorm:"column:department_custom_mobile;type:varchar(30);comment:科室电话" json:"department_custom_mobile"`
|
||||
MedicalInstitution string `gorm:"column:medical_institution;type:varchar(255);comment:医疗机构名称" json:"medical_institution"`
|
||||
WorkerDate string `gorm:"column:worker_date;type:varchar(255);comment:医龄" json:"worker_date"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *UserPharmacist) TableName() string {
|
||||
return "gdxz_user_pharmacist"
|
||||
}
|
||||
|
||||
func (m *UserPharmacist) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.PharmacistId == 0 {
|
||||
m.PharmacistId = 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,46 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// UserPharmacistInfo 药师-详情表
|
||||
type UserPharmacistInfo struct {
|
||||
InfoId int64 `gorm:"column:info_id;type:bigint(19);primary_key;comment:主键id" json:"info_id"`
|
||||
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id" json:"user_id"`
|
||||
PharmacistId int64 `gorm:"column:pharmacist_id;type:bigint(19);comment:药师id" json:"pharmacist_id"`
|
||||
CardType int `gorm:"column:card_type;type:tinyint(1);comment:类型(1:身份证 2:护照 3:港澳通行证 4:台胞证)" json:"card_type"`
|
||||
CardName string `gorm:"column:card_name;type:varchar(30);comment:证件姓名" json:"card_name"`
|
||||
CardNameMask string `gorm:"column:card_name_mask;type:varchar(30);comment:证件姓名(掩码)" json:"card_name_mask"`
|
||||
CardNum string `gorm:"column:card_num;type:varchar(50);comment:证件号码" json:"card_num"`
|
||||
CardNumMask string `gorm:"column:card_num_mask;type:varchar(50);comment:证件号码(掩码)" json:"card_num_mask"`
|
||||
LicenseCert string `gorm:"column:license_cert;type:varchar(255);comment:医师执业证(逗号分隔)" json:"license_cert"`
|
||||
QualificationCert string `gorm:"column:qualification_cert;type:varchar(255);comment:医师资格证(逗号分隔)" json:"qualification_cert"`
|
||||
QualificationCertNum string `gorm:"column:qualification_cert_num;type:varchar(255);comment:医师资格证号(逗号分隔)" json:"qualification_cert_num"`
|
||||
WorkCert string `gorm:"column:work_cert;type:varchar(255);comment:医师工作证(逗号分隔)" json:"work_cert"`
|
||||
MultiPointImages string `gorm:"column:multi_point_images;type:varchar(255);comment:多点执业备案信息(逗号分隔)" json:"multi_point_images"`
|
||||
IdCardFront string `gorm:"column:id_card_front;type:varchar(255);comment:身份证正面图片" json:"id_card_front"`
|
||||
IdCardBack string `gorm:"column:id_card_back;type:varchar(255);comment:身份证背面图片" json:"id_card_back"`
|
||||
SignImage string `gorm:"column:sign_image;type:varchar(255);comment:签名图片" json:"sign_image"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *UserPharmacistInfo) TableName() string {
|
||||
return "gdxz_user_pharmacist_info"
|
||||
}
|
||||
|
||||
func (m *UserPharmacistInfo) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.InfoId == 0 {
|
||||
m.InfoId = 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
|
||||
}
|
||||
Reference in New Issue
Block a user