HospitalSvc.asmx.cs 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381
  1. #region Copyright © 2015 CLIPSOFT Co.,Ltd. All Rights Reserved.
  2. //
  3. // All rights are reserved. Reproduction or transmission in whole or in part,
  4. // in any form or by any means, electronic, mechanical or otherwise, is
  5. // prohibited without the prior written consent of the copyright owner.
  6. //
  7. // Filename: ConsentSvc.asmx.cs
  8. //
  9. #endregion
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Web.Services;
  13. using System.Collections;
  14. using IBatisNet.DataMapper;
  15. using CLIP.eForm.Server.Data;
  16. using CLIP.eForm.Consent.Entity;
  17. using CLIP.eForm.Consent.Dac;
  18. using System.IO;
  19. using System.Drawing;
  20. using System.Text;
  21. using System.Linq;
  22. namespace CLIP.eForm.Consent.WebService {
  23. /// <summary>
  24. /// Class description
  25. /// </summary>
  26. /// <remarks>
  27. /// <p>[설계자]</p>
  28. /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
  29. /// <p>[원본 작성자]</p>
  30. /// <p> 클립소프트 기술부 이인희</p>
  31. /// <p>[수정 작성자]</p>
  32. /// <p> 파티마병원 정보지원과 오재은</p>
  33. /// <p>----------------------------------------------------------------------------------------</p>
  34. /// <p>[HISTORY]</p>
  35. /// <p> 2016-06-15 : 최초작성</p>
  36. /// <p>----------------------------------------------------------------------------------------</p>
  37. /// </remarks>
  38. /// <summary>
  39. /// HospitalSvc 요약 설명입니다.
  40. /// </summary>
  41. [WebService(Namespace = "http://tempuri.org/")]
  42. [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  43. [System.ComponentModel.ToolboxItem(false)]
  44. // ASP.NET AJAX를 사용하여 스크립트에서 이 웹 서비스를 호출하려면 다음 줄의 주석 처리를 제거합니다.
  45. // [System.Web.Script.Services.ScriptService]
  46. public class HospitalSvc : System.Web.Services.WebService {
  47. private IBatisHelper _ibatisHelper;
  48. //private IBatisHelper cendbHelper;
  49. public HospitalSvc() {
  50. _ibatisHelper = new IBatisHelper("HospitalSvcOracleMap.config");
  51. //cendbHelper = new IBatisHelper("CenDBOracleMap.config");
  52. }
  53. protected override void Dispose(bool disposing) {
  54. if (IbatisSession != null && IbatisSession.Transaction != null) {
  55. IbatisSession.CommitTransaction();
  56. IbatisSession.CloseConnection();
  57. }
  58. if (IbatisMapper != null)
  59. IbatisMapper.CloseConnection();
  60. //if (cendbSession != null && cendbSession.Transaction != null) {
  61. // cendbSession.CommitTransaction();
  62. // cendbSession.CloseConnection();
  63. //}
  64. //if (cendbMapper != null) {
  65. // cendbMapper.CloseConnection();
  66. //}
  67. base.Dispose(disposing);
  68. }
  69. /// <summary>
  70. /// 현재 연결된 IBatis Connection을 반환
  71. /// </summary>
  72. public ISqlMapper IbatisMapper {
  73. get {
  74. if (_ibatisHelper == null) {
  75. return null;
  76. } else {
  77. return _ibatisHelper.GetSqlMapper();
  78. }
  79. }
  80. }
  81. //public ISqlMapper cendbMapper {
  82. // get {
  83. // if (cendbHelper == null) {
  84. // return null;
  85. // } else {
  86. // return cendbHelper.GetSqlMapper();
  87. // }
  88. // }
  89. //}
  90. /// <summary>
  91. /// 현재 연결된 ISqlMapSession 을 반환
  92. /// </summary>
  93. public ISqlMapSession IbatisSession {
  94. get {
  95. if (_ibatisHelper == null) {
  96. return null;
  97. } else {
  98. return _ibatisHelper.GetMapSession();
  99. }
  100. }
  101. }
  102. //public ISqlMapSession cendbSession {
  103. // get {
  104. // if (cendbHelper == null) {
  105. // return null;
  106. // } else {
  107. // return cendbHelper.GetMapSession();
  108. // }
  109. // }
  110. //}
  111. [WebMethod]
  112. public bool CheckWebService() {
  113. return true;
  114. }
  115. //[WebMethod]
  116. //public string checkCendbService() {
  117. // int hashCode = 0;
  118. // if (cendbHelper != null) {
  119. // hashCode = cendbHelper.GetHashCode();
  120. // }
  121. // return String.Format("result is: {0}", hashCode);
  122. //}
  123. [WebMethod]
  124. public bool CheckDatabaseConnection() {
  125. // TODO: 데이터 베이스 커넥션 테스트 호출 필요
  126. if (IbatisMapper != null) {
  127. return true;
  128. }
  129. return false;
  130. }
  131. /// <summary>
  132. /// 동의서 기본 세팅 정보
  133. /// </summary>
  134. /// <returns></returns>
  135. [WebMethod(Description = "동의서 기본 세팅 정보")]
  136. public List<SettingListVO> GetSettingData() {
  137. List<SettingListVO> result = null;
  138. try {
  139. using (UserDac dac = new UserDac()) {
  140. Hashtable param = new Hashtable();
  141. //return (List<SettingListVO>) dac.GetSettingData(IbatisMapper, param);
  142. result = (List<SettingListVO>) dac.GetSettingData(IbatisMapper, param);
  143. }
  144. } catch (Exception ex) {
  145. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSettingData error: {0}", ex.Message));
  146. }
  147. return result;
  148. }
  149. /// <summary>
  150. /// 사용자 상세정보
  151. /// 의사의 경우 엔존번호를 반환한다
  152. /// </summary>
  153. /// <param name="userId">사용자 ID</param>
  154. /// <param name="instCd">근무지기관코드</param>
  155. /// <param name="deptCd">근무지부서코드</param>
  156. /// <returns></returns>
  157. [WebMethod(Description = "사용자 상세정보")]
  158. public UserVO GetUserInfo(string userId, string instCd, string deptCd) {
  159. UserVO user = new UserVO();
  160. try {
  161. using (UserDac dac = new UserDac()) {
  162. Hashtable param = new Hashtable {
  163. { "userId", userId },
  164. { "instCd", instCd },
  165. { "deptCd", deptCd ?? "" }
  166. };
  167. user = dac.GetUserInfo(this.IbatisMapper, param);
  168. if (user == null) {
  169. user = new UserVO();
  170. user.userId = "";
  171. user.userName = "";
  172. user.userDeptCode = "";
  173. user.userDeptName = "";
  174. user.deptEngAbbr = "";
  175. user.jobKindCd = "";
  176. user.jobKindNm = "";
  177. user.instCd = "";
  178. user.userTelNo = "";
  179. user.ioFlag = "";
  180. }
  181. }
  182. return user;
  183. } catch (Exception ex) {
  184. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetUserInfo error: {0}", ex.Message));
  185. throw ex;
  186. }
  187. }
  188. /// <summary>
  189. /// 환자 진료일 조회
  190. /// </summary>
  191. /// <param name="patientNo">환자번호</param>
  192. /// <param name="searchClnDate">검색진료일</param>
  193. /// <param name="searchType">검색조건, (searchType == ">=" 이면 clnDate >= searchClnDate, searchType == "=" 이면 clnDate = searchClnDate) </param>
  194. /// <param name="orddeptcd">진료부서코드</param>
  195. /// <param name="dutinstcd">근무지기관코드</param>
  196. /// <returns></returns>
  197. [WebMethod(Description = "환자 진료일 조회")]
  198. public List<ClnDateForDropdownVO> GetTrmtDateList(string patientNo, string searchClnDate, string searchType, string orddeptcd
  199. , string dutinstcd, string ordType) {
  200. List<ClnDateForDropdownVO> clnDateList;
  201. try {
  202. using (PatientDac dac = new PatientDac()) {
  203. Hashtable param = new Hashtable {
  204. { "instcd", dutinstcd },
  205. { "pid", patientNo },
  206. { "searchClnDate", searchClnDate },
  207. { "searchType", searchType },
  208. { "orddeptcd", orddeptcd },
  209. { "ordType", ordType}
  210. };
  211. clnDateList = (List<ClnDateForDropdownVO>) dac.GetTrmtDateList(this.IbatisMapper, param);
  212. }
  213. return clnDateList;
  214. } catch (Exception ex) {
  215. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetTrmtDateList error: {0}", ex.Message));
  216. throw ex;
  217. }
  218. }
  219. /// <summary>
  220. /// 환자리스트 조회
  221. /// </summary>
  222. /// <param name="srchDd">조회일자 ex) 20200101</param>
  223. /// <param name="ordDeptCd">진료과 코드</param>
  224. /// <param name="doctorId">의사 아이디</param>
  225. /// <param name="pid">환자 등록번호</param>
  226. /// <param name="patientState">동의서 상태 및 환자 상태</param>
  227. /// <param name="instCd">병원 기관코드</param>
  228. /// <param name="wardCd">병동코드</param>
  229. /// <param name="userId">사용자 아이디</param>
  230. /// <param name="myPatient">입원에서 내환자 검색 조건</param>
  231. /// <param name="jobKindCd"></param>
  232. /// <param name="drKind">의사 구분코드 전공의(A), 담당교수(B), 그외 직종(C) 구분코드 </param>
  233. /// <param name="selectFlag">화면 구분 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검색 : S</param>
  234. /// <param name="srchYN">검색 화면 여부</param>
  235. /// <returns></returns>
  236. [WebMethod(Description = "환자리스트 조회")]
  237. public List<PatListVO> GetPatientList(String srchDd, String ordDeptCd, String doctorId, String pid, String patientState, String instCd,
  238. String wardCd, String userId, String myPatient, String jobKindCd, String drKind, String selectFlag, String srchYN) {
  239. wardCd = wardCd ?? "";
  240. userId = userId ?? "";
  241. myPatient = myPatient ?? "N";
  242. jobKindCd = jobKindCd ?? "";
  243. drKind = drKind ?? "";
  244. selectFlag = selectFlag.ToUpper();
  245. if (selectFlag.Equals("SR")) {
  246. if (patientState.Equals("A")) {
  247. selectFlag = "I";
  248. patientState = "A";
  249. } else if (patientState.Equals("0")) {
  250. selectFlag = "O";
  251. } else if (patientState.Equals("1")) {
  252. selectFlag = "E";
  253. patientState = "A";
  254. }
  255. }
  256. List<PatListVO> result;
  257. try {
  258. using (PatListDac dac = new PatListDac()) {
  259. Hashtable param = new Hashtable();
  260. param.Add("srchDd", srchDd);
  261. param.Add("ordDeptCd", ordDeptCd);
  262. param.Add("doctorId", doctorId);
  263. param.Add("pid", pid);
  264. param.Add("patientState", patientState);
  265. param.Add("instCd", instCd);
  266. param.Add("selectFlag", selectFlag);
  267. param.Add("srchYN", srchYN);
  268. if (selectFlag.Equals("I")) {
  269. param.Add("wardCd", wardCd);
  270. param.Add("userId", userId);
  271. param.Add("myPatient", myPatient);
  272. }
  273. if (selectFlag.Equals("I") || selectFlag.Equals("E")) {
  274. param.Add("jobKindCd", jobKindCd);
  275. param.Add("drKind", drKind);
  276. }
  277. result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  278. }
  279. return result;
  280. } catch (Exception ex) {
  281. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetPatientList error: {0}", ex.Message));
  282. throw ex;
  283. }
  284. }
  285. /// <summary>
  286. /// 검사탭 환자리스트 조회 모바일 전용
  287. /// </summary>
  288. /// <param name="selectFlag">선택한 탭의 상태값 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검사 : EX, 검색 : S</param>
  289. /// <param name="toDt"></param>
  290. /// <param name="fromDt"></param>
  291. /// <param name="baseCd">지원부서목록</param>
  292. /// <param name="supportDeptCd">지원과</param>
  293. /// <param name="pid">환자번호</param>
  294. /// <param name="patientState"></param>
  295. /// <returns></returns>
  296. [WebMethod(Description = "검사탭 환자리스트 조회")]
  297. public List<PatListVO> GetPatientExList(String selectFlag, String toDt, String fromDt, String baseCd, String supportDeptCd, String pid, String patientState) {
  298. List<PatListVO> result = null;
  299. try {
  300. using (PatListDac dac = new PatListDac()) {
  301. Hashtable param = new Hashtable();
  302. param.Add("selectFlag", selectFlag);
  303. param.Add("toDt", toDt);
  304. param.Add("fromDt", fromDt);
  305. param.Add("baseCd", baseCd);
  306. param.Add("supportDeptCd", supportDeptCd);
  307. param.Add("pid", pid);
  308. param.Add("patientState", patientState);
  309. param.Add("deviceType", "MOBILE");
  310. result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  311. }
  312. return result;
  313. } catch (Exception ex) {
  314. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
  315. throw ex;
  316. }
  317. }
  318. /// <summary>
  319. /// 검사탭 환자리스트 조회 모바일 전용
  320. /// </summary>
  321. /// <param name="selectFlag">선택한 탭의 상태값 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검사 : EX, 검색 : S</param>
  322. /// <param name="toDt"></param>
  323. /// <param name="fromDt"></param>
  324. /// <param name="baseCd">지원부서목록</param>
  325. /// <param name="supportDeptCd">지원과</param>
  326. /// <param name="pid">환자번호</param>
  327. /// <param name="patientState"></param>
  328. /// <returns></returns>
  329. [WebMethod(Description = "검사탭 환자리스트 조회")]
  330. public List<PatListVO> GetPatientExListPC(String selectFlag, String toDt, String fromDt, String baseCd, String supportDeptCd, String pid, String patientState, string isMainD, string mainDrId) {
  331. List<PatListVO> result = null;
  332. try {
  333. using (PatListDac dac = new PatListDac()) {
  334. Hashtable param = new Hashtable();
  335. param.Add("selectFlag", selectFlag);
  336. param.Add("toDt", toDt);
  337. param.Add("fromDt", fromDt);
  338. param.Add("baseCd", baseCd);
  339. param.Add("supportDeptCd", supportDeptCd);
  340. param.Add("pid", pid);
  341. param.Add("patientState", patientState);
  342. param.Add("deviceType", "PC");
  343. param.Add("isMainD", isMainD);
  344. param.Add("mainDrId", mainDrId);
  345. result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  346. }
  347. return result;
  348. } catch (Exception ex) {
  349. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
  350. throw ex;
  351. }
  352. }
  353. /// <summary>
  354. /// 검사탭 환자리스트 조회 PC 클라이언트 전용
  355. /// </summary>
  356. /// <param name="selectFlag">선택한 탭의 상태값 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검사 : EX, 검색 : S</param>
  357. /// <param name="toDt"></param>
  358. /// <param name="fromDt"></param>
  359. /// <param name="baseCd">지원부서목록</param>
  360. /// <param name="supportDeptCd">지원과</param>
  361. /// <param name="pid">환자번호</param>
  362. /// <param name="patientState"></param>
  363. /// <returns></returns>
  364. [WebMethod(Description = "검사탭 환자리스트 조회")]
  365. public List<PatListVO> GetPatientExPCList(String selectFlag, String toDt, String fromDt, String baseCd, String supportDeptCd, String pid, String patientState, string isMainD, string mainDrId) {
  366. List<PatListVO> result = null;
  367. try {
  368. using (PatListDac dac = new PatListDac()) {
  369. Hashtable param = new Hashtable();
  370. param.Add("selectFlag", selectFlag);
  371. param.Add("toDt", toDt);
  372. param.Add("fromDt", fromDt);
  373. param.Add("baseCd", baseCd);
  374. param.Add("supportDeptCd", supportDeptCd);
  375. param.Add("pid", pid);
  376. param.Add("patientState", patientState);
  377. param.Add("isMainD", isMainD);
  378. param.Add("mainDrId", mainDrId);
  379. result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  380. }
  381. return result;
  382. } catch (Exception ex) {
  383. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
  384. throw ex;
  385. }
  386. }
  387. ///// <summary>
  388. ///// 입원탭 환자리스트 조회
  389. ///// </summary>
  390. ///// <param name="srchdd">조회일자 ex)20160623</param>
  391. ///// <param name="orddeptcd">진료과 및 집도과 ex) 빈값은 전체</param>
  392. ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex) 빈값은 전체</param>
  393. ///// <param name="pid">환자등록번호 ex) 빈값은 전체</param>
  394. ///// <param name="wardcd">병동 코드 ex) 3041400000</param>
  395. ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)빈값은 전체</param>
  396. ///// <param name="jobkindcd"></param>
  397. ///// <param name="dutinstcd">근무지기관코드</param>
  398. ///// <param name="userId">로그인 사용자 ID</param>
  399. ///// <param name="myPatient">내환자 검색 checkbox value, 내환자 검색의 경우 pid 파라미터는 null 로 보내야 한다.ex) Y, N</param>
  400. //[WebMethod(Description = "입원탭 환자리스트 조회")]
  401. //public List<PatListVO> GetInPatList(String srchdd, String orddeptcd, String doctorid, String pid, String wardcd, String patstat, String jobkindcd, String dutinstcd, String userId, String myPatient, String drKind) {
  402. // List<PatListVO> result;
  403. // try {
  404. // using (PatListDac dac = new PatListDac()) {
  405. // var myPatValue = myPatient ?? "N";
  406. // var userIdValue = userId ?? "";
  407. // // 내환자 검색일 경우 입력된 환자 번호를 무시하도록 설정
  408. // if (myPatValue == "Y") {
  409. // pid = "";
  410. // }
  411. // //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetCategoryForDropdown error: {0}", srchdd));
  412. // Hashtable param = new Hashtable {
  413. // { "instcd", dutinstcd },
  414. // { "srchdd", srchdd },
  415. // { "orddeptcd", orddeptcd },
  416. // { "wardcd", wardcd },
  417. // { "patstat", patstat },
  418. // { "pid", pid },
  419. // { "doctorid", doctorid },
  420. // { "selectflag", "I" },
  421. // { "userid", userIdValue },
  422. // { "myPatient", myPatValue },
  423. // { "srchYN", "N" },
  424. // { "drKind", drKind }
  425. // };
  426. // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  427. // }
  428. // return result;
  429. // } catch (Exception ex) {
  430. // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
  431. // throw ex;
  432. // }
  433. //}
  434. ///// <summary>
  435. ///// 외래탭 환자리스트 조회
  436. ///// </summary>
  437. ///// <param name="srchdd">조회일자 ex)20160628 orddd</param>
  438. ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체, 2010400000</param>
  439. ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex)빈값은 전체, 104796 orddrid</param>
  440. ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
  441. ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) 빈값은 전체</param>
  442. ///// <param name="dutinstcd">근무지기관코드</param>
  443. ///// <returns>외래 환자 리스트</returns>
  444. //[WebMethod(Description = "외래탭 환자리스트 조회")]
  445. //public List<PatListVO> GetOutPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String dutinstcd) {
  446. // List<PatListVO> result = null;
  447. // try {
  448. // using (PatListDac dac = new PatListDac()) {
  449. // Hashtable param = new Hashtable {
  450. // { "instcd", dutinstcd },
  451. // { "srchdd", srchdd },
  452. // { "orddeptcd", orddeptcd },
  453. // { "orddrid", doctorid },
  454. // { "pid", pid },
  455. // { "patstat", patstat },
  456. // { "selectflag", "O" },
  457. // { "srchYN", "N" }
  458. // };
  459. // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  460. // }
  461. // return result;
  462. // } catch (Exception ex) {
  463. // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetOutPatList error: {0}", ex.Message));
  464. // throw ex;
  465. // }
  466. //}
  467. ///// <summary>
  468. ///// 수술탭 환자리스트 조회
  469. ///// </summary>
  470. ///// <param name="srchdd">조회일자 ex)20160623</param>
  471. ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체</param>
  472. ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex)빈값은 전체</param>
  473. ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
  474. ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)A</param>
  475. ///// <param name="dutinstcd">근무지기관코드</param>
  476. ///// <returns></returns>
  477. //[WebMethod(Description = "수술탭 환자리스트 조회")]
  478. //public List<PatListVO> GetOpPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String dutinstcd) {
  479. // List<PatListVO> result;
  480. // try {
  481. // using (PatListDac dac = new PatListDac()) {
  482. // Hashtable param = new Hashtable {
  483. // { "instcd", dutinstcd },
  484. // { "srchdd", srchdd },
  485. // { "opstatcd", patstat },
  486. // { "orddeptcd", orddeptcd },
  487. // { "orddrid", doctorid },
  488. // { "pid", pid },
  489. // { "selectflag", "OP" },
  490. // { "srchYN", "N" }
  491. // };
  492. // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  493. // }
  494. // return result;
  495. // } catch (Exception ex) {
  496. // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetOpPatList error: {0}", ex.Message));
  497. // throw ex;
  498. // }
  499. //}
  500. ///// <summary>
  501. ///// 응급탭 환자 리스트 조회
  502. ///// </summary>
  503. ///// <param name="srchdd">조회일자 ex) 20160623</param>
  504. ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체</param>
  505. ///// <param name="doctorid"> 진료의 또는 주치의 또는 집도의 ex)빈값은 전체</param>
  506. ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
  507. ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)빈값은 전체</param>
  508. ///// <param name="jobkindcd">직무의 종류와 담당분야가 동일한 직무의군 코드값 아직 정의 되지 않았음. 예)영양직, 의무정보직, 임상병리직'</param>
  509. ///// <param name="dutinstcd">근무지기관코드</param>
  510. ///// <returns></returns>
  511. //[WebMethod(Description = "응급탭 환자 리스트 조회")]
  512. //public List<PatListVO> GetErPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String jobkindcd, String dutinstcd, String drKind) {
  513. // List<PatListVO> result;
  514. // try {
  515. // using (PatListDac dac = new PatListDac()) {
  516. // Hashtable param = new Hashtable {
  517. // { "instcd", dutinstcd },
  518. // { "srchdd", srchdd },
  519. // { "orddeptcd", orddeptcd },
  520. // { "orddrid", doctorid },
  521. // { "patstat", patstat },
  522. // { "pid", pid },
  523. // { "selectflag", "ER" },
  524. // { "srchYN", "N" },
  525. // { "drKind", drKind }
  526. // };
  527. // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  528. // }
  529. // return result;
  530. // } catch (Exception ex) {
  531. // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetErPatList error: {0}", ex.Message));
  532. // throw ex;
  533. // }
  534. //}
  535. ///// <summary>
  536. ///// 환자검색 조회 기능
  537. ///// </summary>
  538. ///// <param name="srchdd">조회일자 ex)20160623</param>
  539. ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체</param>
  540. ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex)빈값은 전체</param>
  541. ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
  542. ///// <param name="ordtype">외래 O / 입원 I / 응급 ER</param>
  543. ///// <param name="dutinstcd">근무지기관코드</param>
  544. ///// <param name="userId">로그인 사용자 ID</param>
  545. ///// <param name="myPatient">내환자 검색 checkbox value, 내환자 검색의 경우 pid 파라미터는 null 로 보내야 한다.ex) Y, N</param>
  546. ///// <returns></returns>
  547. //[WebMethod(Description = "환자검색 조회 기능")]
  548. //public List<PatListVO> GetSrPatList(String srchdd, String orddeptcd, String doctorid, String pid, String ordtype, String dutinstcd, String userId, String myPatient) {
  549. // List<PatListVO> result;
  550. // try {
  551. // using (PatListDac dac = new PatListDac()) {
  552. // var myPatValue = myPatient ?? "N";
  553. // var userIdValue = userId ?? "";
  554. // // 내환자 검색일 경우 입력된 환자 번호를 무시하도록 설정
  555. // if (myPatValue == "Y") {
  556. // pid = "";
  557. // }
  558. // Hashtable param = new Hashtable {
  559. // { "instcd", dutinstcd },
  560. // { "srchdd", srchdd },
  561. // { "orddeptcd", orddeptcd },
  562. // { "wardcd", "" },
  563. // { "medispclid", doctorid },
  564. // { "orddrid", doctorid },
  565. // { "pid", pid },
  566. // { "opstatcd", "A" },
  567. // { "selectflag", ordtype },
  568. // { "patstat", "0" },
  569. // { "myPatient", myPatValue },
  570. // { "userId", userIdValue },
  571. // { "srchYN", "Y" }
  572. // };
  573. // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
  574. // }
  575. // return result;
  576. // } catch (Exception ex) {
  577. // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSrPatList error: {0}", ex.Message));
  578. // throw ex;
  579. // }
  580. //}
  581. /// <summary>
  582. /// 환자리스트 조회조건 중 진료과 조회
  583. /// </summary>
  584. /// <param name="ordType">내원 종류 ( 탭 종류 ) 외래 : O , 입원 : I , 수술 : OP, 응급 : ER, 환자검색 : SR</param>
  585. /// <param name="instCd">근무지기관코드</param>
  586. [WebMethod(Description = "환자리스트 조회조건 중 진료과 조회")]
  587. public List<DeptListVO> GetDeptList(String ordType, String instCd) {
  588. List<DeptListVO> result;
  589. try {
  590. using (PatListDac dac = new PatListDac()) {
  591. Hashtable param = new Hashtable();
  592. if (instCd == null) {
  593. instCd = "031";
  594. }
  595. param.Add("instCd", instCd);
  596. param.Add("ordType", ordType);
  597. result = (List<DeptListVO>) dac.GetDeptList(this.IbatisMapper, param);
  598. }
  599. return result;
  600. } catch (Exception ex) {
  601. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDeptList error: {0}", ex.Message));
  602. throw ex;
  603. }
  604. }
  605. /// <summary>
  606. /// 환자리스트 조회조건 중 진료과 리스트 진짜 사용할꺼
  607. /// </summary>
  608. /// <param name="ordType">내원 종류 ( 탭 종류 ) 외래 : O , 입원 : I , 수술 : OP, 응급 : ER, 환자검색 : S</param>
  609. /// <param name="dutInstCd">근무지기관코드</param>
  610. [WebMethod(Description = "환자리스트 조회조건 중 진료과 리스트")]
  611. public List<DeptListVO> GetOrgDeptList(String ordType, String dutInstCd) {
  612. List<DeptListVO> result;
  613. try {
  614. using (PatListDac dac = new PatListDac()) {
  615. Hashtable param = new Hashtable();
  616. if (dutInstCd == null) {
  617. dutInstCd = "101";
  618. }
  619. param.Add("instCd", dutInstCd);
  620. param.Add("ordType", ordType);
  621. result = (List<DeptListVO>) dac.GetDeptList(this.IbatisMapper, param);
  622. }
  623. return result;
  624. } catch (Exception ex) {
  625. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDeptList error: {0}", ex.Message));
  626. throw ex;
  627. }
  628. }
  629. /// <summary>
  630. /// 환자리스트 조회조건 중 병동 조회
  631. /// </summary>
  632. /// <param name="dutInstCd">근무지기관코드</param>
  633. /// <returns></returns>
  634. [WebMethod(Description = "환자리스트 조회조건 중 병동 조회")]
  635. public List<DeptListVO> GetWardList(String instCd) {
  636. List<DeptListVO> result;
  637. try {
  638. using (PatListDac dac = new PatListDac()) {
  639. Hashtable param = new Hashtable();
  640. param.Add("instCd", instCd);
  641. result = (List<DeptListVO>) dac.GetWardList(this.IbatisMapper, param);
  642. }
  643. return result;
  644. } catch (Exception ex) {
  645. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetWardList error: {0}", ex.Message));
  646. throw ex;
  647. }
  648. }
  649. /// <summary>
  650. /// 환자리스트 조회조건 의사 조회
  651. /// </summary>
  652. /// <param name="srchDd">조회 일자 20190822</param>
  653. /// <param name="ordDeptCd">진료과 코드 (소화기내과 : 2010000000) </param>
  654. /// <param name="dutInstCd">근무지기관코드 101</param>
  655. /// <returns></returns>
  656. [WebMethod(Description = "환자리스트 조회조건 중 의사 조회")]
  657. public List<DocListVO> GetDoctorList(String srchDd, String ordDeptCd, String instCd) {
  658. List<DocListVO> result;
  659. try {
  660. using (PatListDac dac = new PatListDac()) {
  661. Hashtable param = new Hashtable();
  662. param.Add("instCd", instCd);
  663. param.Add("srchDd", srchDd);
  664. param.Add("ordDeptCd", ordDeptCd);
  665. result = (List<DocListVO>) dac.GetDocList(this.IbatisMapper, param);
  666. }
  667. return result;
  668. } catch (Exception ex) {
  669. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDoctorList error: {0}", ex.Message));
  670. throw ex;
  671. }
  672. }
  673. /// <summary>
  674. /// 검사 지원부서 설정 목록
  675. /// </summary>
  676. /// <returns></returns>
  677. [WebMethod(Description = "검사 지원부서 설정 목록")]
  678. public List<DeptListVO> GetSupportDeptList() {
  679. List<DeptListVO> result;
  680. try {
  681. using (PatListDac dac = new PatListDac()) {
  682. Hashtable param = new Hashtable();
  683. result = (List<DeptListVO>)dac.GetSupportDeptList(this.IbatisMapper, param);
  684. }
  685. return result;
  686. } catch (Exception ex) {
  687. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSupportDeptList error: {0}", ex.Message));
  688. throw ex;
  689. }
  690. }
  691. [WebMethod(Description = "검사 지원부서 설정 목록")]
  692. public List<InspectionVO> GetInspectingRoomName(string deptCd) {
  693. List<InspectionVO> result;
  694. try {
  695. using (PatListDac dac = new PatListDac()) {
  696. Hashtable param = new Hashtable();
  697. param.Add("deptCd", deptCd);
  698. result = (List<InspectionVO>) dac.GetInspectingRoomName(this.IbatisMapper, param);
  699. }
  700. return result;
  701. } catch (Exception ex) {
  702. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInspectingRoomName error: {0}", ex.Message));
  703. throw ex;
  704. }
  705. }
  706. /// <summary>
  707. /// 환자리스트 조회조건 중 환자 검색 팝업
  708. /// </summary>
  709. /// <param name="srchcond">조회 구분( 1: 등록번호, 2: 환자명, 3: 주민번호, 4: 환자명+주민번호)</param>
  710. /// <param name="pid">환자 등록번호 ex) 2234596</param>
  711. /// <param name="hngnm">환자이름 ex) 오재은</param>
  712. /// <param name="rrgstno1">주민번호 앞자리 ex) 891117</param>
  713. /// <param name="rrgstno2">주민번호 뒷자리 ex) 1682813</param>
  714. /// <param name="dutinstcd">근무지기관코드</param>
  715. /// <returns></returns>
  716. [WebMethod(Description = "환자리스트 조회조건 중 환자 검색 팝업")]
  717. public List<PatInfoListVO> GetSrchPatInfo(String srchcond, String pid, String hngnm, String rrgstno1, String rrgstno2, String dutinstcd) {
  718. List<PatInfoListVO> result;
  719. try {
  720. using (PatListDac dac = new PatListDac()) {
  721. Hashtable param = new Hashtable();
  722. param.Add("instcd", dutinstcd);
  723. param.Add("srchcond", srchcond);
  724. param.Add("pid", pid);
  725. param.Add("hngnm", hngnm);
  726. param.Add("rrgstno1", rrgstno1);
  727. param.Add("rrgstno2", rrgstno2);
  728. result = (List<PatInfoListVO>) dac.GetSrchPatInfo(this.IbatisMapper, param);
  729. }
  730. return result;
  731. } catch (Exception ex) {
  732. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSrchPatInfo error: {0}", ex.Message));
  733. throw ex;
  734. }
  735. }
  736. /// <summary>
  737. /// 환자 선택시 수진일자별 진단 데이터 조회.
  738. /// 입원일때 한 수진에 수술이 여러개일 경우 집도과로 체크
  739. /// 외래일때 당일 수진이 여러개일경우 진료과로 체크
  740. /// </summary>
  741. /// <param name="pid">환자 등록번호 ex) 2234596 , 2270516</param>
  742. /// <param name="inDd">외래 : 진료일, 입원: 입원일 ex) 20160205 , 20151201</param>
  743. /// <param name="ordType">내원 구분 (I: 입원, E: 응급, O: 외래) O , I</param>
  744. /// <param name="ordDeptCd">내원 구분 (I: 입원, E: 응급, O: 외래) O , I</param>
  745. /// <param name="cretNo">생성번호</param>
  746. /// <param name="instCd">근무지기관코드</param>
  747. /// <param name="opRsrvNo">수술예약번호</param>
  748. /// <returns></returns>
  749. [WebMethod(Description = "환자 선택시 수진일자별 진단 데이터 조회")]
  750. public List<PatientVO> GetPatientInfo(String pid, String inDd, String ordType, String ordDeptCd, String cretNo, String instCd, String opRsrvNo) {
  751. List<PatientVO> result;
  752. opRsrvNo = opRsrvNo ?? "";
  753. try {
  754. using (PatientDac dac = new PatientDac()) {
  755. Hashtable param = new Hashtable {
  756. { "instCd", instCd },
  757. { "inDd", inDd },
  758. { "pid", pid },
  759. { "ordType", ordType},
  760. { "ordDeptCd", ordDeptCd},
  761. { "cretNo", cretNo },
  762. { "opRsrvNo", opRsrvNo }
  763. };
  764. result = (List<PatientVO>) dac.GetPatientInfo(this.IbatisMapper, param);
  765. }
  766. return result;
  767. } catch (Exception ex) {
  768. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetPatientInfo error: {0}", ex.Message));
  769. throw ex;
  770. }
  771. }
  772. /// <summary>
  773. /// 사용자 즐겨찾기 추가
  774. /// </summary>
  775. /// <param name="userId">사용자 아이디 107810</param>
  776. /// <param name="formCd">서식코드 </param>
  777. /// <param name="instCd">근무지기관코드</param>
  778. [WebMethod(Description = "사용자 즐겨찾기 추가")]
  779. public SingleReturnData SetUserFormSetList(String userId, String formCd, String instCd) {
  780. SingleReturnData result = new SingleReturnData();
  781. int res = 0;
  782. try {
  783. using (UserDac dac = new UserDac()) {
  784. Hashtable param = new Hashtable();
  785. param.Add("instCd", instCd);
  786. param.Add("userId", userId);
  787. param.Add("formCd", formCd);
  788. res = dac.SetUserFormSet(this.IbatisMapper, param);
  789. }
  790. result.responseData = Convert.ToString(res);
  791. return result;
  792. } catch (Exception ex) {
  793. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SetUserFormSetList error: {0}", ex.Message));
  794. throw ex;
  795. }
  796. }
  797. /// <summary>
  798. /// 사용자 즐겨찾기 삭제
  799. /// </summary>
  800. /// <param name="idx">즐겨찾기에 추가된 동의서 고유번호</param>
  801. /// <param name="userId">사용자 아이디 107810</param>
  802. /// <param name="formCd">서식코드 </param>
  803. /// <param name="dutInstCd">근무지기관코드</param>
  804. [WebMethod(Description = "사용자 즐겨찾기 삭제")]
  805. public SingleReturnData DelUserFormSetList(String idx, String userId, String formCd, String dutInstCd) {
  806. SingleReturnData result = new SingleReturnData();
  807. int res = 0;
  808. try {
  809. using (UserDac dac = new UserDac()) {
  810. Hashtable param = new Hashtable();
  811. param.Add("idx", idx);
  812. param.Add("instCd", dutInstCd);
  813. param.Add("userId", userId);
  814. param.Add("formCd", formCd);
  815. dac.DelUserFormSet(this.IbatisMapper, param);
  816. //if (cendbHelper.GetSqlMapper().DataSource.Name == "DCUMCHospitalDB") {
  817. // res = dac.DelUserFormSet(this.IbatisMapper, param);
  818. // result.responseData = Convert.ToString(res);
  819. //} else {
  820. // res = dac.DelUserFormSet(this.cendbMapper, param);
  821. // result.responseData = Convert.ToString(res);
  822. //}
  823. }
  824. } catch (Exception ex) {
  825. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm DelUserFormSetList error: {0}", ex.Message));
  826. throw ex;
  827. }
  828. return result;
  829. }
  830. /// <summary>
  831. /// OCRTAG 할당
  832. /// </summary>
  833. /// <returns></returns>
  834. [WebMethod(Description = "OCRTAG 할당")]
  835. public SingleReturnData GetOcrTag() {
  836. SingleReturnData result = new SingleReturnData();
  837. try {
  838. using (PatientDac dac = new PatientDac()) {
  839. Hashtable param = new Hashtable();
  840. String res = dac.GetOcrTag(this.IbatisMapper, param);
  841. result.responseData = res;
  842. }
  843. } catch (Exception ex) {
  844. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetOcrTag error: {0}", ex.Message));
  845. throw ex;
  846. }
  847. return result;
  848. }
  849. /// <summary>
  850. /// 사용자의 서명이미지 조회
  851. /// </summary>
  852. /// <param name="userId">사용자 아이디 103043</param>
  853. /// <param name="instCd">근무지기관코드</param>
  854. [WebMethod(Description = "사용자의 서명이미지 조회")]
  855. public UserSignImageVO GetSignImage(string userId, string instCd) {
  856. UserSignImageVO vo = new UserSignImageVO();
  857. try {
  858. string base64stringimg = string.Empty;
  859. using (UserDac dac = new UserDac()) {
  860. userId = userId.ToUpper();
  861. Hashtable param = new Hashtable();
  862. param.Add("userId", userId);
  863. param.Add("instCd", instCd);
  864. IList<UserSignImageVO> vos = dac.GetUserSignImage(this.IbatisMapper, param);
  865. foreach (UserSignImageVO item in vos) {
  866. vo = item;
  867. break;
  868. }
  869. if (vos.Count == 0) {
  870. vo.SignImage = new Byte[0];
  871. }
  872. }
  873. } catch (Exception ex) {
  874. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSignImage error: {0}", ex.Message));
  875. throw ex;
  876. }
  877. return vo;
  878. }
  879. /// <summary>
  880. /// 주,부 진단명 리스트 조회(진단명 팝업)
  881. /// </summary>
  882. /// <param name="pid">등록번호 </param>
  883. /// <param name="orddd">진료일, 입원일 </param>
  884. /// <param name="dutinstcd">근무지기관코드</param>
  885. [WebMethod(Description = "주,부 진단명 리스트 조회(진단명 팝업)")]
  886. public List<string> GetDiagNameList(String pid, String orddd, String dutinstcd) {
  887. List<string> result;
  888. try {
  889. using (PatientDac dac = new PatientDac()) {
  890. Hashtable param = new Hashtable();
  891. if (dutinstcd == null) {
  892. dutinstcd = "031";
  893. }
  894. param.Add("instcd", dutinstcd);
  895. param.Add("orddd", orddd);
  896. param.Add("pid", pid);
  897. result = (List<string>) dac.GetDiagList(this.IbatisMapper, param);
  898. }
  899. return result;
  900. } catch (Exception ex) {
  901. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDiagNameList error: {0}", ex.Message));
  902. throw ex;
  903. }
  904. }
  905. public List<string> getOpNameList(String pid, string dutinstcd) {
  906. List<string> result = null;
  907. try {
  908. //using (OperationNameDAC opDac = new OperationNameDAC())
  909. {
  910. Hashtable args = new Hashtable();
  911. //Hashtable param = new Hashtable();
  912. args.Add("pid", pid);
  913. args.Add("dutinstcd", dutinstcd);
  914. //result = (List<string>)opDac.getOpNameList(this.IbatisMapper, args);
  915. }
  916. return result;
  917. } catch (Exception e) {
  918. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getOpNameList error: {0}", e.Message));
  919. throw e;
  920. }
  921. }
  922. /// <summary>
  923. /// 파일이름 조회
  924. /// </summary>
  925. /// <param name=" pid">등록번호 1640515</param>
  926. /// <param name=" ordtype">내원구분 I</param>
  927. /// <param name=" orddd">내월일자 20151130</param>
  928. /// <param name=" dschdd">퇴원일자 99991231</param>
  929. /// <param name=" cretno">이력번호 1</param>
  930. /// <param name=" filesize">파일크기 없어도됨</param>
  931. /// <param name=" formcd">서식코드 1300010289</param>
  932. /// <param name=" pageno">페이지번호 6</param>
  933. /// <param name=" ocrtag">OCR코드 2016071989074</param>
  934. /// <param name=" userid">사용자아이디 105042</param>
  935. /// <param name = "dutinstcd" >근무지기관코드</ param >
  936. [WebMethod(Description = "파일이름 조회")]
  937. public string GetFileName(string pid, string ordtype, string orddd, string dschdd, string cretno, string filesize, string formcd, string pageno, string ocrtag, string userid, string orddeptcd, string dutinstcd) {
  938. try {
  939. using (PatientDac dac = new PatientDac()) {
  940. Hashtable param = new Hashtable();
  941. param.Add("instcd", dutinstcd);
  942. param.Add("pid", pid);
  943. param.Add("ordtype", ordtype);
  944. param.Add("orddd", orddd);
  945. param.Add("dschdd", dschdd);
  946. param.Add("cretno", cretno);
  947. param.Add("filesize", filesize);
  948. param.Add("formcd", formcd);
  949. param.Add("pageno", pageno);
  950. param.Add("ocrtag", ocrtag);
  951. param.Add("userid", userid);
  952. param.Add("orddeptcd", orddeptcd);
  953. //return dac.GetFileName(this.IbatisMapper, param);
  954. }
  955. } catch (Exception ex) {
  956. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetFileName error: {0}", ex.Message));
  957. throw ex;
  958. }
  959. return "";
  960. }
  961. /// <summary>
  962. /// setFileName으로 등록된 데이터 삭제하는 로직
  963. /// </summary>
  964. /// <param name="pid">등록번호 1640515</param>
  965. /// <param name="ordtype">내원구분 I</param>
  966. /// <param name="orddd">내월일자 20151130</param>
  967. /// <param name="dschdd">퇴원일자 99991231</param>
  968. /// <param name="cretno">이력번호 1</param>
  969. /// <param name="formcd">서식코드 1300010289</param>
  970. /// <param name="ocrtag">OCR코드 2016071989074</param>
  971. /// <param name="userid">사용자아이디 105042</param>
  972. /// <param name="username">사용자명 홍길동</param>
  973. /// <param name="consentmstrid">동의서 생성 아이디 1573</param>
  974. /// <param name="hostype">병원구분 111</param>
  975. /// <param name="orddeptcd">진료과 코드 </param>
  976. /// <param name="dutinstcd">근무지기관코드</param>
  977. [WebMethod(Description = "setFileName으로 등록된 데이터 삭제하는 함수")]
  978. public void delEformData(string pid, string ordtype, string orddd, string dschdd, string cretno, string formcd, string ocrtag, string userid, string username, string consentmstrid, string hostype, string orddeptcd, string dutinstcd) {
  979. try {
  980. using (PatientDac dac = new PatientDac()) {
  981. Hashtable param = new Hashtable();
  982. param.Add("instcd", dutinstcd);
  983. param.Add("pid", pid);
  984. param.Add("ordtype", ordtype);
  985. param.Add("orddd", orddd);
  986. param.Add("dschdd", dschdd);
  987. param.Add("cretno", cretno);
  988. param.Add("formcd", formcd);
  989. param.Add("ocrtag", ocrtag);
  990. param.Add("userid", userid);
  991. param.Add("username", username);
  992. param.Add("consentmstrid", consentmstrid);
  993. param.Add("hostype", hostype);
  994. param.Add("orddeptcd", orddeptcd);
  995. dac.delEformData(this.IbatisMapper, param);
  996. }
  997. } catch (Exception ex) {
  998. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm delEformData error: {0}", ex.Message));
  999. throw ex;
  1000. }
  1001. }
  1002. /// <summary>
  1003. /// 모바일 Default Tap(외래, 입원..) 설정
  1004. /// </summary>
  1005. /// <param name="userId">사용자 아이디</param>
  1006. /// <param name="status">외래 O 입원 I 응급 E 수술 P </param>
  1007. /// <param name="instCd">근무지기관코드</param>
  1008. [WebMethod(Description = "모바일 Default Tap(외래, 입원..) 설정")]
  1009. public SingleReturnData UpdateUserSetup(string userId, string status, string instCd) {
  1010. SingleReturnData result = new SingleReturnData();
  1011. int rts = 1;
  1012. try {
  1013. using (PatientDac dac = new PatientDac()) {
  1014. Hashtable param = new Hashtable();
  1015. param.Add("userId", userId);
  1016. param.Add("status", status);
  1017. param.Add("instCd", instCd);
  1018. rts = dac.UpdateUserSetup(this.IbatisMapper, param);
  1019. result.responseData = Convert.ToString(rts);
  1020. }
  1021. } catch (Exception ex) {
  1022. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm UpdateUserSetup error: {0}", ex.Message));
  1023. //throw ex;
  1024. }
  1025. return result;
  1026. }
  1027. ///// <summary>
  1028. ///// 모바일 주치의별 미작성 리스트 가져오기
  1029. ///// </summary>
  1030. ///// <param name="userid">사용자 아이디</param>
  1031. ///// <param name="status">동의서 상태(UNFINISHED, TEMP ....)</param>
  1032. ///// <param name="fromdd"></param>
  1033. ///// <param name="todd"></param>
  1034. ///// <param name="dutinstcd">근무지기관코드</param>
  1035. ///// <returns></returns>
  1036. //[WebMethod(Description = "모바일 주치의별 미작성 리스트 가져오기")]
  1037. //public List<UnFinishedListVO> GetUnfinishedListPerDoctor(string userid, string status, string fromdd, string todd, string dutinstcd) {
  1038. // try {
  1039. // using (ConsentDac dac = new ConsentDac()) {
  1040. // Hashtable param = new Hashtable {
  1041. // { "userid", userid },
  1042. // { "status", status },
  1043. // { "fromdd", fromdd },
  1044. // { "todd", todd },
  1045. // { "instcd", dutinstcd }
  1046. // };
  1047. // return (List<UnFinishedListVO>) dac.GetUnfinishedListPerDoctor(this.IbatisMapper, param);
  1048. // }
  1049. // } catch (Exception ex) {
  1050. // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetUnfinishedListPerDoctor error: {0}", ex.Message));
  1051. // throw ex;
  1052. // }
  1053. //}
  1054. /// <summary>
  1055. /// 모바일 사용자 로그인 API
  1056. /// </summary>
  1057. /// <param name="userid"></param>
  1058. /// <param name="password"></param>
  1059. /// <param name="dutinstcd"></param>
  1060. /// <returns></returns>
  1061. [WebMethod(Description = "모바일 사용자 로그인 API")]
  1062. public List<UserLoginDeptList> doLogin(string userid, string pwd, string dutinstcd, String certSucc) {
  1063. MobileLoginResult result;
  1064. try {
  1065. using (UserDac dac = new UserDac()) {
  1066. Hashtable param = new Hashtable();
  1067. int n;
  1068. if (!int.TryParse(userid, out n)) {
  1069. userid = userid.ToUpper();
  1070. }
  1071. param.Add("userid", userid);
  1072. result = dac.doLogin(this.IbatisMapper, param);
  1073. if (result == null) {
  1074. return null;
  1075. }
  1076. if (certSucc == "false") {
  1077. if (result.pwd != pwd) {
  1078. return null;
  1079. }
  1080. }
  1081. string syscd = (dutinstcd == "031") ? "HIS031" : "HIS032";
  1082. Hashtable param2 = new Hashtable();
  1083. param2.Add("userid", result.userid);
  1084. param2.Add("syscd", syscd);
  1085. return (List<UserLoginDeptList>) dac.getUserdeptList(this.IbatisMapper, param2);
  1086. }
  1087. } catch (Exception e) {
  1088. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm doLogin ERROR : {0}", e.ToString()));
  1089. throw e;
  1090. }
  1091. }
  1092. /// <summary>
  1093. /// 사용자 로그인, 로그아웃 로그
  1094. /// </summary>
  1095. /// <param name="userId">사용자 아이디</param>
  1096. /// <param name="loginStatus">로그인 성공(CERT_LOGIN, LOGIN), 실패(CERT_FAIL, FAIL), 로그아웃(LOGOFF) 상태</param>
  1097. /// <param name="deviceType">모바일(MOBILE), PC(PC) 구분</param>
  1098. /// <param name="macAddress">사용자 단말 고유 정보</param>
  1099. /// <returns></returns>
  1100. [WebMethod(Description = "사용자 로그인, 로그아웃 로그")]
  1101. public void userLoginOutLog(string userId, string loginStatus, string deviceType, string macAddress) {
  1102. try {
  1103. using (UserDac dac = new UserDac()) {
  1104. Hashtable param = new Hashtable();
  1105. param.Add("userId", userId);
  1106. param.Add("loginStatus", loginStatus);
  1107. param.Add("deviceType", deviceType);
  1108. param.Add("macAddress", macAddress);
  1109. dac.userLoginOutLog(this.IbatisMapper, param);
  1110. }
  1111. } catch (Exception ex) {
  1112. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm userLoginOutLog ERROR : {0}", ex.ToString()));
  1113. throw ex;
  1114. }
  1115. }
  1116. /// <summary>
  1117. /// 모바일 사용자 정보요청 API
  1118. /// </summary>
  1119. /// <param name="userid"></param>
  1120. /// <param name="dutplceinstcd"></param>
  1121. /// <param name="dutplcecd"></param>
  1122. /// <returns></returns>
  1123. [WebMethod(Description = "모바일 사용자 정보요청 API")]
  1124. public MobileUserInfo GetMobileUserInfo(string userid, string dutplceinstcd, string dutplcecd) {
  1125. MobileUserInfo result = null;
  1126. try {
  1127. using (UserDac dac = new UserDac()) {
  1128. Hashtable param = new Hashtable();
  1129. param.Add("userid", userid);
  1130. param.Add("dutplceinstcd", dutplceinstcd);
  1131. param.Add("dutplcecd", dutplcecd);
  1132. result = dac.getMobileUserInfo(this.IbatisMapper, param);
  1133. }
  1134. return result;
  1135. } catch (Exception e) {
  1136. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetMobileUserInfo ERROR : {0}", e.ToString()));
  1137. throw e;
  1138. }
  1139. }
  1140. [WebMethod(Description = "사용자별 지원부서 설정 저장")]
  1141. public string getUserPrefMonitor(string userId, string instcd) {
  1142. string monitorNo = string.Empty;
  1143. try {
  1144. using(UserDac dac = new UserDac()) {
  1145. Hashtable param = new Hashtable();
  1146. param.Add("userid", userId);
  1147. monitorNo = dac.getUserPrefMonitor(this.IbatisMapper, param);
  1148. }
  1149. } catch (Exception e) {
  1150. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getUserPrefMonitor ERROR : {0}", e.ToString()));
  1151. }
  1152. return monitorNo;
  1153. }
  1154. [WebMethod(Description = "사용자별 지원부서 설정 저장")]
  1155. public SingleReturnData SetSupportUserData(string userId, string baseCd, string supportDeptCd, string supportDeptNm, string macAddress) {
  1156. SingleReturnData result = new SingleReturnData();
  1157. string rts = "";
  1158. try {
  1159. using (UserDac dac = new UserDac()) {
  1160. Hashtable param = new Hashtable();
  1161. param.Add("userId", userId);
  1162. param.Add("supportDeptCd", supportDeptCd);
  1163. param.Add("supportDeptNm", supportDeptNm);
  1164. param.Add("macAddress", macAddress);
  1165. param.Add("baseCd", baseCd);
  1166. rts = dac.SetSupportUserData(this.IbatisMapper, param);
  1167. result.responseData = rts;
  1168. }
  1169. } catch (Exception ex) {
  1170. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SetSupportUserData ERROR : {0}", ex.ToString()));
  1171. }
  1172. return result;
  1173. }
  1174. [WebMethod(Description = "사용자별 활성화 듀얼모니터 설정 저장")]
  1175. public SingleReturnData SetUserPrefMonitor(string userId, string monitorNo) {
  1176. SingleReturnData result = new SingleReturnData();
  1177. try {
  1178. using (UserDac dac = new UserDac()) {
  1179. Hashtable param = new Hashtable();
  1180. param.Add("userId", userId);
  1181. param.Add("monitorNo", monitorNo);
  1182. var resultStr = dac.SetUserPrefMonitor(this.IbatisMapper, param);
  1183. result.responseData = resultStr;
  1184. }
  1185. } catch (Exception e) {
  1186. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SetUserPrefMonitor ERROR : {0}", e.ToString()));
  1187. }
  1188. return result;
  1189. }
  1190. [WebMethod(Description = "로그아웃 세션 타임 반환")]
  1191. public string getSessionTime(string instcd) {
  1192. string sessionTime = "30";
  1193. try {
  1194. using(UserDac dac = new UserDac()) {
  1195. Hashtable param = new Hashtable();
  1196. sessionTime = dac.getSessionTime(this.IbatisMapper, param);
  1197. }
  1198. }catch(Exception e) {
  1199. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getSessionTime ERROR : {0}", e.ToString()));
  1200. }
  1201. return sessionTime;
  1202. }
  1203. /// <summary>
  1204. /// 세션타임을 가져온다
  1205. /// </summary>
  1206. /// <returns></returns>
  1207. [WebMethod(Description = "모바일 세션 시간을 가져옴")]
  1208. public SingleReturnData GetBaseData(String instCd) {
  1209. SingleReturnData result = new SingleReturnData();
  1210. try {
  1211. using (UserDac dac = new UserDac()) {
  1212. Hashtable param = new Hashtable();
  1213. param.Add("instCd", instCd);
  1214. result.responseData = dac.GetBaseData(this.IbatisMapper, param);
  1215. }
  1216. } catch (Exception e) {
  1217. //result.responseData = "30";
  1218. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm checkPrintable ERROR : {0}", e.ToString()));
  1219. }
  1220. return result;
  1221. }
  1222. }
  1223. }