|
@@ -960,6 +960,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
960
|
960
|
s.PatientId = patient_id
|
961
|
961
|
s.HisPatientId = his_patient_id
|
962
|
962
|
s.StartTime = pTime
|
|
963
|
+
|
963
|
964
|
errcode := c.setAdviceWithJSON(&s, advice.(map[string]interface{}))
|
964
|
965
|
if errcode > 0 {
|
965
|
966
|
c.ServeFailJSONWithSGJErrorCode(errcode)
|
|
@@ -1062,7 +1063,8 @@ func (c *HisApiController) CreateHisPrescription() {
|
1062
|
1063
|
if p.Type == 3 { //处理透前准备耗材数量数据
|
1063
|
1064
|
consumables, _ := service.FindHisConsumablesByID(adminInfo.CurrentOrgId, patient_id, recordDateTime, p.ProjectId)
|
1064
|
1065
|
if consumables.ID > 0 {
|
1065
|
|
- consumables.Count = int64(p.Count)
|
|
1066
|
+ cnt, _ := strconv.ParseInt(p.Count, 10, 64)
|
|
1067
|
+ consumables.Count = cnt
|
1066
|
1068
|
service.UpdateConsumables(&consumables)
|
1067
|
1069
|
}
|
1068
|
1070
|
}
|
|
@@ -1380,7 +1382,8 @@ func (c *HisApiController) DeletePrescription() {
|
1380
|
1382
|
if stockConfig.IsOpen == 1 {
|
1381
|
1383
|
if item.Type == 3 {
|
1382
|
1384
|
good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
|
1383
|
|
- f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(item.Count), 10), 64)
|
|
1385
|
+ //cnt, _ := strconv.ParseInt(item.Count, 10, 64)
|
|
1386
|
+ f_count, _ := strconv.ParseFloat(item.Count, 64)
|
1384
|
1387
|
good.Total = good.Total + f_count
|
1385
|
1388
|
service.UpdateGoodInfo(&good)
|
1386
|
1389
|
}
|
|
@@ -1473,7 +1476,8 @@ func (c *HisApiController) DeleteProject() {
|
1473
|
1476
|
if stockConfig.IsOpen == 1 {
|
1474
|
1477
|
if project.Type == 3 {
|
1475
|
1478
|
good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
1476
|
|
- f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
|
|
1479
|
+
|
|
1480
|
+ f_count, _ := strconv.ParseFloat(project.Count, 64)
|
1477
|
1481
|
good.Total = good.Total + f_count
|
1478
|
1482
|
service.UpdateGoodInfo(&good)
|
1479
|
1483
|
}
|
|
@@ -1971,8 +1975,7 @@ func (c *HisApiController) setProjectWithJSONTwo(project *models.HisPrescription
|
1971
|
1975
|
|
1972
|
1976
|
if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
|
1973
|
1977
|
total, _ := json["total"].(string)
|
1974
|
|
- totals, _ := strconv.ParseInt(total, 10, 64)
|
1975
|
|
- project.Count = totals
|
|
1978
|
+ project.Count = total
|
1976
|
1979
|
}
|
1977
|
1980
|
|
1978
|
1981
|
if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
|
|
@@ -2130,6 +2133,11 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
|
2130
|
2133
|
hisAdvice, err := service.GetHisDoctorAdvicesById(advice.ID)
|
2131
|
2134
|
if err == nil {
|
2132
|
2135
|
if hisAdvice.ID > 0 {
|
|
2136
|
+ if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
|
|
2137
|
+ singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
|
|
2138
|
+ advice.SingleDose = singleDose
|
|
2139
|
+ }
|
|
2140
|
+
|
2133
|
2141
|
advice.ExecutionTime = hisAdvice.ExecutionTime
|
2134
|
2142
|
advice.ExecutionStaff = hisAdvice.ExecutionStaff
|
2135
|
2143
|
advice.ExecutionState = hisAdvice.ExecutionState
|
|
@@ -2138,6 +2146,16 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
|
2138
|
2146
|
advice.CheckState = hisAdvice.CheckState
|
2139
|
2147
|
advice.StartTime = hisAdvice.StartTime
|
2140
|
2148
|
advice.HospApprFlag = hisAdvice.HospApprFlag
|
|
2149
|
+
|
|
2150
|
+ if hisAdvice.SingleDose != advice.SingleDose || hisAdvice.DeliveryWay != advice.DeliveryWay || hisAdvice.ExecutionFrequency != advice.ExecutionFrequency || hisAdvice.Day != advice.Day || hisAdvice.PrescribingNumber != advice.PrescribingNumber || hisAdvice.Price != advice.Price || hisAdvice.Remark != advice.Remark {
|
|
2151
|
+ advice.ExecutionTime = 0
|
|
2152
|
+ advice.ExecutionStaff = 0
|
|
2153
|
+ advice.ExecutionState = 2
|
|
2154
|
+ advice.CheckTime = 0
|
|
2155
|
+ advice.Checker = 0
|
|
2156
|
+ advice.CheckState = 2
|
|
2157
|
+ }
|
|
2158
|
+
|
2141
|
2159
|
//advice.Groupno = hisAdvice.Groupno
|
2142
|
2160
|
|
2143
|
2161
|
}
|
|
@@ -2345,8 +2363,8 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
2345
|
2363
|
|
2346
|
2364
|
if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
|
2347
|
2365
|
total, _ := json["total"].(string)
|
2348
|
|
- totals, _ := strconv.ParseInt(total, 10, 64)
|
2349
|
|
- project.Count = totals
|
|
2366
|
+ //totals, _ := strconv.ParseInt(total, 10, 64)
|
|
2367
|
+ project.Count = total
|
2350
|
2368
|
}
|
2351
|
2369
|
|
2352
|
2370
|
if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
|
|
@@ -2402,7 +2420,7 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
2402
|
2420
|
if stockConfig.IsOpen == 1 {
|
2403
|
2421
|
if project.Type == 3 {
|
2404
|
2422
|
good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
2405
|
|
- f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
|
|
2423
|
+ f_count, _ := strconv.ParseFloat(project.Count, 64)
|
2406
|
2424
|
good.Total = good.Total - f_count
|
2407
|
2425
|
service.UpdateGoodInfo(&good)
|
2408
|
2426
|
}
|
|
@@ -2415,12 +2433,18 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
|
2415
|
2433
|
if project.Type == 3 {
|
2416
|
2434
|
good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
2417
|
2435
|
if project.Count < temp_project.Count {
|
2418
|
|
- other_count := temp_project.Count - project.Count
|
|
2436
|
+ f_count_one, _ := strconv.ParseFloat(project.Count, 64)
|
|
2437
|
+ f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
|
|
2438
|
+
|
|
2439
|
+ other_count := f_count_two - f_count_one
|
2419
|
2440
|
other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
|
2420
|
2441
|
good.Total = good.Total + other_count_two
|
2421
|
2442
|
service.UpdateGoodInfo(&good)
|
2422
|
2443
|
} else if project.Count > temp_project.Count {
|
2423
|
|
- other_count := project.Count - temp_project.Count
|
|
2444
|
+ f_count_one, _ := strconv.ParseFloat(project.Count, 64)
|
|
2445
|
+ f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
|
|
2446
|
+
|
|
2447
|
+ other_count := f_count_one - f_count_two
|
2424
|
2448
|
other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
|
2425
|
2449
|
good.Total = good.Total - other_count_two
|
2426
|
2450
|
service.UpdateGoodInfo(&good)
|
|
@@ -2576,8 +2600,8 @@ func (c *HisApiController) setProjectTemplateWithJSON(project *models.HisPrescri
|
2576
|
2600
|
|
2577
|
2601
|
if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
|
2578
|
2602
|
total, _ := json["total"].(string)
|
2579
|
|
- totals, _ := strconv.ParseInt(total, 10, 64)
|
2580
|
|
- project.Count = totals
|
|
2603
|
+ //totals, _ := strconv.ParseInt(total, 10, 64)
|
|
2604
|
+ project.Count = total
|
2581
|
2605
|
}
|
2582
|
2606
|
|
2583
|
2607
|
if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
|
|
@@ -3279,7 +3303,8 @@ func (c *HisApiController) GetUploadInfo() {
|
3279
|
3303
|
}
|
3280
|
3304
|
if item.Type == 2 { //项目
|
3281
|
3305
|
for _, subItem := range item.HisPrescriptionProject {
|
3282
|
|
- total = total + (subItem.Price * float64(subItem.Count))
|
|
3306
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
3307
|
+ total = total + (subItem.Price * cnt)
|
3283
|
3308
|
}
|
3284
|
3309
|
}
|
3285
|
3310
|
|
|
@@ -3349,11 +3374,12 @@ func (c *HisApiController) GetUploadInfo() {
|
3349
|
3374
|
}
|
3350
|
3375
|
if item.Type == 2 { //项目
|
3351
|
3376
|
for _, subItem := range item.HisPrescriptionProject {
|
|
3377
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
3352
|
3378
|
cus := &Custom{
|
3353
|
3379
|
AdviceId: 0,
|
3354
|
3380
|
ProjectId: subItem.ID,
|
3355
|
|
- DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*float64(subItem.Count)),
|
3356
|
|
- Cut: fmt.Sprintf("%.4f", float64(subItem.Count)),
|
|
3381
|
+ DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
|
|
3382
|
+ Cut: fmt.Sprintf("%.4f", cnt),
|
3357
|
3383
|
FeedetlSn: subItem.FeedetlSn,
|
3358
|
3384
|
Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
|
3359
|
3385
|
MedListCodg: subItem.MedListCodg,
|
|
@@ -5116,7 +5142,8 @@ func (c *HisApiController) PreSettle() {
|
5116
|
5142
|
}
|
5117
|
5143
|
if item.Type == 2 { //项目
|
5118
|
5144
|
for _, subItem := range item.HisPrescriptionProject {
|
5119
|
|
- total = total + (subItem.Price * float64(subItem.Count))
|
|
5145
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
5146
|
+ total = total + (subItem.Price * cnt)
|
5120
|
5147
|
}
|
5121
|
5148
|
}
|
5122
|
5149
|
|
|
@@ -5174,12 +5201,12 @@ func (c *HisApiController) PreSettle() {
|
5174
|
5201
|
|
5175
|
5202
|
if item.Type == 2 { //项目
|
5176
|
5203
|
for _, subItem := range item.HisPrescriptionProject {
|
5177
|
|
-
|
|
5204
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
5178
|
5205
|
cus := &Custom{
|
5179
|
5206
|
AdviceId: 0,
|
5180
|
5207
|
ProjectId: subItem.ID,
|
5181
|
|
- DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
|
5182
|
|
- Cut: fmt.Sprintf("%.2f", float64(subItem.Count)),
|
|
5208
|
+ DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cnt),
|
|
5209
|
+ Cut: fmt.Sprintf("%.2f", cnt),
|
5183
|
5210
|
FeedetlSn: subItem.FeedetlSn,
|
5184
|
5211
|
Price: fmt.Sprintf("%.2f", float64(subItem.Price)),
|
5185
|
5212
|
MedListCodg: subItem.MedListCodg,
|