张保健 11 个月前
父节点
当前提交
8f939fc0e9
共有 6 个文件被更改,包括 22 次插入7 次删除
  1. 10 1
      controllers/lis.go
  2. 1 1
      main.go
  3. 1 0
      routers/router.go
  4. 5 0
      service/cron.go
  5. 4 4
      service/lgty_service.go
  6. 1 1
      service/ystx_service.go

+ 10 - 1
controllers/lis.go 查看文件

@@ -35,9 +35,18 @@ func (c *LisController) Schedule() {
35 35
 
36 36
 }
37 37
 
38
+// 广州康允LIS同步
39
+func (c *LisController) SyncGzky() {
40
+	service.SyncGzkyLis()
41
+	c.ServeSuccessJSON(map[string]interface{}{
42
+		"resultList": "12345",
43
+	})
44
+	return
45
+}
46
+
38 47
 // 石狮盛誉LIS同步
39 48
 func (c *LisController) SyncSssy() {
40
-	service.SyncToSssytx()
49
+	service.SyncSYData2()
41 50
 	c.ServeSuccessJSON(map[string]interface{}{
42 51
 		"resultList": "12345",
43 52
 	})

+ 1 - 1
main.go 查看文件

@@ -15,7 +15,7 @@ func init() {
15 15
 }
16 16
 
17 17
 func main() {
18
-	//service.BeginAutoSyncLis()
18
+	service.BeginAutoSyncLis()
19 19
 
20 20
 	beego.Run()
21 21
 }

+ 1 - 0
routers/router.go 查看文件

@@ -34,4 +34,5 @@ func init() {
34 34
 	//beego.Router("/api/lis/pajm", &controllers.LisController{}, "get:SyncPajmLis")
35 35
 	beego.Router("/api/lis/sssy", &controllers.LisController{}, "get:SyncSssy")
36 36
 	beego.Router("/api/lis/tscyvip", &controllers.LisController{}, "get:SyncTscyVipLis")
37
+	beego.Router("/api/lis/syncgzky", &controllers.LisController{}, "get:SyncGzky")
37 38
 }

+ 5 - 0
service/cron.go 查看文件

@@ -64,6 +64,11 @@ func BeginAutoSyncLis() {
64 64
 		SyncTscyVipLis()
65 65
 	})
66 66
 
67
+	//spec6 := "0 20 1 * * ?" // 每天凌晨同步 广州康允透析中心LIS对接,本地部署的
68
+	//createLisSyncCronJob.AddFunc(spec6, func() {
69
+	//	SyncGzkyLis()
70
+	//})
71
+
67 72
 	createLisSyncCronJob.Start()
68 73
 }
69 74
 

+ 4 - 4
service/lgty_service.go 查看文件

@@ -40,7 +40,7 @@ func SyncLisLgty() (err error) {
40 40
 				if inspectionLastInfo.ID > 0 {
41 41
 					sync_time = inspectionLastInfo.CreatedTime
42 42
 				} else {
43
-					sync_time = 1640966400
43
+					sync_time = 1672502400
44 44
 				}
45 45
 			}
46 46
 
@@ -63,7 +63,7 @@ func SyncLisLgty() (err error) {
63 63
 						}
64 64
 						middleReportHandle := models.MiddleReportHandle{
65 65
 							OrgId:       org_id,
66
-							HisUserId:   patient.AdmissionNumber,
66
+							HisUserId:   patient.IdCardNo,
67 67
 							ApplyNo:     head.ApplyNo,
68 68
 							ReportId:    head.ReportId,
69 69
 							Name:        head.Name,
@@ -107,7 +107,7 @@ func SyncLisLgty() (err error) {
107 107
 				}
108 108
 				var syncInfo models.MiddleSyncInfo
109 109
 				syncInfo.OrgId = org_id
110
-				syncInfo.HisUserId = patient.AdmissionNumber
110
+				syncInfo.HisUserId = patient.IdCardNo
111 111
 				syncInfo.SyncTime = time.Now().Unix()
112 112
 				syncInfo.SyncResultType = 1
113 113
 				syncInfo.SyncRsultRemark = "同步成功"
@@ -126,7 +126,7 @@ func SyncLisLgty() (err error) {
126 126
 				// 未同步到检验检查头部信息
127 127
 				var syncInfo models.MiddleSyncInfo
128 128
 				syncInfo.OrgId = org_id
129
-				syncInfo.HisUserId = patient.AdmissionNumber
129
+				syncInfo.HisUserId = patient.IdCardNo
130 130
 				syncInfo.SyncTime = time.Now().Unix()
131 131
 				syncInfo.SyncResultType = 1
132 132
 				syncInfo.SyncRsultRemark = "该患者这个时间段没有任何检验检查数据"

+ 1 - 1
service/ystx_service.go 查看文件

@@ -288,7 +288,7 @@ func SyncLisYstx() (err error) {
288 288
 
289 289
 // 根据姓名获取patient_id
290 290
 func GetPatientID(org_id int64, patient_name string) (patient models.Patients, err error) {
291
-	err = readDb.Model(&models.Patients{}).Where("user_org_id = ? and status = 1 and name = ? ", org_id, patient_name).First(&patient).Error
291
+	err = readDb.Model(&models.Patients{}).Where("user_org_id = ? and status = 1 and name = ? and lapseto = 1 ", org_id, patient_name).First(&patient).Error
292 292
 	return
293 293
 }
294 294