HospitalSvc.asmx.cs 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424
  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<ConsentVO> GetConsentSetList(string userId, string instCd) {
  609. List<ConsentVO> 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<ConsentVO>) 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. UserSignDataVo signData = null;
  1152. byte[] decodedImage = Convert.FromBase64String(signImage);
  1153. string result = "0";
  1154. try
  1155. {
  1156. using (UserDac dac = new UserDac())
  1157. {
  1158. Hashtable param = new Hashtable();
  1159. //받아온 사용자의 사인데이터를 조회
  1160. param.Add("instCd", instCd);
  1161. param.Add("userId", userId);
  1162. signData = dac.getUserSignDataInfo(mapper, param);
  1163. //사인데이터가 있을 경우
  1164. if (signData != null)
  1165. {
  1166. string today = DateTime.Now.ToString("yyyyMMdd");
  1167. string yesterday = DateTime.Now.AddDays(-1).ToString("yyyyMMdd");
  1168. //해당 사인데이터가 오늘 저장된 것이 아니라면 오늘날짜로 새로 저장하고 이전 데이터의 유효기간을 마감시킨다.
  1169. if (!signData.signImgeFromDd.Equals(today))
  1170. {
  1171. insSignImage(instCd, userId, signData.signImgeSeqNo + 1, decodedImage, inptId, dac, mapper);
  1172. setSignToDd(instCd, userId, signData.signImgeSeqNo, yesterday, "N", inptId, dac, mapper);
  1173. }
  1174. else
  1175. {
  1176. // 사인데이터가 오늘 저장된 것이라면 사인데이터를 업데이트 해준다.
  1177. param = new Hashtable();
  1178. param.Add("instCd", instCd);
  1179. param.Add("userId", userId);
  1180. param.Add("curSeqNo", signData.signImgeSeqNo);
  1181. param.Add("signData", decodedImage);
  1182. param.Add("inptUser", inptId);
  1183. dac.setUserSignData(mapper, param);
  1184. }
  1185. }
  1186. else
  1187. {
  1188. //사인데이터가 없으면 그대로 저장
  1189. insSignImage(instCd,
  1190. userId,
  1191. int.TryParse(signSeq, out int res) ? res : 1,
  1192. decodedImage,
  1193. inptId,
  1194. dac,
  1195. mapper);
  1196. }
  1197. }
  1198. result = "1";
  1199. return result;
  1200. }
  1201. catch (Exception ex)
  1202. {
  1203. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm setSignImage error: {0}", ex.Message));
  1204. throw ex;
  1205. }
  1206. }
  1207. /// <summary>
  1208. /// 서명이미지를 생성한다.
  1209. /// </summary>
  1210. /// <param name="instCd"></param>
  1211. /// <param name="userId"></param>
  1212. /// <param name="nextSeqNo"></param>
  1213. /// <param name="signImage"></param>
  1214. /// <param name="inptId"></param>
  1215. /// <param name="dac"></param>
  1216. /// <param name="mapper"></param>
  1217. private void insSignImage(string instCd, string userId, int nextSeqNo, byte[] signImage, string inptId, UserDac dac, ISqlMapper mapper)
  1218. {
  1219. Hashtable param = new Hashtable();
  1220. param.Add("instCd", instCd);
  1221. param.Add("userId", userId);
  1222. param.Add("nextSeqNo", nextSeqNo);
  1223. param.Add("signData", signImage);
  1224. param.Add("inputUserId", inptId);
  1225. dac.insSignImage(mapper, param);
  1226. }
  1227. /// <summary>
  1228. /// 사용자 사인데이터의 ToDd를 설정한다
  1229. /// </summary>
  1230. /// <param name="instCd"></param>
  1231. /// <param name="userId"></param>
  1232. /// <param name="curSeqNo"></param>
  1233. /// <param name="toDd"></param>
  1234. /// <param name="repryn"></param>
  1235. /// <param name="inptUser"></param>
  1236. /// <param name="dac"></param>
  1237. /// <param name="mapper"></param>
  1238. private void setSignToDd(string instCd, string userId, int curSeqNo, string toDd, string repryn, string inptUser, UserDac dac, ISqlMapper mapper)
  1239. {
  1240. Hashtable param = new Hashtable();
  1241. param.Add("instCd", instCd);
  1242. param.Add("userId", userId);
  1243. param.Add("curSeqNo", curSeqNo);
  1244. param.Add("yesterDay", toDd);
  1245. param.Add("repryn", repryn);
  1246. param.Add("inptUser", inptUser);
  1247. dac.setUserSignToDd(mapper, param);
  1248. }
  1249. /// <summary>
  1250. /// 사용자에 대한 서명정보 조회
  1251. /// </summary>
  1252. /// <param name="instCd"></param>
  1253. /// <param name="userId"></param>
  1254. /// <returns></returns>
  1255. [WebMethod(Description = "서명 이미지 조회")]
  1256. public UserSignDataVo getUserSignDataInfo(string instCd, string userId)
  1257. {
  1258. UserSignDataVo result = null;
  1259. UserDac dac = new UserDac();
  1260. Hashtable param = new Hashtable();
  1261. param.Add("instCd", instCd);
  1262. param.Add("userId", userId);
  1263. result = dac.getUserSignDataInfo(IbatisMapper, param);
  1264. return result;
  1265. }
  1266. #endregion
  1267. }
  1268. }