sync.go 50KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. package controllers
  2. import (
  3. "Data_Upload_Api/enums"
  4. "Data_Upload_Api/models/sz"
  5. "Data_Upload_Api/service"
  6. "Data_Upload_Api/service/city"
  7. "Data_Upload_Api/utils"
  8. _ "fmt"
  9. "github.com/astaxie/beego"
  10. _ "github.com/jinzhu/gorm"
  11. _ "math"
  12. _ "strconv"
  13. _ "strings"
  14. _ "time"
  15. )
  16. type SyncController struct {
  17. BaseAPIController
  18. }
  19. func SyncAPIRegisterRouters() {
  20. beego.Router("/sync/upload/hqyy", &SyncController{}, "get:SyncToHqyy")
  21. beego.Router("/sync/upload/lg2h", &SyncController{}, "get:SyncToLg2h")
  22. beego.Router("/sync/upload/smzy", &SyncController{}, "get:SyncToSmzy")
  23. beego.Router("/sync/upload/szbl", &SyncController{}, "get:SyncToSzbl")
  24. beego.Router("/sync/upload/szjk", &SyncController{}, "get:SyncToSzjk")
  25. beego.Router("/sync/upload/smzybr", &SyncController{}, "get:SyncToSmzybr")
  26. beego.Router("/sync/addpatient", &SyncController{}, "get:AddPatient")
  27. beego.Router("/sync/delpatient", &SyncController{}, "get:DelPatient")
  28. beego.Router("/sync/upload/szblbr", &SyncController{}, "get:SyncToSzblbr")
  29. beego.Router("/sync/upload/szblyyxxzx", &SyncController{}, "get:SyncToSzblYxxxzx")
  30. beego.Router("/sync/upload/smzyyyxxzx", &SyncController{}, "get:SyncToSmzyYxxxzx")
  31. beego.Router("/sync/upload/szblbeyyxxzx", &SyncController{}, "get:SyncToSzblbeYxxxzx")
  32. beego.Router("/sync/upload/szblpgyyxxzx", &SyncController{}, "get:SyncToSzblpgYxxxzx")
  33. beego.Router("/sync/upload/wzyy", &SyncController{}, "get:SyncTowzyy")
  34. }
  35. func (c *SyncController) SyncToSzblbeYxxxzx() {
  36. org := &sz.DataUploadConfig{
  37. OrgId: 10278,
  38. ProvinceId: 19,
  39. CityId: 291,
  40. DepartmentName: "深圳市百霖贝尔血液透析中心",
  41. HospitalId: "MA5G5BPX7",
  42. InstType: 1,
  43. DbHost: "127.0.0.1",
  44. DbPort: "1433",
  45. DbPass: "1Q2W3e4r!@#$",
  46. DbUser: "adapter",
  47. DbName: "adapter_blbe",
  48. }
  49. // for _, org := range configs {
  50. // 第二步:跟进配置,创建数据库连接
  51. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  52. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  53. if err != nil {
  54. utils.ErrorLog("创建数据库连接失败:%v", err)
  55. return
  56. }
  57. // 第三步:开始同步数据
  58. // 机构人员字典表 t_hd_hospital
  59. city.SyncTBDICPractitioner(orgDb, org.OrgId, org.HospitalId)
  60. // 药品目录字典表
  61. city.SyncTBDICMedicines(orgDb, org.OrgId, org.HospitalId)
  62. // 药品对照字典
  63. city.SyncTBDICYpdzzd(orgDb, org.OrgId, org.HospitalId)
  64. // 诊疗项目目录字典表
  65. city.SyncTBDICZlxmml(orgDb, org.OrgId, org.HospitalId)
  66. // 诊疗项目目录字典表
  67. city.SyncTBDICZlxmdzzd(orgDb, org.OrgId, org.HospitalId)
  68. // 机构床位 t_hd_wm
  69. city.SyncTMDICTBED(orgDb, org.OrgId, org.HospitalId)
  70. // 门诊患者信息表
  71. city.SyncTBMZPatientInformation(orgDb, org.OrgId, org.HospitalId)
  72. // 挂号表
  73. city.SyncTBHISMZReg(orgDb, org.OrgId, org.HospitalId)
  74. // 门诊就诊记录表
  75. city.SyncTB_YL_MZ_Medical_Record(orgDb, org.OrgId, org.HospitalId)
  76. // 门诊处方主表
  77. city.SyncTB_CIS_Prescription(orgDb, org.OrgId, org.HospitalId)
  78. // 18. 门诊处方明细表
  79. city.SyncTB_CIS_Prescription_Detail(orgDb, org.OrgId, org.HospitalId)
  80. // 19. 门诊收费表
  81. city.SyncTB_HIS_MZ_Charge(orgDb, org.OrgId, org.HospitalId)
  82. // 20. 门诊收费明细表
  83. city.SyncTB_HIS_MZ_Fee_Detail(orgDb, org.OrgId, org.HospitalId)
  84. // 业务量收入统计表
  85. city.SyncTB_STAT_YWL_Report(orgDb, org.OrgId, org.HospitalId)
  86. // 第四步:关闭数据库连接
  87. service.CloseDB(orgDb)
  88. }
  89. // }
  90. return
  91. }
  92. func (c *SyncController) SyncTowzyy() {
  93. org := &sz.DataUploadConfig{
  94. OrgId: 10580,
  95. ProvinceId: 19,
  96. CityId: 291,
  97. DepartmentName: "深圳五洲中医院",
  98. HospitalId: "783910835",
  99. InstType: 2,
  100. DbHost: "172.8.110.22",
  101. DbPort: "1433",
  102. DbPass: "12361myd!@#",
  103. DbUser: "sa",
  104. DbName: "adapter_2019",
  105. }
  106. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  107. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  108. if err != nil {
  109. utils.ErrorLog("创建数据库连接失败:%v", err)
  110. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  111. return
  112. }
  113. // 第三步:开始同步数据
  114. // 同步医院信息 t_hd_hospital
  115. // city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  116. // // 同步员工 t_hd_staff
  117. city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  118. // 布局表(T_HD_LAYOUT)
  119. city.SyncLayout(orgDb, org.OrgId, org.HospitalId)
  120. // 同步设备 t_hd_dm
  121. city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  122. // 同步水处理器 t_hd_wm
  123. city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  124. // 同步维修 t_hd_maintain
  125. city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  126. // 同步设备消毒方法表(T_HD_DISINFECT_METHOD
  127. city.SyncDisinfectMethod(orgDb, org.OrgId, org.HospitalId)
  128. // 同步其它设备信息表(T_HD_OTHER_MACHINE)
  129. city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  130. // 同步透析机消毒检测记录表(T_HD_DM_DISINFECT)
  131. city.SyncDmDisinfect(orgDb, org.OrgId, org.HospitalId)
  132. // 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
  133. city.SyncLisCulture(orgDb, org.OrgId, org.HospitalId)
  134. // 透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_EN)
  135. city.SyncDialysate(orgDb, org.OrgId, org.HospitalId)
  136. // 水处理机消毒记录表(T_HD_WM_DISINFECT)
  137. city.SyncWmDisinfect(orgDb, org.OrgId, org.HospitalId)
  138. //透析用水PH值检测表(T_HD_WATER_PH)
  139. city.SynLisWaterPh(orgDb, org.OrgId, org.HospitalId)
  140. //透析用水细菌培养检测表(T_HD_WATER_BC)
  141. city.SyncLisWaterBc(orgDb, org.OrgId, org.HospitalId)
  142. //透析用水内毒素检测表(T_HD_WATER_EN)
  143. city.SyncLisWaterEn(orgDb, org.OrgId, org.HospitalId)
  144. //透析用水有毒化学物检测表(T_HD_WATER_NC)
  145. city.SynLisWaterNc(orgDb, org.OrgId, org.HospitalId)
  146. //透析用水水硬度检测表(T_HD_WATER_WH)
  147. city.SynListHadWater(orgDb, org.OrgId, org.HospitalId)
  148. //透析用水游离氯检测表(T_HD_WATER_FC)
  149. city.SyncLisWaterFc(orgDb, org.OrgId, org.HospitalId)
  150. //透析用水电解质检测表(T_HD_WATER_EL)
  151. city.SyncLisWaterEl(orgDb, org.OrgId, org.HospitalId)
  152. //透析用水微量元素检测表(T_HD_WATER_TE)
  153. city.SyncLisWaterTe(orgDb, org.OrgId, org.HospitalId)
  154. //透析室空气消毒记录表(T_HD_AIR_DISINFECT)
  155. city.SyncLisAirDetection(orgDb, org.OrgId, org.HospitalId)
  156. //物表消毒记录表(T_HD_SURFACE_DISINFECT)
  157. city.SyncLisBodyDetection(orgDb, org.OrgId, org.HospitalId)
  158. //同步血透患者基本信息表(T_HD_PATIENT)
  159. city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  160. // 同步患者退出信息表(T_HD_PATIENT_QUIT)
  161. city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  162. // 同步处方 t_hd_ps
  163. city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  164. // 同步处方药品 t_hd_ps
  165. city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  166. // 患者诊断信息表(T_HD_DIAGNOSIS)
  167. city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  168. // 患者通路信息表(T_HD_ACCESS)
  169. city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  170. //导管感染记录表(T_HD_CI)
  171. city.SynListHdCi(orgDb, org.OrgId, org.HospitalId)
  172. //导管感染转归记录表(T_HD_CI_OUTCOME)
  173. city.SynLisHdCiOutCome(orgDb, org.OrgId, org.HospitalId)
  174. // // city.UpdatePatient(orgDb, org.OrgId, org.HospitalId)
  175. // 患者传染病检查记录表(T_HD_INFECTION
  176. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  177. // 同步排班 t_hd_shift
  178. city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  179. // 同步透析医嘱表(T_HD_DOCTORS_ADVICE)
  180. city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  181. // 同步患者透析记录 t_hd_dialysis
  182. city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  183. //city.SyncLisIndicatorsBc(orgDb, org.OrgId, org.HospitalId)
  184. //city.SyncLisIndicatorsBcUpdate(orgDb, org.OrgId, org.HospitalId)
  185. //city.SyncLisReportBc(orgDb, org.OrgId, org.HospitalId)
  186. // 同步透中信息 t_hd_middle
  187. city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  188. // 透析并发症记录表(T_HD_COMPLICATION)
  189. city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  190. // 透析床位表(T_HD_SICKBED)
  191. city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  192. // 同步透析床位分区 t_hd_division
  193. city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  194. // 血透患者检测结果表(T_HD_LIS_REPORT)
  195. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  196. //血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  197. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  198. // // 第四步:关闭数据库连接
  199. // // 第四步:关闭数据库连接
  200. service.CloseDB(orgDb)
  201. }
  202. // }
  203. c.ServeSuccessJSON(map[string]interface{}{
  204. "resultList": "12345",
  205. })
  206. return
  207. }
  208. func (c *SyncController) SyncToSzblpgYxxxzx() {
  209. org := &sz.DataUploadConfig{
  210. OrgId: 10888,
  211. ProvinceId: 19,
  212. CityId: 291,
  213. DepartmentName: "深圳市百霖鹏港血液透析中心",
  214. HospitalId: "MACWP1CB",
  215. InstType: 1,
  216. DbHost: "127.0.0.1",
  217. DbPort: "1433",
  218. DbPass: "1Q2W3e4r!@#$",
  219. DbUser: "adapter",
  220. DbName: "adapter_blpg",
  221. }
  222. // for _, org := range configs {
  223. // 第二步:跟进配置,创建数据库连接
  224. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  225. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  226. if err != nil {
  227. utils.ErrorLog("创建数据库连接失败:%v", err)
  228. return
  229. }
  230. // 第三步:开始同步数据
  231. // 机构人员字典表 t_hd_hospital
  232. //city.SyncTBDICPractitioner_pg(orgDb, org.OrgId, org.HospitalId)
  233. //// 药品目录字典表
  234. //city.SyncTBDICMedicines_pg(orgDb, org.OrgId, org.HospitalId)
  235. //// 药品对照字典
  236. //city.SyncTBDICYpdzzd_pg(orgDb, org.OrgId, org.HospitalId)
  237. //// 诊疗项目目录字典表
  238. //city.SyncTBDICZlxmml_pg(orgDb, org.OrgId, org.HospitalId)
  239. //// 诊疗项目目录字典表
  240. //city.SyncTBDICZlxmdzzd_pg(orgDb, org.OrgId, org.HospitalId)
  241. //// 机构床位 t_hd_wm
  242. //city.SyncTMDICTBED_pg(orgDb, org.OrgId, org.HospitalId)
  243. //// 门诊患者信息表
  244. //city.SyncTBMZPatientInformation_pg(orgDb, org.OrgId, org.HospitalId)
  245. ////// 挂号表
  246. //city.SyncTBHISMZReg_pg(orgDb, org.OrgId, org.HospitalId)
  247. // 门诊就诊记录表
  248. city.SyncTB_YL_MZ_Medical_Record_pg(orgDb, org.OrgId, org.HospitalId)
  249. // 门诊处方主表
  250. //city.SyncTB_CIS_Prescription_pg(orgDb, org.OrgId, org.HospitalId)
  251. ////// 18. 门诊处方明细表
  252. //city.SyncTB_CIS_Prescription_Detail_pg(orgDb, org.OrgId, org.HospitalId)
  253. ////// 19. 门诊收费表
  254. //city.SyncTB_HIS_MZ_Charge_pg(orgDb, org.OrgId, org.HospitalId)
  255. ////// 20. 门诊收费明细表
  256. //city.SyncTB_HIS_MZ_Fee_Detail_pg(orgDb, org.OrgId, org.HospitalId)
  257. ////// 业务量收入统计表
  258. //city.SyncTB_STAT_YWL_Report_pg(orgDb, org.OrgId, org.HospitalId)
  259. ////city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  260. //city.SyncTB_Diagnosis_Detail_pg(orgDb, org.OrgId, org.HospitalId)
  261. // 第四步:关闭数据库连接
  262. service.CloseDB(orgDb)
  263. }
  264. // }
  265. return
  266. }
  267. func (c *SyncController) SyncToSzblYxxxzx() {
  268. org := &sz.DataUploadConfig{
  269. OrgId: 10138,
  270. ProvinceId: 19,
  271. CityId: 291,
  272. DepartmentName: "深圳市百霖血液透析中心",
  273. HospitalId: "MA5DB4KB6",
  274. InstType: 1,
  275. DbHost: "127.0.0.1",
  276. DbPort: "1433",
  277. DbPass: "1Q2W3e4r!@#$",
  278. DbUser: "adapter",
  279. DbName: "adapter_2019",
  280. }
  281. // for _, org := range configs {
  282. // 第二步:跟进配置,创建数据库连接
  283. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  284. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  285. if err != nil {
  286. utils.ErrorLog("创建数据库连接失败:%v", err)
  287. return
  288. }
  289. // 第三步:开始同步数据
  290. // 机构人员字典表 t_hd_hospital
  291. city.SyncTBDICPractitioner(orgDb, org.OrgId, org.HospitalId)
  292. // 药品目录字典表
  293. city.SyncTBDICMedicines(orgDb, org.OrgId, org.HospitalId)
  294. // 药品对照字典
  295. city.SyncTBDICYpdzzd(orgDb, org.OrgId, org.HospitalId)
  296. // 诊疗项目目录字典表
  297. city.SyncTBDICZlxmml(orgDb, org.OrgId, org.HospitalId)
  298. // 诊疗项目目录字典表
  299. city.SyncTBDICZlxmdzzd(orgDb, org.OrgId, org.HospitalId)
  300. // 机构床位 t_hd_wm
  301. city.SyncTMDICTBED(orgDb, org.OrgId, org.HospitalId)
  302. // 门诊患者信息表
  303. city.SyncTBMZPatientInformation(orgDb, org.OrgId, org.HospitalId)
  304. // 挂号表
  305. city.SyncTBHISMZReg(orgDb, org.OrgId, org.HospitalId)
  306. // 门诊就诊记录表
  307. city.SyncTB_YL_MZ_Medical_Record(orgDb, org.OrgId, org.HospitalId)
  308. // 门诊处方主表
  309. city.SyncTB_CIS_Prescription(orgDb, org.OrgId, org.HospitalId)
  310. // 18. 门诊处方明细表
  311. city.SyncTB_CIS_Prescription_Detail(orgDb, org.OrgId, org.HospitalId)
  312. // 19. 门诊收费表
  313. city.SyncTB_HIS_MZ_Charge(orgDb, org.OrgId, org.HospitalId)
  314. // 20. 门诊收费明细表
  315. city.SyncTB_HIS_MZ_Fee_Detail(orgDb, org.OrgId, org.HospitalId)
  316. // 业务量收入统计表
  317. city.SyncTB_STAT_YWL_Report(orgDb, org.OrgId, org.HospitalId)
  318. // 第四步:关闭数据库连接
  319. service.CloseDB(orgDb)
  320. }
  321. // }
  322. return
  323. }
  324. func (c *SyncController) DelPatient() {
  325. org := &sz.DataUploadConfig{
  326. OrgId: 10138,
  327. ProvinceId: 19,
  328. CityId: 291,
  329. DepartmentName: "深圳市百霖血液透析中心",
  330. HospitalId: "MA5DB4KB6",
  331. InstType: 1,
  332. DbHost: "127.0.0.1",
  333. DbPort: "1433",
  334. DbPass: "1Q2W3e4r!@#$",
  335. DbUser: "adapter",
  336. DbName: "adapter_2019",
  337. }
  338. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  339. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  340. if err != nil {
  341. utils.ErrorLog("创建数据库连接失败:%v", err)
  342. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  343. return
  344. }
  345. patient_id, _ := c.GetInt64("patient_id")
  346. city.SyncPatientOutByID(orgDb, org.OrgId, org.HospitalId, patient_id)
  347. }
  348. c.ServeSuccessJSON(map[string]interface{}{
  349. "resultList": "12345",
  350. })
  351. return
  352. }
  353. func (c *SyncController) AddPatient() {
  354. org := &sz.DataUploadConfig{
  355. OrgId: 10278,
  356. ProvinceId: 19,
  357. CityId: 291,
  358. DepartmentName: "深圳市百霖血液透析中心",
  359. HospitalId: "MA5G5BPX7",
  360. InstType: 1,
  361. DbHost: "127.0.0.1",
  362. DbPort: "1433",
  363. DbPass: "1Q2W3e4r!@#$",
  364. DbUser: "adapter",
  365. DbName: "adapter_blbe",
  366. }
  367. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  368. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  369. if err != nil {
  370. utils.ErrorLog("创建数据库连接失败:%v", err)
  371. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  372. return
  373. }
  374. patient_id, _ := c.GetInt64("patient_id")
  375. city.SyncPatientByID(orgDb, org.OrgId, org.HospitalId, patient_id)
  376. }
  377. c.ServeSuccessJSON(map[string]interface{}{
  378. "resultList": "12345",
  379. })
  380. return
  381. }
  382. func (c *SyncController) SyncToSzbl() {
  383. org := &sz.DataUploadConfig{
  384. OrgId: 10138,
  385. ProvinceId: 19,
  386. CityId: 291,
  387. DepartmentName: "深圳市百霖血液透析中心",
  388. HospitalId: "MA5DB4KB6",
  389. InstType: 1,
  390. DbHost: "127.0.0.1",
  391. DbPort: "1433",
  392. DbPass: "1Q2W3e4r!@#$",
  393. DbUser: "adapter",
  394. DbName: "adapter_2019",
  395. }
  396. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  397. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  398. if err != nil {
  399. utils.ErrorLog("创建数据库连接失败:%v", err)
  400. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  401. return
  402. }
  403. // 第三步:开始同步数据
  404. // 同步医院信息 t_hd_hospital
  405. // city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  406. // // 同步员工 t_hd_staff
  407. // city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  408. // // 布局表(T_HD_LAYOUT)
  409. // city.SyncLayout(orgDb, org.OrgId, org.HospitalId)
  410. // // 同步设备 t_hd_dm
  411. // city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  412. // // 同步水处理器 t_hd_wm
  413. // city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  414. // // 同步维修 t_hd_maintain
  415. // city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  416. // // 同步设备消毒方法表(T_HD_DISINFECT_METHOD
  417. // city.SyncDisinfectMethod(orgDb, org.OrgId, org.HospitalId)
  418. // // 同步其它设备信息表(T_HD_OTHER_MACHINE)
  419. // city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  420. // // 同步透析机消毒检测记录表(T_HD_DM_DISINFECT)
  421. // city.SyncDmDisinfect(orgDb, org.OrgId, org.HospitalId)
  422. // // 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
  423. // city.SyncLisCulture(orgDb,org.OrgId,org.HospitalId)
  424. // // 透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_EN)
  425. // city.SyncDialysate(orgDb,org.OrgId,org.HospitalId)
  426. // // 水处理机消毒记录表(T_HD_WM_DISINFECT)
  427. // city.SyncWmDisinfect(orgDb,org.OrgId,org.HospitalId)
  428. // //透析用水PH值检测表(T_HD_WATER_PH)
  429. // city.SynLisWaterPh(orgDb,org.OrgId,org.HospitalId)
  430. // //透析用水细菌培养检测表(T_HD_WATER_BC)
  431. // city.SyncLisWaterBc(orgDb,org.OrgId,org.HospitalId)
  432. // //透析用水内毒素检测表(T_HD_WATER_EN)
  433. // city.SyncLisWaterEn(orgDb,org.OrgId,org.HospitalId)
  434. // //透析用水有毒化学物检测表(T_HD_WATER_NC)
  435. // city.SynLisWaterNc(orgDb,org.OrgId,org.HospitalId)
  436. // //透析用水水硬度检测表(T_HD_WATER_WH)
  437. // city.SynListHadWater(orgDb,org.OrgId,org.HospitalId)
  438. // //透析用水游离氯检测表(T_HD_WATER_FC)
  439. // city.SyncLisWaterFc(orgDb,org.OrgId,org.HospitalId)
  440. // //透析用水电解质检测表(T_HD_WATER_EL)
  441. // city.SyncLisWaterEl(orgDb,org.OrgId,org.HospitalId)
  442. // //透析用水微量元素检测表(T_HD_WATER_TE)
  443. // city.SyncLisWaterTe(orgDb,org.OrgId,org.HospitalId)
  444. // //透析室空气消毒记录表(T_HD_AIR_DISINFECT)
  445. // city.SyncLisAirDetection(orgDb,org.OrgId,org.HospitalId)
  446. // //物表消毒记录表(T_HD_SURFACE_DISINFECT)
  447. // city.SyncLisBodyDetection(orgDb,org.OrgId,org.HospitalId)
  448. // 同步血透患者基本信息表(T_HD_PATIENT)
  449. // city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  450. // // 同步患者退出信息表(T_HD_PATIENT_QUIT)
  451. city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  452. // // 同步处方 t_hd_ps
  453. // city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  454. // // 同步处方药品 t_hd_ps
  455. // city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  456. // // 患者诊断信息表(T_HD_DIAGNOSIS)
  457. // city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  458. // // 患者通路信息表(T_HD_ACCESS)
  459. // city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  460. // //导管感染记录表(T_HD_CI)
  461. // city.SynListHdCi(orgDb,org.OrgId,org.HospitalId)
  462. // //导管感染转归记录表(T_HD_CI_OUTCOME)
  463. // city.SynLisHdCiOutCome(orgDb,org.OrgId,org.HospitalId)
  464. // // // city.UpdatePatient(orgDb, org.OrgId, org.HospitalId)
  465. // // 患者传染病检查记录表(T_HD_INFECTION
  466. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  467. // // 同步排班 t_hd_shift
  468. // city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  469. // // 同步透析医嘱表(T_HD_DOCTORS_ADVICE)
  470. // city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  471. // // 同步患者透析记录 t_hd_dialysis
  472. city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  473. //city.SyncLisIndicatorsBc(orgDb, org.OrgId, org.HospitalId)
  474. //city.SyncLisIndicatorsBcUpdate(orgDb, org.OrgId, org.HospitalId)
  475. //city.SyncLisReportBc(orgDb, org.OrgId, org.HospitalId)
  476. // // 同步透中信息 t_hd_middle
  477. // city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  478. // // 透析并发症记录表(T_HD_COMPLICATION)
  479. // city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  480. // // 透析床位表(T_HD_SICKBED)
  481. // city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  482. // // 同步透析床位分区 t_hd_division
  483. // city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  484. //// 血透患者检测结果表(T_HD_LIS_REPORT)
  485. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  486. //血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  487. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  488. // // 第四步:关闭数据库连接
  489. // // 第四步:关闭数据库连接
  490. service.CloseDB(orgDb)
  491. }
  492. // }
  493. c.ServeSuccessJSON(map[string]interface{}{
  494. "resultList": "12345",
  495. })
  496. return
  497. }
  498. func (c *SyncController) SyncToSzblbr() {
  499. org := &sz.DataUploadConfig{
  500. OrgId: 10278,
  501. ProvinceId: 19,
  502. CityId: 291,
  503. DepartmentName: "深圳市百霖贝尔血液透析中心",
  504. HospitalId: "MA5G5BPX7",
  505. InstType: 1,
  506. DbHost: "127.0.0.1",
  507. DbPort: "1433",
  508. DbPass: "1Q2W3e4r!@#$",
  509. DbUser: "adapter",
  510. DbName: "adapter_blbe",
  511. }
  512. // for _, org := range configs {
  513. // 第二步:跟进配置,创建数据库连接
  514. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  515. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  516. if err != nil {
  517. utils.ErrorLog("创建数据库连接失败:%v", err)
  518. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  519. return
  520. }
  521. // 第三步:开始同步数据
  522. // 同步医院信息 t_hd_hospital
  523. // city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  524. // // 同步员工 t_hd_staff
  525. // city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  526. // // 布局表(T_HD_LAYOUT)
  527. // city.SyncLayout(orgDb, org.OrgId, org.HospitalId)
  528. // // 同步设备 t_hd_dm
  529. // city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  530. // // 同步水处理器 t_hd_wm
  531. // city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  532. // // 同步维修 t_hd_maintain
  533. // city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  534. // // 同步设备消毒方法表(T_HD_DISINFECT_METHOD
  535. // city.SyncDisinfectMethod(orgDb, org.OrgId, org.HospitalId)
  536. // // 同步其它设备信息表(T_HD_OTHER_MACHINE)
  537. // city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  538. // // 同步透析机消毒检测记录表(T_HD_DM_DISINFECT)
  539. // city.SyncDmDisinfect(orgDb, org.OrgId, org.HospitalId)
  540. // // 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
  541. // city.SyncLisCulture(orgDb,org.OrgId,org.HospitalId)
  542. // // 透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_EN)
  543. // city.SyncDialysate(orgDb,org.OrgId,org.HospitalId)
  544. // // 水处理机消毒记录表(T_HD_WM_DISINFECT)
  545. // city.SyncWmDisinfect(orgDb,org.OrgId,org.HospitalId)
  546. // //透析用水PH值检测表(T_HD_WATER_PH)
  547. // city.SynLisWaterPh(orgDb,org.OrgId,org.HospitalId)
  548. // //透析用水细菌培养检测表(T_HD_WATER_BC)
  549. // city.SyncLisWaterBc(orgDb,org.OrgId,org.HospitalId)
  550. // //透析用水内毒素检测表(T_HD_WATER_EN)
  551. // city.SyncLisWaterEn(orgDb,org.OrgId,org.HospitalId)
  552. // //透析用水有毒化学物检测表(T_HD_WATER_NC)
  553. // city.SynLisWaterNc(orgDb,org.OrgId,org.HospitalId)
  554. // //透析用水水硬度检测表(T_HD_WATER_WH)
  555. // city.SynListHadWater(orgDb,org.OrgId,org.HospitalId)
  556. // //透析用水游离氯检测表(T_HD_WATER_FC)
  557. // city.SyncLisWaterFc(orgDb,org.OrgId,org.HospitalId)
  558. // //透析用水电解质检测表(T_HD_WATER_EL)
  559. // city.SyncLisWaterEl(orgDb,org.OrgId,org.HospitalId)
  560. // //透析用水微量元素检测表(T_HD_WATER_TE)
  561. // city.SyncLisWaterTe(orgDb,org.OrgId,org.HospitalId)
  562. // //透析室空气消毒记录表(T_HD_AIR_DISINFECT)
  563. // city.SyncLisAirDetection(orgDb,org.OrgId,org.HospitalId)
  564. // //物表消毒记录表(T_HD_SURFACE_DISINFECT)
  565. // city.SyncLisBodyDetection(orgDb,org.OrgId,org.HospitalId)
  566. // 同步血透患者基本信息表(T_HD_PATIENT)
  567. // city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  568. // // 同步患者退出信息表(T_HD_PATIENT_QUIT)
  569. city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  570. // // 同步处方 t_hd_ps
  571. // city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  572. // // 同步处方药品 t_hd_ps
  573. // city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  574. // // 患者诊断信息表(T_HD_DIAGNOSIS)
  575. // city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  576. // // 患者通路信息表(T_HD_ACCESS)
  577. // city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  578. // //导管感染记录表(T_HD_CI)
  579. // city.SynListHdCi(orgDb,org.OrgId,org.HospitalId)
  580. // //导管感染转归记录表(T_HD_CI_OUTCOME)
  581. // city.SynLisHdCiOutCome(orgDb,org.OrgId,org.HospitalId)
  582. // // // city.UpdatePatient(orgDb, org.OrgId, org.HospitalId)
  583. // // 患者传染病检查记录表(T_HD_INFECTION
  584. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  585. // // 同步排班 t_hd_shift
  586. //city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  587. //// // 同步透析医嘱表(T_HD_DOCTORS_ADVICE)
  588. //city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  589. //// // 同步患者透析记录 t_hd_dialysis
  590. city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  591. //// // 同步透中信息 t_hd_middle
  592. //city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  593. //// // 透析并发症记录表(T_HD_COMPLICATION)
  594. //city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  595. // // 透析床位表(T_HD_SICKBED)
  596. // city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  597. // // 同步透析床位分区 t_hd_division
  598. // city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  599. // 血透患者检测结果表(T_HD_LIS_REPORT)
  600. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  601. //// 血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  602. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  603. //city.SyncLisIndicatorsBc(orgDb, org.OrgId, org.HospitalId)
  604. //city.SyncLisReportBc(orgDb, org.OrgId, org.HospitalId)
  605. //city.SyncLisIndicatorsBcUpdate(orgDb, org.OrgId, org.HospitalId)
  606. // // 第四步:关闭数据库连接
  607. // // 第四步:关闭数据库连接
  608. service.CloseDB(orgDb)
  609. }
  610. // }
  611. c.ServeSuccessJSON(map[string]interface{}{
  612. "resultList": "12345",
  613. })
  614. return
  615. }
  616. func (c *SyncController) SyncToLg2h() {
  617. // 第一步:到上报配置表中找到深圳需要上报的机构
  618. // sz_province, _ := beego.AppConfig.Int64("sz_province")
  619. // sz_city, _ := beego.AppConfig.Int64("sz_city")
  620. // configs, _ := service.FindAllDataUploadConfigOrgInfo(sz_province, sz_city, 3)
  621. org := &sz.DataUploadConfig{
  622. OrgId: 9598,
  623. ProvinceId: 19,
  624. CityId: 291,
  625. DepartmentName: "深圳市龙岗区第二人民医院",
  626. HospitalId: "455835506",
  627. InstType: 1,
  628. DbHost: "183.62.158.36",
  629. DbPort: "61433",
  630. DbPass: "LG2H+9897",
  631. DbUser: "sa",
  632. DbName: "adapter_2019",
  633. }
  634. // for _, org := range configs {
  635. // 第二步:跟进配置,创建数据库连接
  636. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  637. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  638. if err != nil {
  639. utils.ErrorLog("创建数据库连接失败:%v", err)
  640. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  641. return
  642. }
  643. // 第三步:开始同步数据
  644. // 同步医院信息 t_hd_hospital
  645. //city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  646. //// 同步员工 t_hd_staff
  647. //city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  648. //// 布局表(T_HD_LAYOUT)
  649. //city.SyncLayout(orgDb, org.OrgId, org.HospitalId)
  650. //// 同步设备 t_hd_dm
  651. //city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  652. //// 同步水处理器 t_hd_wm
  653. //city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  654. //// 同步维修 t_hd_maintain
  655. //city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  656. //// 同步设备消毒方法表(T_HD_DISINFECT_METHOD
  657. //city.SyncDisinfectMethod(orgDb, org.OrgId, org.HospitalId)
  658. //// 同步其它设备信息表(T_HD_OTHER_MACHINE)
  659. //city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  660. //// 同步透析机消毒检测记录表(T_HD_DM_DISINFECT)
  661. //city.SyncDmDisinfect(orgDb, org.OrgId, org.HospitalId)
  662. //// 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
  663. //city.SyncLisCulture(orgDb,org.OrgId,org.HospitalId)
  664. //// 透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_EN)
  665. //city.SyncDialysate(orgDb,org.OrgId,org.HospitalId)
  666. //// 水处理机消毒记录表(T_HD_WM_DISINFECT)
  667. //city.SyncWmDisinfect(orgDb,org.OrgId,org.HospitalId)
  668. ////透析用水PH值检测表(T_HD_WATER_PH)
  669. //city.SynLisWaterPh(orgDb,org.OrgId,org.HospitalId)
  670. ////透析用水细菌培养检测表(T_HD_WATER_BC)
  671. //city.SyncLisWaterBc(orgDb, org.OrgId, org.HospitalId)
  672. ////透析用水内毒素检测表(T_HD_WATER_EN)
  673. //city.SyncLisWaterEn(orgDb,org.OrgId,org.HospitalId)
  674. ////透析用水有毒化学物检测表(T_HD_WATER_NC)
  675. //city.SynLisWaterNc(orgDb,org.OrgId,org.HospitalId)
  676. ////透析用水水硬度检测表(T_HD_WATER_WH)
  677. //city.SynListHadWater(orgDb,org.OrgId,org.HospitalId)
  678. ////透析用水游离氯检测表(T_HD_WATER_FC)
  679. //city.SyncLisWaterFc(orgDb,org.OrgId,org.HospitalId)
  680. ////透析用水电解质检测表(T_HD_WATER_EL)
  681. //city.SyncLisWaterEl(orgDb,org.OrgId,org.HospitalId)
  682. ////透析用水微量元素检测表(T_HD_WATER_TE)
  683. //city.SyncLisWaterTe(orgDb,org.OrgId,org.HospitalId)
  684. ////透析室空气消毒记录表(T_HD_AIR_DISINFECT)
  685. //city.SyncLisAirDetection(orgDb,org.OrgId,org.HospitalId)
  686. ////物表消毒记录表(T_HD_SURFACE_DISINFECT)
  687. //city.SyncLisBodyDetection(orgDb,org.OrgId,org.HospitalId)
  688. //// 同步血透患者基本信息表(T_HD_PATIENT)
  689. //city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  690. //// 同步患者退出信息表(T_HD_PATIENT_QUIT)
  691. //city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  692. //// 同步处方 t_hd_ps
  693. //city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  694. //// 同步处方药品 t_hd_ps
  695. //city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  696. //// 患者诊断信息表(T_HD_DIAGNOSIS)
  697. //city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  698. //// 患者通路信息表(T_HD_ACCESS)
  699. //city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  700. ////导管感染记录表(T_HD_CI)
  701. //city.SynListHdCi(orgDb,org.OrgId,org.HospitalId)
  702. ////导管感染转归记录表(T_HD_CI_OUTCOME)
  703. //city.SynLisHdCiOutCome(orgDb,org.OrgId,org.HospitalId)
  704. //// // city.UpdatePatient(orgDb, org.OrgId, org.HospitalId)
  705. //// 患者传染病检查记录表(T_HD_INFECTION
  706. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  707. //// 同步排班 t_hd_shift
  708. //city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  709. //// 同步透析医嘱表(T_HD_DOCTORS_ADVICE)
  710. //city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  711. //// 同步患者透析记录 t_hd_dialysis
  712. //city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  713. //// 同步透中信息 t_hd_middle
  714. //city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  715. //// 透析并发症记录表(T_HD_COMPLICATION)
  716. //city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  717. //// 透析床位表(T_HD_SICKBED)
  718. //city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  719. //// 同步透析床位分区 t_hd_division
  720. //city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  721. // 血透患者检测结果表(T_HD_LIS_REPORT)
  722. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  723. // 血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  724. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  725. // 第四步:关闭数据库连接
  726. // 第四步:关闭数据库连接
  727. service.CloseDB(orgDb)
  728. }
  729. // }
  730. c.ServeSuccessJSON(map[string]interface{}{
  731. "resultList": "12345",
  732. })
  733. return
  734. }
  735. func (c *SyncController) SyncToHqyy() {
  736. // 第一步:到上报配置表中找到深圳需要上报的机构
  737. // sz_province, _ := beego.AppConfig.Int64("sz_province")
  738. // sz_city, _ := beego.AppConfig.Int64("sz_city")
  739. // configs, _ := service.FindAllDataUploadConfigOrgInfo(sz_province, sz_city, 3)
  740. org := &sz.DataUploadConfig{
  741. OrgId: 9442,
  742. ProvinceId: 19,
  743. CityId: 291,
  744. DepartmentName: "暨南大学附属深圳华侨医院",
  745. HospitalId: "73307826X",
  746. InstType: 1,
  747. DbHost: "183.11.232.26",
  748. DbPort: "3306",
  749. DbPass: "1Q2W3e4r!@#$",
  750. DbUser: "sa",
  751. DbName: "xtzk",
  752. }
  753. // for _, org := range configs {
  754. // 第二步:跟进配置,创建数据库连接
  755. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  756. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  757. if err != nil {
  758. utils.ErrorLog("创建数据库连接失败:%v", err)
  759. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  760. return
  761. }
  762. // 第三步:开始同步数据
  763. // 同步医院信息 t_hd_hospital
  764. city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  765. // 同步水处理器 t_hd_wm
  766. city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  767. // // 同步员工 t_hd_staff
  768. city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  769. // // 同步病人 t_hd_patient
  770. city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  771. // // 同步排班 t_hd_shift
  772. city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  773. // 同步处方 t_hd_ps
  774. city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  775. // 同步处方药品 t_hd_ps
  776. city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  777. // // 同步转院信息 t_hd_patient_out
  778. city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  779. // 同步处方信息 t_hd_doctors_advice
  780. city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  781. // 同步透中信息 t_hd_middle
  782. city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  783. // // 同步设备 t_hd_other_machine
  784. city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  785. // // 同步维修 t_hd_maintain
  786. city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  787. // // 同步设备 t_hd_dm
  788. city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  789. // // 同步患者透析记录 t_hd_dialysis
  790. city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  791. // 同步透析床位分区 t_hd_division
  792. city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  793. // 患者通路信息表(T_HD_ACCESS)
  794. city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  795. // 透析床位表(T_HD_SICKBED)
  796. city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  797. // 患者诊断信息表(T_HD_DIAGNOSIS)
  798. city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  799. // 患者传染病检查记录表(T_HD_INFECTION
  800. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  801. // 透析并发症记录表(T_HD_COMPLICATION)
  802. city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  803. // 血透患者检测结果表(T_HD_LIS_REPORT)
  804. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  805. // 血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  806. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  807. // 第四步:关闭数据库连接
  808. service.CloseDB(orgDb)
  809. }
  810. // }
  811. c.ServeSuccessJSON(map[string]interface{}{
  812. "resultList": "12345",
  813. })
  814. return
  815. }
  816. func (c *SyncController) SyncToSmzybr() {
  817. org := &sz.DataUploadConfig{
  818. OrgId: 9504,
  819. ProvinceId: 19,
  820. CityId: 291,
  821. DepartmentName: "深圳生命之源血液透析中心",
  822. HospitalId: "MA5EU4PC0",
  823. InstType: 1,
  824. DbHost: "127.0.0.1",
  825. DbPort: "1433",
  826. DbPass: "1Q2W3e4r!@#$",
  827. DbUser: "sa",
  828. DbName: "adapter_2019",
  829. }
  830. // for _, org := range configs {
  831. // 第二步:跟进配置,创建数据库连接
  832. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  833. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  834. if err != nil {
  835. utils.ErrorLog("创建数据库连接失败:%v", err)
  836. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  837. return
  838. }
  839. // 第三步:开始同步数据
  840. // 机构人员字典表 t_hd_hospital
  841. // city.SyncTBDICPractitioner(orgDb, org.OrgId, org.HospitalId)
  842. // 药品目录字典表
  843. city.SyncTBDICMedicines(orgDb, org.OrgId, org.HospitalId)
  844. // 药品对照字典
  845. // city.SyncTBDICYpdzzd(orgDb, org.OrgId, org.HospitalId)
  846. // 诊疗项目目录字典表
  847. // city.SyncTBDICZlxmml(orgDb, org.OrgId, org.HospitalId)
  848. // // 诊疗项目目录字典表
  849. // city.SyncTBDICZlxmdzzd(orgDb, org.OrgId, org.HospitalId)
  850. // // 机构床位 t_hd_wm
  851. // city.SyncTMDICTBED(orgDb, org.OrgId, org.HospitalId)
  852. // // 门诊患者信息表
  853. // city.SyncTBMZPatientInformation(orgDb, org.OrgId, org.HospitalId)
  854. // // 挂号表
  855. // city.SyncTBHISMZReg(orgDb, org.OrgId, org.HospitalId)
  856. // // 门诊就诊记录表
  857. // city.SyncTB_YL_MZ_Medical_Record(orgDb, org.OrgId, org.HospitalId)
  858. // // 门诊处方主表
  859. // city.SyncTB_CIS_Prescription(orgDb, org.OrgId, org.HospitalId)
  860. // // 18. 门诊处方明细表
  861. // city.SyncTB_CIS_Prescription_Detail(orgDb, org.OrgId, org.HospitalId)
  862. // // 19. 门诊收费表
  863. // city.SyncTB_HIS_MZ_Charge(orgDb, org.OrgId, org.HospitalId)
  864. // // 20. 门诊收费明细表
  865. // city.SyncTB_HIS_MZ_Fee_Detail(orgDb, org.OrgId, org.HospitalId)
  866. // // 业务量收入统计表
  867. // city.SyncTB_STAT_YWL_Report(orgDb, org.OrgId, org.HospitalId)
  868. // 第四步:关闭数据库连接
  869. service.CloseDB(orgDb)
  870. }
  871. // }
  872. c.ServeSuccessJSON(map[string]interface{}{
  873. "resultList": "12345",
  874. })
  875. return
  876. }
  877. func (c *SyncController) SyncToSmzy() {
  878. // 第一步:到上报配置表中找到深圳需要上报的机构
  879. // sz_province, _ := beego.AppConfig.Int64("sz_province")
  880. // sz_city, _ := beego.AppConfig.Int64("sz_city")
  881. // configs, _ := service.FindAllDataUploadConfigOrgInfo(sz_province, sz_city, 3)
  882. org := &sz.DataUploadConfig{
  883. OrgId: 9504,
  884. ProvinceId: 19,
  885. CityId: 291,
  886. DepartmentName: "深圳生命之源血液透析中心",
  887. HospitalId: "MA5EU4PC0",
  888. InstType: 1,
  889. DbHost: "localhost",
  890. DbPort: "1433",
  891. DbPass: "1Q2W3e4r!@#$",
  892. DbUser: "sa",
  893. DbName: "xtzk",
  894. }
  895. // for _, org := range configs {
  896. // 第二步:跟进配置,创建数据库连接
  897. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  898. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  899. if err != nil {
  900. utils.ErrorLog("创建数据库连接失败:%v", err)
  901. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  902. return
  903. }
  904. // 第三步:开始同步数据
  905. // 同步医院信息 t_hd_hospital
  906. // city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  907. // // 同步员工 t_hd_staff
  908. city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  909. // 布局表(T_HD_LAYOUT)
  910. city.SyncLayout(orgDb, org.OrgId, org.HospitalId)
  911. // 同步设备 t_hd_dm
  912. city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  913. // 同步水处理器 t_hd_wm
  914. city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  915. // 同步维修 t_hd_maintain
  916. city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  917. // 同步设备消毒方法表(T_HD_DISINFECT_METHOD
  918. city.SyncDisinfectMethod(orgDb, org.OrgId, org.HospitalId)
  919. // 同步其它设备信息表(T_HD_OTHER_MACHINE)
  920. city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  921. // 同步透析机消毒检测记录表(T_HD_DM_DISINFECT)
  922. city.SyncDmDisinfect(orgDb, org.OrgId, org.HospitalId)
  923. // 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
  924. city.SyncLisCulture(orgDb, org.OrgId, org.HospitalId)
  925. // 透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_EN)
  926. city.SyncDialysate(orgDb, org.OrgId, org.HospitalId)
  927. // 水处理机消毒记录表(T_HD_WM_DISINFECT)
  928. city.SyncWmDisinfect(orgDb, org.OrgId, org.HospitalId)
  929. //透析用水PH值检测表(T_HD_WATER_PH)
  930. city.SynLisWaterPh(orgDb, org.OrgId, org.HospitalId)
  931. //透析用水细菌培养检测表(T_HD_WATER_BC)
  932. city.SyncLisWaterBc(orgDb, org.OrgId, org.HospitalId)
  933. //透析用水内毒素检测表(T_HD_WATER_EN)
  934. city.SyncLisWaterEn(orgDb, org.OrgId, org.HospitalId)
  935. //透析用水有毒化学物检测表(T_HD_WATER_NC)
  936. city.SynLisWaterNc(orgDb, org.OrgId, org.HospitalId)
  937. //透析用水水硬度检测表(T_HD_WATER_WH)
  938. city.SynListHadWater(orgDb, org.OrgId, org.HospitalId)
  939. //透析用水游离氯检测表(T_HD_WATER_FC)
  940. city.SyncLisWaterFc(orgDb, org.OrgId, org.HospitalId)
  941. //透析用水电解质检测表(T_HD_WATER_EL)
  942. city.SyncLisWaterEl(orgDb, org.OrgId, org.HospitalId)
  943. //透析用水微量元素检测表(T_HD_WATER_TE)
  944. city.SyncLisWaterTe(orgDb, org.OrgId, org.HospitalId)
  945. //透析室空气消毒记录表(T_HD_AIR_DISINFECT)
  946. city.SyncLisAirDetection(orgDb, org.OrgId, org.HospitalId)
  947. //物表消毒记录表(T_HD_SURFACE_DISINFECT)
  948. city.SyncLisBodyDetection(orgDb, org.OrgId, org.HospitalId)
  949. //同步血透患者基本信息表(T_HD_PATIENT)
  950. city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  951. // 同步患者退出信息表(T_HD_PATIENT_QUIT)
  952. city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  953. // 同步处方 t_hd_ps
  954. city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  955. // 同步处方药品 t_hd_ps
  956. city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  957. // 患者诊断信息表(T_HD_DIAGNOSIS)
  958. city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  959. // 患者通路信息表(T_HD_ACCESS)
  960. city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  961. //导管感染记录表(T_HD_CI)
  962. city.SynListHdCi(orgDb, org.OrgId, org.HospitalId)
  963. //导管感染转归记录表(T_HD_CI_OUTCOME)
  964. city.SynLisHdCiOutCome(orgDb, org.OrgId, org.HospitalId)
  965. // // city.UpdatePatient(orgDb, org.OrgId, org.HospitalId)
  966. // 患者传染病检查记录表(T_HD_INFECTION
  967. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  968. // 同步排班 t_hd_shift
  969. city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  970. // 同步透析医嘱表(T_HD_DOCTORS_ADVICE)
  971. city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  972. // 同步患者透析记录 t_hd_dialysis
  973. city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  974. //city.SyncLisIndicatorsBc(orgDb, org.OrgId, org.HospitalId)
  975. //city.SyncLisIndicatorsBcUpdate(orgDb, org.OrgId, org.HospitalId)
  976. //city.SyncLisReportBc(orgDb, org.OrgId, org.HospitalId)
  977. // 同步透中信息 t_hd_middle
  978. city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  979. // 透析并发症记录表(T_HD_COMPLICATION)
  980. city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  981. // 透析床位表(T_HD_SICKBED)
  982. city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  983. // 同步透析床位分区 t_hd_division
  984. city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  985. // 血透患者检测结果表(T_HD_LIS_REPORT)
  986. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  987. //血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  988. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  989. // // 第四步:关闭数据库连接
  990. // // 第四步:关闭数据库连接
  991. service.CloseDB(orgDb)
  992. }
  993. // }
  994. c.ServeSuccessJSON(map[string]interface{}{
  995. "resultList": "12345",
  996. })
  997. return
  998. }
  999. func (c *SyncController) SyncToSmzyYxxxzx() {
  1000. org := &sz.DataUploadConfig{
  1001. OrgId: 9504,
  1002. ProvinceId: 19,
  1003. CityId: 291,
  1004. DepartmentName: "深圳生命之源血液透析中心",
  1005. HospitalId: "MA5EU4PC0",
  1006. InstType: 1,
  1007. DbHost: "localhost",
  1008. DbPort: "1433",
  1009. DbPass: "1Q2W3e4r!@#$",
  1010. DbUser: "sa",
  1011. DbName: "xtzk",
  1012. }
  1013. // for _, org := range configs {
  1014. // 第二步:跟进配置,创建数据库连接
  1015. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  1016. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  1017. if err != nil {
  1018. utils.ErrorLog("创建数据库连接失败:%v", err)
  1019. return
  1020. }
  1021. // 第三步:开始同步数据
  1022. // 机构人员字典表 t_hd_hospital
  1023. city.SyncTBDICPractitioner(orgDb, org.OrgId, org.HospitalId)
  1024. // 药品目录字典表
  1025. city.SyncTBDICMedicines(orgDb, org.OrgId, org.HospitalId)
  1026. // 药品对照字典
  1027. city.SyncTBDICYpdzzd(orgDb, org.OrgId, org.HospitalId)
  1028. // 诊疗项目目录字典表
  1029. city.SyncTBDICZlxmml(orgDb, org.OrgId, org.HospitalId)
  1030. // 诊疗项目目录字典表
  1031. city.SyncTBDICZlxmdzzd(orgDb, org.OrgId, org.HospitalId)
  1032. // 机构床位 t_hd_wm
  1033. city.SyncTMDICTBED(orgDb, org.OrgId, org.HospitalId)
  1034. // 门诊患者信息表
  1035. city.SyncTBMZPatientInformation(orgDb, org.OrgId, org.HospitalId)
  1036. // 挂号表
  1037. city.SyncTBHISMZReg(orgDb, org.OrgId, org.HospitalId)
  1038. // 门诊就诊记录表
  1039. city.SyncTB_YL_MZ_Medical_Record(orgDb, org.OrgId, org.HospitalId)
  1040. // 门诊处方主表
  1041. city.SyncTB_CIS_Prescription(orgDb, org.OrgId, org.HospitalId)
  1042. // 18. 门诊处方明细表
  1043. city.SyncTB_CIS_Prescription_Detail(orgDb, org.OrgId, org.HospitalId)
  1044. // 19. 门诊收费表
  1045. city.SyncTB_HIS_MZ_Charge(orgDb, org.OrgId, org.HospitalId)
  1046. // 20. 门诊收费明细表
  1047. city.SyncTB_HIS_MZ_Fee_Detail(orgDb, org.OrgId, org.HospitalId)
  1048. // 业务量收入统计表
  1049. city.SyncTB_STAT_YWL_Report(orgDb, org.OrgId, org.HospitalId)
  1050. // 第四步:关闭数据库连接
  1051. service.CloseDB(orgDb)
  1052. }
  1053. // }
  1054. return
  1055. }
  1056. func (c *SyncController) SyncToSzjk() {
  1057. // 第一步:到上报配置表中找到深圳需要上报的机构
  1058. // sz_province, _ := beego.AppConfig.Int64("sz_province")
  1059. // sz_city, _ := beego.AppConfig.Int64("sz_city")
  1060. // configs, _ := service.FindAllDataUploadConfigOrgInfo(sz_province, sz_city, 3)
  1061. org := &sz.DataUploadConfig{
  1062. OrgId: 10245,
  1063. ProvinceId: 19,
  1064. CityId: 291,
  1065. DepartmentName: "深圳静康医院血液透析中心",
  1066. HospitalId: "MA5DKWHG3",
  1067. InstType: 1,
  1068. DbHost: "localhost",
  1069. DbPort: "1433",
  1070. DbPass: "Ya2019",
  1071. DbUser: "sa",
  1072. DbName: "adapter_2019",
  1073. }
  1074. // for _, org := range configs {
  1075. // 第二步:跟进配置,创建数据库连接
  1076. if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
  1077. orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
  1078. if err != nil {
  1079. utils.ErrorLog("创建数据库连接失败:%v", err)
  1080. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  1081. return
  1082. }
  1083. // 第三步:开始同步数据
  1084. // 同步医院信息 t_hd_hospital
  1085. city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
  1086. // 同步水处理器 t_hd_wm
  1087. city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
  1088. // 同步员工 t_hd_staff
  1089. city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
  1090. // // 同步病人 t_hd_patient
  1091. city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
  1092. city.UpdatePatient(orgDb, org.OrgId, org.HospitalId)
  1093. // 同步排班 t_hd_shift
  1094. city.SyncShift(orgDb, org.OrgId, org.HospitalId)
  1095. // 同步处方 t_hd_ps
  1096. city.SyncPs(orgDb, org.OrgId, org.HospitalId)
  1097. // 同步处方药品 t_hd_ps
  1098. city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
  1099. // // 同步转院信息 t_hd_patient_out
  1100. city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
  1101. // 同步处方信息 t_hd_doctors_advice
  1102. city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
  1103. // 同步透中信息 t_hd_middle
  1104. city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
  1105. // // 同步设备 t_hd_other_machine
  1106. city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
  1107. // // 同步维修 t_hd_maintain
  1108. city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
  1109. // // 同步设备 t_hd_dm
  1110. city.SyncDM(orgDb, org.OrgId, org.HospitalId)
  1111. // // 同步患者透析记录 t_hd_dialysis
  1112. city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
  1113. // 同步透析床位分区 t_hd_division
  1114. city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
  1115. // 患者通路信息表(T_HD_ACCESS)
  1116. city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
  1117. // 透析床位表(T_HD_SICKBED)
  1118. city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
  1119. // 患者诊断信息表(T_HD_DIAGNOSIS)
  1120. city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
  1121. // 患者传染病检查记录表(T_HD_INFECTION
  1122. city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
  1123. // 透析并发症记录表(T_HD_COMPLICATION)
  1124. city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
  1125. // 血透患者检测结果表(T_HD_LIS_REPORT)
  1126. city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
  1127. // 血透患者检验结果指标表(T_HD_LIS_INDICATORS)
  1128. city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
  1129. // 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
  1130. city.SyncLisCulture(orgDb, org.OrgId, org.HospitalId)
  1131. //透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_BC)
  1132. city.SyncDialysate(orgDb, org.OrgId, org.HospitalId)
  1133. //物表消毒记录表(T_HD_SURFACE_DISINFECT)
  1134. city.SyncLisBodyDetection(orgDb, org.OrgId, org.HospitalId)
  1135. //透析用水游离氯检测表(T_HD_WATER_FC)
  1136. city.SyncLisWaterFc(orgDb, org.OrgId, org.HospitalId)
  1137. //透析用水有毒化学物检测表(T_HD_WATER_NC)
  1138. city.SynLisWaterNc(orgDb, org.OrgId, org.HospitalId)
  1139. //透析用水PH值检测表(T_HD_WATER_PH)
  1140. city.SynLisWaterPh(orgDb, org.OrgId, org.HospitalId)
  1141. //透析用水水硬度检测表(T_HD_WATER_WH)
  1142. city.SynListHadWater(orgDb, org.OrgId, org.HospitalId)
  1143. //导管感染记录表(T_HD_CI)
  1144. city.SynListHdCi(orgDb, org.OrgId, org.HospitalId)
  1145. //导管感染转归记录表(T_HD_CI_OUTCOME)
  1146. city.SynLisHdCiOutCome(orgDb, org.OrgId, org.HospitalId)
  1147. //透析室空气消毒记录表(T_HD_AIR_DISINFECT)
  1148. city.SyncLisAirDetection(orgDb, org.OrgId, org.HospitalId)
  1149. //透析用水细菌培养检测表(T_HD_WATER_BC)
  1150. city.SyncLisWaterBc(orgDb, org.OrgId, org.HospitalId)
  1151. //透析用水内毒素检测表(T_HD_WATER_EN)
  1152. city.SyncLisWaterEn(orgDb, org.OrgId, org.HospitalId)
  1153. // 第四步:关闭数据库连接
  1154. service.CloseDB(orgDb)
  1155. }
  1156. // }
  1157. c.ServeSuccessJSON(map[string]interface{}{
  1158. "resultList": "12345",
  1159. })
  1160. return
  1161. }