Browse Source

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 1 week ago
parent
commit
622b2aafd4
3 changed files with 523 additions and 374 deletions
  1. 327 238
      controllers/his_api_controller.go
  2. 131 84
      service/app_version.go
  3. 65 52
      service/his_service.go

+ 327 - 238
controllers/his_api_controller.go View File

@@ -874,69 +874,76 @@ func (c *HisApiController) GetTestOrder() {
874 874
 		break
875 875
 	}
876 876
 	c.ServeSuccessJSON(map[string]interface{}{
877
-		"diagnosis":                                   name,
878
-		"order_infos":                                 orderInfos,
879
-		"number":                                      order.MdtrtId,
880
-		"date":                                        order.SettleAccountsDate,
881
-		"charge_admin":                                charge_admin,
882
-		"printor_admin":                               printor_admin,
883
-		"info":                                        order,
884
-		"order":                                       order,
885
-		"bedCostTotal":                                bedCostTotal,
886
-		"bedCostSelfTotal":                            bedCostSelfTotal,
887
-		"bedCostPartSelfTotal":                        bedCostPartSelfTotal,
888
-		"bedSelfTotal":                                bedSelfTotal,
889
-		"bedInscpTotal":                               bedInscpTotal,
890
-		"operationCostTotal":                          operationCostTotal,
891
-		"operationCostSelfTotal":                      operationCostSelfTotal,
892
-		"operationCostPartSelfTotal":                  operationCostPartSelfTotal,
893
-		"operationSelfTotal":                          operationSelfTotal,
894
-		"operationInscpTotal":                         operationInscpTotal,
895
-		"otherCostTotal":                              otherCostTotal,
896
-		"otherCostSelfTotal":                          otherCostSelfTotal,
897
-		"otherCostPartSelfTotal":                      otherCostPartSelfTotal,
898
-		"otherSelfTotal":                              otherSelfTotal,
899
-		"otherInscpTotal":                             otherInscpTotal,
900
-		"materialCostTotal":                           materialCostTotal,
901
-		"materialCostSelfTotal":                       materialCostSelfTotal,
902
-		"materialCostPartSelfTotal":                   materialCostPartSelfTotal,
903
-		"materialSelfTotal":                           materialSelfTotal,
904
-		"materialInscpTotal":                          materialInscpTotal,
905
-		"westernMedicineCostTotal":                    westernMedicineCostTotal,
906
-		"westernMedicineCostSelfTotal":                westernMedicineCostSelfTotal,
907
-		"westernMedicineCostPartSelfTotal":            westernMedicineCostPartSelfTotal,
908
-		"westernMedicineSelfTotal":                    westernMedicineSelfTotal,
909
-		"westernMedicineInscpTotal":                   westernMedicineInscpTotal,
877
+		"diagnosis":            name,
878
+		"order_infos":          orderInfos,
879
+		"number":               order.MdtrtId,
880
+		"date":                 order.SettleAccountsDate,
881
+		"charge_admin":         charge_admin,
882
+		"printor_admin":        printor_admin,
883
+		"info":                 order,
884
+		"order":                order,
885
+		"bedCostTotal":         bedCostTotal,
886
+		"bedCostSelfTotal":     bedCostSelfTotal,
887
+		"bedCostPartSelfTotal": bedCostPartSelfTotal,
888
+		"bedSelfTotal":         bedSelfTotal,
889
+		"bedInscpTotal":        bedInscpTotal,
890
+
891
+		"operationCostTotal":         operationCostTotal,
892
+		"operationCostSelfTotal":     operationCostSelfTotal,
893
+		"operationCostPartSelfTotal": operationCostPartSelfTotal,
894
+		"operationSelfTotal":         operationSelfTotal,
895
+		"operationInscpTotal":        operationInscpTotal,
896
+		"otherCostTotal":             otherCostTotal,
897
+		"otherCostSelfTotal":         otherCostSelfTotal,
898
+		"otherCostPartSelfTotal":     otherCostPartSelfTotal,
899
+		"otherSelfTotal":             otherSelfTotal,
900
+		"otherInscpTotal":            otherInscpTotal,
901
+		"materialCostTotal":          materialCostTotal,
902
+		"materialCostSelfTotal":      materialCostSelfTotal,
903
+		"materialCostPartSelfTotal":  materialCostPartSelfTotal,
904
+		"materialSelfTotal":          materialSelfTotal,
905
+		"materialInscpTotal":         materialInscpTotal,
906
+
907
+		"westernMedicineCostTotal":         westernMedicineCostTotal,
908
+		"westernMedicineCostSelfTotal":     westernMedicineCostSelfTotal,
909
+		"westernMedicineCostPartSelfTotal": westernMedicineCostPartSelfTotal,
910
+		"westernMedicineSelfTotal":         westernMedicineSelfTotal,
911
+		"westernMedicineInscpTotal":        westernMedicineInscpTotal,
912
+
910 913
 		"chineseTraditionalMedicineCostTotal":         chineseTraditionalMedicineCostTotal,
911 914
 		"chineseTraditionalMedicineCostSelfTotal":     chineseTraditionalMedicineCostSelfTotal,
912 915
 		"chineseTraditionalMedicineCostPartSelfTotal": chineseTraditionalMedicineCostPartSelfTotal,
913 916
 		"chineseTraditionalSelfTotal":                 chineseTraditionalSelfTotal,
914 917
 		"chineseTraditionalInscpTotal":                chineseTraditionalInscpTotal,
915
-		"checkCostTotal":                              checkCostTotal,
916
-		"checkCostSelfTotal":                          checkCostSelfTotal,
917
-		"checkCostPartSelfTotal":                      checkCostPartSelfTotal,
918
-		"checkSelfTotal":                              checkSelfTotal,
919
-		"checkInscpTotal":                             checkInscpTotal,
920
-		"laboratoryCostTotal":                         laboratoryCostTotal,
921
-		"laboratoryCostSelfTotal":                     laboratoryCostSelfTotal,
922
-		"laboratoryCostPartSelfTotal":                 laboratoryCostPartSelfTotal,
923
-		"laboratorySelfTotal":                         laboratorySelfTotal,
924
-		"laboratoryInscpTotal":                        laboratoryInscpTotal,
925
-		"treatCostTotal":                              treatCostTotal,
926
-		"treatCostSelfTotal":                          treatCostSelfTotal,
927
-		"treatCostPartSelfTotal":                      treatCostPartSelfTotal,
928
-		"treatSelfTotal":                              treatSelfTotal,
929
-		"treatInscpTotal":                             treatInscpTotal,
930
-		"doctor_info":                                 doctor_info,
931
-		"doctor_name":                                 doctor_name,
932
-		"health_card_no":                              order.PsnNo,
933
-		"yiliao_leibie":                               yiliao_leibie,
934
-		"patient":                                     patient,
935
-		"org_name":                                    miConfig.OrgName,
936
-		"org_code":                                    miConfig.Code,
937
-		"order_number":                                order.Number,
938
-		"his_hospital":                                his_hospital,
939
-		"dia_config":                                  dia_config,
918
+
919
+		"checkCostTotal":         checkCostTotal,
920
+		"checkCostSelfTotal":     checkCostSelfTotal,
921
+		"checkCostPartSelfTotal": checkCostPartSelfTotal,
922
+		"checkSelfTotal":         checkSelfTotal,
923
+		"checkInscpTotal":        checkInscpTotal,
924
+
925
+		"laboratoryCostTotal":         laboratoryCostTotal,
926
+		"laboratoryCostSelfTotal":     laboratoryCostSelfTotal,
927
+		"laboratoryCostPartSelfTotal": laboratoryCostPartSelfTotal,
928
+		"laboratorySelfTotal":         laboratorySelfTotal,
929
+		"laboratoryInscpTotal":        laboratoryInscpTotal,
930
+
931
+		"treatCostTotal":         treatCostTotal,
932
+		"treatCostSelfTotal":     treatCostSelfTotal,
933
+		"treatCostPartSelfTotal": treatCostPartSelfTotal,
934
+		"treatSelfTotal":         treatSelfTotal,
935
+		"treatInscpTotal":        treatInscpTotal,
936
+
937
+		"doctor_info":    doctor_info,
938
+		"doctor_name":    doctor_name,
939
+		"health_card_no": order.PsnNo,
940
+		"yiliao_leibie":  yiliao_leibie,
941
+		"patient":        patient,
942
+		"org_name":       miConfig.OrgName,
943
+		"org_code":       miConfig.Code,
944
+		"order_number":   order.Number,
945
+		"his_hospital":   his_hospital,
946
+		"dia_config":     dia_config,
940 947
 	})
