Przeglądaj źródła

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

csx 3 lat temu
rodzic
commit
2c253005c4

+ 15 - 6
controllers/coordinate/coordinate_controller.go Wyświetl plik

@@ -11,6 +11,12 @@ type CoordinateController struct {
11 11
 	controllers.BaseAuthAPIController
12 12
 }
13 13
 
14
+type ResultReg struct {
15
+	ResultCode string `json:"resultCode"`
16
+	ResultDesc string `json:"resultDesc"`
17
+	InfoSeq    int64  `json:"infoSeq"`
18
+}
19
+
14 20
 func CoordinateRegistRouters() {
15 21
 	beego.Router("/coordinate/check", &CoordinateController{}, "get:SavePatientMessageInfo")
16 22
 	beego.Router("/coordinate/register", &CoordinateController{}, "get:Register")
@@ -21,16 +27,19 @@ func CoordinateRegistRouters() {
21 27
 }
22 28
 
23 29
 func (c *CoordinateController) SavePatientMessageInfo() {
24
-	result, request_log := service.SavePatientMessageInfo()
25
-	fmt.Println(result)
26
-	fmt.Println(request_log)
30
+	//result, request_log := service.SavePatientMessageInfo()
27 31
 
28 32
 }
29 33
 
30 34
 func (c *CoordinateController) Register() {
31
-	result, request_log := service.SaveReg()
32
-	fmt.Println(result)
33
-	fmt.Println(request_log)
35
+	//var reg models.Reg
36
+	//reg.
37
+	//
38
+	//
39
+	//
40
+	//result, request_log := service.SaveReg()
41
+	//fmt.Println(result)
42
+	//fmt.Println(request_log)
34 43
 
35 44
 }
36 45
 

+ 63 - 18
controllers/zh/zh_his_api_controller.go Wyświetl plik

@@ -2256,9 +2256,10 @@ func (this *ZHHisApiController) GetZHInHospitalUnCheck() {
2256 2256
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInHospitalNoExistDataException)
2257 2257
 		return
2258 2258
 	}
