Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
5ece2d7c08
2 changed files with 19 additions and 20 deletions
  1. 3 3
      controllers/sg/his_api_controller.go
  2. 16 17
      service/gdyb_service.go

+ 3 - 3
controllers/sg/his_api_controller.go View File

@@ -1817,11 +1817,11 @@ func (c *HisApiController) GetBatchSettleList() {
1817 1817
 			config = append(config, &diagnosisConfig)
1818 1818
 		}
1819 1819
 
1820
-		for _, item := range config {
1820
+		for index, item := range config {
1821 1821
 			var tempOpspdiseinfo service.OpspdiseinfoStruct
1822 1822
 			tempOpspdiseinfo.DiagCode = item.CountryCode
1823 1823
 			tempOpspdiseinfo.DiagName = item.CountryContentName
1824
-			tempOpspdiseinfo.MaindiagFlag = "1"
1824
+			tempOpspdiseinfo.MaindiagFlag = strconv.Itoa(index)
1825 1825
 			tempOpspdiseinfo.OprnOprtCode = ""
1826 1826
 			tempOpspdiseinfo.OprnOprtName = ""
1827 1827
 			tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo)
@@ -1830,7 +1830,7 @@ func (c *HisApiController) GetBatchSettleList() {
1830 1830
 		sickConfigTwo, _ := service.FindSickById(his.SickType)
1831 1831
 		tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
1832 1832
 		tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
1833
-		tempOpspdiseinfo2.MaindiagFlag = "2"
1833
+		tempOpspdiseinfo2.MaindiagFlag = "1"
1834 1834
 		tempOpspdiseinfo2.OprnOprtCode = ""
1835 1835
 		tempOpspdiseinfo2.OprnOprtName = ""
1836 1836
 		tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)

+ 16 - 17
service/gdyb_service.go View File

@@ -2946,26 +2946,25 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
2946 2946
 		}
2947 2947
 	}
2948 2948
 	opspdiseinfo := make([]map[string]interface{}, 0) // 门诊慢特病诊断信息
2949
-	for _, item := range struct4101.OpspdiseinfoStruct {
2950
-		opspdiseinfotemp := make(map[string]interface{})
2951
-		opspdiseinfotemp["diag_name"] = item.DiagName // 诊断名称  必填
2952
-		opspdiseinfotemp["diag_code"] = item.DiagCode // 诊断代码 必填
2953
-		opspdiseinfotemp["oprn_oprt_name"] = ""       // 手术操作名称 必填
2954
-		opspdiseinfotemp["oprn_oprt_code"] = ""       // 手术操作代码 必填
2955 2949
 
2956
-		opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
2957
-	}
2950
+	opspdiseinfotemp := make(map[string]interface{})
2951
+	opspdiseinfotemp["diag_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName // 诊断名称  必填
2952
+	opspdiseinfotemp["diag_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode // 诊断代码 必填
2953
+	opspdiseinfotemp["oprn_oprt_name"] = ""                                                                      // 手术操作名称 必填
2954
+	opspdiseinfotemp["oprn_oprt_code"] = ""                                                                      // 手术操作代码 必填
2955
+	opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
2958 2956
 
2959 2957
 	diseinfo := make([]map[string]interface{}, 0) // 住院诊断信息
2960
-	for _, item := range struct4101.OpspdiseinfoStruct {
2961
-		fmt.Println(item.DiagName)
2962
-		diseinfotemp := make(map[string]interface{})
2963
-		diseinfotemp["maindiag_flag"] = item.MaindiagFlag // 手术操作代码 必填
2964
-		diseinfotemp["diag_type"] = item.MaindiagFlag     // 诊断类别  必填
2965
-		diseinfotemp["diag_code"] = item.DiagCode         // 诊断代码 必填
2966
-		diseinfotemp["diag_name"] = item.DiagName         // 诊断名称 必填
2967
-		diseinfotemp["adm_cond_type"] = "3"               // 入院病情类型 必填
2968
-		diseinfo = append(diseinfo, diseinfotemp)
2958
+	for index, item := range struct4101.OpspdiseinfoStruct {
2959
+		if index != (len(struct4101.OpspdiseinfoStruct) - 1) {
2960
+			diseinfotemp := make(map[string]interface{})
2961
+			diseinfotemp["maindiag_flag"] = item.MaindiagFlag // 手术操作代码 必填
2962
+			diseinfotemp["diag_type"] = item.MaindiagFlag     // 诊断类别  必填
2963
+			diseinfotemp["diag_code"] = item.DiagCode         // 诊断代码 必填
2964
+			diseinfotemp["diag_name"] = item.DiagName         // 诊断名称 必填
2965
+			diseinfotemp["adm_cond_type"] = "3"               // 入院病情类型 必填
2966
+			diseinfo = append(diseinfo, diseinfotemp)
2967
+		}
2969 2968
 	}
2970 2969
 
2971 2970
 	iteminfo := make([]map[string]interface{}, 0) // 住院诊断信息