941 948
 
942 949
 }
@@ -1054,41 +1061,59 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1054 1061
 		}
1055 1062
 	}
1056 1063
 
1057
-	var bedCostTotal float64 = 0 //床位总费
1058
-	//var bedCostSelfTotal float64 = 0     //床位自费
1064
+	var bedCostTotal float64 = 0         //床位总费
1065
+	var bedCostSelfTotal float64 = 0     //床位自费
1059 1066
 	var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
1067
+	var bedSelfTotal float64 = 0         //床位部分项目自费
1068
+	var bedInscpTotal float64 = 0        //床位部分项目自费
1060 1069
 
1061
-	var operationCostTotal float64 = 0 //手术费
1062
-	//var operationCostSelfTotal float64 = 0     //手术费
1070
+	var operationCostTotal float64 = 0         //手术费
1071
+	var operationCostSelfTotal float64 = 0     //手术费
1063 1072
 	var operationCostPartSelfTotal float64 = 0 //手术费
1073
+	var operationSelfTotal float64 = 0         //床位部分项目自费
1074
+	var operationInscpTotal float64 = 0        //床位部分项目自费
1064 1075
 
1065 1076
 	var otherCostTotal float64 = 0 //其他费用
1066 1077
 	//var otherCostSelfTotal float64 = 0     //其他费用
1067 1078
 	var otherCostPartSelfTotal float64 = 0 //其他费用
1079
+	//var otherSelfTotal float64 = 0         //床位部分项目自费
1080
+	//var otherInscpTotal float64 = 0        //床位部分项目自费
1068 1081
 
1069
-	var materialCostTotal float64 = 0 //材料费
1070
-	//var materialCostSelfTotal float64 = 0     //材料费
1082
+	var materialCostTotal float64 = 0         //材料费
1083
+	var materialCostSelfTotal float64 = 0     //材料费
1071 1084
 	var materialCostPartSelfTotal float64 = 0 //材料费
