HospitalSvc.asmx.cs 56 KB

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