HospitalSvc.asmx.cs 57 KB

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