1085
+	var materialSelfTotal float64 = 0         //床位部分项目自费
1086
+	var materialInscpTotal float64 = 0        //床位部分项目自费
1072 1087
 
1073
-	var westernMedicineCostTotal float64 = 0 //西药费
1074
-	//var westernMedicineCostSelfTotal float64 = 0     //西药费
1088
+	var westernMedicineCostTotal float64 = 0         //西药费
1089
+	var westernMedicineCostSelfTotal float64 = 0     //西药费
1075 1090
 	var westernMedicineCostPartSelfTotal float64 = 0 //西药费
1091
+	var westernMedicineSelfTotal float64 = 0         //床位部分项目自费
1092
+	var westernMedicineInscpTotal float64 = 0        //床位部分项目自费
1076 1093
 
1077
-	var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
1078
-	//var chineseTraditionalMedicineCostSelfTotal float64 = 0     //中成药
1094
+	var chineseTraditionalMedicineCostTotal float64 = 0         //中成药
1095
+	var chineseTraditionalMedicineCostSelfTotal float64 = 0     //中成药
1079 1096
 	var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
1097
+	var chineseTraditionalSelfTotal float64 = 0                 //床位部分项目自费
1098
+	var chineseTraditionalInscpTotal float64 = 0                //床位部分项目自费
1080 1099
 
1081
-	var checkCostTotal float64 = 0 //检查费
1082
-	//var checkCostSelfTotal float64 = 0     //检查费
1100
+	var checkCostTotal float64 = 0         //检查费
1101
+	var checkCostSelfTotal float64 = 0     //检查费
1083 1102
 	var checkCostPartSelfTotal float64 = 0 //检查费
1103
+	var checkSelfTotal float64 = 0         //床位部分项目自费
1104
+	var checkInscpTotal float64 = 0        //床位部分项目自费
1084 1105
 
1085
-	var laboratoryCostTotal float64 = 0 //化验费
1086
-	//var laboratoryCostSelfTotal float64 = 0     //化验费
1106
+	var laboratoryCostTotal float64 = 0         //化验费
1107
+	var laboratoryCostSelfTotal float64 = 0     //化验费
1087 1108
 	var laboratoryCostPartSelfTotal float64 = 0 //化验费
1109
+	var laboratorySelfTotal float64 = 0         //床位部分项目自费
1110
+	var laboratoryInscpTotal float64 = 0        //床位部分项目自费
1088 1111
 
1089
-	var treatCostTotal float64 = 0 //治疗费用
1090
-	//var treatCostSelfTotal float64 = 0     //治疗费用
1112
+	var treatCostTotal float64 = 0         //治疗费用
1113
+	var treatCostSelfTotal float64 = 0     //治疗费用
1091 1114
 	var treatCostPartSelfTotal float64 = 0 //治疗费用
1115
+	var treatSelfTotal float64 = 0         //床位部分项目自费
1116
+	var treatInscpTotal float64 = 0        //床位部分项目自费
1092 1117
 
1093 1118
 	var zhenChaCostTotal float64 = 0 //其他费用
1094 1119
 	//var zhenChaCostPartSelfTotal float64 = 0 //其他费用
@@ -1096,113 +1121,115 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1096 1121
 	decimal.DivisionPrecision = 2
1097 1122
 
