陈少旭 vor 1 Monat
Ursprung
Commit
73bdb8fb2f
1 geänderte Dateien mit 58 neuen und 14 gelöschten Zeilen
  1. 58 14
      controllers/his_api_controller.go

+ 58 - 14
controllers/his_api_controller.go Datei anzeigen

@@ -1080,8 +1080,8 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1080 1080
 	var operationSelfTotal float64 = 0         //床位部分项目自费
1081 1081
 	var operationInscpTotal float64 = 0        //床位部分项目自费
1082 1082
 
1083
-	var otherCostTotal float64 = 0 //其他费用
1084
-	//var otherCostSelfTotal float64 = 0     //其他费用
1083
+	var otherCostTotal float64 = 0         //其他费用
1084
+	var otherCostSelfTotal float64 = 0     //其他费用
1085 1085
 	var otherCostPartSelfTotal float64 = 0 //其他费用
1086 1086
 	//var otherSelfTotal float64 = 0         //床位部分项目自费
1087 1087
 	//var otherInscpTotal float64 = 0        //床位部分项目自费
@@ -1122,6 +1122,18 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1122 1122
 	var treatSelfTotal float64 = 0         //床位部分项目自费
1123 1123
 	var treatInscpTotal float64 = 0        //床位部分项目自费
1124 1124
 
1125
+	var huliCostTotal float64 = 0         //治疗费用
1126
+	var huliCostSelfTotal float64 = 0     //治疗费用
1127
+	var huliCostPartSelfTotal float64 = 0 //治疗费用
1128
+	var huliSelfTotal float64 = 0         //床位部分项目自费
1129
+	var huliInscpTotal float64 = 0        //床位部分项目自费
1130
+
1131
+	var zcCostTotal float64 = 0         //治疗费用
1132
+	var zcCostSelfTotal float64 = 0     //治疗费用
1133
+	var zcCostPartSelfTotal float64 = 0 //治疗费用
1134
+	var zcSelfTotal float64 = 0         //床位部分项目自费
1135
+	var zcInscpTotal float64 = 0        //床位部分项目自费
1136
+
1125 1137
 	var zhenChaCostTotal float64 = 0 //其他费用
1126 1138
 	//var zhenChaCostPartSelfTotal float64 = 0 //其他费用
1127 1139
 
@@ -1347,8 +1359,26 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1347 1359
 
1348 1360
 		if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
1349 1361
 			otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1350
