|
@@ -552,9 +552,11 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
552
|
552
|
//}
|
553
|
553
|
|
554
|
554
|
var advice models.DoctorAdvice
|
|
555
|
+ var tempAdvices []models.DoctorAdvice
|
555
|
556
|
|
556
|
557
|
if groupno > 0 {
|
557
|
|
- advices, _ := service.FindAllDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
|
|
558
|
+ advices, _ := service.FindAllDoctorAdviceByGoroupNoTwo(adminUserInfo.Org.Id, groupno)
|
|
559
|
+ tempAdvices = advices
|
558
|
560
|
for _, item := range advices {
|
559
|
561
|
if item.ExecutionState == 2 {
|
560
|
562
|
advice = item
|
|
@@ -562,7 +564,9 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
562
|
564
|
}
|
563
|
565
|
}
|
564
|
566
|
} else {
|
565
|
|
- advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
|
|
567
|
+ advices, _ := service.FindDoctorAdviceByIdsTwo(adminUserInfo.Org.Id, ids)
|
|
568
|
+ tempAdvices = advices
|
|
569
|
+
|
566
|
570
|
for _, item := range advices {
|
567
|
571
|
if item.ExecutionState == 2 {
|
568
|
572
|
advice = item
|
|
@@ -622,10 +626,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
622
|
626
|
|
623
|
627
|
if drugStockConfig.IsOpen == 1 {
|
624
|
628
|
if groupno > 0 {
|
625
|
|
- advices, _ := service.FindAllDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
|
|
629
|
+ //advices, _ := service.FindAllDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
|
626
|
630
|
isHasWay := false //用来判断是否包含来自药品库的医嘱
|
627
|
631
|
record_time := int64(0)
|
628
|
|
- for _, item := range advices {
|
|
632
|
+ for _, item := range tempAdvices {
|
629
|
633
|
if item.Way == 1 {
|
630
|
634
|
isHasWay = true
|
631
|
635
|
record_time = item.RecordDate
|
|
@@ -662,7 +666,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
662
|
666
|
if err != nil {
|
663
|
667
|
utils.TraceLog("创建出库单失败 err = %v", err)
|
664
|
668
|
} else {
|
665
|
|
- for _, item := range advices {
|
|
669
|
+ for _, item := range tempAdvices {
|
666
|
670
|
if item.Way == 1 {
|
667
|
671
|
if item.PrescribingNumber > 0 {
|
668
|
672
|
warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
|
@@ -707,7 +711,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
707
|
711
|
}
|
708
|
712
|
|
709
|
713
|
} else if err == nil {
|
710
|
|
- for _, item := range advices {
|
|
714
|
+ for _, item := range tempAdvices {
|
711
|
715
|
if item.Way == 1 {
|
712
|
716
|
outInfo, err := service.FindDrugStockOutInfoByTypeId(adminUserInfo.Org.Id, item.DrugId, out.ID, out.WarehouseOutOrderNumber)
|
713
|
717
|
if err == gorm.ErrRecordNotFound {
|
|
@@ -781,10 +785,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
781
|
785
|
|
782
|
786
|
}
|
783
|
787
|
} else {
|
784
|
|
- advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
|
|
788
|
+ //advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
|
785
|
789
|
isHasWay := false //用来判断是否包含来自药品库的医嘱
|
786
|
790
|
record_time := int64(0)
|
787
|
|
- for _, item := range advices {
|
|
791
|
+ for _, item := range tempAdvices {
|
788
|
792
|
if item.Way == 1 {
|
789
|
793
|
isHasWay = true
|
790
|
794
|
record_time = item.RecordDate
|
|
@@ -821,7 +825,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
821
|
825
|
if err != nil {
|
822
|
826
|
utils.TraceLog("创建出库单失败 err = %v", err)
|
823
|
827
|
} else {
|
824
|
|
- for _, item := range advices {
|
|
828
|
+ for _, item := range tempAdvices {
|
825
|
829
|
if item.Way == 1 {
|
826
|
830
|
if item.PrescribingNumber > 0 {
|
827
|
831
|
warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
|
@@ -866,7 +870,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
866
|
870
|
}
|
867
|
871
|
|
868
|
872
|
} else if err == nil {
|
869
|
|
- for _, item := range advices {
|
|
873
|
+ for _, item := range tempAdvices {
|
870
|
874
|
if item.Way == 1 {
|
871
|
875
|
outInfo, err := service.FindDrugStockOutInfoByTypeId(adminUserInfo.Org.Id, item.DrugId, out.ID, out.WarehouseOutOrderNumber)
|
872
|
876
|
if err == gorm.ErrRecordNotFound {
|
|
@@ -950,8 +954,8 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
950
|
954
|
|
951
|
955
|
if privateDrugConfig != nil && privateDrugConfig.DrugStart == 1 {
|
952
|
956
|
if groupno > 0 {
|
953
|
|
- advices, _ := service.FindAllDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
|
954
|
|
- for _, item := range advices {
|
|
957
|
+ //advices, _ := service.FindAllDoct/**/orAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
|
|
958
|
+ for _, item := range tempAdvices {
|
955
|
959
|
fmt.Println("------------进来没有22222222", item.ExecutionState)
|
956
|
960
|
if item.ExecutionState == 1 {
|
957
|
961
|
prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
@@ -987,8 +991,8 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
987
|
991
|
}
|
988
|
992
|
} else {
|
989
|
993
|
|
990
|
|
- advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
|
991
|
|
- for _, item := range advices {
|
|
994
|
+ //advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
|
|
995
|
+ for _, item := range tempAdvices {
|
992
|
996
|
if item.ExecutionState == 1 {
|
993
|
997
|
|
994
|
998
|
prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
@@ -2072,14 +2076,9 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
|
2072
|
2076
|
internal_fistula_skin := dataBody["internal_fistula_skin"].(string)
|
2073
|
2077
|
evaluation.InternalFistulaSkin = internal_fistula_skin
|
2074
|
2078
|
}
|
2075
|
|
- if dataBody["is_hemorrhage"] != nil && reflect.TypeOf(dataBody["is_hemorrhage"]).String() == "string" {
|
2076
|
|
- ishemorrhage, _ := dataBody["is_hemorrhage"].(string)
|
2077
|
|
- is_hemorrhage, _ := strconv.ParseInt(ishemorrhage, 10, 64)
|
2078
|
|
- evaluation.IsHemorrhage = is_hemorrhage
|
2079
|
2079
|
|
2080
|
|
- //if dataBody["is_hemorrhage"] != nil && reflect.TypeOf(dataBody["is_hemorrhage"]).String() == "float64" {
|
2081
|
|
- // is_hemorrhage := int64(dataBody["is_hemorrhage"].(float64))
|
2082
|
|
- // fmt.Println("is_hemorrhage2222222222222222",is_hemorrhage)
|
|
2080
|
+ if dataBody["is_hemorrhage"] != nil && reflect.TypeOf(dataBody["is_hemorrhage"]).String() == "float64" {
|
|
2081
|
+ is_hemorrhage := int64(dataBody["is_hemorrhage"].(float64))
|
2083
|
2082
|
if is_hemorrhage != 1 && is_hemorrhage != 2 {
|
2084
|
2083
|
is_hemorrhage = 0
|
2085
|
2084
|
}
|