1098 1123
 	for _, item := range orderInfos {
1099
-		item.FulamtOwnpayAmt = item.DetItemFeeSumamt
1100
-		if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
1101
-			item.MedChrgitmType = "09"
1102
-		}
1103
-		if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
1104
-			if item.HisPrescriptionProject.Type == 2 {
1105
-				if c.GetAdminUserInfo().CurrentOrgId == 10215 {
1106
-					fmt.Println("CostClassify")
1107
-					fmt.Println(item.HisPrescriptionProject.VMHisProject.CostClassify)
1108
-					switch item.HisPrescriptionProject.VMHisProject.CostClassify {
1109
-					case 0:
1110
-						item.MedChrgitmType = "0"
1111
-						break
1112
-					case 1:
1113
-						item.MedChrgitmType = "14"
1114
-						break
1115
-					case 2:
1116
-						item.MedChrgitmType = "05"
1117
-
1118
-						break
1119
-					case 3:
1120
-						item.MedChrgitmType = "03"
1121
-
1122
-						break
1123
-					case 4:
1124
-						item.MedChrgitmType = "03"
1125
-
1126
-						break
1127
-					case 5:
1128
-						item.MedChrgitmType = "08"
1129
-
1130
-						break
1131
-					case 6:
1132
-						item.MedChrgitmType = "14"
1133
-
1134
-						break
1135
-					case 7:
1136
-						item.MedChrgitmType = "14"
1137
-
1138
-						break
1139
-					case 8:
1140
-						item.MedChrgitmType = "03"
1141
-						break
1142
-					case 9:
1143
-						item.MedChrgitmType = "14"
1144
-						break
1145
-					case 10:
1146
-						item.MedChrgitmType = "14"
1147
-						break
1148
-					case 11:
1149
-						item.MedChrgitmType = "06"
1150
-						break
1151
-					case 12:
1152
-						item.MedChrgitmType = "12"
1153
-						break
1154
-					case 13:
1155
-						item.MedChrgitmType = "01"
1156
-						break
1157
-					case 14:
1158
-						item.MedChrgitmType = "04"
1159
-						break
1160
-					case 15:
1161
-						item.MedChrgitmType = "14"
1162
-						break
1124
+		//item.FulamtOwnpayAmt = item.DetItemFeeSumamt
1125
+		if c.GetAdminUserInfo().CurrentOrgId != 10726 {
1126
+			if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
1127
+				item.MedChrgitmType = "09"
1128
+			}
1129
+			if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
1130
+				if item.HisPrescriptionProject.Type == 2 {
1131
+					if c.GetAdminUserInfo().CurrentOrgId == 10215 {
1132
+						fmt.Println("CostClassify")
1133
+						fmt.Println(item.HisPrescriptionProject.VMHisProject.CostClassify)
1134
+						switch item.HisPrescriptionProject.VMHisProject.CostClassify {
1135
+						case 0:
1136
+							item.MedChrgitmType = "0"
1137
+							break
1138
+						case 1:
1139
+							item.MedChrgitmType = "14"
1140
+							break
1141
+						case 2:
1142
+							item.MedChrgitmType = "05"
1163 1143
 
1164
-					}
1144
+							break
1145
+						case 3:
1146
+							item.MedChrgitmType = "03"
1165 1147
 
1166
-				} else {
1167
-					switch item.HisPrescriptionProject.VMHisProject.CostClassify {
1168
-					case 1:
1169
-						item.MedChrgitmType = "14"
1170
-						break
1171
-					case 2:
1172
-						item.MedChrgitmType = "05"
1173
-
1174
-						break
1175
-					case 3:
1176
-						item.MedChrgitmType = "04"
1177
-
1178
-						break
1179
-					case 4:
1180
-						item.MedChrgitmType = "14"
1181
-
1182
-						break
1183
-					case 5:
1184
-						item.MedChrgitmType = "08"
1185
-
1186
-						break
1187
-					case 6:
1188
-						item.MedChrgitmType = "14"
1189
-						break
1190
-					case 7:
1191
-						item.MedChrgitmType = "14"
1192
-						break
1193
-					case 8:
1194
-						item.MedChrgitmType = "03"
1195
-						break
1196
-					case 9:
1197
-						item.MedChrgitmType = "14"
1198
-						break
1199
-					default:
1200
-						item.MedChrgitmType = "14"
1201
-						break
1148
+							break
1149
+						case 4:
1150
+							item.MedChrgitmType = "03"
1151
+
1152
+							break
1153
+						case 5:
1154
+							item.MedChrgitmType = "08"
1155
+
1156
+							break
1157
+						case 6:
1158
+							item.MedChrgitmType = "14"
1159
+
1160
+							break
1161
+						case 7:
1162
+							item.MedChrgitmType = "14"
1163
+
1164
+							break
1165
+						case 8:
1166
+							item.MedChrgitmType = "03"
1167
+							break
1168
+						case 9:
1169
+							item.MedChrgitmType = "14"
1170
+							break
1171
+						case 10:
1172
+							item.MedChrgitmType = "14"
1173
+							break
1174
+						case 11:
1175
+							item.MedChrgitmType = "06"
1176
+							break
1177
+						case 12:
1178
+							item.MedChrgitmType = "12"
1179
+							break
1180
+						case 13:
1181
+							item.MedChrgitmType = "01"
1182
+							break
1183
+						case 14:
1184
+							item.MedChrgitmType = "04"
1185
+							break
1186
+						case 15:
1187
+							item.MedChrgitmType = "14"
1188
+							break
1189
+
1190
+						}
1191
+
1192
+					} else {
1193
+						switch item.HisPrescriptionProject.VMHisProject.CostClassify {
1194
+						case 1:
1195
+							item.MedChrgitmType = "14"
1196
+							break
1197
+						case 2:
1198
+							item.MedChrgitmType = "05"
1199
+
1200
+							break
1201
+						case 3:
1202
+							item.MedChrgitmType = "04"
1203
+
1204
+							break
1205
+						case 4:
1206
+							item.MedChrgitmType = "14"
1207
+
1208
+							break
1209
+						case 5:
1210
+							item.MedChrgitmType = "08"
1211
+
1212
+							break
1213
+						case 6:
1214
+							item.MedChrgitmType = "14"
1215
+							break
1216
+						case 7:
1217
+							item.MedChrgitmType = "14"
1218
+							break
1219
+						case 8:
1220
+							item.MedChrgitmType = "03"
1221
+							break
1222
+						case 9:
1223
+							item.MedChrgitmType = "14"
1224
+							break
1225
+						default:
1226
+							item.MedChrgitmType = "14"
1227
+							break
1228
+						}
1202 1229
 					}
1230
+				} else if item.HisPrescriptionProject.Type == 3 {
1231
+					item.MedChrgitmType = "08"
1203 1232
 				}
1204
-			} else if item.HisPrescriptionProject.Type == 3 {
1205
-				item.MedChrgitmType = "08"
1206 1233
 			}
1207 1234
 		}
1208 1235
 	}
