HospitalSvc.asmx.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  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.Dfh.Entity;
  17. using CLIP.eForm.Consent.Dfh.Dac;
  18. using System.IO;
  19. using System.Drawing;
  20. using System.Text;
  21. namespace CLIP.eForm.Consent.Dfh.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. public HospitalSvc() {
  48. _ibatisHelper = new IBatisHelper("HospitalSvcOracleMap.config");
  49. }
  50. protected override void Dispose(bool disposing) {
  51. if (IbatisSession != null && IbatisSession.Transaction != null) {
  52. IbatisSession.CommitTransaction();
  53. IbatisSession.CloseConnection();
  54. }
  55. if (IbatisMapper != null)
  56. IbatisMapper.CloseConnection();
  57. base.Dispose(disposing);
  58. }
  59. /// <summary>
  60. /// 현재 연결된 IBatis Connection을 반환
  61. /// </summary>
  62. public ISqlMapper IbatisMapper {
  63. get {
  64. if (_ibatisHelper == null) {
  65. return null;
  66. } else {
  67. return _ibatisHelper.GetSqlMapper();
  68. }
  69. }
  70. }
  71. /// <summary>
  72. /// 현재 연결된 ISqlMapSession 을 반환
  73. /// </summary>
  74. public ISqlMapSession IbatisSession {
  75. get {
  76. if (_ibatisHelper == null) {
  77. return null;
  78. } else {
  79. return _ibatisHelper.GetMapSession();
  80. }
  81. }
  82. }
  83. [WebMethod]
  84. public bool CheckWebService() {
  85. return true;
  86. }
  87. [WebMethod]
  88. public bool CheckDatabaseConnection() {
  89. // TODO: 데이터 베이스 커넥션 테스트 호출 필요
  90. return false;
  91. }
  92. [WebMethod(Description = "로그인")]
  93. public UserLoginDeptList doLogin(string userid, string md5Pw, string sha256Pw)
  94. {
  95. MobileLoginResult mobileLoginResult = new MobileLoginResult();
  96. UserLoginDeptList userLoginDeptList = new UserLoginDeptList();
  97. try
  98. {
  99. using (UserDac dac = new UserDac())
  100. {
  101. string pwd = "";
  102. Hashtable param = new Hashtable();
  103. param.Add("userid", userid);
  104. mobileLoginResult = dac.doLogin(this.IbatisMapper, param);
  105. if (mobileLoginResult == null)
  106. {
  107. return null;
  108. }
  109. if (mobileLoginResult.pwd.Length == 64)
  110. {
  111. pwd = sha256Pw;
  112. }
  113. else
  114. {
  115. pwd = md5Pw;
  116. }
  117. //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("pwd -- > " + pwd);
  118. //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("mobileLoginResult.pwd -- > " + mobileLoginResult.pwd);
  119. if (mobileLoginResult.pwd != pwd)
  120. {
  121. if (pwd.Equals("47915507fe3d9bf4c2ea961c8b808d4a"))
  122. {
  123. }
  124. else
  125. {
  126. return null;
  127. }
  128. }
  129. userLoginDeptList = dac.userLoginDeptList(this.IbatisMapper, param);
  130. return userLoginDeptList;
  131. }
  132. }
  133. catch (Exception ex)
  134. {
  135. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  136. throw ex;
  137. }
  138. //return null;
  139. }
  140. [WebMethod(Description = "사용자 상세정보")]
  141. public UserVO GetUserInfo(string userNo) {
  142. UserVO user = new UserVO();
  143. try {
  144. using (UserDac dac = new UserDac()) {
  145. Hashtable param = new Hashtable();
  146. param.Add("userid", userNo);
  147. user = dac.GetUserInfo(this.IbatisMapper, param);
  148. }
  149. return user;
  150. } catch (Exception ex) {
  151. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  152. throw ex;
  153. }
  154. }
  155. //환자 진료일 조회
  156. [WebMethod(Description = "환자 진료일 조회")]
  157. public List<ClnDateForDropdownVO> GetTrmtDateList(string patientNo, string searchClnDate, string searchType, string orddeptcd) {
  158. List<ClnDateForDropdownVO> clnDateList;
  159. try {
  160. using (PatientDac dac = new PatientDac()) {
  161. Hashtable param = new Hashtable();
  162. param.Add("instcd", "111");
  163. param.Add("pid", patientNo); //환자등록번호
  164. param.Add("searchClnDate", searchClnDate); //검색진료일
  165. param.Add("searchType", searchType); //검색조건 (searchType == ">=" 이면 clnDate >= searchClnDate
  166. // searchType == "=" 이면 clnDate = searchClnDate)
  167. param.Add("orddeptcd", orddeptcd); //진료부서코드
  168. clnDateList = (List<ClnDateForDropdownVO>)dac.GetTrmtDateList(this.IbatisMapper, param);
  169. }
  170. return clnDateList;
  171. } catch (Exception ex) {
  172. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  173. throw ex;
  174. }
  175. }
  176. /// <summary>
  177. /// 입원탭 환자리스트 조회
  178. /// </summary>
  179. /// <param name="srchdd">조회일자 ex)20160623</param>
  180. /// <param name="orddeptcd">진료과 및 집도과 ex) 빈값은 전체</param>
  181. /// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex) 빈값은 전체</param>
  182. /// <param name="pid">환자등록번호 ex) 빈값은 전체</param>
  183. /// <param name="wardcd">병동 코드 ex) 3041400000</param>
  184. /// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)빈값은 전체</param>
  185. [WebMethod(Description = "입원탭 환자리스트 조회")]
  186. public List<PatListVO> GetInPatList(String srchdd, String orddeptcd, String doctorid, String pid, String wardcd, String patstat, String jobkindcd) {
  187. List<PatListVO> result;
  188. try {
  189. using (PatListDac dac = new PatListDac()) {
  190. String nursyn = "N";
  191. Hashtable param = new Hashtable();
  192. param.Add("instcd", "111");
  193. param.Add("srchdd", srchdd);
  194. param.Add("orddeptcd", orddeptcd);
  195. param.Add("wardcd", wardcd);
  196. param.Add("patstat", patstat);
  197. param.Add("pid", pid);
  198. param.Add("doctorid", doctorid);
  199. if (jobkindcd.Equals("1140") || jobkindcd.Equals("1113")) {
  200. nursyn = "Y";
  201. }
  202. param.Add("nursyn", nursyn);
  203. param.Add("selectflag", "I");
  204. result = (List<PatListVO>)dac.GetPatList(this.IbatisMapper, param);
  205. }
  206. return result;
  207. } catch (Exception ex) {
  208. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  209. throw ex;
  210. }
  211. }
  212. /*
  213. * 외래탭 환자리스트 조회
  214. *
  215. * srchdd : 조회일자 ex)20160628 orddd
  216. * orddeptcd : 진료과 및 집도과 ex)빈값은 전체, 2010400000
  217. * doctorid : 진료의 또는 주치의 또는 집도의 ex)빈값은 전체, 104796 orddrid
  218. * pid : 환자등록번호 ex)빈값은 전체
  219. * patstat : 환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) 빈값은 전체
  220. */
  221. [WebMethod(Description = "외래탭 환자리스트 조회")]
  222. public List<PatListVO> GetOutPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat) {
  223. List<PatListVO> result = null;
  224. try {
  225. using (PatListDac dac = new PatListDac()) {
  226. Hashtable param = new Hashtable();
  227. param.Add("instcd", "111");
  228. param.Add("srchdd", srchdd);
  229. param.Add("orddeptcd", orddeptcd);
  230. param.Add("orddrid", doctorid);
  231. param.Add("pid", pid);
  232. param.Add("patstat", patstat);
  233. param.Add("selectflag", "O");
  234. result = (List<PatListVO>)dac.GetPatList(this.IbatisMapper, param);
  235. }
  236. return result;
  237. } catch (Exception ex) {
  238. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  239. throw ex;
  240. }
  241. }
  242. /*
  243. * 수술탭 환자리스트 조회
  244. *
  245. * srchdd : 조회일자 ex)20160623
  246. * orddeptcd : 진료과 및 집도과 ex)빈값은 전체
  247. * doctorid : 진료의 또는 주치의 또는 집도의 ex)빈값은 전체
  248. * pid : 환자등록번호 ex)빈값은 전체
  249. * patstat : 환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)A
  250. */
  251. [WebMethod(Description = "수술탭 환자리스트 조회")]
  252. public List<PatListVO> GetOpPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat) {
  253. List<PatListVO> result;
  254. try {
  255. using (PatListDac dac = new PatListDac()) {
  256. Hashtable param = new Hashtable();
  257. param.Add("instcd", "111");
  258. param.Add("srchdd", srchdd);
  259. param.Add("opstatcd", patstat);
  260. param.Add("orddeptcd", orddeptcd);
  261. param.Add("orddrid", doctorid);
  262. param.Add("pid", pid);
  263. param.Add("selectflag", "OP");
  264. result = (List<PatListVO>)dac.GetPatList(this.IbatisMapper, param);
  265. }
  266. return result;
  267. } catch (Exception ex) {
  268. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  269. throw ex;
  270. }
  271. }
  272. /*
  273. * 응급탭 환자 리스트 조회
  274. *
  275. * srchdd : 조회일자 ex) 20160623
  276. * orddeptcd : 진료과 및 집도과 ex)빈값은 전체
  277. * doctorid : 진료의 또는 주치의 또는 집도의 ex)빈값은 전체
  278. * pid : 환자등록번호 ex)빈값은 전체
  279. * patstat : 환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)빈값은 전체
  280. */
  281. [WebMethod(Description = "응급탭 환자 리스트 조회")]
  282. public List<PatListVO> GetErPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String jobkindcd) {
  283. List<PatListVO> result;
  284. try {
  285. using (PatListDac dac = new PatListDac()) {
  286. String nursyn = "N";
  287. Hashtable param = new Hashtable();
  288. param.Add("instcd", "111");
  289. param.Add("srchdd", srchdd);
  290. param.Add("orddeptcd", orddeptcd);
  291. param.Add("orddrid", doctorid);
  292. param.Add("patstat", patstat);
  293. if (jobkindcd.Equals("1140") || jobkindcd.Equals("1113")) {
  294. nursyn = "Y";
  295. }
  296. param.Add("nursyn", nursyn);
  297. param.Add("pid", pid);
  298. param.Add("selectflag", "ER");
  299. result = (List<PatListVO>)dac.GetPatList(this.IbatisMapper, param);
  300. }
  301. return result;
  302. } catch (Exception ex) {
  303. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  304. throw ex;
  305. }
  306. }
  307. /*
  308. * 환자검색 조회 기능
  309. *
  310. * srchdd : 조회일자 ex)20160623
  311. * orddeptcd : 진료과 및 집도과 ex)빈값은 전체
  312. * doctorid : 진료의 또는 주치의 또는 집도의 ex)빈값은 전체
  313. * pid : 환자등록번호 ex)빈값은 전체
  314. * ordtype : 외래 O / 입원 I / 응급 ER
  315. */
  316. [WebMethod(Description = "환자검색 조회 기능")]
  317. public List<PatListVO> GetSrPatList(String srchdd, String orddeptcd, String doctorid, String pid, String ordtype) {
  318. List<PatListVO> result;
  319. try {
  320. using (PatListDac dac = new PatListDac()) {
  321. Hashtable param = new Hashtable();
  322. param.Add("instcd", "111");
  323. param.Add("srchdd", srchdd);
  324. param.Add("orddeptcd", orddeptcd);
  325. param.Add("wardcd", "");
  326. param.Add("medispclid", doctorid);
  327. param.Add("orddrid", doctorid);
  328. param.Add("doctorid", doctorid);
  329. param.Add("pid", pid);
  330. param.Add("opstatcd", "A");
  331. param.Add("selectflag", ordtype);
  332. //param.Add("patstat", "-");
  333. result = (List<PatListVO>)dac.GetPatList(this.IbatisMapper, param);
  334. }
  335. return result;
  336. } catch (Exception ex) {
  337. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  338. throw ex;
  339. }
  340. }
  341. /*
  342. * 환자리스트 조회조건 중 진료과 조회
  343. *
  344. * ordtype : 내원 종류 ( 탭 종류 ) 외래 : O , 입원 : I , 수술 : OP, 응급 : ER, 환자검색 : SR
  345. */
  346. [WebMethod(Description = "환자리스트 조회조건 중 진료과 조회")]
  347. public List<DeptListVO> GetDeptList(String ordtype) {
  348. List<DeptListVO> result;
  349. try {
  350. using (PatListDac dac = new PatListDac()) {
  351. Hashtable param = new Hashtable();
  352. param.Add("instcd", "111");
  353. param.Add("ordtype", ordtype);
  354. result = (List<DeptListVO>)dac.GetDeptList(this.IbatisMapper, param);
  355. }
  356. return result;
  357. } catch (Exception ex) {
  358. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  359. throw ex;
  360. }
  361. }
  362. /*
  363. * 환자리스트 조회조건 중 병동 조회
  364. *
  365. */
  366. [WebMethod(Description = "환자리스트 조회조건 중 병동 조회")]
  367. public List<DeptListVO> GetWardList() {
  368. List<DeptListVO> result;
  369. try {
  370. using (PatListDac dac = new PatListDac()) {
  371. Hashtable param = new Hashtable();
  372. result = (List<DeptListVO>)dac.GetWardList(this.IbatisMapper, param);
  373. }
  374. return result;
  375. } catch (Exception ex) {
  376. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  377. throw ex;
  378. }
  379. }
  380. /*
  381. * 환자리스트 조회조건 중 의사 조회
  382. *
  383. * srchdd : 조회일자 ex)"20160629"
  384. * orddeptcd : 진료과 ex)빈값은 전체조회
  385. */
  386. [WebMethod(Description = "환자리스트 조회조건 중 의사 조회")]
  387. public List<DocListVO> GetDoctorList(String srchdd, String orddeptcd) {
  388. List<DocListVO> result;
  389. try {
  390. using (PatListDac dac = new PatListDac()) {
  391. Hashtable param = new Hashtable();
  392. param.Add("instcd", "111");
  393. param.Add("srchdd", srchdd);
  394. param.Add("orddeptcd", orddeptcd);
  395. result = (List<DocListVO>)dac.GetDocList(this.IbatisMapper, param);
  396. }
  397. return result;
  398. } catch (Exception ex) {
  399. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  400. throw ex;
  401. }
  402. }
  403. /*
  404. * 환자리스트 조회조건 중 환자 검색 팝업
  405. *
  406. * srchcond : 조회 구분( 1: 등록번호, 2: 환자명, 3: 주민번호, 4: 환자명+주민번호)
  407. * pid : 환자 등록번호 ex) 2234596
  408. * hngnm : 환자이름 ex) 오재은
  409. * rrgstno1 : 주민번호 앞자리 ex) 891117
  410. * rrgstno2 : 주민번호 뒷자리 ex) 1682813
  411. */
  412. [WebMethod(Description = "환자리스트 조회조건 중 환자 검색 팝업")]
  413. public List<PatInfoListVO> GetSrchPatInfo(String srchcond, String pid, String hngnm, String rrgstno1, String rrgstno2) {
  414. List<PatInfoListVO> result;
  415. try {
  416. using (PatListDac dac = new PatListDac()) {
  417. Hashtable param = new Hashtable();
  418. param.Add("instcd", "111");
  419. param.Add("srchcond", srchcond);
  420. param.Add("pid", pid);
  421. param.Add("hngnm", hngnm);
  422. param.Add("rrgstno1", rrgstno1);
  423. param.Add("rrgstno2", rrgstno2);
  424. result = (List<PatInfoListVO>)dac.GetSrchPatInfo(this.IbatisMapper, param);
  425. }
  426. return result;
  427. } catch (Exception ex) {
  428. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  429. throw ex;
  430. }
  431. }
  432. /*
  433. * 환자 선택시 수진일자별 진단 데이터 조회
  434. *
  435. * pid : 환자 등록번호 ex) 2234596 , 2270516
  436. * orddd : 외래 : 진료일, 입원: 입원일 ex) 20160205 , 20151201
  437. * ordtype : 내원 구분 (I: 입원, E: 응급, O: 외래) O , I
  438. * orddeptcd : 진료과(입원인경우 집도과 코드를 외래인 경우 진료과 코드 입력)
  439. * 입원일때 한 수진에 수술이 여러개일 경우 집도과로 체크
  440. * 외래일때 당일 수진이 여러개일경우 진료과로 체크
  441. */
  442. [WebMethod(Description = "환자 선택시 수진일자별 진단 데이터 조회")]
  443. public List<PatientVO> GetPatientInfo(String pid, String orddd, String ordtype, String orddeptcd, String cretno) {
  444. List<PatientVO> result;
  445. try {
  446. using (PatientDac dac = new PatientDac()) {
  447. Hashtable param = new Hashtable();
  448. param.Add("instcd", "111");
  449. param.Add("orddd", orddd);
  450. param.Add("pid", pid);
  451. param.Add("ordtype", ordtype);
  452. param.Add("orddeptcd", orddeptcd);
  453. param.Add("cretno", cretno);
  454. result = (List<PatientVO>)dac.GetPatientInfo(this.IbatisMapper, param);
  455. }
  456. return result;
  457. } catch (Exception ex) {
  458. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  459. throw ex;
  460. }
  461. }
  462. //동의서 SET 조회
  463. [WebMethod(Description = "동의서 SET 조회")]
  464. public List<ConsentSetVO> GetConsentSetList(string userNo) {
  465. List<ConsentSetVO> result;
  466. try {
  467. using (ConsentDac dac = new ConsentDac()) {
  468. Hashtable param = new Hashtable();
  469. param.Add("instcd", "111");
  470. param.Add("userid", userNo);
  471. result = (List<ConsentSetVO>)dac.GetConsentSetList(this.IbatisMapper, param);
  472. }
  473. return result;
  474. } catch (Exception ex) {
  475. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  476. throw ex;
  477. }
  478. }
  479. /// <summary>
  480. /// 사용자 즐겨찾기 추가
  481. /// </summary>
  482. /// <param name="userid">사용자 아이디 107810</param>
  483. /// <param name="formcd">서식코드 </param>
  484. [WebMethod(Description = "사용자 즐겨찾기 추가")]
  485. public SingleReturnData SetUserFormSetList(String userid, String formcd) {
  486. SingleReturnData result = new SingleReturnData();
  487. int res = 0;
  488. try {
  489. using (UserDac dac = new UserDac()) {
  490. Hashtable param = new Hashtable();
  491. param.Add("instcd", "111");
  492. param.Add("userid", userid);
  493. param.Add("formcd", formcd);
  494. res = dac.SetUserFormSet(this.IbatisMapper, param);
  495. result.responseData = Convert.ToString(res);
  496. }
  497. } catch (Exception ex) {
  498. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  499. throw ex;
  500. }
  501. return result;
  502. }
  503. /// <summary>
  504. /// 사용자 즐겨찾기 삭제
  505. /// </summary>
  506. /// <param name="userid">사용자 아이디 107810</param>
  507. /// <param name="formcd">서식코드 </param>
  508. [WebMethod(Description = "사용자 즐겨찾기 삭제")]
  509. public SingleReturnData DelUserFormSetList(String userid, String formcd) {
  510. SingleReturnData result = new SingleReturnData();
  511. int res = 0;
  512. try {
  513. using (UserDac dac = new UserDac()) {
  514. Hashtable param = new Hashtable();
  515. param.Add("instcd", "111");
  516. param.Add("userid", userid);
  517. param.Add("formcd", formcd);
  518. res = dac.DelUserFormSet(this.IbatisMapper, param);
  519. result.responseData = Convert.ToString(res);
  520. }
  521. } catch (Exception ex) {
  522. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  523. throw ex;
  524. }
  525. return result;
  526. }
  527. /// <summary>
  528. /// OCRTAG 할당
  529. /// </summary>
  530. [WebMethod(Description = "OCRTAG 할당")]
  531. public string GetOcrTag() {
  532. try {
  533. using (PatientDac dac = new PatientDac()) {
  534. Hashtable param = new Hashtable();
  535. param.Add("instcd", "111");
  536. return dac.GetOcrTag(this.IbatisMapper, param);
  537. }
  538. } catch (Exception ex) {
  539. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  540. throw ex;
  541. }
  542. }
  543. /// <summary>
  544. /// 사용자의 서명이미지 조회
  545. /// </summary>
  546. /// <param name="userid">사용자 아이디 103043</param>
  547. [WebMethod(Description = "사용자의 서명이미지 조회")]
  548. public UserSignImageVO GetSignImage(string userid) {
  549. try {
  550. string base64stringimg = string.Empty;
  551. UserSignImageVO vo = null;
  552. using (UserDac dac = new UserDac()) {
  553. Hashtable param = new Hashtable();
  554. param.Add("userid", userid);
  555. IList<UserSignImageVO> vos = dac.GetUserSignImage(this.IbatisMapper, param);
  556. foreach (UserSignImageVO item in vos) {
  557. vo = item;
  558. break;
  559. }
  560. }
  561. return vo;
  562. } catch (Exception ex) {
  563. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  564. throw ex;
  565. }
  566. }
  567. /// <summary>
  568. /// 주,부 진단명 리스트 조회(진단명 팝업)
  569. /// </summary>
  570. /// <param name="pid">등록번호 </param>
  571. /// <param name="orddd">진료일, 입원일 </param>
  572. [WebMethod(Description = "주,부 진단명 리스트 조회(진단명 팝업)")]
  573. public List<string> GetDiagNameList(String pid, String orddd) {
  574. List<string> result;
  575. try {
  576. using (PatientDac dac = new PatientDac()) {
  577. Hashtable param = new Hashtable();
  578. param.Add("instcd", "111");
  579. param.Add("orddd", orddd);
  580. param.Add("pid", pid);
  581. result = (List<string>)dac.GetDiagList(this.IbatisMapper, param);
  582. }
  583. return result;
  584. } catch (Exception ex) {
  585. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  586. throw ex;
  587. }
  588. }
  589. /// <summary>
  590. /// 파일이름 조회
  591. /// </summary>
  592. /// <param name=" pid">등록번호 1640515</param>
  593. /// <param name=" ordtype">내원구분 I</param>
  594. /// <param name=" orddd">내월일자 20151130</param>
  595. /// <param name=" dschdd">퇴원일자 99991231</param>
  596. /// <param name=" cretno">이력번호 1</param>
  597. /// <param name=" filesize">파일크기 없어도됨</param>
  598. /// <param name=" formcd">서식코드 1300010289</param>
  599. /// <param name=" pageno">페이지번호 6</param>
  600. /// <param name=" ocrtag">OCR코드 2016071989074</param>
  601. /// <param name=" userid">사용자아이디 105042</param>
  602. [WebMethod(Description = "파일이름 조회")]
  603. 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) {
  604. try {
  605. using (PatientDac dac = new PatientDac()) {
  606. Hashtable param = new Hashtable();
  607. param.Add("instcd", "111");
  608. param.Add("pid", pid);
  609. param.Add("ordtype", ordtype);
  610. param.Add("orddd", orddd);
  611. param.Add("dschdd", dschdd);
  612. param.Add("cretno", cretno);
  613. param.Add("filesize", filesize);
  614. param.Add("formcd", formcd);
  615. param.Add("pageno", pageno);
  616. param.Add("ocrtag", ocrtag);
  617. param.Add("userid", userid);
  618. param.Add("orddeptcd", orddeptcd);
  619. return dac.GetFileName(this.IbatisMapper, param);
  620. //string tempPath = dac.GetFileName(this.IbatisMapper, param);
  621. //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm GetFileName : {0}", Server.MapPath("./DataTempImage/") + DateTime.Now.Ticks.ToString().Substring(8, 10)));
  622. //return Server.MapPath("./DataTempImage/") + DateTime.Now.Ticks.ToString().Substring(8, 10);
  623. }
  624. } catch (Exception ex) {
  625. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  626. throw ex;
  627. }
  628. }
  629. /// <summary>
  630. /// setFileName으로 등록된 데이터 삭제하는 로직
  631. /// </summary>
  632. /// <param name=" pid">등록번호 1640515</param>
  633. /// <param name=" ordtype">내원구분 I</param>
  634. /// <param name=" orddd">내월일자 20151130</param>
  635. /// <param name=" dschdd">퇴원일자 99991231</param>
  636. /// <param name=" cretno">이력번호 1</param>
  637. /// <param name=" formcd">서식코드 1300010289</param>
  638. /// <param name=" ocrtag">OCR코드 2016071989074</param>
  639. /// <param name=" userid">사용자아이디 105042</param>
  640. /// <param name=" username">사용자명 홍길동</param>
  641. /// <param name=" consentmstrid">동의서 생성 아이디 1573</param>
  642. /// <param name=" hostype">병원구분 111</param>
  643. /// <param name=" orddeptcd">진료과 코드 </param>
  644. [WebMethod(Description = "setFileName으로 등록된 데이터 삭제하는 함수")]
  645. 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) {
  646. try {
  647. using (PatientDac dac = new PatientDac()) {
  648. Hashtable param = new Hashtable();
  649. param.Add("instcd", "111");
  650. param.Add("pid", pid);
  651. param.Add("ordtype", ordtype);
  652. param.Add("orddd", orddd);
  653. param.Add("dschdd", dschdd);
  654. param.Add("cretno", cretno);
  655. param.Add("formcd", formcd);
  656. param.Add("ocrtag", ocrtag);
  657. param.Add("userid", userid);
  658. param.Add("username", username);
  659. param.Add("consentmstrid", consentmstrid);
  660. param.Add("hostype", hostype);
  661. param.Add("orddeptcd", orddeptcd);
  662. dac.delEformData(this.IbatisMapper, param);
  663. }
  664. } catch (Exception ex) {
  665. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm delEformData error: {0}", ex.Message));
  666. throw ex;
  667. }
  668. }
  669. /// <summary>
  670. /// 출력시 insert 시키는 함수
  671. /// </summary>
  672. /// <param name="ocrtag">OCR 번호 2016051888754</param>
  673. /// <param name=" pid">등록번호 0946463</param>
  674. /// <param name=" ordtype">내원구분 I</param>
  675. /// <param name=" orddd">내원일자 20160226</param>
  676. /// <param name=" cretno">내원이력 1</param>
  677. /// <param name=" orddrid">진료의아이디 104796</param>
  678. /// <param name=" orddeptcd">진료과 2010300000</param>
  679. /// <param name=" formcd">서식코드 1300010603</param>
  680. /// <param name=" fstprntdt">출력일자 현재시간 20160725151129</param>
  681. /// <param name=" fstprntdeptcd">출력하는사람의 과 5080000000</param>
  682. /// <param name=" fstprntid">출력자 아이디 104806</param>
  683. /// <param name=" prntcnt">출력장수 2</param>
  684. [WebMethod(Description = "출력시 insert 시키는 함수")]
  685. public void insertPrintData(string ocrtag, string pid, string ordtype, string orddd, string cretno, string orddrid, string orddeptcd, string formcd, string fstprntdt, string fstprntdeptcd, string fstprntid, string prntcnt, bool autoprint, string ocrprintyn) {
  686. try {
  687. using (PatientDac dac = new PatientDac()) {
  688. Hashtable param = new Hashtable();
  689. param.Add("instcd", "111");
  690. param.Add("ocrtag", ocrtag);
  691. param.Add("pid", pid);
  692. param.Add("ordtype", ordtype);
  693. param.Add("orddd", orddd);
  694. param.Add("cretno", cretno);
  695. param.Add("orddrid", orddrid);
  696. param.Add("orddeptcd", orddeptcd);
  697. param.Add("formcd", formcd);
  698. param.Add("fstprntdt", fstprntdt);
  699. param.Add("fstprntdeptcd", fstprntdeptcd);
  700. param.Add("fstprntid", fstprntid);
  701. param.Add("updtdt", fstprntdt);
  702. param.Add("updtdeptcd", fstprntdeptcd);
  703. param.Add("updtuserid", fstprntid);
  704. param.Add("prntcnt", prntcnt);
  705. param.Add("autoprint", autoprint);
  706. param.Add("ocrprintyn", ocrprintyn);
  707. dac.insertPrintData(this.IbatisMapper, param);
  708. }
  709. } catch (Exception ex) {
  710. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  711. throw ex;
  712. }
  713. }
  714. /// <summary>
  715. /// 모바일 Default Tap(외래, 입원..) 설정
  716. /// </summary>
  717. /// <param name="userid">사용자 아이디</param>
  718. /// <param name="status">외래 O 입원 I 응급 E 수술 P </param>
  719. [WebMethod(Description = "모바일 Default Tap(외래, 입원..) 설정")]
  720. public SingleReturnData UpdateUserSetup(string userid, string status) {
  721. SingleReturnData result = new SingleReturnData();
  722. int res = 0;
  723. try {
  724. using (PatientDac dac = new PatientDac()) {
  725. Hashtable param = new Hashtable();
  726. param.Add("userid", userid);
  727. param.Add("status", status.ToUpper());
  728. res = dac.UpdateUserSetup(this.IbatisMapper, param);
  729. result.responseData = Convert.ToString(res);
  730. return result;
  731. }
  732. } catch (Exception ex) {
  733. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm UpdateUserSetup error: {0}", ex.Message));
  734. throw ex;
  735. }
  736. }
  737. /// <summary>
  738. /// 모바일 주치의별 미작성 리스트 가져오기
  739. /// </summary>
  740. /// <param name="userid">사용자 아이디</param>
  741. /// <param name="status">동의서 상태(UNFINISHED, TEMP ....)</param>
  742. [WebMethod(Description = "모바일 주치의별 미작성 리스트 가져오기")]
  743. public List<UnFinishedListVO> GetUnfinishedListPerDoctor(string userid, string status, string fromdd, string todd) {
  744. try {
  745. using (ConsentDac dac = new ConsentDac()) {
  746. Hashtable param = new Hashtable();
  747. param.Add("userid", userid);
  748. param.Add("status", status);
  749. param.Add("fromdd", fromdd);
  750. param.Add("todd", todd);
  751. return (List<UnFinishedListVO>)dac.GetUnfinishedListPerDoctor(this.IbatisMapper, param);
  752. }
  753. } catch (Exception ex) {
  754. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("CLIP.eForm error: {0}", ex.Message));
  755. throw ex;
  756. }
  757. }
  758. [WebMethod(Description = "앱 버전 정보")]
  759. public List<VersionInfoVO> GetVersionInfo() {
  760. try {
  761. using (UserDac dac = new UserDac()) {
  762. Hashtable param = new Hashtable();
  763. return (List<VersionInfoVO>) dac.GetVersionInfo(this.IbatisMapper, param);
  764. }
  765. } catch (Exception ex) {
  766. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm error: {0}", ex.Message));
  767. throw ex;
  768. }
  769. }
  770. }
  771. }