|
@@ -353,6 +353,7 @@ type HisPrescriptionInfoTemplateTwo struct {
|
353
|
353
|
func (HisPrescriptionInfoTemplateTwo) TableName() string {
|
354
|
354
|
return "his_prescription_info_template"
|
355
|
355
|
}
|
|
356
|
+
|
356
|
357
|
func GetHisPrescriptionTemplateTwo() (prescription []*HisPrescriptionInfoTemplateTwo, err error) {
|
357
|
358
|
err = readDb.Model(&HisPrescriptionInfoTemplateTwo{}).
|
358
|
359
|
Preload("HisPrescriptionAdviceTemplate", func(db *gorm.DB) *gorm.DB {
|
|
@@ -362,9 +363,11 @@ func GetHisPrescriptionTemplateTwo() (prescription []*HisPrescriptionInfoTemplat
|
362
|
363
|
Find(&prescription).Error
|
363
|
364
|
return
|
364
|
365
|
}
|
|
366
|
+
|
365
|
367
|
func SaveAdviceTemplate(advice HisPrescriptionAdviceTemplate) {
|
366
|
368
|
writeDb.Save(&advice)
|
367
|
369
|
}
|
|
370
|
+
|
368
|
371
|
func GetAllPT(org_id int64) (his []*models.HisPrescriptionTemplate, err error) {
|
369
|
372
|
err = readDb.Model(&models.HisPrescriptionTemplate{}).Where("user_org_id = ? AND status = 1", org_id).Find(&his).Error
|
370
|
373
|
return
|
|
@@ -422,6 +425,7 @@ type HisPrescriptionInfoTemplateTHree struct {
|
422
|
425
|
func (HisPrescriptionInfoTemplateTHree) TableName() string {
|
423
|
426
|
return "his_prescription_info_template"
|
424
|
427
|
}
|
|
428
|
+
|
425
|
429
|
func GetAllPTInfo(org_id int64, p_template_id int64) (his []*HisPrescriptionInfoTemplateTHree, err error) {
|
426
|
430
|
err = readDb.Model(&HisPrescriptionInfoTemplateTHree{}).Preload("HisPrescriptionAdviceTemplate", func(db *gorm.DB) *gorm.DB {
|
427
|
431
|
return db.Where("status = 1")
|
|
@@ -430,6 +434,7 @@ func GetAllPTInfo(org_id int64, p_template_id int64) (his []*HisPrescriptionInfo
|
430
|
434
|
}).Where("user_org_id = ? AND status = 1 AND p_template_id = ?", org_id, p_template_id).Find(&his).Error
|
431
|
435
|
return
|
432
|
436
|
}
|
|
437
|
+
|
433
|
438
|
func GetAllInfo(org_id int64, project_id int64) (his []*HisPrescriptionProjectTemplate, err error) {
|
434
|
439
|
err = readDb.Model(&HisPrescriptionProjectTemplate{}).Where("user_org_id = ? AND status = 1 AND project_id = ? ", org_id, project_id).Find(&his).Error
|
435
|
440
|
return
|
|
@@ -438,21 +443,26 @@ func UpdateStatus(project_id int64, p_id int64) {
|
438
|
443
|
writeDb.Model(&HisPrescriptionProjectTemplate{}).Where("id = ?", project_id).Updates(map[string]interface{}{"status": 0})
|
439
|
444
|
writeDb.Model(&HisPrescriptionInfoTemplateTwo{}).Where("id = ?", p_id).Updates(map[string]interface{}{"status": 0})
|
440
|
445
|
}
|
|
446
|
+
|
441
|
447
|
func SaveOrder(order *models.HisOrder) {
|
442
|
448
|
writeDb.Save(&order)
|
443
|
449
|
}
|
|
450
|
+
|
444
|
451
|
func GetAllPrivateHis(org_id int64) (his []*models.HisPatient) {
|
445
|
452
|
readDb.Model(&models.HisPatient{}).Where("user_org_id = ? AND balance_accounts_type = 2 AND status = 1", org_id).Find(&his)
|
446
|
453
|
return
|
447
|
454
|
}
|
|
455
|
+
|
448
|
456
|
func SaveHis(his *models.HisPatient) {
|
449
|
457
|
writeDb.Save(his)
|
450
|
458
|
return
|
451
|
459
|
}
|
|
460
|
+
|
452
|
461
|
func GetAllProjectPrescription() (pre []*models.HisPrescription) {
|
453
|
462
|
readDb.Model(&models.HisPrescription{}).Where("user_org_id = 10215 AND status = 1 AND type = 2 AND order_status = 1 AND record_date >= 1659283200").Find(&pre)
|
454
|
463
|
return
|
455
|
464
|
}
|
|
465
|
+
|
456
|
466
|
func GetAllProject(id int64) (pre []*models.HisPrescriptionProject) {
|
457
|
467
|
readDb.Model(&models.HisPrescriptionProject{}).Where("user_org_id = 10215 AND status = 1 AND project_id = 1735 AND prescription_id = ?", id).Find(&pre)
|
458
|
468
|
return
|
|
@@ -468,6 +478,7 @@ func GetAllProject(id int64) (pre []*models.HisPrescriptionProject) {
|
468
|
478
|
// }).Find(&order).Error
|
469
|
479
|
// return
|
470
|
480
|
//}
|
|
481
|
+
|
471
|
482
|
type HisOrderTen struct {
|
472
|
483
|
ID int64 `gorm:"column:id" json:"id" form:"id"`
|
473
|
484
|
UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
@@ -542,47 +553,14 @@ type HisOrderTen struct {
|
542
|
553
|
Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
543
|
554
|
PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
544
|
555
|
Decimal float64 `gorm:"column:decimal" json:"decimal" form:"decimal"`
|
545
|
|
- HisPrescriptionTen []*HisPrescriptionTen `gorm:"ForeignKey:BatchNumber;AssociationForeignKey:Number" json:"info"`
|
546
|
|
- //VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:BatchNumber;AssociationForeignKey:Number" json:"order_info"`
|
547
|
|
- VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:OrderNumber;AssociationForeignKey:Number" json:"order_info"`
|
548
|
|
- OthDesc string `gorm:"oth_desc" json:"oth_desc" form:"oth_desc"`
|
549
|
|
- PayWays string `gorm:"pay_ways" json:"pay_ways" form:"pay_ways"`
|
550
|
|
-
|
551
|
|
- Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
|
556
|
+ VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:OrderNumber;AssociationForeignKey:Number" json:"info"`
|
|
557
|
+ Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
552
|
558
|
}
|
553
|
559
|
|
554
|
560
|
func (HisOrderTen) TableName() string {
|
555
|
561
|
return "his_order"
|
556
|
562
|
}
|
557
|
563
|
|
558
|
|
-type HisPrescriptionInfoOne struct {
|
559
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
560
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
561
|
|
- RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
562
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
563
|
|
- HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
564
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
565
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
566
|
|
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
567
|
|
- Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
568
|
|
- Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
|
569
|
|
- Diagnosis string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
|
570
|
|
- RegisterType int64 `gorm:"column:register_type" json:"register_type" form:"register_type"`
|
571
|
|
- Doctor string `gorm:"column:doctor" json:"doctor" form:"doctor"`
|
572
|
|
- Departments int64 `gorm:"column:departments" json:"departments" form:"departments"`
|
573
|
|
- SickHistory string `gorm:"column:sick_history" json:"sick_history" form:"sick_history"`
|
574
|
|
- PrescriptionNumber string `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
|
575
|
|
- PrescriptionStatus int64 `gorm:"column:prescription_status" json:"prescription_status" form:"prescription_status"`
|
576
|
|
- BatchNumber string `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
|
577
|
|
- DoctorId int64 `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
|
578
|
|
- SickType int64 `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
|
579
|
|
- PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
580
|
|
-}
|
581
|
|
-
|
582
|
|
-func (HisPrescriptionInfoOne) TableName() string {
|
583
|
|
- return "his_prescription_info"
|
584
|
|
-}
|
585
|
|
-
|
586
|
564
|
type HisPrescriptionTen struct {
|
587
|
565
|
ID int64 `gorm:"column:id" json:"id" form:"id"`
|
588
|
566
|
UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
@@ -604,7 +582,6 @@ type HisPrescriptionTen struct {
|
604
|
582
|
Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
605
|
583
|
HisDoctorAdviceInfoTen []*HisDoctorAdviceInfoTen `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
|
606
|
584
|
HisPrescriptionProjectTen []*HisPrescriptionProjectTen `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
|
607
|
|
- HisPrescriptionInfoOne HisPrescriptionInfoOne `gorm:"ForeignKey:PrescriptionNumber;AssociationForeignKey:PrescriptionNumber" json:"p_info"`
|
608
|
585
|
Total string `gorm:"-" json:"total" form:"total"`
|
609
|
586
|
PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
610
|
587
|
MedType string `gorm:"column:med_type" json:"med_type" form:"med_type"`
|
|
@@ -614,83 +591,43 @@ type HisPrescriptionTen struct {
|
614
|
591
|
func (HisPrescriptionTen) TableName() string {
|
615
|
592
|
return "his_prescription"
|
616
|
593
|
}
|
|
594
|
+
|
617
|
595
|
func GetHisOrderDetailThree() (order []*HisOrderTen, err error) {
|
618
|
|
- err = readDb.Model(&HisOrderTen{}).Preload("VmHisOrderInfo9504", "status = 1").Preload("Patients", "status = 1").Preload("HisPrescriptionTen", func(db *gorm.DB) *gorm.DB {
|
|
596
|
+ err = readDb.Model(&HisOrderTen{}).Preload("Patients", "status = 1").Preload("VmHisOrderInfo9504", func(db *gorm.DB) *gorm.DB {
|
619
|
597
|
return db.Where("status = 1").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
620
|
598
|
return db.Where("status = 1").Preload("VMHisProject", "status = 1").Preload("VMGoodInfo", "status = 1")
|
621
|
599
|
}).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
622
|
600
|
return db.Where("status = 1").Preload("Drug", "status = 1")
|
623
|
601
|
})
|
624
|
|
- }).Where("settle_accounts_date >= 1675180800 AND settle_accounts_date <= 1677513600 AND status = 1 AND order_status =2 and p_type = 1 AND user_org_id = 10215").Find(&order).Order("patient_id").Error
|
|
602
|
+ }).Where("setl_time >= '2023-03-01 00:00:00' AND setl_time <= '2023-03-31 23:59:59' AND status = 1 AND order_status =2 and p_type = 1 AND user_org_id = 10215").Find(&order).Order("patient_id").Error
|
625
|
603
|
return
|
626
|
604
|
}
|
627
|
605
|
|
628
|
|
-type VmHisOrderInfo9504Two struct {
|
629
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
630
|
|
- OrderNumber string `gorm:"column:order_number" json:"order_number" form:"order_number"`
|
631
|
|
- UploadDate int64 `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
|
632
|
|
- AdviceId int64 `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
|
633
|
|
- DetItemFeeSumamt float64 `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
|
634
|
|
- Cnt float64 `gorm:"column:cnt" json:"cnt" form:"cnt"`
|
635
|
|
- Pric float64 `gorm:"column:pric" json:"pric" form:"pric"`
|
636
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
637
|
|
- PricUplmtAmt float64 `gorm:"column:pric_uplmt_amt" json:"pric_uplmt_amt" form:"pric_uplmt_amt"`
|
638
|
|
- SelfpayProp float64 `gorm:"column:selfpay_prop" json:"selfpay_prop" form:"selfpay_prop"`
|
639
|
|
- FulamtOwnpayAmt float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
|
640
|
|
- OverlmtAmt float64 `gorm:"column:overlmt_amt" json:"overlmt_amt" form:"overlmt_amt"`
|
641
|
|
- PreselfpayAmt float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
|
642
|
|
- BasMednFlag string `gorm:"column:bas_medn_flag" json:"bas_medn_flag" form:"bas_medn_flag"`
|
643
|
|
- MedChrgitmType string `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
|
644
|
|
- HiNegoDrugFlag string `gorm:"column:hi_nego_drug_flag" json:"hi_nego_drug_flag" form:"hi_nego_drug_flag"`
|
645
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
646
|
|
- Memo string `gorm:"column:memo" json:"memo" form:"memo"`
|
647
|
|
- FeedetlSn string `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
|
648
|
|
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
649
|
|
- InscpScpAmt float64 `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
|
650
|
|
- DrtReimFlag string `gorm:"column:drt_reim_flag" json:"drt_reim_flag" form:"drt_reim_flag"`
|
651
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
652
|
|
- ListSpItemFlag string `gorm:"column:list_sp_item_flag" json:"list_sp_item_flag" form:"list_sp_item_flag"`
|
653
|
|
- ChldMedcFlag string `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
|
654
|
|
- LmtUsedFlag string `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
|
655
|
|
- ChrgitmLv string `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
|
656
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
657
|
|
- HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
658
|
|
- OrderId int64 `gorm:"column:order_id" json:"order_id" form:"order_id"`
|
659
|
|
- ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
660
|
|
- Type int64 `gorm:"column:type" json:"type" form:"type"`
|
661
|
|
- ItemId int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
|
662
|
|
- SettleType int64 `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
|
663
|
|
-}
|
664
|
|
-
|
665
|
|
-func (VmHisOrderInfo9504Two) TableName() string {
|
666
|
|
- return "his_order_info"
|
667
|
|
-}
|
668
|
|
-
|
669
|
606
|
type HisDoctorAdviceInfoTen struct {
|
670
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
671
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
672
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
673
|
|
- AdviceDate int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
|
674
|
|
- AdviceName string `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
|
675
|
|
- AdviceDesc string `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
|
676
|
|
- SingleDose float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
677
|
|
- SingleDoseUnit string `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
|
678
|
|
- PrescribingNumber float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
|
679
|
|
- PrescribingNumberUnit string `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
|
680
|
|
- DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
681
|
|
- ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
682
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
683
|
|
- CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
|
684
|
|
- RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
685
|
|
- DrugSpec float64 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
|
686
|
|
- DrugSpecUnit string `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
|
687
|
|
- PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
688
|
|
- VmHisOrderInfo9504Two VmHisOrderInfo9504Two `gorm:"ForeignKey:AdviceId;AssociationForeignKey:ID" json:"order_info"`
|
689
|
|
- Price float64 `gorm:"column:price" json:"price" form:"price"`
|
690
|
|
- DrugId int64 `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
|
691
|
|
- Drug Drug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" json:"drug"`
|
692
|
|
- IsMedicine int64 `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
|
693
|
|
- ExecutionFrequencyId int64 `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
|
|
607
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
608
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
609
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
610
|
+ AdviceDate int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
|
|
611
|
+ AdviceName string `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
|
|
612
|
+ AdviceDesc string `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
|
|
613
|
+ SingleDose float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
|
614
|
+ SingleDoseUnit string `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
|
|
615
|
+ PrescribingNumber float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
|
|
616
|
+ PrescribingNumberUnit string `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
|
|
617
|
+ DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
|
618
|
+ ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
|
619
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
620
|
+ CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
|
|
621
|
+ RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
|
622
|
+ DrugSpec float64 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
|
|
623
|
+ DrugSpecUnit string `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
|
|
624
|
+ PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
|
625
|
+
|
|
626
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
627
|
+ DrugId int64 `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
|
|
628
|
+ Drug Drug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" json:"drug"`
|
|
629
|
+ IsMedicine int64 `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
|
|
630
|
+ ExecutionFrequencyId int64 `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
|
694
|
631
|
}
|
695
|
632
|
|
696
|
633
|
func (HisDoctorAdviceInfoTen) TableName() string {
|
|
@@ -698,39 +635,38 @@ func (HisDoctorAdviceInfoTen) TableName() string {
|
698
|
635
|
}
|
699
|
636
|
|
700
|
637
|
type HisPrescriptionProjectTen struct {
|
701
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
702
|
|
- ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
703
|
|
- Price float64 `gorm:"column:price" json:"price" form:"price"`
|
704
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
705
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
706
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
707
|
|
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
708
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
709
|
|
- HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
710
|
|
- RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
711
|
|
- PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
712
|
|
- Count string `gorm:"column:count" json:"count" form:"count"`
|
713
|
|
- FeedetlSn string `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
|
714
|
|
- MedListCodg string `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
|
715
|
|
- SingleDose string `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
716
|
|
- DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
717
|
|
- ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
718
|
|
- Day string `gorm:"column:day" json:"day" form:"day"`
|
719
|
|
- VMHisProject VMHisProject `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
|
720
|
|
- VMGoodInfo VMGoodInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
|
721
|
|
- Remark string `gorm:"column:remark" json:"remark" form:"remark"`
|
722
|
|
- Unit string `gorm:"column:unit" json:"unit" form:"unit"`
|
723
|
|
- Type int64 `gorm:"column:type" json:"type" form:"type"`
|
724
|
|
- Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
|
725
|
|
- ExecutionTime int64 `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
|
726
|
|
- ExecutionStaff int64 `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
|
727
|
|
- ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
|
728
|
|
- CheckTime int64 `gorm:"column:check_time" json:"check_time" form:"check_time"`
|
729
|
|
- CheckState int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
|
730
|
|
- Checker int64 `gorm:"column:checker" json:"checker" form:"checker"`
|
731
|
|
- StartTime int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
|
732
|
|
- TeamId int64 `gorm:"column:team_id" json:"team_id" form:"team_id"`
|
733
|
|
- VmHisOrderInfo9504Two VmHisOrderInfo9504Two `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"order_info"`
|
|
638
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
639
|
+ ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
|
640
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
641
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
642
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
643
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
|
644
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
|
645
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
646
|
+ HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
|
647
|
+ RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
|
648
|
+ PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
|
649
|
+ Count string `gorm:"column:count" json:"count" form:"count"`
|
|
650
|
+ FeedetlSn string `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
|
|
651
|
+ MedListCodg string `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
|
|
652
|
+ SingleDose string `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
|
653
|
+ DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
|
654
|
+ ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
|
655
|
+ Day string `gorm:"column:day" json:"day" form:"day"`
|
|
656
|
+ VMHisProject VMHisProject `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
|
|
657
|
+ VMGoodInfo VMGoodInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
|
|
658
|
+ Remark string `gorm:"column:remark" json:"remark" form:"remark"`
|
|
659
|
+ Unit string `gorm:"column:unit" json:"unit" form:"unit"`
|
|
660
|
+ Type int64 `gorm:"column:type" json:"type" form:"type"`
|
|
661
|
+ Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
|
|
662
|
+ ExecutionTime int64 `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
|
|
663
|
+ ExecutionStaff int64 `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
|
|
664
|
+ ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
|
|
665
|
+ CheckTime int64 `gorm:"column:check_time" json:"check_time" form:"check_time"`
|
|
666
|
+ CheckState int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
|
|
667
|
+ Checker int64 `gorm:"column:checker" json:"checker" form:"checker"`
|
|
668
|
+ StartTime int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
|
|
669
|
+ TeamId int64 `gorm:"column:team_id" json:"team_id" form:"team_id"`
|
734
|
670
|
|
735
|
671
|
FrequencyType int64 `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
|
736
|
672
|
DayCount int64 `gorm:"column:day_count" json:"day_count" form:"day_count"`
|
|
@@ -741,19 +677,14 @@ type HisPrescriptionProjectTen struct {
|
741
|
677
|
func (HisPrescriptionProjectTen) TableName() string {
|
742
|
678
|
return "his_prescription_project"
|
743
|
679
|
}
|
|
680
|
+
|
744
|
681
|
func GetHisPatient11111(orgid int64) (paitent []*models.HisHospitalCheckRecord, err error) {
|
745
|
|
- err = XTReadDB().Model(&paitent).Where("user_org_id = ? and status = 1 AND in_hosptial_time >= '2023-02-01 00:00:00' AND in_hosptial_time <= '2023-02-28 23:59:59'", orgid).Find(&paitent).Error
|
746
|
|
- return paitent, err
|
747
|
|
-}
|
748
|
|
-func GetHisPatient2222(orgid int64) (paitent []*models.HisPatient, err error) {
|
749
|
|
- err = XTReadDB().Model(&models.HisPatient{}).Where("user_org_id = ? and status = 1 AND record_date >= 1654012800 AND record_date <= 1659196800 ", orgid).Find(&paitent).Error
|
|
682
|
+ err = XTReadDB().Model(&paitent).Where("user_org_id = ? and status = 1 AND in_hosptial_time >= '2022-12-01 00:00:00' AND in_hosptial_time <= '2022-12-31 23:59:59'", orgid).Find(&paitent).Error
|
750
|
683
|
return paitent, err
|
751
|
684
|
}
|
|
685
|
+
|
752
|
686
|
func SaveHP(paitent *models.HisHospitalCheckRecord) {
|
753
|
687
|
writeDb.Save(&paitent)
|
754
|
|
-}
|
755
|
|
-func SaveHPtWO(paitent *models.HisPatient) {
|
756
|
|
- writeDb.Save(&paitent)
|
757
|
688
|
|
758
|
689
|
}
|
759
|
690
|
|
|
@@ -829,8 +760,6 @@ type HisOrder9504 struct {
|
829
|
760
|
DepartmentName string `gorm:"-" json:"department_name" form:"department_name"`
|
830
|
761
|
DoctorName string `gorm:"-" json:"doctor_name" form:"doctor_name"`
|
831
|
762
|
SettleStartTime int64 `gorm:"settle_start_time" json:"settle_start_time" form:"settle_start_time"`
|
832
|
|
- OthDesc string `gorm:"oth_desc" json:"oth_desc" form:"oth_desc"`
|
833
|
|
- PayWays string `gorm:"pay_ways" json:"pay_ways" form:"pay_ways"`
|
834
|
763
|
|
835
|
764
|
Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
836
|
765
|
PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
|
@@ -926,6 +855,7 @@ type VmHisOrderInfo95042 struct {
|
926
|
855
|
func (VmHisOrderInfo95042) TableName() string {
|
927
|
856
|
return "his_order_info"
|
928
|
857
|
}
|
|
858
|
+
|
929
|
859
|
func GetHisOrderDetail9504() (order []*HisOrder9504, err error) {
|
930
|
860
|
err = readDb.Model(&HisOrder9504{}).Preload("Patients", "status = 1").Preload("VmHisOrderInfo9504", func(db *gorm.DB) *gorm.DB {
|
931
|
861
|
return db.Where("status = 1").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
|
@@ -936,6 +866,7 @@ func GetHisOrderDetail9504() (order []*HisOrder9504, err error) {
|
936
|
866
|
}).Where("settle_accounts_date >= 1640966400 AND settle_accounts_date <= 1661875200 AND status = 1 AND order_status =2 AND user_org_id = 9504").Find(&order).Order("setl_time").Error
|
937
|
867
|
return
|
938
|
868
|
}
|
|
869
|
+
|
939
|
870
|
func GetHisOrderDetail10188() (order []*HisOrder9504, err error) {
|
940
|
871
|
err = readDb.Model(&HisOrder9504{}).Preload("Patients", "status = 1").Preload("VmHisOrderInfo9504", func(db *gorm.DB) *gorm.DB {
|
941
|
872
|
return db.Where("status = 1").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
|
@@ -959,7 +890,7 @@ func GetHisOrderDetail10138() (order []*HisOrderTen, err error) {
|
959
|
890
|
return db.Where("status = 1 AND order_status = 2").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
960
|
891
|
return db.Where("status = 1").Preload("VMHisProject")
|
961
|
892
|
})
|
962
|
|
- }).Where("settle_accounts_date >= 1672502400 AND settle_accounts_date <= 1676822400 AND status = 1 AND order_status =2 AND user_org_id = 10278").Find(&order).Error
|
|
893
|
+ }).Where("settle_accounts_date >= 1664553600 AND settle_accounts_date <= 1672416000 AND status = 1 AND order_status =2 AND user_org_id = 10278").Find(&order).Error
|
963
|
894
|
return
|
964
|
895
|
}
|
965
|
896
|
|
|
@@ -1104,181 +1035,9 @@ func SaveSch(sch models.Schedule) (err error) {
|
1104
|
1035
|
}
|
1105
|
1036
|
|
1106
|
1037
|
func SaveSchTwo(sch models.Schedule, sch_two models.Schedule) (err error) {
|
1107
|
|
- utx := writeDb.Begin()
|
1108
|
|
- if err = utx.Model(&Schedule{}).Where("status=1 AND id = ?", sch.ID).Updates(map[string]interface{}{"status": 0}).Error; err != nil {
|
1109
|
|
- utx.Rollback()
|
1110
|
|
- return err
|
1111
|
|
- }
|
1112
|
|
- if err = utx.Model(&Schedule{}).Where("status=1 AND id = ?", sch_two.ID).Updates(map[string]interface{}{"status": 0}).Error; err != nil {
|
1113
|
|
- utx.Rollback()
|
1114
|
|
- return err
|
1115
|
|
- }
|
1116
|
|
- utx.Commit()
|
1117
|
|
- return err
|
1118
|
|
-}
|
|
1038
|
+ //err = writeDb.Save(&sch).Error
|
|
1039
|
+ err = writeDb.Model(&Schedule{}).Where("status=1 AND id = ?", sch.ID).Updates(map[string]interface{}{"status": 0}).Error
|
|
1040
|
+ err = writeDb.Model(&Schedule{}).Where("status=1 AND id = ?", sch_two.ID).Updates(map[string]interface{}{"status": 0}).Error
|
1119
|
1041
|
|
1120
|
|
-func GetHisOrderInfoDetail() (order []*VmHisOrderInfo9504, err error) {
|
1121
|
|
- err = readDb.Model(&VmHisOrderInfo9504{}).Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
1122
|
|
- return db.Where("status = 1").Preload("VMHisProject").Preload("VMGoodInfo")
|
1123
|
|
- }).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
1124
|
|
- return db.Where("status = 1").Preload("Drug")
|
1125
|
|
- }).Where("status = 1 AND order_number = '202302201702258124538'").Find(&order).Error
|
1126
|
|
- return
|
1127
|
|
-}
|
1128
|
|
-
|
1129
|
|
-func GetHisPrescriptionInfoDetail() (order []*HisPrescriptionProjectTen, err error) {
|
1130
|
|
- err = readDb.Model(&HisPrescriptionProjectTen{}).Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
1131
|
|
- return db.Where("status = 1").Preload("VMHisProject").Preload("VMGoodInfo")
|
1132
|
|
- }).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
1133
|
|
- return db.Where("status = 1").Preload("Drug")
|
1134
|
|
- }).Where("status = 1 AND order_number = '202302201702258124538'").Find(&order).Error
|
1135
|
|
- return
|
1136
|
|
-}
|
1137
|
|
-
|
1138
|
|
-type HisOrder10138 struct {
|
1139
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
1140
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
1141
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
1142
|
|
- Number string `gorm:"column:number" json:"number" form:"number"`
|
1143
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
1144
|
|
- OrderStatus int64 `gorm:"column:order_status" json:"order_status" form:"order_status"`
|
1145
|
|
- MdtrtId string `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
|
1146
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
1147
|
|
- SettleAccountsDate int64 `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
|
1148
|
|
- VmHisOrderInfo9504 []*VmHisOrderInfo9504 `json:"infos" form:"infos"`
|
1149
|
|
-}
|
1150
|
|
-
|
1151
|
|
-func (HisOrder10138) TableName() string {
|
1152
|
|
- return "his_order"
|
1153
|
|
-}
|
1154
|
|
-
|
1155
|
|
-type PatientVM10138 struct {
|
1156
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
1157
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
1158
|
|
- Name string `gorm:"column:name" json:"name" form:"name"`
|
1159
|
|
- HisOrder10138 []*HisOrder10138 `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"order"`
|
1160
|
|
-}
|
1161
|
|
-
|
1162
|
|
-func (PatientVM10138) TableName() string {
|
1163
|
|
- return "xt_patients"
|
1164
|
|
-}
|
1165
|
|
-
|
1166
|
|
-func GetHisAllPatientOrder(start_time int64, end_time int64) (order []*PatientVM10138, err error) {
|
1167
|
|
- err = readDb.Model(&PatientVM10138{}).Preload("HisOrder10138", " ctime >= ? AND ctime <= ? AND status = 1 AND order_status = 2", start_time, end_time).Where("user_org_id = 10138 AND status = 1").Find(&order).Error
|
1168
|
|
- return
|
1169
|
|
-}
|
1170
|
|
-
|
1171
|
|
-func GetHisOrderInfoDetail10138(order_number string) (order []*VmHisOrderInfo9504, err error) {
|
1172
|
|
- err = readDb.Model(&VmHisOrderInfo9504{}).Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
1173
|
|
- return db.Where("status = 1").Preload("VMHisProject").Preload("VMGoodInfo")
|
1174
|
|
- }).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
1175
|
|
- return db.Where("status = 1").Preload("Drug")
|
1176
|
|
- }).Where("status = 1 AND order_number = ?", order_number).Find(&order).Error
|
1177
|
|
- return
|
1178
|
|
-}
|
1179
|
|
-
|
1180
|
|
-//func GetHisOrderDetailOne(start_time int64, end_time int64) (order []*HisOrder9504, err error) {
|
1181
|
|
-// err = readDb.Model(&HisOrder9504{}).Preload("Patients", "status = 1").Preload("VmHisOrderInfo9504", func(db *gorm.DB) *gorm.DB {
|
1182
|
|
-// return db.Where("status = 1").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
1183
|
|
-// return db.Where("status = 1").Preload("VMHisProject").Preload("VMGoodInfo")
|
1184
|
|
-// }).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
1185
|
|
-// return db.Where("status = 1").Preload("Drug")
|
1186
|
|
-// })
|
1187
|
|
-// }).Where("settle_accounts_date >= ? AND settle_accounts_date <= ? AND status = 1 AND order_status =2 AND user_org_id = 9919", start_time, end_time).Find(&order).Order("setl_time").Error
|
1188
|
|
-// return
|
1189
|
|
-//}
|
1190
|
|
-//
|
1191
|
|
-
|
1192
|
|
-type HisOrderTenOne struct {
|
1193
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
1194
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
1195
|
|
- HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
1196
|
|
- SettleAccountsDate int64 `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
|
1197
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
1198
|
|
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
1199
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
1200
|
|
- Number string `gorm:"column:number" json:"number" form:"number"`
|
1201
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
1202
|
|
- Infcode int64 `gorm:"column:infcode" json:"infcode" form:"infcode"`
|
1203
|
|
- WarnMsg string `gorm:"column:warn_msg" json:"warn_msg" form:"warn_msg"`
|
1204
|
|
- Cainfo string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
|
1205
|
|
- ErrMsg string `gorm:"column:err_msg" json:"err_msg" form:"err_msg"`
|
1206
|
|
- RespondTime string `gorm:"column:respond_time" json:"respond_time" form:"respond_time"`
|
1207
|
|
- InfRefmsgid string `gorm:"column:inf_refmsgid" json:"inf_refmsgid" form:"inf_refmsgid"`
|
1208
|
|
- OrderStatus int64 `gorm:"column:order_status" json:"order_status" form:"order_status"`
|
1209
|
|
- MdtrtId string `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
|
1210
|
|
- SetlId string `gorm:"column:setl_id" json:"setl_id" form:"setl_id"`
|
1211
|
|
- PsnNo string `gorm:"column:psn_no" json:"psn_no" form:"psn_no"`
|
1212
|
|
- PsnName string `gorm:"column:psn_name" json:"psn_name" form:"psn_name"`
|
1213
|
|
- PsnCertType string `gorm:"column:psn_cert_type" json:"psn_cert_type" form:"psn_cert_type"`
|
1214
|
|
- Certno string `gorm:"column:certno" json:"certno" form:"certno"`
|
1215
|
|
- Gend string `gorm:"column:gend" json:"gend" form:"gend"`
|
1216
|
|
- Naty string `gorm:"column:naty" json:"naty" form:"naty"`
|
1217
|
|
- Brdy time.Time `gorm:"column:brdy" json:"brdy" form:"brdy"`
|
1218
|
|
- Age float64 `gorm:"column:age" json:"age" form:"age"`
|
1219
|
|
- Insutype string `gorm:"column:insutype" json:"insutype" form:"insutype"`
|
1220
|
|
- PsnType string `gorm:"column:psn_type" json:"psn_type" form:"psn_type"`
|
1221
|
|
- CvlservFlag string `gorm:"column:cvlserv_flag" json:"cvlserv_flag" form:"cvlserv_flag"`
|
1222
|
|
- SetlTime string `gorm:"column:setl_time" json:"setl_time" form:"setl_time"`
|
1223
|
|
- MdtrtCertType string `gorm:"column:mdtrt_cert_type" json:"mdtrt_cert_type" form:"mdtrt_cert_type"`
|
1224
|
|
- MedType string `gorm:"column:med_type" json:"med_type" form:"med_type"`
|
1225
|
|
- MedfeeSumamt float64 `gorm:"column:medfee_sumamt" json:"medfee_sumamt" form:"medfee_sumamt"`
|
1226
|
|
- FulamtOwnpayAmt float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
|
1227
|
|
- OverlmtSelfPay float64 `gorm:"column:overlmt_self_pay" json:"overlmt_self_pay" form:"overlmt_self_pay"`
|
1228
|
|
- PreselfpayAmt float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
|
1229
|
|
- InscpScpAmt float64 `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
|
1230
|
|
- ActPayDedc float64 `gorm:"column:act_pay_dedc" json:"act_pay_dedc" form:"act_pay_dedc"`
|
1231
|
|
- HifpPay float64 `gorm:"column:hifp_pay" json:"hifp_pay" form:"hifp_pay"`
|
1232
|
|
- CvlservPay float64 `gorm:"column:cvlserv_pay" json:"cvlserv_pay" form:"cvlserv_pay"`
|
1233
|
|
- PoolPropSelfpay float64 `gorm:"column:pool_prop_selfpay" json:"pool_prop_selfpay" form:"pool_prop_selfpay"`
|
1234
|
|
- HifesPay float64 `gorm:"column:hifes_pay" json:"hifes_pay" form:"hifes_pay"`
|
1235
|
|
- HifmiPay float64 `gorm:"column:hifmi_pay" json:"hifmi_pay" form:"hifmi_pay"`
|
1236
|
|
- HifobPay float64 `gorm:"column:hifob_pay" json:"hifob_pay" form:"hifob_pay"`
|
1237
|
|
- MafPay float64 `gorm:"column:maf_pay" json:"maf_pay" form:"maf_pay"`
|
1238
|
|
- OthPay float64 `gorm:"column:oth_pay" json:"oth_pay" form:"oth_pay"`
|
1239
|
|
- FundPaySumamt float64 `gorm:"column:fund_pay_sumamt" json:"fund_pay_sumamt" form:"fund_pay_sumamt"`
|
1240
|
|
- PsnPartAmt float64 `gorm:"column:psn_part_amt" json:"psn_part_amt" form:"psn_part_amt"`
|
1241
|
|
- AcctPay float64 `gorm:"column:acct_pay" json:"acct_pay" form:"acct_pay"`
|
1242
|
|
- PsnCashPay float64 `gorm:"column:psn_cash_pay" json:"psn_cash_pay" form:"psn_cash_pay"`
|
1243
|
|
- HospPartAmt float64 `gorm:"column:hosp_part_amt" json:"hosp_part_amt" form:"hosp_part_amt"`
|
1244
|
|
- Balc float64 `gorm:"column:balc" json:"balc" form:"balc"`
|
1245
|
|
- AcctMulaidPay float64 `gorm:"column:acct_mulaid_pay" json:"acct_mulaid_pay" form:"acct_mulaid_pay"`
|
1246
|
|
- MedinsSetlId string `gorm:"column:medins_setl_id" json:"medins_setl_id" form:"medins_setl_id"`
|
1247
|
|
- ClrOptins string `gorm:"column:clr_optins" json:"clr_optins" form:"clr_optins"`
|
1248
|
|
- ClrWay string `gorm:"column:clr_way" json:"clr_way" form:"clr_way"`
|
1249
|
|
- ClrType string `gorm:"column:clr_type" json:"clr_type" form:"clr_type"`
|
1250
|
|
- SetlDetail string `gorm:"column:setl_detail" json:"setl_detail" form:"setl_detail"`
|
1251
|
|
- IsMedicineInsurance int64 `gorm:"column:is_medicine_insurance" json:"is_medicine_insurance" form:"is_medicine_insurance"`
|
1252
|
|
- PayWay int64 `gorm:"column:pay_way" json:"pay_way" form:"pay_way"`
|
1253
|
|
- PayPrice float64 `gorm:"column:pay_price" json:"pay_price" form:"pay_price"`
|
1254
|
|
- PayCardNo string `gorm:"column:pay_card_no" json:"pay_card_no" form:"pay_card_no"`
|
1255
|
|
- DiscountPrice float64 `gorm:"column:discount_price" json:"discount_price" form:"discount_price"`
|
1256
|
|
- PreferentialPrice float64 `gorm:"column:preferential_price" json:"preferential_price" form:"preferential_price"`
|
1257
|
|
- RealityPrice float64 `gorm:"column:reality_price" json:"reality_price" form:"reality_price"`
|
1258
|
|
- FoundPrice float64 `gorm:"column:found_price" json:"found_price" form:"found_price"`
|
1259
|
|
- MedicalInsurancePrice float64 `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
|
1260
|
|
- PrivatePrice float64 `gorm:"column:private_price" json:"private_price" form:"private_price"`
|
1261
|
|
- DepartmentName string `gorm:"-" json:"department_name" form:"department_name"`
|
1262
|
|
- DoctorName string `gorm:"-" json:"doctor_name" form:"doctor_name"`
|
1263
|
|
- Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
1264
|
|
- PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
1265
|
|
- Decimal float64 `gorm:"column:decimal" json:"decimal" form:"decimal"`
|
1266
|
|
- HisPrescriptionTen []*HisPrescriptionTen `gorm:"ForeignKey:BatchNumber;AssociationForeignKey:Number" json:"info"`
|
1267
|
|
- OthDesc string `gorm:"oth_desc" json:"oth_desc" form:"oth_desc"`
|
1268
|
|
- PayWays string `gorm:"pay_ways" json:"pay_ways" form:"pay_ways"`
|
1269
|
|
-}
|
1270
|
|
-
|
1271
|
|
-func (HisOrderTenOne) TableName() string {
|
1272
|
|
- return "his_order"
|
1273
|
|
-}
|
1274
|
|
-
|
1275
|
|
-func GetHisOrderDetailOne(start_time int64, end_time int64) (order []*HisOrderTen, err error) {
|
1276
|
|
- err = readDb.Model(&HisOrderTen{}).Preload("HisPrescriptionTen", func(db *gorm.DB) *gorm.DB {
|
1277
|
|
- return db.Where("status = 1").Preload("HisPrescriptionInfoOne", "status = 1").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
1278
|
|
- return db.Where("status = 1").Preload("VmHisOrderInfo9504Two", "status = 1").Preload("VMHisProject", "status = 1").Preload("VMGoodInfo", "status = 1")
|
1279
|
|
- }).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
1280
|
|
- return db.Where("status = 1").Preload("VmHisOrderInfo9504Two", "status = 1").Preload("Drug", "status = 1")
|
1281
|
|
- })
|
1282
|
|
- }).Where("settle_accounts_date >= ? AND settle_accounts_date <= ? AND status = 1 AND order_status =2 AND user_org_id = 9919 AND setl_id <> ''", start_time, end_time).Find(&order).Error
|
1283
|
1042
|
return
|
1284
|
1043
|
}
|