@@ -1213,8 +1240,11 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1213 1240
 	for _, item := range orderInfos {
1214 1241
 		if item.MedChrgitmType == "01" { //床位费
1215 1242
 			bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1216
-			//bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1217
-			//bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1243
+			bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1244
+			bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1245
+			bedSelfTotal, _ = decimal.NewFromFloat(bedSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1246
+			bedInscpTotal, _ = decimal.NewFromFloat(bedInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1247
+
1218 1248
 		}
1219 1249
 		if item.MedChrgitmType == "02" { //诊察费
1220 1250
 			zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
@@ -1223,50 +1253,83 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1223 1253
 
1224 1254
 		if item.MedChrgitmType == "03" { //检查费
1225 1255
 			checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1226
-			//checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1227
-			//checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1256
+			checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1257
+			checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1258
+			checkSelfTotal, _ = decimal.NewFromFloat(checkSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1259
+			checkInscpTotal, _ = decimal.NewFromFloat(checkInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1260
+
1228 1261
 		}
1229 1262
 
1230 1263
 		if item.MedChrgitmType == "02" { //检查费
1231 1264
 			checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1232
-			//checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1233
-			//checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1265
+			checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1266
+			checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1267
+			checkSelfTotal, _ = decimal.NewFromFloat(checkSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1268
+			checkInscpTotal, _ = decimal.NewFromFloat(checkInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1269
+
1234 1270
 		}
1235 1271
 
1236 1272
 		if item.MedChrgitmType == "04" { //化验费
1237 1273
 			laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1238
-			//laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1239
-			//laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1274
+			laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1275
+			laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1276
+			laboratorySelfTotal, _ = decimal.NewFromFloat(laboratorySelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1277
+			laboratoryInscpTotal, _ = decimal.NewFromFloat(laboratoryInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1278
+
1240 1279
 		}
1241 1280
 
1242 1281
 		if item.MedChrgitmType == "05" { //治疗费
1243 1282
 			treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1244
-			//treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1245
-			//treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1283
+			treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1284
+			treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1285
+			treatSelfTotal, _ = decimal.NewFromFloat(treatSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1286
+			treatInscpTotal, _ = decimal.NewFromFloat(treatInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1287
+
1246 1288
 		}
1247 1289
 
1248 1290
 		if item.MedChrgitmType == "06" { //手术费
1249 1291
 			operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1250
-			//operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1251
-			//operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1292
+			operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1293
+			operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1294
+
1295
+			operationSelfTotal, _ = decimal.NewFromFloat(operationSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1296
+			operationInscpTotal, _ = decimal.NewFromFloat(operationInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1297
+
1252 1298
 		}
1253 1299
 
1254 1300
 		if item.MedChrgitmType == "08" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" || item.MedChrgitmType == "1401" { //材料费
1255 1301
 			materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1256
-			//materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1257
-			//materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1302
+			materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1303
+			materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1304
+
1305
+			materialSelfTotal, _ = decimal.NewFromFloat(materialSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1306
+			materialInscpTotal, _ = decimal.NewFromFloat(materialInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1307
+
1258 1308
 		}
1259 1309
 
1260 1310
 		if item.MedChrgitmType == "09" { //西药费
1311
+			fmt.Println("FulamtOwnpayAmt")
1312
+
1313
+			fmt.Println(item.FulamtOwnpayAmt)
1314
+			fmt.Println("FulamtOwnpayAmt")
1315
+
1261 1316
 			westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1262
-			//westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1263
-			//westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1317
+			westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1318
+			westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1319
+
1320
+			westernMedicineSelfTotal, _ = decimal.NewFromFloat(westernMedicineSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1321
+			westernMedicineInscpTotal, _ = decimal.NewFromFloat(westernMedicineInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1322
+
1264 1323
 		}
1265 1324
 
1266 1325
 		if item.MedChrgitmType == "11" { //中成费
1267 1326
 			chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1268
-			//chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1269
-			//chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1327
+			chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1328
+			chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1329
+
1330
+			chineseTraditionalSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1331
+			chineseTraditionalInscpTotal, _ = decimal.NewFromFloat(chineseTraditionalInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1332
+
1270 1333
 		}
1271 1334
 
1272 1335
 		if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
@@ -1299,51 +1362,77 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1299 1362
 	json.Unmarshal([]byte(order.SetlDetail), &rf)
1300 1363
 	patient, _ := service.GetFaPiaoPatientByID(order.UserOrgId, order.PatientId)
1301 1364
 	c.ServeSuccessJSON(map[string]interface{}{
1302
-		"patient":                                     patient,
1303
-		"order_infos":                                 orderInfos,
1304
-		"diagnosis":                                   name,
1305
-		"bedCostTotal":                                bedCostTotal,
1306
-		"bedCostSelfTotal":                            bedCostTotal,
1307
-		"bedCostPartSelfTotal":                        bedCostPartSelfTotal,
1308
-		"operationCostTotal":                          operationCostTotal,
1309
-		"operationCostSelfTotal":                      operationCostTotal,
1310
-		"operationCostPartSelfTotal":                  operationCostPartSelfTotal,
1311
-		"otherCostTotal":                              otherCostTotal,
1312
-		"otherCostSelfTotal":                          otherCostTotal,
1313
-		"otherCostPartSelfTotal":                      otherCostPartSelfTotal,
1314
-		"materialCostTotal":                           materialCostTotal,
1315
-		"materialCostSelfTotal":                       materialCostTotal,
1316
-		"materialCostPartSelfTotal":                   materialCostPartSelfTotal,
1317
-		"westernMedicineCostTotal":                    westernMedicineCostTotal,
1318
-		"westernMedicineCostSelfTotal":                westernMedicineCostTotal,
1319
-		"westernMedicineCostPartSelfTotal":            westernMedicineCostPartSelfTotal,
1365
+		"patient":              patient,
1366
+		"order_infos":          orderInfos,
1367
+		"diagnosis":            name,
1368
+		"bedCostTotal":         bedCostTotal,
1369
+		"bedCostSelfTotal":     bedCostSelfTotal,
1370
+		"bedCostPartSelfTotal": bedCostPartSelfTotal,
1371
+
1372
+		"bedSelfTotal":  bedSelfTotal,
1373
+		"bedInscpTotal": bedInscpTotal,
1374
+
1375
+		"operationCostTotal":         operationCostTotal,
1376
+		"operationCostSelfTotal":     operationCostSelfTotal,
1377
+		"operationCostPartSelfTotal": operationCostPartSelfTotal,
1378
+		"operationInscpTotal":        operationInscpTotal,
1379
+		"operationSelfTotal":         operationSelfTotal,
1380
+
1381
+		"otherCostTotal": otherCostTotal,
1382
+		//"otherCostSelfTotal":        otherCostSelfTotal,
1383
+		"otherCostPartSelfTotal":    otherCostPartSelfTotal,
1384
+		"materialCostTotal":         materialCostTotal,
1385
+		"materialCostSelfTotal":     materialCostSelfTotal,
1386
+		"materialCostPartSelfTotal": materialCostPartSelfTotal,
1387
+		"materialSelfTotal":         materialSelfTotal,
1388
+		"materialInscpTotal":        materialInscpTotal,
1389
+
1390
+		"westernMedicineCostTotal":         westernMedicineCostTotal,
1391
+		"westernMedicineCostSelfTotal":     westernMedicineCostSelfTotal,
1392
+		"westernMedicineCostPartSelfTotal": westernMedicineCostPartSelfTotal,
1393
+		"westernMedicineSelfTotal":         westernMedicineSelfTotal,
1394
+		"westernMedicineInscpTotal":        westernMedicineInscpTotal,
1395
+
1320 1396
 		"chineseTraditionalMedicineCostTotal":         chineseTraditionalMedicineCostTotal,
1321
-		"chineseTraditionalMedicineCostSelfTotal":     chineseTraditionalMedicineCostTotal,
1397
+		"chineseTraditionalMedicineCostSelfTotal":     chineseTraditionalMedicineCostSelfTotal,
1322 1398
 		"chineseTraditionalMedicineCostPartSelfTotal": chineseTraditionalMedicineCostPartSelfTotal,
1323
-		"checkCostTotal":                              checkCostTotal,
1324
-		"checkCostSelfTotal":                          checkCostTotal,
1325
-		"zhenChaCostTotal":                            zhenChaCostTotal,
1326
-		"zhenChaCostSelfTotal":                        zhenChaCostTotal,
1327
-		"checkCostPartSelfTotal":                      checkCostPartSelfTotal,
1328
-		"laboratoryCostTotal":                         laboratoryCostTotal,
1329
-		"laboratoryCostSelfTotal":                     laboratoryCostTotal,
1330
-		"laboratoryCostPartSelfTotal":                 laboratoryCostPartSelfTotal,
1331
-		"treatCostTotal":                              treatCostTotal,
1332
-		"treatCostSelfTotal":                          treatCostTotal,
1333
-		"treatCostPartSelfTotal":                      treatCostPartSelfTotal,
1334
-		"charge_admin":                                charge_admin,
1335
-		"printor_admin":                               printor_admin,
1336
-		"org_name":                                    org.OrgName,
1337
-		"org_code":                                    miConfig.Code,
1338
-		"name":                                        patient.Name,
1339
-		"number":                                      order.MdtrtId,
1340
-		"date":                                        order.SettleAccountsDate,
1341
-		"info":                                        order,
1342
-		"new_order":                                   order,
1343
-		"his_hospital":                                his_hospital,
1344
-		"his":                                         his,
1345
-		"funds":                                       rf,
1346
-		"dia_config":                                  dia_config,
1399
+		"chineseTraditionalSelfTotal":                 chineseTraditionalSelfTotal,
1400
+		"chineseTraditionalInscpTotal":                chineseTraditionalInscpTotal,
1401
+
1402
+		"checkCostTotal":         checkCostTotal,
1403
+		"checkCostSelfTotal":     checkCostSelfTotal,
1404
+		"checkSelfTotal":         checkSelfTotal,
1405
+		"checkInscpTotal":        checkInscpTotal,
1406
+		"checkCostPartSelfTotal": checkCostPartSelfTotal,
1407
+
1408
+		"zhenChaCostTotal":     zhenChaCostTotal,
1409
+		"zhenChaCostSelfTotal": zhenChaCostTotal,
1410
+
1411
+		"laboratoryCostTotal":         laboratoryCostTotal,
1412
+		"laboratoryCostSelfTotal":     laboratoryCostSelfTotal,
1413
+		"laboratoryCostPartSelfTotal": laboratoryCostPartSelfTotal,
1414
+		"laboratorySelfTotal":         laboratorySelfTotal,
1415
+		"laboratoryInscpTotal":        laboratoryInscpTotal,
1416
+
1417
+		"treatCostTotal":         treatCostTotal,
1418
+		"treatCostSelfTotal":     treatCostSelfTotal,
1419
+		"treatCostPartSelfTotal": treatCostPartSelfTotal,
1420
+		"treatSelfTotal":         treatSelfTotal,
1421
+		"treatInscpTotal":        treatInscpTotal,
1422
+
1423
+		"charge_admin":  charge_admin,
1424
+		"printor_admin": printor_admin,
1425
+		"org_name":      org.OrgName,
1426
+		"org_code":      miConfig.Code,
1427
+		"name":          patient.Name,
1428
+		"number":        order.MdtrtId,
1429
+		"date":          order.SettleAccountsDate,
1430
+		"info":          order,
1431
+		"new_order":     order,
1432
+		"his_hospital":  his_hospital,
1433
+		"his":           his,
1434
+		"funds":         rf,
1435
+		"dia_config":    dia_config,
1347 1436
 	})
1348 1437
 
1349 1438
 }

+ 131 - 84
service/app_version.go View File

@@ -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
+}

+ 65 - 52
service/his_service.go View File

@@ -2026,24 +2026,28 @@ func (HisPrescriptionProject) TableName() string {
2026 2026
 }
2027 2027
 
2028 2028
 type HisOrderInfo struct {
2029
-	ID                     int64                  `gorm:"column:id" json:"id" form:"id"`
2030
-	OrderNumber            string                 `gorm:"column:order_number" json:"order_number" form:"order_number"`
2031
-	UploadDate             int64                  `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
2032
-	AdviceId               int64                  `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
2033
-	DetItemFeeSumamt       float64                `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
2034
-	Cnt                    float64                `gorm:"column:cnt" json:"cnt" form:"cnt"`
2035
-	Pric                   float64                `gorm:"column:pric" json:"pric" form:"pric"`
2036
-	PatientId              int64                  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2037
-	MedChrgitmType         string                 `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
2038
-	Status                 int64                  `gorm:"column:status" json:"status" form:"status"`
2039
-	FeedetlSn              string                 `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
2040
-	ChldMedcFlag           string                 `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
2041
-	ChrgitmLv              string                 `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
2042
-	UserOrgId              int64                  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2043
-	ProjectId              int64                  `gorm:"column:project_id" json:"project_id" form:"project_id"`
2044
-	SelfpayProp            float64                `gorm:"column:selfpay_prop" json:"selfpay_prop" form:"selfpay_prop"`
2045
-	ItemId                 int64                  `gorm:"column:item_id" json:"item_id" form:"item_id"`
2046
-	FulamtOwnpayAmt        float64                `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
2029
+	ID               int64   `gorm:"column:id" json:"id" form:"id"`
2030
+	OrderNumber      string  `gorm:"column:order_number" json:"order_number" form:"order_number"`
2031
+	UploadDate       int64   `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
2032
+	AdviceId         int64   `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
2033
+	DetItemFeeSumamt float64 `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
2034
+	Cnt              float64 `gorm:"column:cnt" json:"cnt" form:"cnt"`
2035
+	Pric             float64 `gorm:"column:pric" json:"pric" form:"pric"`
2036
+	PatientId        int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2037
+	MedChrgitmType   string  `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
2038
+	Status           int64   `gorm:"column:status" json:"status" form:"status"`
2039
+	FeedetlSn        string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
2040
+	ChldMedcFlag     string  `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
2041
+	ChrgitmLv        string  `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
2042
+	UserOrgId        int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2043
+	ProjectId        int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
2044
+	SelfpayProp      float64 `gorm:"column:selfpay_prop" json:"selfpay_prop" form:"selfpay_prop"`
2045
+	ItemId           int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
2046
+	FulamtOwnpayAmt  float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
2047
+	OverlmtAmt       float64 `gorm:"column:overlmt_amt" json:"overlmt_amt" form:"overlmt_amt"`
2048
+	PreselfpayAmt    float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
2049
+	InscpScpAmt      float64 `json:"inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
2050
+
2047 2051
 	HisPrescriptionProject HisPrescriptionProject `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"project"`
2048 2052
 	HisDoctorAdviceInfo    HisDoctorAdviceInfo    `gorm:"ForeignKey:ID;AssociationForeignKey:AdviceId" json:"advice"`
2049 2053
 }
@@ -2869,23 +2873,27 @@ func UpDateOrderTwo(order *models.HisOrder, tx *gorm.DB) (err error) {
2869 2873
 }
2870 2874
 
2871 2875
 type HisOrderInfoTen struct {
2872
-	ID                     int64                      `gorm:"column:id" json:"id" form:"id"`
2873
-	OrderNumber            string                     `gorm:"column:order_number" json:"order_number" form:"order_number"`
2874
-	UploadDate             int64                      `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
2875
-	AdviceId               int64                      `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
2876
-	DetItemFeeSumamt       float64                    `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
2877
-	Cnt                    float64                    `gorm:"column:cnt" json:"cnt" form:"cnt"`
2878
-	Pric                   float64                    `gorm:"column:pric" json:"pric" form:"pric"`
2879
-	PatientId              int64                      `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2880
-	MedChrgitmType         string                     `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
2881
-	Status                 int64                      `gorm:"column:status" json:"status" form:"status"`
2882
-	FeedetlSn              string                     `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
2883
-	ChldMedcFlag           string                     `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
2884
-	ChrgitmLv              string                     `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
2885
-	UserOrgId              int64                      `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2886
-	ProjectId              int64                      `gorm:"column:project_id" json:"project_id" form:"project_id"`
2887
-	ItemId                 int64                      `gorm:"column:item_id" json:"item_id" form:"item_id"`
2888
-	FulamtOwnpayAmt        float64                    `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
2876
+	ID               int64   `gorm:"column:id" json:"id" form:"id"`
2877
+	OrderNumber      string  `gorm:"column:order_number" json:"order_number" form:"order_number"`
2878
+	UploadDate       int64   `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
2879
+	AdviceId         int64   `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
2880
+	DetItemFeeSumamt float64 `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
2881
+	Cnt              float64 `gorm:"column:cnt" json:"cnt" form:"cnt"`
2882
+	Pric             float64 `gorm:"column:pric" json:"pric" form:"pric"`
2883
+	PatientId        int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2884
+	MedChrgitmType   string  `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
2885
+	Status           int64   `gorm:"column:status" json:"status" form:"status"`
2886
+	FeedetlSn        string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
2887
+	ChldMedcFlag     string  `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
2888
+	ChrgitmLv        string  `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
2889
+	UserOrgId        int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2890
+	ProjectId        int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
2891
+	ItemId           int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
2892
+	FulamtOwnpayAmt  float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
2893
+	OverlmtAmt       float64 `gorm:"column:overlmt_amt"`
2894
+	PreselfpayAmt    float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
2895
+	InscpScpAmt      float64 `json:"inscp_scp_amt"`
2896
+
2889 2897
 	HisPrescriptionProject HisPrescriptionProject     `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"project"`
2890 2898
 	HisDoctorAdviceInfo    models.HisDoctorAdviceInfo `gorm:"ForeignKey:ID;AssociationForeignKey:AdviceId" json:"advice"`
2891 2899
 }
@@ -2925,23 +2933,28 @@ func GetHisPrescriptonProjectById(id int64) (models.HisPrescriptionProject, erro
2925 2933
 }
2926 2934
 
2927 2935
 type HisOrderInfoTwo struct {
2928
-	ID                     int64                      `gorm:"column:id" json:"id" form:"id"`
2929
-	OrderNumber            string                     `gorm:"column:order_number" json:"order_number" form:"order_number"`
2930
-	UploadDate             int64                      `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
2931
-	AdviceId               int64                      `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
2932
-	DetItemFeeSumamt       float64                    `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
2933
-	Cnt                    float64                    `gorm:"column:cnt" json:"cnt" form:"cnt"`
2934
-	Pric                   float64                    `gorm:"column:pric" json:"pric" form:"pric"`
2935
-	PatientId              int64                      `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2936
-	MedChrgitmType         string                     `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
2937
-	Status                 int64                      `gorm:"column:status" json:"status" form:"status"`
2938
-	FeedetlSn              string                     `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
2939
-	ChldMedcFlag           string                     `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
2940
-	ChrgitmLv              string                     `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
2941
-	UserOrgId              int64                      `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2942
-	ProjectId              int64                      `gorm:"column:project_id" json:"project_id" form:"project_id"`
2943
-	ItemId                 int64                      `gorm:"column:item_id" json:"item_id" form:"item_id"`
2944
-	FulamtOwnpayAmt        float64                    `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
2936
+	ID               int64   `gorm:"column:id" json:"id" form:"id"`
2937
+	OrderNumber      string  `gorm:"column:order_number" json:"order_number" form:"order_number"`
2938
+	UploadDate       int64   `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
2939
+	AdviceId         int64   `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
2940
+	DetItemFeeSumamt float64 `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
2941
+	Cnt              float64 `gorm:"column:cnt" json:"cnt" form:"cnt"`
2942
+	Pric             float64 `gorm:"column:pric" json:"pric" form:"pric"`
2943
+	PatientId        int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2944
+	MedChrgitmType   string  `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
2945
+	Status           int64   `gorm:"column:status" json:"status" form:"status"`
2946
+	FeedetlSn        string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
2947
+	ChldMedcFlag     string  `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
2948
+	ChrgitmLv        string  `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
2949
+	UserOrgId        int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2950
+	ProjectId        int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
2951
+	ItemId           int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
2952
+	FulamtOwnpayAmt  float64 `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
2953
+	OverlmtAmt       float64 `gorm:"column:overlmt_amt"`
2954
+	PreselfpayAmt    float64 `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
2955
+
2956
+	InscpScpAmt float64 `json:"inscp_scp_amt"`
2957
+
2945 2958
 	HisPrescriptionProject HisPrescriptionProject     `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"project"`
2946 2959
 	HisDoctorAdviceInfo    models.HisDoctorAdviceInfo `gorm:"ForeignKey:ID;AssociationForeignKey:AdviceId" json:"advice"`
2947 2960
 }