2259
-	result, requestLog := service.ZHGdyb2404(record.Number, record.PsnNo, miConfig.SecretKey, miConfig.OrgName, miConfig.Code, role.UserName, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
2260
-	//saveLog()
2261
-	saveLog(result, requestLog, "2404", "入院登记撤销")
2259
+
2260
+	result, requestLog := service.Gdyb2302(record.PsnNo, record.Number, miConfig.OrgName, role.UserName, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, "0000", 0)
2261
+	//saveLog(result,requestLog,)
2262
+	saveLog(result, requestLog, "2302", "月结退明细")
2262 2263
 
2263 2264
 	var dat map[string]interface{}
2264 2265
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
@@ -2266,8 +2267,10 @@ func (this *ZHHisApiController) GetZHInHospitalUnCheck() {
2266 2267
 	} else {
2267 2268
 		fmt.Println(err)
2268 2269
 	}
2270
+
2269 2271
 	userJSONBytes, _ := json.Marshal(dat)
2270
-	var res ResultEmpty
2272
+
2273
+	var res2 ResultEmpty
2271 2274
 	var resEmpty10265 ResultEmpty10265
2272 2275
 	if miConfig.Code == "H15049901371" {
2273 2276
 		if err := json.Unmarshal(userJSONBytes, &resEmpty10265); err != nil {
@@ -2276,31 +2279,73 @@ func (this *ZHHisApiController) GetZHInHospitalUnCheck() {
2276 2279
 			return
2277 2280
 		}
2278 2281
 		Infcode, _ := strconv.ParseInt(resEmpty10265.Infcode, 10, 64)
2279
-		res.Infcode = Infcode
2280
-		res.RespondTime = resEmpty10265.RespondTime
2281
-		res.ErrMsg = resEmpty10265.ErrMsg
2282
-		res.Output = resEmpty10265.Output
2283
-		res.WarnMsg = resEmpty10265.WarnMsg
2282
+		res2.Infcode = Infcode
2283
+		res2.RespondTime = resEmpty10265.RespondTime
2284
+		res2.ErrMsg = resEmpty10265.ErrMsg
2285
+		res2.Output = resEmpty10265.Output
2286
+		res2.WarnMsg = resEmpty10265.WarnMsg
2284 2287
 	} else {
2285
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2288
+		if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
2286 2289
 			utils.ErrorLog("解析失败:%v", err)
2287 2290
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2288 2291
 			return
2289 2292
 		}
2290 2293
 	}
2291 2294
 
2292
-	if res.Infcode == 0 {
2293
-		record.Status = 0
2294
-		service.CreateHospitalRecord(&record)
2295
+	if res2.Infcode == 0 {
2295 2296
 
2296
-		this.ServeSuccessJSON(map[string]interface{}{
2297
-			"msg": "撤销入院成功",
2298
-		})
2297
+		result, requestLog := service.ZHGdyb2404(record.Number, record.PsnNo, miConfig.SecretKey, miConfig.OrgName, miConfig.Code, role.UserName, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
2298
+		//saveLog()
2299
+		saveLog(result, requestLog, "2404", "入院登记撤销")
2300
+
2301
+		var dat map[string]interface{}
2302
+		if err := json.Unmarshal([]byte(result), &dat); err == nil {
2303
+			fmt.Println(dat)
2304
+		} else {
2305
+			fmt.Println(err)
2306
+		}
2307
+		userJSONBytes, _ := json.Marshal(dat)
2308
+		var res ResultEmpty
2309
+		var resEmpty10265 ResultEmpty10265
2310
+		if miConfig.Code == "H15049901371" {
2311
+			if err := json.Unmarshal(userJSONBytes, &resEmpty10265); err != nil {
2312
+				utils.ErrorLog("解析失败:%v", err)
2313
+				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2314
+				return
2315
+			}
2316
+			Infcode, _ := strconv.ParseInt(resEmpty10265.Infcode, 10, 64)
2317
+			res.Infcode = Infcode
2318
+			res.RespondTime = resEmpty10265.RespondTime
2319
+			res.ErrMsg = resEmpty10265.ErrMsg
2320
+			res.Output = resEmpty10265.Output
2321
+			res.WarnMsg = resEmpty10265.WarnMsg
2322
+		} else {
2323
+			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2324
+				utils.ErrorLog("解析失败:%v", err)
2325
+				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2326
+				return
2327
+			}
2328
+		}
2329
+
2330
+		if res.Infcode == 0 {
2331
+			record.Status = 0
2332
+			service.CreateHospitalRecord(&record)
2333
+
2334
+			this.ServeSuccessJSON(map[string]interface{}{
2335
+				"msg": "撤销入院成功",
2336
+			})
2337
+
2338
+		} else {
2339
+			this.ServeSuccessJSON(map[string]interface{}{
2340
+				"failed_code": -10,
2341
+				"msg":         res.ErrMsg,
2342
+			})
2343
+		}
2299 2344
 
2300 2345
 	} else {
2301 2346
 		this.ServeSuccessJSON(map[string]interface{}{
2302
-			"failed_code": -10,
2303
-			"msg":         res.ErrMsg,
2347
+			"code": -10,
2348
+			"msg":  res2.ErrMsg,
2304 2349
 		})
2305 2350
 	}
2306 2351
 

+ 12 - 0
models/zb_his_models.go Wyświetl plik

@@ -0,0 +1,12 @@
1
+package models
2
+
3
+type Reg struct {
4
+	DeptId      string
5
+	PatientId   string
6
+	PatientName string
7
+	DoctorId    string
8
+	RegDate     string
9
+	RegFee      string
10
+	TreatFee    string
11
+	OperatorId  string
12
+}

+ 19 - 18
service/coordinate_service.go Wyświetl plik

@@ -4,6 +4,7 @@ import (
4 4
 	"bytes"
5 5
 	"encoding/json"
6 6
 	"fmt"
7
+	"gdyb/models"
7 8
 	"io/ioutil"
8 9
 	"net/http"
9 10
 )
@@ -12,7 +13,6 @@ func SavePatientMessageInfo() (string, string) {
12 13
 
13 14
 	//input := make(map[string]interface{})
14 15
 	inputData := make(map[string]interface{})
15
-
16 16
 	inputData["patType"] = "1"                  // 就诊凭证编号
17 17
 	inputData["patIdNo"] = "441701195808152845" // 开始时间
18 18
 	inputData["patName"] = "罗秀云"                // 人员姓名
@@ -65,22 +65,23 @@ func SavePatientMessageInfo() (string, string) {
65 65
 	return str, inputLog
66 66
 
67 67
 }
68
-func SaveReg() (string, string) {
68
+
69
+func SaveReg(reg models.Reg) (string, string) {
69 70
 
70 71
 	//input := make(map[string]interface{})
71 72
 	inputData := make(map[string]interface{})
72 73
 
73
-	inputData["deptId"] = "01"     // 就诊凭证编号
74
-	inputData["clinicUnitId"] = "" // 开始时间
75
-	inputData["healthCardNo"] = "" // 人员姓名
74
+	inputData["deptId"] = reg.DeptId // 就诊凭证编号
75
+	inputData["clinicUnitId"] = ""   // 开始时间
76
+	inputData["healthCardNo"] = ""   // 人员姓名
76 77
 
77
-	inputData["patientId"] = "701822660170096645" // 人员姓名
78
-	inputData["patientName"] = "罗秀云"              // 人员姓名
79
-	inputData["idCardNo"] = ""                    // 人员姓名
80
-	inputData["phone"] = ""                       // 人员姓名
81
-	inputData["doctorId"] = "01"                  // 人员姓名
82
-	inputData["doctorLevelCode"] = ""             // 人员姓名
83
-	inputData["regDate"] = "2022-05-10"           // 人员姓名
78
+	inputData["patientId"] = reg.PatientId     // 人员姓名
79
+	inputData["patientName"] = reg.PatientName // 人员姓名
80
+	inputData["idCardNo"] = ""                 // 人员姓名
81
+	inputData["phone"] = ""                    // 人员姓名
82
+	inputData["doctorId"] = reg.DoctorId       // 人员姓名
83
+	inputData["doctorLevelCode"] = ""          // 人员姓名
84
+	inputData["regDate"] = reg.RegDate         // 人员姓名
84 85
 
85 86
 	inputData["shiftCode"] = "" // 人员姓名
86 87
 	inputData["startTime"] = "" // 人员姓名
@@ -89,13 +90,13 @@ func SaveReg() (string, string) {
89 90
 	inputData["scheduleId"] = "" // 人员姓名
90 91
 	inputData["periodId"] = ""   // 人员姓名
91 92
 
92
-	inputData["svObjectId"] = "" // 人员姓名
93
-	inputData["diseaseId"] = ""  // 人员姓名
94
-	inputData["regFee"] = "0.00" // 人员姓名
93
+	inputData["svObjectId"] = ""     // 人员姓名
94
+	inputData["diseaseId"] = ""      // 人员姓名
95
+	inputData["regFee"] = reg.RegFee // 人员姓名
95 96
 
96
-	inputData["treatFee"] = "0.00"    // 人员姓名
97
-	inputData["operatorId"] = "admin" // 人员姓名
98
-	inputData["remark"] = ""          // 人员姓名
97
+	inputData["treatFee"] = reg.TreatFee     // 人员姓名
98
+	inputData["operatorId"] = reg.OperatorId // 人员姓名
99
+	inputData["remark"] = ""                 // 人员姓名
99 100
 
100 101
 	inputData["orderType"] = ""  // 人员姓名
101 102
 	inputData["clinicCode"] = "" // 人员姓名