-			//otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1351
-			//otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1362
+			otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1363
+			otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1364
+		}
1365
+
1366
+		if item.MedChrgitmType == "02" { //其他费
1367
+			zcCostTotal, _ = decimal.NewFromFloat(zcCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1368
+			zcCostSelfTotal, _ = decimal.NewFromFloat(zcCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1369
+			zcCostPartSelfTotal, _ = decimal.NewFromFloat(zcCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1370
+			zcSelfTotal, _ = decimal.NewFromFloat(zcSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1371
+			zcInscpTotal, _ = decimal.NewFromFloat(zcInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1372
+
1373
+		}
1374
+
1375
+		if item.MedChrgitmType == "07" { //其他费
1376
+			huliCostTotal, _ = decimal.NewFromFloat(huliCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
1377
+			huliCostSelfTotal, _ = decimal.NewFromFloat(huliCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
1378
+			huliCostPartSelfTotal, _ = decimal.NewFromFloat(huliCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
1379
+			huliSelfTotal, _ = decimal.NewFromFloat(huliSelfTotal).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
1380
+			huliInscpTotal, _ = decimal.NewFromFloat(huliInscpTotal).Add(decimal.NewFromFloat(item.InscpScpAmt)).Float64()
1381
+
1352 1382
 		}
1353 1383
 	}
1354 1384
 
@@ -1391,8 +1421,8 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1391 1421
 		"operationInscpTotal":        operationInscpTotal,
1392 1422
 		"operationSelfTotal":         operationSelfTotal,
1393 1423
 
1394
-		"otherCostTotal": otherCostTotal,
1395
-		//"otherCostSelfTotal":        otherCostSelfTotal,
1424
+		"otherCostTotal":            otherCostTotal,
1425
+		"otherCostSelfTotal":        otherCostSelfTotal,
1396 1426
 		"otherCostPartSelfTotal":    otherCostPartSelfTotal,
1397 1427
 		"materialCostTotal":         materialCostTotal,
1398 1428
 		"materialCostSelfTotal":     materialCostSelfTotal,
@@ -1446,6 +1476,18 @@ func (c *HisApiController) GetPrivateExpensesOrder() {
1446 1476
 		"his":           his,
1447 1477
 		"funds":         rf,
1448 1478
 		"dia_config":    dia_config,
1479
+
1480
+		"huliCostTotal":         huliCostTotal,
1481
+		"huliCostSelfTotal":     huliCostSelfTotal,
1482
+		"huliCostPartSelfTotal": huliCostPartSelfTotal,
1483
+		"huliSelfTotal":         huliSelfTotal,
1484
+		"huliInscpTotal":        huliInscpTotal,
1485
+
1486
+		"zcCostTotal":         zcCostTotal,
1487
+		"zcCostSelfTotal":     zcCostSelfTotal,
1488
+		"zcCostPartSelfTotal": zcCostPartSelfTotal,
1489
+		"zcSelfTotal":         zcSelfTotal,
1490
+		"zcInscpTotal":        zcInscpTotal,
1449 1491
 	})
1450 1492
 
1451 1493
 }
@@ -1657,7 +1699,7 @@ func (c *HisApiController) GetHisPatientInfo() {
1657 1699
 	sch, _ := service.GetPatientSch(patient_id, recordDateTime, admin.CurrentOrgId)
1658 1700
 	if sch.ID > 0 {
1659 1701
 		var week string
1660
-		t := time.Now()
1702
+		t := theTime
1661 1703
 		switch t.Weekday().String() {
1662 1704
 		case "Monday":
1663 1705
 			week = "周一"
@@ -1713,12 +1755,12 @@ func (c *HisApiController) GetHisPatientInfo() {
1713 1755
 					}
1714 1756
 
1715 1757
 					if subItem.FrequencyType == 2 { //按照天数频率
1716
-						p, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
1758
+						p, _ := time.Parse("2006-01-02", theTime.Format("2006-01-02"))
1717 1759
 						now := p.Unix()
1718 1760
 						dayStr := strconv.FormatInt(subItem.DayCount, 10)
1719 1761
 						dayStr2 := "-" + dayStr
1720 1762
 						count, _ := strconv.ParseInt(dayStr2, 10, 64)
1721
-						oldTime := time.Now().AddDate(0, 0, int(count)).Unix()
1763
+						oldTime := theTime.AddDate(0, 0, int(count)).Unix()
1722 1764
 						advices, _ := service.FindAllHisDoctorAdviceByTime(now, oldTime, patient_id, c.GetAdminUserInfo().CurrentOrgId, subItem.DrugId)
1723 1765
 						if len(advices) == 0 {
1724 1766
 							cus.HisPrescriptionAdviceTemplate = append(cus.HisPrescriptionAdviceTemplate, subItem)
@@ -1740,12 +1782,12 @@ func (c *HisApiController) GetHisPatientInfo() {
1740 1782
 						}
1741 1783
 
1742 1784
 						if subItem.FrequencyType == 2 {
1743
-							p, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
1785
+							p, _ := time.Parse("2006-01-02", theTime.Format("2006-01-02"))
1744 1786
 							now := p.Unix()
1745 1787
 							dayStr := strconv.FormatInt(subItem.DayCount, 10)
1746 1788
 							dayStr2 := "-" + dayStr
1747 1789
 							count, _ := strconv.ParseInt(dayStr2, 10, 64)
1748
-							oldTime := time.Now().AddDate(0, 0, int(count)).Unix()
1790
+							oldTime := theTime.AddDate(0, 0, int(count)).Unix()
1749 1791
 							projects, _ := service.FindAllHisProjectByTime(now, oldTime, patient_id, c.GetAdminUserInfo().CurrentOrgId, subItem.ProjectId)
1750 1792
 							if len(projects) == 0 {
1751 1793
 								cus.HisPrescriptionProjectTemplate = append(cus.HisPrescriptionProjectTemplate, subItem)
@@ -1765,12 +1807,12 @@ func (c *HisApiController) GetHisPatientInfo() {
1765 1807
 						}
1766 1808
 
1767 1809
 						if subItem.FrequencyType == 2 {
1768
-							p, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
1810
+							p, _ := time.Parse("2006-01-02", theTime.Format("2006-01-02"))
1769 1811
 							now := p.Unix()
1770 1812
 							dayStr := strconv.FormatInt(subItem.DayCount, 10)
1771 1813
 							dayStr2 := "-" + dayStr
1772 1814
 							count, _ := strconv.ParseInt(dayStr2, 10, 64)
1773
-							oldTime := time.Now().AddDate(0, 0, int(count)).Unix()
1815
+							oldTime := theTime.AddDate(0, 0, int(count)).Unix()
1774 1816
 							projects, _ := service.FindAllHisProjectByTime(now, oldTime, patient_id, c.GetAdminUserInfo().CurrentOrgId, subItem.ProjectId)
1775 1817
 							if len(projects) == 0 {
1776 1818
 								cus.HisPrescriptionProjectTemplate = append(cus.HisPrescriptionProjectTemplate, subItem)
@@ -3572,6 +3614,7 @@ func (c *HisApiController) CreateHisPrescription() {
3572 3614
 					ctime := time.Now().Unix()
3573 3615
 
3574 3616
 					if tempPrescription.ID == 0 {
3617
+
3575 3618
 						prescription := &models.HisPrescription{
3576 3619
 							ID:                 0,
3577 3620
 							PatientId:          patient_id,
@@ -10214,6 +10257,7 @@ func (c *HisApiController) GetHisOrderList() {
10214 10257
 	sch_type, _ := c.GetInt64("sch_type", 0)
10215 10258
 	zone_type, _ := c.GetInt64("zone_type", 0)
10216 10259
 	med_type, _ := c.GetInt64("med_type", 0)
10260
+	fee_type, _ := c.GetInt64("fee_type", 0)
10217 10261
 
10218 10262
 	timeLayout := "2006-01-02"
10219 10263
 	loc, _ := time.LoadLocation("Local")
@@ -10240,7 +10284,7 @@ func (c *HisApiController) GetHisOrderList() {
10240 10284
 
10241 10285
 	adminUser := c.GetAdminUserInfo()
10242 10286
 	org_id := adminUser.CurrentOrgId
10243
-	order, err, total := service.GetHisOrderList(org_id, page, limit, startTime, endTime, types, keywords, p_type, sort_type, start_time, end_time, charge_type, sch_type, zone_type, med_type)
10287
+	order, err, total := service.GetHisOrderList(org_id, page, limit, startTime, endTime, types, keywords, p_type, sort_type, start_time, end_time, charge_type, sch_type, zone_type, med_type, fee_type)
10244 10288
 
10245 10289
 	for _, item := range order {
10246 10290
 		info, _ := service.GetHisPrescriptionByPatientID(item.PatientId, item.UserOrgId)