123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551 |
- #region Copyright © 2015 CLIPSOFT Co.,Ltd. All Rights Reserved.
- //
- // All rights are reserved. Reproduction or transmission in whole or in part,
- // in any form or by any means, electronic, mechanical or otherwise, is
- // prohibited without the prior written consent of the copyright owner.
- //
- // Filename: ConsentSvc.asmx.cs
- //
- #endregion
- using System;
- using System.Collections.Generic;
- using System.Web.Services;
- using System.Collections;
- using IBatisNet.DataMapper;
- using CLIP.eForm.Server.Data;
- using CLIP.eForm.Consent.Entity;
- using CLIP.eForm.Consent.Dac;
- using System.IO;
- using System.Drawing;
- using System.Text;
- using System.Linq;
- namespace CLIP.eForm.Consent.WebService {
- /// <summary>
- /// Class description
- /// </summary>
- /// <remarks>
- /// <p>[설계자]</p>
- /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
- /// <p>[원본 작성자]</p>
- /// <p> 클립소프트 기술부 이인희</p>
- /// <p>[수정 작성자]</p>
- /// <p> 파티마병원 정보지원과 오재은</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// <p>[HISTORY]</p>
- /// <p> 2016-06-15 : 최초작성</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// </remarks>
- /// <summary>
- /// HospitalSvc 요약 설명입니다.
- /// </summary>
- [WebService(Namespace = "http://tempuri.org/")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- [System.ComponentModel.ToolboxItem(false)]
- // ASP.NET AJAX를 사용하여 스크립트에서 이 웹 서비스를 호출하려면 다음 줄의 주석 처리를 제거합니다.
- // [System.Web.Script.Services.ScriptService]
- public class HospitalSvc : System.Web.Services.WebService {
- private IBatisHelper _ibatisHelper;
- //private IBatisHelper cendbHelper;
- public HospitalSvc() {
- _ibatisHelper = new IBatisHelper("HospitalSvcOracleMap.config");
- //cendbHelper = new IBatisHelper("CenDBOracleMap.config");
- }
- protected override void Dispose(bool disposing) {
- if (IbatisSession != null && IbatisSession.Transaction != null) {
- IbatisSession.CommitTransaction();
- IbatisSession.CloseConnection();
- }
- if (IbatisMapper != null)
- IbatisMapper.CloseConnection();
- //if (cendbSession != null && cendbSession.Transaction != null) {
- // cendbSession.CommitTransaction();
- // cendbSession.CloseConnection();
- //}
- //if (cendbMapper != null) {
- // cendbMapper.CloseConnection();
- //}
- base.Dispose(disposing);
- }
- /// <summary>
- /// 현재 연결된 IBatis Connection을 반환
- /// </summary>
- public ISqlMapper IbatisMapper {
- get {
- if (_ibatisHelper == null) {
- return null;
- } else {
- return _ibatisHelper.GetSqlMapper();
- }
- }
- }
- //public ISqlMapper cendbMapper {
- // get {
- // if (cendbHelper == null) {
- // return null;
- // } else {
- // return cendbHelper.GetSqlMapper();
- // }
- // }
- //}
- /// <summary>
- /// 현재 연결된 ISqlMapSession 을 반환
- /// </summary>
- public ISqlMapSession IbatisSession {
- get {
- if (_ibatisHelper == null) {
- return null;
- } else {
- return _ibatisHelper.GetMapSession();
- }
- }
- }
- //public ISqlMapSession cendbSession {
- // get {
- // if (cendbHelper == null) {
- // return null;
- // } else {
- // return cendbHelper.GetMapSession();
- // }
- // }
- //}
- [WebMethod]
- public bool CheckWebService() {
- return true;
- }
- //[WebMethod]
- //public string checkCendbService() {
- // int hashCode = 0;
- // if (cendbHelper != null) {
- // hashCode = cendbHelper.GetHashCode();
- // }
- // return String.Format("result is: {0}", hashCode);
- //}
- [WebMethod]
- public bool CheckDatabaseConnection() {
- // TODO: 데이터 베이스 커넥션 테스트 호출 필요
- if (IbatisMapper != null) {
- return true;
- }
- return false;
- }
- /// <summary>
- /// 동의서 기본 세팅 정보
- /// </summary>
- /// <returns></returns>
- [WebMethod(Description = "동의서 기본 세팅 정보")]
- public List<SettingListVO> GetSettingData() {
- List<SettingListVO> result = null;
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- //return (List<SettingListVO>) dac.GetSettingData(IbatisMapper, param);
- result = (List<SettingListVO>) dac.GetSettingData(IbatisMapper, param);
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSettingData error: {0}", ex.Message));
- }
- return result;
- }
- /// <summary>
- /// 사용자 상세정보
- /// 의사의 경우 엔존번호를 반환한다
- /// </summary>
- /// <param name="userid">사용자 ID</param>
- /// <param name="dutinstcd">근무지기관코드</param>
- /// <param name="dutplcecd">근무지부서코드</param>
- /// <returns></returns>
- [WebMethod(Description = "사용자 상세정보")]
- public UserVO GetUserInfo(string userid, string dutinstcd, string dutplcecd) {
- UserVO user = new UserVO();
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable {
- { "userid", userid.ToUpper() },
- { "dutinstcd", dutinstcd },
- { "dutplcecd", dutplcecd ?? "" }
- };
- user = dac.GetUserInfo(this.IbatisMapper, param);
- }
- return user;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetUserInfo error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 환자 진료일 조회
- /// </summary>
- /// <param name="patientNo">환자번호</param>
- /// <param name="searchClnDate">검색진료일</param>
- /// <param name="searchType">검색조건, (searchType == ">=" 이면 clnDate >= searchClnDate, searchType == "=" 이면 clnDate = searchClnDate) </param>
- /// <param name="orddeptcd">진료부서코드</param>
- /// <param name="dutinstcd">근무지기관코드</param>
- /// <returns></returns>
- [WebMethod(Description = "환자 진료일 조회")]
- public List<ClnDateForDropdownVO> GetTrmtDateList(string patientNo, string searchClnDate, string searchType, string orddeptcd
- , string dutinstcd, string ordType) {
- List<ClnDateForDropdownVO> clnDateList;
- try {
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable {
- { "instcd", dutinstcd },
- { "pid", patientNo },
- { "searchClnDate", searchClnDate },
- { "searchType", searchType },
- { "orddeptcd", orddeptcd },
- { "ordType", ordType}
- };
- clnDateList = (List<ClnDateForDropdownVO>) dac.GetTrmtDateList(this.IbatisMapper, param);
- }
- return clnDateList;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetTrmtDateList error: {0}", ex.Message));
- throw ex;
- }
- }
- ///<summary>
- /// <param name="selectFlag">조회하고자 하는 화면 타입 : 입원(I), 외래(O), 응급(ER), 수술(OP)</param>
- /// <param name="srchYN">검색 탭 일때 Y, 그렇지 않으면 N</param>>
- /// <param name="srchDd">조회일자 ex) 20190726</param>
- /// <param name="ordDeptCd">진료과 코드</param>
- /// <param name="doctorId">진료의 아이디</param>
- /// <param name="pid">환지 진료번호(차트번호)</param>
- /// <param name="wardCd">병동 코드</param>
- /// <param name="patientState">환자 상태</param>
- /// <param name="dutInstCd">근무지기관 코드</param>
- /// <param name="userId">로그인한 사용자 아이디</param>
- /// <param name="myPatient">내환자 검색 checkbox value, 내환자 검색의 경우 pid 파라미터는 null 로 보내야 한다.ex) Y, N</param>
- /// <param name="drKind">입원, 응급에서 진료의 선택시 진료의 구분 (A : 전공의, B : 교수)</param>
- [WebMethod(Description = "환자리스트 조회")]
- public List<PatListVO> GetPatientList(String selectFlag, String srchYN, String srchDd, String ordDeptCd, String doctorId, String pid, String wardCd, String patientState, String dutInstCd, String userId, String myPatient, String drKind) {
- List<PatListVO> result = null;
- try {
- using (PatListDac dac = new PatListDac()) {
- var myPatientFlag = myPatient ?? "N";
- var userIdValue = userId ?? "";
- var searchFlag = srchYN ?? "N";
- wardCd = wardCd ?? "";
- patientState = patientState ?? "";
- userId = userId ?? "";
- //if (myPatientFlag.Equals("Y") && !drKind.Equals("C")) {
- // doctorId = userId;
- //}
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("doctorId -- > " + doctorId);
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("userId -- > " + userId);
- Hashtable param = new Hashtable();
- param.Add("selectFlag", selectFlag);
- param.Add("srchYN", searchFlag);
- param.Add("srchDd", srchDd);
- param.Add("ordDeptCd", ordDeptCd);
- param.Add("pid", pid);
- param.Add("instCd", dutInstCd);
- param.Add("userId", userId);
- param.Add("drKind", drKind);
- param.Add("doctorId", doctorId);
- param.Add("patientState", patientState);
- if (selectFlag == "I") {
- param.Add("wardCd", wardCd);
- param.Add("myPatient", myPatientFlag);
- }
- result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 검사탭 환자리스트 조회 모바일 전용
- /// </summary>
- /// <param name="selectFlag">선택한 탭의 상태값 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검사 : EX, 검색 : S</param>
- /// <param name="toDt"></param>
- /// <param name="fromDt"></param>
- /// <param name="baseCd">지원부서목록</param>
- /// <param name="supportDeptCd">지원과</param>
- /// <param name="pid">환자번호</param>
- /// <param name="patientState"></param>
- /// <returns></returns>
- [WebMethod(Description = "검사탭 환자리스트 조회")]
- public List<PatListVO> GetPatientExList(String selectFlag, String toDt, String fromDt, String baseCd, String supportDeptCd, String pid, String patientState) {
- List<PatListVO> result = null;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("selectFlag", selectFlag);
- param.Add("toDt", toDt);
- param.Add("fromDt", fromDt);
- param.Add("baseCd", baseCd);
- param.Add("supportDeptCd", supportDeptCd);
- param.Add("pid", pid);
- param.Add("patientState", patientState);
- param.Add("deviceType", "MOBILE");
- result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 검사탭 환자리스트 조회 모바일 전용
- /// </summary>
- /// <param name="selectFlag">선택한 탭의 상태값 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검사 : EX, 검색 : S</param>
- /// <param name="toDt"></param>
- /// <param name="fromDt"></param>
- /// <param name="baseCd">지원부서목록</param>
- /// <param name="supportDeptCd">지원과</param>
- /// <param name="pid">환자번호</param>
- /// <param name="patientState"></param>
- /// <returns></returns>
- [WebMethod(Description = "검사탭 환자리스트 조회")]
- public List<PatListVO> GetPatientExListPC(String selectFlag, String toDt, String fromDt, String baseCd, String supportDeptCd, String pid, String patientState, string isMainD, string mainDrId) {
- List<PatListVO> result = null;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("selectFlag", selectFlag);
- param.Add("toDt", toDt);
- param.Add("fromDt", fromDt);
- param.Add("baseCd", baseCd);
- param.Add("supportDeptCd", supportDeptCd);
- param.Add("pid", pid);
- param.Add("patientState", patientState);
- param.Add("deviceType", "PC");
- param.Add("isMainD", isMainD);
- param.Add("mainDrId", mainDrId);
- result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 검사탭 환자리스트 조회 PC 클라이언트 전용
- /// </summary>
- /// <param name="selectFlag">선택한 탭의 상태값 입원 : I, 외래 : O, 응급 : ER, 수술 : OP, 검사 : EX, 검색 : S</param>
- /// <param name="toDt"></param>
- /// <param name="fromDt"></param>
- /// <param name="baseCd">지원부서목록</param>
- /// <param name="supportDeptCd">지원과</param>
- /// <param name="pid">환자번호</param>
- /// <param name="patientState"></param>
- /// <returns></returns>
- [WebMethod(Description = "검사탭 환자리스트 조회")]
- public List<PatListVO> GetPatientExPCList(String selectFlag, String toDt, String fromDt, String baseCd, String supportDeptCd, String pid, String patientState, string isMainD, string mainDrId) {
- List<PatListVO> result = null;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("selectFlag", selectFlag);
- param.Add("toDt", toDt);
- param.Add("fromDt", fromDt);
- param.Add("baseCd", baseCd);
- param.Add("supportDeptCd", supportDeptCd);
- param.Add("pid", pid);
- param.Add("patientState", patientState);
- param.Add("isMainD", isMainD);
- param.Add("mainDrId", mainDrId);
- result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
- throw ex;
- }
- }
- ///// <summary>
- ///// 입원탭 환자리스트 조회
- ///// </summary>
- ///// <param name="srchdd">조회일자 ex)20160623</param>
- ///// <param name="orddeptcd">진료과 및 집도과 ex) 빈값은 전체</param>
- ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex) 빈값은 전체</param>
- ///// <param name="pid">환자등록번호 ex) 빈값은 전체</param>
- ///// <param name="wardcd">병동 코드 ex) 3041400000</param>
- ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)빈값은 전체</param>
- ///// <param name="jobkindcd"></param>
- ///// <param name="dutinstcd">근무지기관코드</param>
- ///// <param name="userId">로그인 사용자 ID</param>
- ///// <param name="myPatient">내환자 검색 checkbox value, 내환자 검색의 경우 pid 파라미터는 null 로 보내야 한다.ex) Y, N</param>
- //[WebMethod(Description = "입원탭 환자리스트 조회")]
- //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) {
- // List<PatListVO> result;
- // try {
- // using (PatListDac dac = new PatListDac()) {
- // var myPatValue = myPatient ?? "N";
- // var userIdValue = userId ?? "";
- // // 내환자 검색일 경우 입력된 환자 번호를 무시하도록 설정
- // if (myPatValue == "Y") {
- // pid = "";
- // }
- // //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetCategoryForDropdown error: {0}", srchdd));
- // Hashtable param = new Hashtable {
- // { "instcd", dutinstcd },
- // { "srchdd", srchdd },
- // { "orddeptcd", orddeptcd },
- // { "wardcd", wardcd },
- // { "patstat", patstat },
- // { "pid", pid },
- // { "doctorid", doctorid },
- // { "selectflag", "I" },
- // { "userid", userIdValue },
- // { "myPatient", myPatValue },
- // { "srchYN", "N" },
- // { "drKind", drKind }
- // };
- // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- // }
- // return result;
- // } catch (Exception ex) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInPatList error: {0}", ex.Message));
- // throw ex;
- // }
- //}
- ///// <summary>
- ///// 외래탭 환자리스트 조회
- ///// </summary>
- ///// <param name="srchdd">조회일자 ex)20160628 orddd</param>
- ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체, 2010400000</param>
- ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex)빈값은 전체, 104796 orddrid</param>
- ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
- ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) 빈값은 전체</param>
- ///// <param name="dutinstcd">근무지기관코드</param>
- ///// <returns>외래 환자 리스트</returns>
- //[WebMethod(Description = "외래탭 환자리스트 조회")]
- //public List<PatListVO> GetOutPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String dutinstcd) {
- // List<PatListVO> result = null;
- // try {
- // using (PatListDac dac = new PatListDac()) {
- // Hashtable param = new Hashtable {
- // { "instcd", dutinstcd },
- // { "srchdd", srchdd },
- // { "orddeptcd", orddeptcd },
- // { "orddrid", doctorid },
- // { "pid", pid },
- // { "patstat", patstat },
- // { "selectflag", "O" },
- // { "srchYN", "N" }
- // };
- // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- // }
- // return result;
- // } catch (Exception ex) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetOutPatList error: {0}", ex.Message));
- // throw ex;
- // }
- //}
- ///// <summary>
- ///// 수술탭 환자리스트 조회
- ///// </summary>
- ///// <param name="srchdd">조회일자 ex)20160623</param>
- ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체</param>
- ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex)빈값은 전체</param>
- ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
- ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)A</param>
- ///// <param name="dutinstcd">근무지기관코드</param>
- ///// <returns></returns>
- //[WebMethod(Description = "수술탭 환자리스트 조회")]
- //public List<PatListVO> GetOpPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String dutinstcd) {
- // List<PatListVO> result;
- // try {
- // using (PatListDac dac = new PatListDac()) {
- // Hashtable param = new Hashtable {
- // { "instcd", dutinstcd },
- // { "srchdd", srchdd },
- // { "opstatcd", patstat },
- // { "orddeptcd", orddeptcd },
- // { "orddrid", doctorid },
- // { "pid", pid },
- // { "selectflag", "OP" },
- // { "srchYN", "N" }
- // };
- // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- // }
- // return result;
- // } catch (Exception ex) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetOpPatList error: {0}", ex.Message));
- // throw ex;
- // }
- //}
- ///// <summary>
- ///// 응급탭 환자 리스트 조회
- ///// </summary>
- ///// <param name="srchdd">조회일자 ex) 20160623</param>
- ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체</param>
- ///// <param name="doctorid"> 진료의 또는 주치의 또는 집도의 ex)빈값은 전체</param>
- ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
- ///// <param name="patstat">환자 상태구분 (외래 : 진료구분, 입원 : 구분, 수술 : 수술상태, 응급 : 재원구분, 환자찾기 : ID인지 이름인지) ex)빈값은 전체</param>
- ///// <param name="jobkindcd">직무의 종류와 담당분야가 동일한 직무의군 코드값 아직 정의 되지 않았음. 예)영양직, 의무정보직, 임상병리직'</param>
- ///// <param name="dutinstcd">근무지기관코드</param>
- ///// <returns></returns>
- //[WebMethod(Description = "응급탭 환자 리스트 조회")]
- //public List<PatListVO> GetErPatList(String srchdd, String orddeptcd, String doctorid, String pid, String patstat, String jobkindcd, String dutinstcd, String drKind) {
- // List<PatListVO> result;
- // try {
- // using (PatListDac dac = new PatListDac()) {
- // Hashtable param = new Hashtable {
- // { "instcd", dutinstcd },
- // { "srchdd", srchdd },
- // { "orddeptcd", orddeptcd },
- // { "orddrid", doctorid },
- // { "patstat", patstat },
- // { "pid", pid },
- // { "selectflag", "ER" },
- // { "srchYN", "N" },
- // { "drKind", drKind }
- // };
- // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- // }
- // return result;
- // } catch (Exception ex) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetErPatList error: {0}", ex.Message));
- // throw ex;
- // }
- //}
- ///// <summary>
- ///// 환자검색 조회 기능
- ///// </summary>
- ///// <param name="srchdd">조회일자 ex)20160623</param>
- ///// <param name="orddeptcd">진료과 및 집도과 ex)빈값은 전체</param>
- ///// <param name="doctorid">진료의 또는 주치의 또는 집도의 ex)빈값은 전체</param>
- ///// <param name="pid">환자등록번호 ex)빈값은 전체</param>
- ///// <param name="ordtype">외래 O / 입원 I / 응급 ER</param>
- ///// <param name="dutinstcd">근무지기관코드</param>
- ///// <param name="userId">로그인 사용자 ID</param>
- ///// <param name="myPatient">내환자 검색 checkbox value, 내환자 검색의 경우 pid 파라미터는 null 로 보내야 한다.ex) Y, N</param>
- ///// <returns></returns>
- //[WebMethod(Description = "환자검색 조회 기능")]
- //public List<PatListVO> GetSrPatList(String srchdd, String orddeptcd, String doctorid, String pid, String ordtype, String dutinstcd, String userId, String myPatient) {
- // List<PatListVO> result;
- // try {
- // using (PatListDac dac = new PatListDac()) {
- // var myPatValue = myPatient ?? "N";
- // var userIdValue = userId ?? "";
- // // 내환자 검색일 경우 입력된 환자 번호를 무시하도록 설정
- // if (myPatValue == "Y") {
- // pid = "";
- // }
- // Hashtable param = new Hashtable {
- // { "instcd", dutinstcd },
- // { "srchdd", srchdd },
- // { "orddeptcd", orddeptcd },
- // { "wardcd", "" },
- // { "medispclid", doctorid },
- // { "orddrid", doctorid },
- // { "pid", pid },
- // { "opstatcd", "A" },
- // { "selectflag", ordtype },
- // { "patstat", "0" },
- // { "myPatient", myPatValue },
- // { "userId", userIdValue },
- // { "srchYN", "Y" }
- // };
- // result = (List<PatListVO>) dac.GetPatList(this.IbatisMapper, param);
- // }
- // return result;
- // } catch (Exception ex) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSrPatList error: {0}", ex.Message));
- // throw ex;
- // }
- //}
- /// <summary>
- /// 환자리스트 조회조건 중 진료과 리스트 없어질꺼(앱 수정하면 지워!)
- /// </summary>
- /// <param name="ordType">내원 종류 ( 탭 종류 ) 외래 : O , 입원 : I , 수술 : OP, 응급 : ER, 환자검색 : S</param>
- /// <param name="dutInstCd">근무지기관코드</param>
- [WebMethod(Description = "환자리스트 조회조건 중 진료과 리스트")]
- public List<DeptListVO> GetDeptList(String ordType, String dutInstCd) {
- List<DeptListVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- if (dutInstCd == null) {
- dutInstCd = "101";
- }
- param.Add("instCd", dutInstCd);
- param.Add("ordType", ordType);
- result = (List<DeptListVO>) dac.GetDeptList(this.IbatisMapper, param);
- result.Insert(0, new DeptListVO("", "진료과(전체)", ""));
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDeptList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 환자리스트 조회조건 중 진료과 리스트 진짜 사용할꺼
- /// </summary>
- /// <param name="ordType">내원 종류 ( 탭 종류 ) 외래 : O , 입원 : I , 수술 : OP, 응급 : ER, 환자검색 : S</param>
- /// <param name="dutInstCd">근무지기관코드</param>
- [WebMethod(Description = "환자리스트 조회조건 중 진료과 리스트")]
- public List<DeptListVO> GetOrgDeptList(String ordType, String dutInstCd) {
- List<DeptListVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- if (dutInstCd == null) {
- dutInstCd = "101";
- }
- param.Add("instCd", dutInstCd);
- param.Add("ordType", ordType);
- result = (List<DeptListVO>) dac.GetDeptList(this.IbatisMapper, param);
- result.Insert(0, new DeptListVO("", "진료과(전체)", ""));
- result.Add(new DeptListVO("2330000000", "종합검진", ""));
- result.Add(new DeptListVO("2340000000", "일반검진", ""));
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDeptList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 환자리스트 조회조건 중 병동 조회
- /// </summary>
- /// <param name="dutInstCd">근무지기관코드</param>
- /// <returns></returns>
- [WebMethod(Description = "환자리스트 조회조건 중 병동 조회")]
- public List<DeptListVO> GetWardList(String dutInstCd) {
- List<DeptListVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("instCd", dutInstCd);
- result = (List<DeptListVO>) dac.GetWardList(this.IbatisMapper, param);
- result.Insert(0, new DeptListVO("", "병동(전체)", ""));
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetWardList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 환자리스트 조회조건 의사 조회
- /// </summary>
- /// <param name="srchDd">조회 일자 20190822</param>
- /// <param name="ordDeptCd">진료과 코드 (소화기내과 : 2010000000) </param>
- /// <param name="dutInstCd">근무지기관코드 101</param>
- /// <returns></returns>
- [WebMethod(Description = "환자리스트 조회조건 중 의사 조회")]
- public List<DocListVO> GetDoctorList(String srchDd, String ordDeptCd, String dutInstCd) {
- List<DocListVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("srchDd", srchDd);
- param.Add("ordDeptCd", ordDeptCd);
- param.Add("instCd", dutInstCd);
- result = (List<DocListVO>) dac.GetDocList(this.IbatisMapper, param);
- result.Insert(0, new DocListVO("", "진료의(전체)", ""));
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDoctorList error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 검사 지원부서 설정 목록
- /// </summary>
- /// <returns></returns>
- [WebMethod(Description = "검사 지원부서 설정 목록")]
- public List<DeptListVO> GetSupportDeptList() {
- List<DeptListVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- result = (List<DeptListVO>)dac.GetSupportDeptList(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSupportDeptList error: {0}", ex.Message));
- throw ex;
- }
- }
- [WebMethod(Description = "검사 지원부서 설정 목록")]
- public List<InspectionVO> GetInspectingRoomName(string deptCd) {
- List<InspectionVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("deptCd", deptCd);
- result = (List<InspectionVO>) dac.GetInspectingRoomName(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetInspectingRoomName error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 환자리스트 조회조건 중 환자 검색 팝업
- /// </summary>
- /// <param name="srchcond">조회 구분( 1: 등록번호, 2: 환자명, 3: 주민번호, 4: 환자명+주민번호)</param>
- /// <param name="pid">환자 등록번호 ex) 2234596</param>
- /// <param name="hngnm">환자이름 ex) 오재은</param>
- /// <param name="rrgstno1">주민번호 앞자리 ex) 891117</param>
- /// <param name="rrgstno2">주민번호 뒷자리 ex) 1682813</param>
- /// <param name="dutinstcd">근무지기관코드</param>
- /// <returns></returns>
- [WebMethod(Description = "환자리스트 조회조건 중 환자 검색 팝업")]
- public List<PatInfoListVO> GetSrchPatInfo(String srchcond, String pid, String hngnm, String rrgstno1, String rrgstno2, String dutinstcd) {
- List<PatInfoListVO> result;
- try {
- using (PatListDac dac = new PatListDac()) {
- Hashtable param = new Hashtable();
- param.Add("instcd", dutinstcd);
- param.Add("srchcond", srchcond);
- param.Add("pid", pid);
- param.Add("hngnm", hngnm);
- param.Add("rrgstno1", rrgstno1);
- param.Add("rrgstno2", rrgstno2);
- result = (List<PatInfoListVO>) dac.GetSrchPatInfo(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSrchPatInfo error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 환자 선택시 수진일자별 진단 데이터 조회.
- /// 입원일때 한 수진에 수술이 여러개일 경우 집도과로 체크
- /// 외래일때 당일 수진이 여러개일경우 진료과로 체크
- /// </summary>
- /// <param name="pid">환자 등록번호 ex) 2234596 , 2270516</param>
- /// <param name="ordDd">외래 : 진료일, 입원: 입원일 ex) 20160205 , 20151201</param>
- /// <param name="ordType">내원 구분 (I: 입원, E: 응급, O: 외래 OP : 수술)</param>
- /// <param name="ordDeptCd">진료과(입원인경우 집도과 코드를 외래인 경우 진료과 코드 입력)</param>
- /// <param name="cretNo">생성번호</param>
- /// <param name="dutInstCd">근무지기관코드</param>
- /// <param name="opRsrvNo">수술예약번호</param>
- /// <returns></returns>
- [WebMethod(Description = "환자 선택시 수진일자별 진단 데이터 조회")]
- public List<PatientVO> GetPatientInfo(String pid, String ordDd, String ordType, String ordDeptCd, String cretNo, String dutInstCd, String opRsrvNo) {
- List<PatientVO> result;
- try {
- opRsrvNo = opRsrvNo ?? "";
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable {
- { "instCd", dutInstCd },
- { "ordDd", ordDd },
- { "pid", pid },
- { "ordType", ordType },
- { "ordDeptCd", ordDeptCd },
- { "cretNo", cretNo },
- { "opRsrvNo", opRsrvNo }
- };
- result = (List<PatientVO>) dac.GetPatientInfo(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetPatientInfo error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 사용자 즐겨찾기 추가
- /// </summary>
- /// <param name="userId">사용자 아이디 107810</param>
- /// <param name="formCd">서식코드 </param>
- /// <param name="dutInstCd">근무지기관코드</param>
- /// <param name="toDay">오늘 날짜</param>
- [WebMethod(Description = "사용자 즐겨찾기 추가")]
- public SingleReturnData SetUserFormSetList(string userId, string formCd, string dutInstCd, string toDay) {
- SingleReturnData result = new SingleReturnData();
- int res = 0;
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("instCd", dutInstCd);
- param.Add("userId", userId);
- param.Add("formCd", formCd);
- param.Add("toDay", toDay);
- int count = dac.GetUserFormCode(this.IbatisMapper, param);
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("count");
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(count);
- if (count > 0) {
- result.responseData = "0";
- } else {
- res = dac.SetUserFormSet(this.IbatisMapper, param);
- }
-
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SetUserFormSetList error: {0}", ex.Message));
- throw ex;
- }
- return result;
- }
- /// <summary>
- /// 사용자 즐겨찾기 삭제
- /// </summary>
- /// <param name="idx">즐겨찾기에 추가된 동의서 고유번호</param>
- /// <param name="userId">사용자 아이디 107810</param>
- /// <param name="formCd">서식코드 </param>
- /// <param name="dutInstCd">근무지기관코드</param>
- [WebMethod(Description = "사용자 즐겨찾기 삭제")]
- public SingleReturnData DelUserFormSetList(String idx, String userId, String formCd, String dutInstCd) {
- SingleReturnData result = new SingleReturnData();
- int res = 0;
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("idx", idx);
- param.Add("instCd", dutInstCd);
- param.Add("userId", userId);
- param.Add("formCd", formCd);
- dac.DelUserFormSet(this.IbatisMapper, param);
- //if (cendbHelper.GetSqlMapper().DataSource.Name == "DCUMCHospitalDB") {
- // res = dac.DelUserFormSet(this.IbatisMapper, param);
- // result.responseData = Convert.ToString(res);
- //} else {
- // res = dac.DelUserFormSet(this.cendbMapper, param);
- // result.responseData = Convert.ToString(res);
- //}
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm DelUserFormSetList error: {0}", ex.Message));
- throw ex;
- }
- return result;
- }
- /// <summary>
- /// OCRTAG 할당
- /// </summary>
- /// <returns></returns>
- [WebMethod(Description = "OCRTAG 할당")]
- public SingleReturnData GetOcrTag() {
- SingleReturnData result = new SingleReturnData();
- try {
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable();
- String res = dac.GetOcrTag(this.IbatisMapper, param);
- result.responseData = res;
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetOcrTag error: {0}", ex.Message));
- throw ex;
- }
- return result;
- }
- /// <summary>
- /// 사용자의 서명이미지 조회
- /// </summary>
- /// <param name="userId">사용자 아이디 103043</param>
- /// <param name="instCd">근무지기관코드</param>
- [WebMethod(Description = "사용자의 서명이미지 조회")]
- public UserSignImageVO GetSignImage(string userId, string instCd) {
- try {
- string base64stringimg = string.Empty;
- UserSignImageVO vo = null;
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId);
- param.Add("instCd", instCd);
- IList<UserSignImageVO> vos = dac.GetUserSignImage(this.IbatisMapper, param);
- foreach (UserSignImageVO item in vos) {
- vo = item;
- break;
- }
- }
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("vo -- > " + vo);
- if (vo == null) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("!!!!!!!!!!!!");
- vo = new UserSignImageVO();
- vo.SignImage = new byte[0];
- }
- return vo;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetSignImage error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 주,부 진단명 리스트 조회(진단명 팝업)
- /// </summary>
- /// <param name="pid">등록번호 </param>
- /// <param name="orddd">진료일, 입원일 </param>
- /// <param name="dutinstcd">근무지기관코드</param>
- [WebMethod(Description = "주,부 진단명 리스트 조회(진단명 팝업)")]
- public List<string> GetDiagNameList(String pid, String orddd, String dutinstcd) {
- List<string> result;
- try {
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable();
- if (dutinstcd == null) {
- dutinstcd = "031";
- }
- param.Add("instcd", dutinstcd);
- param.Add("orddd", orddd);
- param.Add("pid", pid);
- result = (List<string>) dac.GetDiagList(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetDiagNameList error: {0}", ex.Message));
- throw ex;
- }
- }
- public List<string> getOpNameList(String pid, string dutinstcd) {
- List<string> result = null;
- try {
- //using (OperationNameDAC opDac = new OperationNameDAC())
- {
- Hashtable args = new Hashtable();
- //Hashtable param = new Hashtable();
- args.Add("pid", pid);
- args.Add("dutinstcd", dutinstcd);
- //result = (List<string>)opDac.getOpNameList(this.IbatisMapper, args);
- }
- return result;
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getOpNameList error: {0}", e.Message));
- throw e;
- }
- }
- /// <summary>
- /// 파일이름 조회
- /// </summary>
- /// <param name=" pid">등록번호 1640515</param>
- /// <param name=" ordtype">내원구분 I</param>
- /// <param name=" orddd">내월일자 20151130</param>
- /// <param name=" dschdd">퇴원일자 99991231</param>
- /// <param name=" cretno">이력번호 1</param>
- /// <param name=" filesize">파일크기 없어도됨</param>
- /// <param name=" formcd">서식코드 1300010289</param>
- /// <param name=" pageno">페이지번호 6</param>
- /// <param name=" ocrtag">OCR코드 2016071989074</param>
- /// <param name=" userid">사용자아이디 105042</param>
- /// <param name = "dutinstcd" >근무지기관코드</ param >
- [WebMethod(Description = "파일이름 조회")]
- 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) {
- try {
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable();
- param.Add("instcd", dutinstcd);
- param.Add("pid", pid);
- param.Add("ordtype", ordtype);
- param.Add("orddd", orddd);
- param.Add("dschdd", dschdd);
- param.Add("cretno", cretno);
- param.Add("filesize", filesize);
- param.Add("formcd", formcd);
- param.Add("pageno", pageno);
- param.Add("ocrtag", ocrtag);
- param.Add("userid", userid);
- param.Add("orddeptcd", orddeptcd);
- //return dac.GetFileName(this.IbatisMapper, param);
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetFileName error: {0}", ex.Message));
- throw ex;
- }
- return "";
- }
- /// <summary>
- /// setFileName으로 등록된 데이터 삭제하는 로직
- /// </summary>
- /// <param name="pid">등록번호 1640515</param>
- /// <param name="ordtype">내원구분 I</param>
- /// <param name="orddd">내월일자 20151130</param>
- /// <param name="dschdd">퇴원일자 99991231</param>
- /// <param name="cretno">이력번호 1</param>
- /// <param name="formcd">서식코드 1300010289</param>
- /// <param name="ocrtag">OCR코드 2016071989074</param>
- /// <param name="userid">사용자아이디 105042</param>
- /// <param name="username">사용자명 홍길동</param>
- /// <param name="consentmstrid">동의서 생성 아이디 1573</param>
- /// <param name="hostype">병원구분 111</param>
- /// <param name="orddeptcd">진료과 코드 </param>
- /// <param name="dutinstcd">근무지기관코드</param>
- [WebMethod(Description = "setFileName으로 등록된 데이터 삭제하는 함수")]
- 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) {
- try {
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable();
- param.Add("instcd", dutinstcd);
- param.Add("pid", pid);
- param.Add("ordtype", ordtype);
- param.Add("orddd", orddd);
- param.Add("dschdd", dschdd);
- param.Add("cretno", cretno);
- param.Add("formcd", formcd);
- param.Add("ocrtag", ocrtag);
- param.Add("userid", userid);
- param.Add("username", username);
- param.Add("consentmstrid", consentmstrid);
- param.Add("hostype", hostype);
- param.Add("orddeptcd", orddeptcd);
- dac.delEformData(this.IbatisMapper, param);
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm delEformData error: {0}", ex.Message));
- throw ex;
- }
- }
- /// <summary>
- /// 모바일 Default Tap(외래, 입원..) 설정
- /// </summary>
- /// <param name="userId">사용자 아이디</param>
- /// <param name="status">외래 O 입원 I 응급 E 수술 P </param>
- /// <param name="instCd">근무지기관코드</param>
- [WebMethod(Description = "모바일 Default Tap(외래, 입원..) 설정")]
- public SingleReturnData UpdateUserSetup(string userId, string status, string instCd) {
- SingleReturnData result = new SingleReturnData();
- int rts = 1;
- try {
- using (PatientDac dac = new PatientDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId);
- param.Add("status", status);
- param.Add("instCd", instCd);
- rts = dac.UpdateUserSetup(this.IbatisMapper, param);
- result.responseData = Convert.ToString(rts);
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm UpdateUserSetup error: {0}", ex.Message));
- //throw ex;
- }
- return result;
- }
- ///// <summary>
- ///// 모바일 주치의별 미작성 리스트 가져오기
- ///// </summary>
- ///// <param name="userid">사용자 아이디</param>
- ///// <param name="status">동의서 상태(UNFINISHED, TEMP ....)</param>
- ///// <param name="fromdd"></param>
- ///// <param name="todd"></param>
- ///// <param name="dutinstcd">근무지기관코드</param>
- ///// <returns></returns>
- //[WebMethod(Description = "모바일 주치의별 미작성 리스트 가져오기")]
- //public List<UnFinishedListVO> GetUnfinishedListPerDoctor(string userid, string status, string fromdd, string todd, string dutinstcd) {
- // try {
- // using (ConsentDac dac = new ConsentDac()) {
- // Hashtable param = new Hashtable {
- // { "userid", userid },
- // { "status", status },
- // { "fromdd", fromdd },
- // { "todd", todd },
- // { "instcd", dutinstcd }
- // };
- // return (List<UnFinishedListVO>) dac.GetUnfinishedListPerDoctor(this.IbatisMapper, param);
- // }
- // } catch (Exception ex) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetUnfinishedListPerDoctor error: {0}", ex.Message));
- // throw ex;
- // }
- //}
- /// <summary>
- /// 모바일 사용자 로그인 API
- /// </summary>
- /// <param name="userId">사용자 아이디</param>
- /// <param name="sha256EncPw">sha256 encrypt password</param>
- /// <param name="md5EncPw">md5 encrypt password</param>
- /// <param name="dutInstCd">근무지기관코드</param>
- /// <param name="certSucc">인증서로그인 여부</param>
- /// <returns></returns>
- //[WebMethod(Description = "모바일 사용자 로그인 API")]
- //public List<UserLoginDeptList> doLogin(string userId, string sha256EncPw, string md5EncPw, string dutInstCd, string certSucc) {
- // MobileLoginResult result;
- // string password = "";
- // try {
- // using (UserDac dac = new UserDac()) {
- // Hashtable param = new Hashtable();
- // int n;
- // if (!int.TryParse(userId, out n)) {
- // userId = userId.ToUpper();
- // }
- // param.Add("userId", userId);
- // result = dac.doLogin(this.IbatisMapper, param);
- // if (result == null) {
- // return null;
- // }
- // if(result.pwd.Length == 64) {
- // // sha256 아이디 + 비밀번호 비교
- // password = sha256EncPw;
- // } else {
- // // md5 비밀번호만
- // password = md5EncPw;
- // }
- // if (certSucc == "false") {
- // if (result.pwd != password) {
- // int updateCnt = dac.updateLoginFailCount(this.IbatisMapper, param);
- // if (updateCnt > 0) {
- // int failCnt = dac.getLoginFailCount(this.IbatisMapper, param);
- // if (failCnt == 3) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (3회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- // } else if (failCnt == 4) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (4회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- // } else if (failCnt == 5) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (5회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- // } else if (failCnt == 6) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (6회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- // } else if (failCnt == 7) {
- // // 사용자정보 또는 로그인 비밀번호 오류(연속 7회)로 인하여 10분동안 로그인이 제한됩니다 \n잠시 후 다시 로그인을 시도하십시오.
- // }
- // }
-
- // return null;
- // }
- // }
- // //개발 서버 : DEV101
- // //운영 서버 : EMR101
- // //string sysCd = "DEV101";
- // string sysCd = "EMR101";
- // Hashtable param2 = new Hashtable();
- // param2.Add("userId", result.userId);
- // param2.Add("sysCd", sysCd);
- // return (List<UserLoginDeptList>) dac.getUserdeptList(this.IbatisMapper, param2);
- // }
- // } catch (Exception e) {
- // CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm doLogin ERROR : {0}", e.ToString()));
- // throw e;
- // }
- //}
- [WebMethod(Description = "모바일 사용자 로그인 API")]
- public SingleReturnData doLogin(string userId, string sha256EncPw, string md5EncPw, string dutInstCd, string certFlag, string certSuccess) {
- SingleReturnData mResult = new SingleReturnData();
- MobileLoginResult result;
- string password = "";
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- int n;
- if (!int.TryParse(userId, out n)) {
- userId = userId.ToUpper();
- }
- param.Add("userId", userId);
- result = dac.doLogin(this.IbatisMapper, param);
- if (result == null) {
- return null;
- }
- if (result.pwd.Length == 64) {
- // sha256 아이디 + 비밀번호 비교
- password = sha256EncPw;
- } else {
- // md5 비밀번호만
- password = md5EncPw;
- }
- if (certFlag == "false") {
-
- if (result.pwd != password) {
- mResult.responseData = Convert.ToString(loginFailCount(userId));
- } else {
- string expiryYn = dac.checkUserPwdValidTerm(this.IbatisMapper, param);
- if (expiryYn.Equals("Y")) {
- mResult.responseData = "overDate";
- } else {
- mResult.responseData = "success";
- }
- }
-
- } else {
- if (certSuccess == "N") {
- mResult.responseData = Convert.ToString(loginFailCount(userId));
- } else {
- string expiryYn = dac.checkUserPwdValidTerm(this.IbatisMapper, param);
- if (expiryYn.Equals("Y")) {
- mResult.responseData = "overDate";
- } else {
- mResult.responseData = "success";
- }
- //mResult.responseData = "success";
- }
- }
- }
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm doLogin ERROR : {0}", e.ToString()));
- throw e;
- }
- return mResult;
- }
- /// <summary>
- /// 로그인 실패 카운트
- /// </summary>
- /// <param name="userId"></param>
- /// <returns></returns>
- private int loginFailCount(string userId) {
- int failCnt = 0;
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId.ToUpper());
- //int updateCnt = dac.updateLoginFailCount(this.IbatisMapper, param);
- failCnt = dac.getLoginFailCount(this.IbatisMapper, param);
- dac.updateLoginFailCount(this.IbatisMapper, param);
- failCnt = dac.getLoginFailCount(this.IbatisMapper, param);
- //if (failCnt == 3) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (3회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- //} else if (failCnt == 4) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (4회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- //} else if (failCnt == 5) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (5회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- //} else if (failCnt == 6) {
- // // 사용자정보 또는 암호가 일치하지 않습니다 (6회) \n7회 오류발생시 10분간 로그인이 제한됩니다.
- //} else if (failCnt == 7) {
- // // 사용자정보 또는 로그인 비밀번호 오류(연속 7회)로 인하여 10분동안 로그인이 제한됩니다 \n잠시 후 다시 로그인을 시도하십시오.
- //}
- }
- } catch(Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm doLogin ERROR : {0}", e.ToString()));
- throw e;
- }
- return failCnt;
- }
- [WebMethod(Description = "모바일 사용자 로그인 성공시 부서 리스트 및 사용자 정보를 가져온다")]
- public List<UserLoginDeptList> getUserInfoDeptList(string userId) {
- try {
- using (UserDac dac = new UserDac()) {
- string sysCd = "EMR101";
- Hashtable param2 = new Hashtable();
- param2.Add("userId", userId.ToUpper());
- param2.Add("sysCd", sysCd);
- return (List<UserLoginDeptList>) dac.getUserdeptList(this.IbatisMapper, param2);
- }
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getUserInfoDeptList ERROR : {0}", e.ToString()));
- throw e;
- }
- }
- [WebMethod(Description = "중복로그인 체크를 위한 사용자 세션")]
- public SingleReturnData checkedUserSession(string userId, string ipAddr, string macAddr) {
- SingleReturnData result = new SingleReturnData();
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId.ToUpper());
- param.Add("ipAddr", ipAddr);
- param.Add("macAddr", macAddr);
- result.responseData = dac.checkedSession(this.IbatisMapper, param);
- if (result.responseData.Equals("")) {
- result.responseData = "N";
- }
- if (result.responseData.Equals("Y")) {
- result.responseData = dac.checkedSession2(this.IbatisMapper, param);
- }
- dac.insertUpdateSession(this.IbatisMapper, param);
- }
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm checkedUserSession ERROR : {0}", e.ToString()));
- throw e;
- }
- return result;
- }
- /// <summary>
- /// 중복 로그인 세션 해제
- /// </summary>
- /// <param name="userId">사용자 아이디</param>
- /// <param name="adaminFlag">문자열로 true이면 관리자가 해제</param>
- [WebMethod(Description = "중복 로그인 세션 해제")]
- public Boolean removeSession(string userId, string adaminFlag) {
- Boolean result = false;
- try {
- using (UserDac dac = new UserDac()) {
- adaminFlag = adaminFlag ?? "false";
- Hashtable param = new Hashtable();
- param.Add("userId", userId.ToUpper());
- param.Add("adminFlag", adaminFlag);
- int rts = dac.removeSession(this.IbatisMapper, param);
-
- if (rts > 0) {
- result = true;
- } else {
- result = false;
- }
- }
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm removeSession ERROR : {0}", e.ToString()));
- throw e;
- }
- return result;
- }
- /// <summary>
- /// 사용자 로그인, 로그아웃 로그
- /// </summary>
- /// <param name="userId">사용자 아이디</param>
- /// <param name="loginStatus">로그인 성공(CERT_LOGIN, LOGIN), 실패(CERT_FAIL, FAIL), 로그아웃(LOGOFF) 상태</param>
- /// <param name="deviceType">모바일(MOBILE), PC(PC) 구분</param>
- /// <param name="macAddress">사용자 단말 고유 정보</param>
- /// <returns></returns>
- [WebMethod(Description = "사용자 로그인, 로그아웃 로그")]
- public void userLoginOutLog(string userId, string loginStatus, string deviceType, string macAddress) {
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId);
- param.Add("loginStatus", loginStatus);
- param.Add("deviceType", deviceType);
- param.Add("macAddress", macAddress);
- dac.userLoginOutLog(this.IbatisMapper, param);
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm userLoginOutLog ERROR : {0}", ex.ToString()));
- throw ex;
- }
- }
- /// <summary>
- /// 모바일 사용자 정보요청 API
- /// </summary>
- /// <param name="userid"></param>
- /// <param name="dutplceinstcd"></param>
- /// <param name="dutplcecd"></param>
- /// <returns></returns>
- [WebMethod(Description = "모바일 사용자 정보요청 API")]
- public MobileUserInfo GetMobileUserInfo(string userid, string dutplceinstcd, string dutplcecd) {
- MobileUserInfo result = null;
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userid", userid);
- param.Add("dutplceinstcd", dutplceinstcd);
- param.Add("dutplcecd", dutplcecd);
- result = dac.getMobileUserInfo(this.IbatisMapper, param);
- }
- return result;
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetMobileUserInfo ERROR : {0}", e.ToString()));
- throw e;
- }
- }
- [WebMethod(Description = "사용자별 지원부서 설정 저장")]
- public string getUserPrefMonitor(string userId, string instcd) {
- string monitorNo = string.Empty;
- try {
- using(UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userid", userId);
- monitorNo = dac.getUserPrefMonitor(this.IbatisMapper, param);
- }
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getUserPrefMonitor ERROR : {0}", e.ToString()));
- }
- return monitorNo;
- }
- [WebMethod(Description = "사용자별 지원부서 설정 저장")]
- public SingleReturnData SetSupportUserData(string userId, string baseCd, string supportDeptCd, string supportDeptNm, string macAddress) {
- SingleReturnData result = new SingleReturnData();
- string rts = "";
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId);
- param.Add("supportDeptCd", supportDeptCd);
- param.Add("supportDeptNm", supportDeptNm);
- param.Add("macAddress", macAddress);
- param.Add("baseCd", baseCd);
- rts = dac.SetSupportUserData(this.IbatisMapper, param);
- result.responseData = rts;
- }
- } catch (Exception ex) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SetSupportUserData ERROR : {0}", ex.ToString()));
- }
- return result;
- }
- [WebMethod(Description = "사용자별 활성화 듀얼모니터 설정 저장")]
- public SingleReturnData SetUserPrefMonitor(string userId, string monitorNo) {
- SingleReturnData result = new SingleReturnData();
- try {
- using (UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- param.Add("userId", userId);
- param.Add("monitorNo", monitorNo);
- var resultStr = dac.SetUserPrefMonitor(this.IbatisMapper, param);
- result.responseData = resultStr;
- }
- } catch (Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SetUserPrefMonitor ERROR : {0}", e.ToString()));
- }
- return result;
- }
- [WebMethod(Description = "로그아웃 세션 타임 반환")]
- public string getSessionTime(string instcd) {
- string sessionTime = "30";
- try {
- using(UserDac dac = new UserDac()) {
- Hashtable param = new Hashtable();
- sessionTime = dac.getSessionTime(this.IbatisMapper, param);
- }
- }catch(Exception e) {
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm getSessionTime ERROR : {0}", e.ToString()));
- }
- return sessionTime;
- }
- }
- }
|