|
@@ -6,6 +6,7 @@ import (
|
6
|
6
|
"github.com/jinzhu/gorm"
|
7
|
7
|
"math"
|
8
|
8
|
"strconv"
|
|
9
|
+ "strings"
|
9
|
10
|
"time"
|
10
|
11
|
)
|
11
|
12
|
|
|
@@ -486,82 +487,83 @@ func GetAllProject(id int64) (pre []*models.HisPrescriptionProject) {
|
486
|
487
|
//}
|
487
|
488
|
|
488
|
489
|
type HisOrderTen struct {
|
489
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
490
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
491
|
|
- HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
492
|
|
- SettleAccountsDate int64 `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
|
493
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
494
|
|
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
495
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
496
|
|
- Number string `gorm:"column:number" json:"number" form:"number"`
|
497
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
498
|
|
- Infcode int64 `gorm:"column:infcode" json:"infcode" form:"infcode"`
|
499
|
|
- WarnMsg string `gorm:"column:warn_msg" json:"warn_msg" form:"warn_msg"`
|
500
|
|
- Cainfo string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
|
501
|
|
- ErrMsg string `gorm:"column:err_msg" json:"err_msg" form:"err_msg"`
|
502
|
|
- RespondTime string `gorm:"column:respond_time" json:"respond_time" form:"respond_time"`
|
503
|
|
- InfRefmsgid string `gorm:"column:inf_refmsgid" json:"inf_refmsgid" form:"inf_refmsgid"`
|
504
|
|
- OrderStatus int64 `gorm:"column:order_status" json:"order_status" form:"order_status"`
|
505
|
|
- MdtrtId string `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
|
506
|
|
- SetlId string `gorm:"column:setl_id" json:"setl_id" form:"setl_id"`
|
507
|
|
- PsnNo string `gorm:"column:psn_no" json:"psn_no" form:"psn_no"`
|
508
|
|
- PsnName string `gorm:"column:psn_name" json:"psn_name" form:"psn_name"`
|
509
|
|
- PsnCertType string `gorm:"column:psn_cert_type" json:"psn_cert_type" form:"psn_cert_type"`
|
510
|
|
- Certno string `gorm:"column:certno" json:"certno" form:"certno"`
|
511
|
|
- Gend string `gorm:"column:gend" json:"gend" form:"gend"`
|
512
|
|
- Naty string `gorm:"column:naty" json:"naty" form:"naty"`
|
513
|
|
- Brdy time.Time `gorm:"column:brdy" json:"brdy" form:"brdy"`
|
514
|
|
- Age float64 `gorm:"column:age" json:"age" form:"age"`
|
515
|
|
- Insutype string `gorm:"column:insutype" json:"insutype" form:"insutype"`
|
516
|
|
- PsnType string `gorm:"column:psn_type" json:"psn_type" form:"psn_type"`
|
517
|
|
- CvlservFlag string `gorm:"column:cvlserv_flag" json:"cvlserv_flag" form:"cvlserv_flag"`
|
518
|
|
- SetlTime string `gorm:"column:setl_time" json:"setl_time" form:"setl_time"`
|
519
|
|
- MdtrtCertType string `gorm:"column:mdtrt_cert_type" json:"mdtrt_cert_type" form:"mdtrt_cert_type"`
|
520
|
|
- MedType string `gorm:"column:med_type" json:"med_type" form:"med_type"`
|
521
|
|
- MedfeeSumamt float64 `gorm:"column:medfee_sumamt" json:"medfee_sumamt" form:"medfee_sumamt"`
|
522
|
|
- FulamtOwnpayAmt float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
|
523
|
|
- OverlmtSelfPay float64 `gorm:"column:overlmt_self_pay" json:"overlmt_self_pay" form:"overlmt_self_pay"`
|
524
|
|
- PreselfpayAmt float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
|
525
|
|
- InscpScpAmt float64 `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
|
526
|
|
- ActPayDedc float64 `gorm:"column:act_pay_dedc" json:"act_pay_dedc" form:"act_pay_dedc"`
|
527
|
|
- HifpPay float64 `gorm:"column:hifp_pay" json:"hifp_pay" form:"hifp_pay"`
|
528
|
|
- CvlservPay float64 `gorm:"column:cvlserv_pay" json:"cvlserv_pay" form:"cvlserv_pay"`
|
529
|
|
- PoolPropSelfpay float64 `gorm:"column:pool_prop_selfpay" json:"pool_prop_selfpay" form:"pool_prop_selfpay"`
|
530
|
|
- HifesPay float64 `gorm:"column:hifes_pay" json:"hifes_pay" form:"hifes_pay"`
|
531
|
|
- HifmiPay float64 `gorm:"column:hifmi_pay" json:"hifmi_pay" form:"hifmi_pay"`
|
532
|
|
- HifobPay float64 `gorm:"column:hifob_pay" json:"hifob_pay" form:"hifob_pay"`
|
533
|
|
- MafPay float64 `gorm:"column:maf_pay" json:"maf_pay" form:"maf_pay"`
|
534
|
|
- OthPay float64 `gorm:"column:oth_pay" json:"oth_pay" form:"oth_pay"`
|
535
|
|
- FundPaySumamt float64 `gorm:"column:fund_pay_sumamt" json:"fund_pay_sumamt" form:"fund_pay_sumamt"`
|
536
|
|
- PsnPartAmt float64 `gorm:"column:psn_part_amt" json:"psn_part_amt" form:"psn_part_amt"`
|
537
|
|
- AcctPay float64 `gorm:"column:acct_pay" json:"acct_pay" form:"acct_pay"`
|
538
|
|
- PsnCashPay float64 `gorm:"column:psn_cash_pay" json:"psn_cash_pay" form:"psn_cash_pay"`
|
539
|
|
- HospPartAmt float64 `gorm:"column:hosp_part_amt" json:"hosp_part_amt" form:"hosp_part_amt"`
|
540
|
|
- Balc float64 `gorm:"column:balc" json:"balc" form:"balc"`
|
541
|
|
- AcctMulaidPay float64 `gorm:"column:acct_mulaid_pay" json:"acct_mulaid_pay" form:"acct_mulaid_pay"`
|
542
|
|
- MedinsSetlId string `gorm:"column:medins_setl_id" json:"medins_setl_id" form:"medins_setl_id"`
|
543
|
|
- ClrOptins string `gorm:"column:clr_optins" json:"clr_optins" form:"clr_optins"`
|
544
|
|
- ClrWay string `gorm:"column:clr_way" json:"clr_way" form:"clr_way"`
|
545
|
|
- ClrType string `gorm:"column:clr_type" json:"clr_type" form:"clr_type"`
|
546
|
|
- SetlDetail string `gorm:"column:setl_detail" json:"setl_detail" form:"setl_detail"`
|
547
|
|
- IsMedicineInsurance int64 `gorm:"column:is_medicine_insurance" json:"is_medicine_insurance" form:"is_medicine_insurance"`
|
548
|
|
- PayWay int64 `gorm:"column:pay_way" json:"pay_way" form:"pay_way"`
|
549
|
|
- PayPrice float64 `gorm:"column:pay_price" json:"pay_price" form:"pay_price"`
|
550
|
|
- PayCardNo string `gorm:"column:pay_card_no" json:"pay_card_no" form:"pay_card_no"`
|
551
|
|
- DiscountPrice float64 `gorm:"column:discount_price" json:"discount_price" form:"discount_price"`
|
552
|
|
- PreferentialPrice float64 `gorm:"column:preferential_price" json:"preferential_price" form:"preferential_price"`
|
553
|
|
- RealityPrice float64 `gorm:"column:reality_price" json:"reality_price" form:"reality_price"`
|
554
|
|
- FoundPrice float64 `gorm:"column:found_price" json:"found_price" form:"found_price"`
|
555
|
|
- MedicalInsurancePrice float64 `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
|
556
|
|
- PrivatePrice float64 `gorm:"column:private_price" json:"private_price" form:"private_price"`
|
557
|
|
- DepartmentName string `gorm:"-" json:"department_name" form:"department_name"`
|
558
|
|
- DoctorName string `gorm:"-" json:"doctor_name" form:"doctor_name"`
|
559
|
|
- Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
560
|
|
- PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
561
|
|
- Decimal float64 `gorm:"column:decimal" json:"decimal" form:"decimal"`
|
562
|
|
- //VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:OrderNumber;AssociationForeignKey:Number" json:"info"`
|
563
|
|
- HisPrescriptionTen []*HisPrescriptionTen `gorm:"ForeignKey:BatchNumber;AssociationForeignKey:Number" json:"info"`
|
564
|
|
- Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
|
490
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
491
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
492
|
+ HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
|
493
|
+ SettleAccountsDate int64 `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
|
|
494
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
|
495
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
|
496
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
497
|
+ Number string `gorm:"column:number" json:"number" form:"number"`
|
|
498
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
499
|
+ Infcode int64 `gorm:"column:infcode" json:"infcode" form:"infcode"`
|
|
500
|
+ WarnMsg string `gorm:"column:warn_msg" json:"warn_msg" form:"warn_msg"`
|
|
501
|
+ Cainfo string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
|
|
502
|
+ ErrMsg string `gorm:"column:err_msg" json:"err_msg" form:"err_msg"`
|
|
503
|
+ RespondTime string `gorm:"column:respond_time" json:"respond_time" form:"respond_time"`
|
|
504
|
+ InfRefmsgid string `gorm:"column:inf_refmsgid" json:"inf_refmsgid" form:"inf_refmsgid"`
|
|
505
|
+ OrderStatus int64 `gorm:"column:order_status" json:"order_status" form:"order_status"`
|
|
506
|
+ MdtrtId string `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
|
|
507
|
+ SetlId string `gorm:"column:setl_id" json:"setl_id" form:"setl_id"`
|
|
508
|
+ PsnNo string `gorm:"column:psn_no" json:"psn_no" form:"psn_no"`
|
|
509
|
+ PsnName string `gorm:"column:psn_name" json:"psn_name" form:"psn_name"`
|
|
510
|
+ PsnCertType string `gorm:"column:psn_cert_type" json:"psn_cert_type" form:"psn_cert_type"`
|
|
511
|
+ Certno string `gorm:"column:certno" json:"certno" form:"certno"`
|
|
512
|
+ Gend string `gorm:"column:gend" json:"gend" form:"gend"`
|
|
513
|
+ Naty string `gorm:"column:naty" json:"naty" form:"naty"`
|
|
514
|
+ Brdy time.Time `gorm:"column:brdy" json:"brdy" form:"brdy"`
|
|
515
|
+ Age float64 `gorm:"column:age" json:"age" form:"age"`
|
|
516
|
+ Insutype string `gorm:"column:insutype" json:"insutype" form:"insutype"`
|
|
517
|
+ PsnType string `gorm:"column:psn_type" json:"psn_type" form:"psn_type"`
|
|
518
|
+ CvlservFlag string `gorm:"column:cvlserv_flag" json:"cvlserv_flag" form:"cvlserv_flag"`
|
|
519
|
+ SetlTime string `gorm:"column:setl_time" json:"setl_time" form:"setl_time"`
|
|
520
|
+ MdtrtCertType string `gorm:"column:mdtrt_cert_type" json:"mdtrt_cert_type" form:"mdtrt_cert_type"`
|
|
521
|
+ MedType string `gorm:"column:med_type" json:"med_type" form:"med_type"`
|
|
522
|
+ MedfeeSumamt float64 `gorm:"column:medfee_sumamt" json:"medfee_sumamt" form:"medfee_sumamt"`
|
|
523
|
+ FulamtOwnpayAmt float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
|
|
524
|
+ OverlmtSelfPay float64 `gorm:"column:overlmt_self_pay" json:"overlmt_self_pay" form:"overlmt_self_pay"`
|
|
525
|
+ PreselfpayAmt float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
|
|
526
|
+ InscpScpAmt float64 `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
|
|
527
|
+ ActPayDedc float64 `gorm:"column:act_pay_dedc" json:"act_pay_dedc" form:"act_pay_dedc"`
|
|
528
|
+ HifpPay float64 `gorm:"column:hifp_pay" json:"hifp_pay" form:"hifp_pay"`
|
|
529
|
+ CvlservPay float64 `gorm:"column:cvlserv_pay" json:"cvlserv_pay" form:"cvlserv_pay"`
|
|
530
|
+ PoolPropSelfpay float64 `gorm:"column:pool_prop_selfpay" json:"pool_prop_selfpay" form:"pool_prop_selfpay"`
|
|
531
|
+ HifesPay float64 `gorm:"column:hifes_pay" json:"hifes_pay" form:"hifes_pay"`
|
|
532
|
+ HifmiPay float64 `gorm:"column:hifmi_pay" json:"hifmi_pay" form:"hifmi_pay"`
|
|
533
|
+ HifobPay float64 `gorm:"column:hifob_pay" json:"hifob_pay" form:"hifob_pay"`
|
|
534
|
+ MafPay float64 `gorm:"column:maf_pay" json:"maf_pay" form:"maf_pay"`
|
|
535
|
+ OthPay float64 `gorm:"column:oth_pay" json:"oth_pay" form:"oth_pay"`
|
|
536
|
+ FundPaySumamt float64 `gorm:"column:fund_pay_sumamt" json:"fund_pay_sumamt" form:"fund_pay_sumamt"`
|
|
537
|
+ PsnPartAmt float64 `gorm:"column:psn_part_amt" json:"psn_part_amt" form:"psn_part_amt"`
|
|
538
|
+ AcctPay float64 `gorm:"column:acct_pay" json:"acct_pay" form:"acct_pay"`
|
|
539
|
+ PsnCashPay float64 `gorm:"column:psn_cash_pay" json:"psn_cash_pay" form:"psn_cash_pay"`
|
|
540
|
+ HospPartAmt float64 `gorm:"column:hosp_part_amt" json:"hosp_part_amt" form:"hosp_part_amt"`
|
|
541
|
+ Balc float64 `gorm:"column:balc" json:"balc" form:"balc"`
|
|
542
|
+ AcctMulaidPay float64 `gorm:"column:acct_mulaid_pay" json:"acct_mulaid_pay" form:"acct_mulaid_pay"`
|
|
543
|
+ MedinsSetlId string `gorm:"column:medins_setl_id" json:"medins_setl_id" form:"medins_setl_id"`
|
|
544
|
+ ClrOptins string `gorm:"column:clr_optins" json:"clr_optins" form:"clr_optins"`
|
|
545
|
+ ClrWay string `gorm:"column:clr_way" json:"clr_way" form:"clr_way"`
|
|
546
|
+ ClrType string `gorm:"column:clr_type" json:"clr_type" form:"clr_type"`
|
|
547
|
+ SetlDetail string `gorm:"column:setl_detail" json:"setl_detail" form:"setl_detail"`
|
|
548
|
+ IsMedicineInsurance int64 `gorm:"column:is_medicine_insurance" json:"is_medicine_insurance" form:"is_medicine_insurance"`
|
|
549
|
+ PayWay int64 `gorm:"column:pay_way" json:"pay_way" form:"pay_way"`
|
|
550
|
+ PayPrice float64 `gorm:"column:pay_price" json:"pay_price" form:"pay_price"`
|
|
551
|
+ PayCardNo string `gorm:"column:pay_card_no" json:"pay_card_no" form:"pay_card_no"`
|
|
552
|
+ DiscountPrice float64 `gorm:"column:discount_price" json:"discount_price" form:"discount_price"`
|
|
553
|
+ PreferentialPrice float64 `gorm:"column:preferential_price" json:"preferential_price" form:"preferential_price"`
|
|
554
|
+ RealityPrice float64 `gorm:"column:reality_price" json:"reality_price" form:"reality_price"`
|
|
555
|
+ FoundPrice float64 `gorm:"column:found_price" json:"found_price" form:"found_price"`
|
|
556
|
+ MedicalInsurancePrice float64 `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
|
|
557
|
+ PrivatePrice float64 `gorm:"column:private_price" json:"private_price" form:"private_price"`
|
|
558
|
+ DepartmentName string `gorm:"-" json:"department_name" form:"department_name"`
|
|
559
|
+ DoctorName string `gorm:"-" json:"doctor_name" form:"doctor_name"`
|
|
560
|
+ Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
|
561
|
+ PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
|
562
|
+ Decimal float64 `gorm:"column:decimal" json:"decimal" form:"decimal"`
|
|
563
|
+ VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:OrderNumber;AssociationForeignKey:Number" json:"info"`
|
|
564
|
+ //HisPrescriptionTen []*HisPrescriptionTen `gorm:"ForeignKey:BatchNumber;AssociationForeignKey:Number" json:"info"`
|
|
565
|
+ Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
|
566
|
+ CardDesc string `gorm:"card_desc" json:"card_desc" form:"card_desc"`
|
565
|
567
|
}
|
566
|
568
|
|
567
|
569
|
func (HisOrderTen) TableName() string {
|
|
@@ -783,6 +785,7 @@ type HisOrder9504 struct {
|
783
|
785
|
Decimal float64 `gorm:"column:decimal" json:"decimal" form:"decimal"`
|
784
|
786
|
VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:OrderNumber;AssociationForeignKey:Number" json:"info"`
|
785
|
787
|
Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
|
788
|
+ CardDesc string `gorm:"card_desc" json:"card_desc" form:"card_desc"`
|
786
|
789
|
}
|
787
|
790
|
|
788
|
791
|
func (HisOrder9504) TableName() string {
|
|
@@ -907,7 +910,7 @@ func GetHisOrderDetail10138() (order []*HisOrderTen, err error) {
|
907
|
910
|
return db.Where("status = 1 AND order_status = 2").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
908
|
911
|
return db.Where("status = 1").Preload("VMHisProject")
|
909
|
912
|
})
|
910
|
|
- }).Where("setl_time >= '2024-04-01 00:00:00' AND setl_time <= '2024-06-30 23:00:00' AND status = 1 AND order_status =2 AND user_org_id = 10278").Find(&order).Error
|
|
913
|
+ }).Where("setl_time >= '2024-07-01 00:00:00' AND setl_time <= '2024-09-30 23:00:00' AND status = 1 AND order_status =2 AND user_org_id = 10278").Find(&order).Error
|
911
|
914
|
return
|
912
|
915
|
}
|
913
|
916
|
|
|
@@ -941,7 +944,7 @@ func GetHisOrderDetail10106(start_time int64, end_time int64) (order []*HisOrder
|
941
|
944
|
}).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
942
|
945
|
return db.Where("status = 1").Preload("Drug")
|
943
|
946
|
})
|
944
|
|
- }).Where("settle_accounts_date >= ? AND settle_accounts_date <= ? AND status = 1 AND order_status =2 AND user_org_id = 10106", start_time, end_time).Find(&order).Order("setl_time").Error
|
|
947
|
+ }).Where("settle_accounts_date >= ? AND settle_accounts_date <= ? AND status = 1 AND order_status =2 AND user_org_id = 10265", start_time, end_time).Find(&order).Order("setl_time").Error
|
945
|
948
|
return
|
946
|
949
|
}
|
947
|
950
|
|
|
@@ -1252,6 +1255,7 @@ type XtBaseDrugtwo struct {
|
1252
|
1255
|
ZuobiaoId string `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
|
1253
|
1256
|
Bby01 string `gorm:"column:bby01" json:"bby01" form:"bby01"`
|
1254
|
1257
|
Bck01b string `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
|
|
1258
|
+ IsZeroFlag int64 `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
|
1255
|
1259
|
}
|
1256
|
1260
|
|
1257
|
1261
|
func (XtBaseDrugtwo) TableName() string {
|
|
@@ -1399,11 +1403,11 @@ func UpDateNumber(id int64, number string) {
|
1399
|
1403
|
}
|
1400
|
1404
|
|
1401
|
1405
|
func GetOrderinfo(org_id int64) (info []models.HisOrderInfo, err error) {
|
1402
|
|
- err = readDb.Model(&models.HisOrderInfo{}).Where("user_org_id = ? and advice_id = 0 and med_chrgitm_type = '09' and ctime >= 1717344000", org_id).Find(&info).Error
|
|
1406
|
+ err = readDb.Model(&models.HisOrderInfo{}).Where("user_org_id = ? and advice_id = 0 and project_id = 0 and ctime >= 1726675200", org_id).Find(&info).Error
|
1403
|
1407
|
for _, in := range info {
|
1404
|
1408
|
var doc models.HisDoctorAdviceInfo
|
1405
|
|
- readDb.Model(&models.HisDoctorAdviceInfo{}).Where("user_org_id = ? and feedetl_sn = ? and status = 1 and advice_date = 1717344000", org_id, in.FeedetlSn).First(&doc)
|
1406
|
|
- writeDb.Model(&models.HisOrderInfo{}).Where("user_org_id = ? and feedetl_sn = ? and advice_id = 0 and med_chrgitm_type = '09' and ctime >= 1717344000", org_id, doc.FeedetlSn).Updates(map[string]interface{}{"advice_id": doc.ID})
|
|
1409
|
+ readDb.Model(&models.HisDoctorAdviceInfo{}).Where("user_org_id = ? and feedetl_sn = ? and status = 1 and advice_date >= 1726675200", org_id, in.FeedetlSn).First(&doc)
|
|
1410
|
+ writeDb.Model(&models.HisOrderInfo{}).Where("user_org_id = ? and feedetl_sn = ? and advice_id = 0 and project_id = 0 and ctime >= 1726675200", org_id, doc.FeedetlSn).Updates(map[string]interface{}{"advice_id": doc.ID})
|
1407
|
1411
|
}
|
1408
|
1412
|
return
|
1409
|
1413
|
}
|
|
@@ -1426,7 +1430,6 @@ type Result22 struct {
|
1426
|
1430
|
}
|
1427
|
1431
|
|
1428
|
1432
|
func Aaa() {
|
1429
|
|
-
|
1430
|
1433
|
var inspections []Result22
|
1431
|
1434
|
readDb.Raw(`
|
1432
|
1435
|
SELECT
|
|
@@ -1457,7 +1460,7 @@ func Aaa() {
|
1457
|
1460
|
JOIN xt_assessment_before_dislysis be
|
1458
|
1461
|
ON be.patient_id = xts.patient_id
|
1459
|
1462
|
AND DATE(FROM_UNIXTIME(xts.inspect_date)) = DATE(FROM_UNIXTIME(be.assessment_date))
|
1460
|
|
- WHERE xts.org_id = 10677 AND xts.item_id = 106770503) xts
|
|
1463
|
+ WHERE xts.org_id = 10677 AND xts.item_id = 106770503 and xts.inspect_date >= 1725120000) xts
|
1461
|
1464
|
JOIN
|
1462
|
1465
|
(SELECT
|
1463
|
1466
|
DATE(FROM_UNIXTIME(xt.inspect_date)) AS inspect_date,
|
|
@@ -1474,7 +1477,7 @@ func Aaa() {
|
1474
|
1477
|
JOIN xt_assessment_after_dislysis ad
|
1475
|
1478
|
ON DATE(FROM_UNIXTIME(xt.inspect_date)) = DATE(FROM_UNIXTIME(ad.assessment_date))
|
1476
|
1479
|
AND xt.patient_id = ad.patient_id
|
1477
|
|
- WHERE xt.org_id = 10677 AND xt.item_id = 106771301
|
|
1480
|
+ WHERE xt.org_id = 10677 AND xt.item_id = 106771301 and xt.inspect_date >= 1725120000
|
1478
|
1481
|
AND ad.weight_after > 0
|
1479
|
1482
|
AND ad.actual_ultrafiltration > 0) b
|
1480
|
1483
|
ON xts.inspect_date = b.inspect_date
|
|
@@ -1611,3 +1614,47 @@ func Aaa() {
|
1611
|
1614
|
writeDb.Create(&ins9)
|
1612
|
1615
|
}
|
1613
|
1616
|
}
|
|
1617
|
+
|
|
1618
|
+func GetOrder11111() {
|
|
1619
|
+ var info []models.HisOrder
|
|
1620
|
+ err = readDb.Model(&models.HisOrder{}).Where("user_org_id = 10138 and order_status = 2 and status = 1 and setl_time >= '2024-08-01 00:00:00' and setl_time <= '2024-12-31 23:59:59'").Find(&info).Error
|
|
1621
|
+ for _, in := range info {
|
|
1622
|
+ var p models.HisPatient
|
|
1623
|
+ var sss models.OutpatientServiceSick
|
|
1624
|
+ readDb.Model(&models.HisPatient{}).Where("number = ?", in.MdtrtId).First(&p)
|
|
1625
|
+ readDb.Model(&models.OutpatientServiceSick{}).Where("id = ?", p.SickType).First(&sss)
|
|
1626
|
+ in.SickName = sss.ClassName
|
|
1627
|
+ writeDb.Save(&in)
|
|
1628
|
+ //writeDb.Model(&models.HisOrderInfo{}).Where("user_org_id = ? and feedetl_sn = ? and advice_id = 0 and med_chrgitm_type = '09' and ctime >= 1717344000", org_id, doc.FeedetlSn).Updates(map[string]interface{}{"advice_id": doc.ID})
|
|
1629
|
+ }
|
|
1630
|
+ return
|
|
1631
|
+}
|
|
1632
|
+
|
|
1633
|
+func GetOrder111112() {
|
|
1634
|
+ var info []models.HisOrder
|
|
1635
|
+ err = readDb.Model(&models.HisOrder{}).Where("user_org_id = 10138 and order_status = 2 and status = 1 and setl_time >= '2024-11-23 00:00:00'").Find(&info).Error
|
|
1636
|
+ for _, in := range info {
|
|
1637
|
+ var p_info models.HisPrescriptionInfo
|
|
1638
|
+ readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = 10138 and status = 1 and patient_id = ? and record_date = ?", in.PatientId, in.SettleAccountsDate).First(&p_info)
|
|
1639
|
+ //readUserDb.Model(&models.UserAdminRole{}).Where("admin_user_id = ? and org_id = 10138", p_info.DoctorId)
|
|
1640
|
+
|
|
1641
|
+ diass := strings.Split(in.Diagnosis, ",")
|
|
1642
|
+ var dia_name = ""
|
|
1643
|
+ for _, dia := range diass {
|
|
1644
|
+ var sss models.HisXtDiagnoseConfig
|
|
1645
|
+ if len(dia) > 0 {
|
|
1646
|
+ readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id = ?", dia).First(&sss)
|
|
1647
|
+ if len(dia_name) == 0 {
|
|
1648
|
+ dia_name = sss.ClassName
|
|
1649
|
+ } else {
|
|
1650
|
+ dia_name = dia_name + "," + sss.ClassName
|
|
1651
|
+ }
|
|
1652
|
+ }
|
|
1653
|
+ }
|
|
1654
|
+ if len(dia_name) > 0 {
|
|
1655
|
+ in.WarnMsg = dia_name
|
|
1656
|
+ writeDb.Save(&in)
|
|
1657
|
+ }
|
|
1658
|
+ }
|
|
1659
|
+ return
|
|
1660
|
+}
|