|
@@ -875,7 +875,7 @@ func GetHisOrderList(user_org_id int64, page int64, limit int64, start_time int6
|
875
|
875
|
db = db.Where("his_order.settle_accounts_date<=?", end_time)
|
876
|
876
|
}
|
877
|
877
|
|
878
|
|
- db = db.Where("his_order.status = 1 AND his_order.user_org_id = ? AND his_order.p_type = ?", user_org_id, p_type)
|
|
878
|
+ db = db.Where("his_order.status = 1 AND his_order.user_org_id = ? AND his_order.p_type = ? AND his_order.order_status = 2", user_org_id, p_type)
|
879
|
879
|
|
880
|
880
|
db = db.Preload("HisOrderInfo", "status = 1 AND user_org_id = ?", user_org_id).
|
881
|
881
|
Preload("Patients", "status = 1 AND user_org_id = ?", user_org_id).
|
|
@@ -933,26 +933,61 @@ func UpDateHospitalHisPrescriptionInfoNumber(user_org_id int64, number string, s
|
933
|
933
|
}
|
934
|
934
|
|
935
|
935
|
type HisOrder struct {
|
936
|
|
- ID int64 `gorm:"column:id" json:"id" form:"id"`
|
937
|
|
- UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
938
|
|
- HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
939
|
|
- SettleAccountsDate int64 `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
|
940
|
|
- Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
941
|
|
- Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
942
|
|
- Status int64 `gorm:"column:status" json:"status" form:"status"`
|
943
|
|
- Number string `gorm:"column:number" json:"number" form:"number"`
|
944
|
|
- PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
945
|
|
- MedfeeSumamt float64 `gorm:"column:medfee_sumamt" json:"medfee_sumamt" form:"medfee_sumamt"`
|
946
|
|
- OrderStatus float64 `gorm:"column:order_status" json:"order_status" form:"order_status"`
|
947
|
|
- PayWay int64 `gorm:"column:pay_way" json:"pay_way" form:"pay_way"`
|
948
|
|
- PayPrice float64 `gorm:"column:pay_price" json:"pay_price" form:"pay_price"`
|
949
|
|
- PayCardNo string `gorm:"column:pay_card_no" json:"pay_card_no" form:"pay_card_no"`
|
950
|
|
- DiscountPrice float64 `gorm:"column:discount_price" json:"discount_price" form:"discount_price"`
|
951
|
|
- PreferentialPrice float64 `gorm:"column:preferential_price" json:"preferential_price" form:"preferential_price"`
|
952
|
|
- RealityPrice float64 `gorm:"column:reality_price" json:"reality_price" form:"reality_price"`
|
953
|
|
- FoundPrice float64 `gorm:"column:found_price" json:"found_price" form:"found_price"`
|
954
|
|
- MedicalInsurancePrice float64 `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
|
955
|
|
- PrivatePrice float64 `gorm:"column:private_price" json:"private_price" form:"private_price"`
|
|
936
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
937
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
938
|
+ HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
|
939
|
+ Number string `gorm:"column:number" json:"number" form:"number"`
|
|
940
|
+
|
|
941
|
+ SettleAccountsDate int64 `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
|
|
942
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
943
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
944
|
+ Infcode int64 `gorm:"column:infcode" json:"infcode" form:"infcode"`
|
|
945
|
+ WarnMsg string `gorm:"column:warn_msg" json:"warn_msg" form:"warn_msg"`
|
|
946
|
+ Cainfo string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
|
|
947
|
+ ErrMsg string `gorm:"column:err_msg" json:"err_msg" form:"err_msg"`
|
|
948
|
+ RespondTime string `gorm:"column:respond_time" json:"respond_time" form:"respond_time"`
|
|
949
|
+ InfRefmsgid string `gorm:"column:inf_refmsgid" json:"inf_refmsgid" form:"inf_refmsgid"`
|
|
950
|
+ OrderStatus int64 `gorm:"column:order_status" json:"order_status" form:"order_status"`
|
|
951
|
+ MdtrtId string `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
|
|
952
|
+ SetlId string `gorm:"column:setl_id" json:"setl_id" form:"setl_id"`
|
|
953
|
+ Insutype string `gorm:"column:insutype" json:"insutype" form:"insutype"`
|
|
954
|
+ PsnType string `gorm:"column:psn_type" json:"psn_type" form:"psn_type"`
|
|
955
|
+ CvlservFlag string `gorm:"column:cvlserv_flag" json:"cvlserv_flag" form:"cvlserv_flag"`
|
|
956
|
+ SetlTime string `gorm:"column:setl_time" json:"setl_time" form:"setl_time"`
|
|
957
|
+ MdtrtCertType string `gorm:"column:mdtrt_cert_type" json:"mdtrt_cert_type" form:"mdtrt_cert_type"`
|
|
958
|
+ MedType string `gorm:"column:med_type" json:"med_type" form:"med_type"`
|
|
959
|
+ MedfeeSumamt float64 `gorm:"column:medfee_sumamt" json:"medfee_sumamt" form:"medfee_sumamt"`
|
|
960
|
+ FulamtOwnpayAmt float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
|
|
961
|
+ OverlmtSelfPay float64 `gorm:"column:overlmt_self_pay" json:"overlmt_self_pay" form:"overlmt_self_pay"`
|
|
962
|
+ PreselfpayAmt float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
|
|
963
|
+ InscpScpAmt float64 `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
|
|
964
|
+ ActPayDedc float64 `gorm:"column:act_pay_dedc" json:"act_pay_dedc" form:"act_pay_dedc"`
|
|
965
|
+ HifpPay float64 `gorm:"column:hifp_pay" json:"hifp_pay" form:"hifp_pay"`
|
|
966
|
+ CvlservPay float64 `gorm:"column:cvlserv_pay" json:"cvlserv_pay" form:"cvlserv_pay"`
|
|
967
|
+ PoolPropSelfpay float64 `gorm:"column:pool_prop_selfpay" json:"pool_prop_selfpay" form:"pool_prop_selfpay"`
|
|
968
|
+ HifesPay float64 `gorm:"column:hifes_pay" json:"hifes_pay" form:"hifes_pay"`
|
|
969
|
+ HifmiPay float64 `gorm:"column:hifmi_pay" json:"hifmi_pay" form:"hifmi_pay"`
|
|
970
|
+ HifobPay float64 `gorm:"column:hifob_pay" json:"hifob_pay" form:"hifob_pay"`
|
|
971
|
+ MafPay float64 `gorm:"column:maf_pay" json:"maf_pay" form:"maf_pay"`
|
|
972
|
+ OthPay float64 `gorm:"column:oth_pay" json:"oth_pay" form:"oth_pay"`
|
|
973
|
+ FundPaySumamt float64 `gorm:"column:fund_pay_sumamt" json:"fund_pay_sumamt" form:"fund_pay_sumamt"`
|
|
974
|
+ PsnPartAmt float64 `gorm:"column:psn_part_amt" json:"psn_part_amt" form:"psn_part_amt"`
|
|
975
|
+ AcctPay float64 `gorm:"column:acct_pay" json:"acct_pay" form:"acct_pay"`
|
|
976
|
+ PsnCashPay float64 `gorm:"column:psn_cash_pay" json:"psn_cash_pay" form:"psn_cash_pay"`
|
|
977
|
+ HospPartAmt float64 `gorm:"column:hosp_part_amt" json:"hosp_part_amt" form:"hosp_part_amt"`
|
|
978
|
+ Balc float64 `gorm:"column:balc" json:"balc" form:"balc"`
|
|
979
|
+ AcctMulaidPay float64 `gorm:"column:acct_mulaid_pay" json:"acct_mulaid_pay" form:"acct_mulaid_pay"`
|
|
980
|
+ MedinsSetlId string `gorm:"column:medins_setl_id" json:"medins_setl_id" form:"medins_setl_id"`
|
|
981
|
+ ClrOptins string `gorm:"column:clr_optins" json:"clr_optins" form:"clr_optins"`
|
|
982
|
+ ClrWay string `gorm:"column:clr_way" json:"clr_way" form:"clr_way"`
|
|
983
|
+ ClrType string `gorm:"column:clr_type" json:"clr_type" form:"clr_type"`
|
|
984
|
+ SetlDetail string `gorm:"column:setl_detail" json:"setl_detail" form:"setl_detail"`
|
|
985
|
+ IsMedicineInsurance int64 `gorm:"column:is_medicine_insurance" json:"is_medicine_insurance" form:"is_medicine_insurance"`
|
|
986
|
+ PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
|
987
|
+ SettleType int64 `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
|
|
988
|
+ SettleStartTime int64 `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
|
|
989
|
+ SettleEndTime int64 `gorm:"column:settle_end_time" json:"settle_end_time" form:"settle_end_time"`
|
|
990
|
+ IsPre int64 `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
|
956
|
991
|
|
957
|
992
|
HisOrderInfo models.HisOrderInfo `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
|
958
|
993
|
Patients models.Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
|
@@ -962,7 +997,6 @@ type HisOrder struct {
|
962
|
997
|
|
963
|
998
|
FaPiaoCode string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
|
964
|
999
|
FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
|
965
|
|
- IsPre int64 `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
|
966
|
1000
|
Diagnosis string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
|
967
|
1001
|
}
|
968
|
1002
|
|
|
@@ -1807,13 +1841,8 @@ func GetNewHisPatientInfo(his_patient_id int64) (info models.HisPatient, err err
|
1807
|
1841
|
return
|
1808
|
1842
|
}
|
1809
|
1843
|
|
1810
|
|
-func GetNewHisOrder(user_org_id int64, mdtrt_id string, patient_id int64) (order HisOrder, err error) {
|
1811
|
|
- err = readDb.Model(&HisOrder{}).Where("status = 1 AND user_org_id = ? AND patient_id = ? AND mdtrt_id=? ", user_org_id, patient_id, mdtrt_id).
|
1812
|
|
- Preload("HisOrderInfo", "status = 1 AND user_org_id = ?", user_org_id).
|
1813
|
|
- Preload("Patients", "status = 1 AND user_org_id = ?", user_org_id).
|
1814
|
|
- Preload("HisPatient", "status = 1 AND user_org_id = ?", user_org_id).
|
1815
|
|
- Preload("HisPrescriptionInfo", "status = 1 AND user_org_id = ?", user_org_id).
|
1816
|
|
- Order("ctime desc").
|
|
1844
|
+func GetNewHisOrder(user_org_id int64, mdtrt_id string, patient_id int64) (order models.HisOrder, err error) {
|
|
1845
|
+ err = readDb.Model(&models.HisOrder{}).Where("status = 1 AND user_org_id = ? AND patient_id = ? AND mdtrt_id=? ", user_org_id, patient_id, mdtrt_id).
|
1817
|
1846
|
Last(&order).Error
|
1818
|
1847
|
return
|
1819
|
1848
|
}
|