|
@@ -140,15 +140,16 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
/// <summary>
|
|
|
/// 환자, 상태에 따른 동의서 목록 검색
|
|
|
/// </summary>
|
|
|
- /// <param name="pid">환자등록번호</param>
|
|
|
- /// <param name="userId">사용자 아이디, 작성자별 조회시 pid는 입력하지 않고 userId만 보내줘야함</param>
|
|
|
+ /// <param name="patientCode">환자등록번호</param>
|
|
|
/// <param name="startDt">데이터생성일자 조회 시작일</param>
|
|
|
- /// <param name="endDt">조회 마지막 일자 (현재 일자를 넣음)</param>
|
|
|
- /// <param name="consentState">동의서 상태</param>
|
|
|
+ /// <param name="endDt">The end dt.</param>
|
|
|
+ /// <param name="consentState">State of the conset.</param>
|
|
|
/// <param name="instCd">근무지기관코드</param>
|
|
|
+ /// <param name="userId">The user identifier.</param>
|
|
|
/// <returns></returns>
|
|
|
[WebMethod(Description = "환자/상태에 따른 동의서 목록 검색")]
|
|
|
- public List<ConsentVO> GetConsentList(string pid, string userId, string startDt, string endDt, string consentState, string instCd) {
|
|
|
+ public List<ConsentVO> GetConsentList(string patientCode, string startDt, string endDt, string consentState, string instCd
|
|
|
+ , string userId) {
|
|
|
|
|
|
List<ConsentVO> result;
|
|
|
|
|
@@ -175,14 +176,15 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
using (ConsentDac dac = new ConsentDac()) {
|
|
|
|
|
|
Hashtable param = new Hashtable {
|
|
|
- { "pid", pid },
|
|
|
- { "userId", userId },
|
|
|
+ { "patientCode", patientCode },
|
|
|
{ "startDt", startDt },
|
|
|
{ "endDt", endDt },
|
|
|
{ "consentState", consentState },
|
|
|
- { "instCd", instCd }
|
|
|
+ { "instCd", instCd },
|
|
|
+ { "userId", userId ?? string.Empty}
|
|
|
};
|
|
|
|
|
|
+ //result = (List<ConsentFormListVO>) dac.GetConsentList(this.IbatisMapper, param);
|
|
|
result = (List<ConsentVO>) dac.GetConsentList(this.IbatisMapper, param);
|
|
|
}
|
|
|
|
|
@@ -387,9 +389,8 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
/// </summary>
|
|
|
/// <param name="userId">사용자 아이디 107810</param>
|
|
|
/// <param name="instCd">근무지기관코드</param>
|
|
|
- /// <param name="toDay">오늘 날짜</param>
|
|
|
[WebMethod(Description = "동의서 SET 조회")]
|
|
|
- public List<ConsentVO> GetConsentSetList(string userId, string instCd, string toDay) {
|
|
|
+ public List<ConsentVO> GetConsentSetList(string userId, string instCd) {
|
|
|
List<ConsentVO> result;
|
|
|
|
|
|
try {
|
|
@@ -397,7 +398,6 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
Hashtable param = new Hashtable();
|
|
|
param.Add("instCd", instCd);
|
|
|
param.Add("userId", userId);
|
|
|
- param.Add("toDay", toDay);
|
|
|
result = (List<ConsentVO>) dac.GetConsentSetList(this.IbatisMapper, param);
|
|
|
}
|
|
|
|
|
@@ -540,8 +540,8 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
|
|
|
try {
|
|
|
using (ConsentDac dac = new ConsentDac()) {
|
|
|
- string remotePath = "";
|
|
|
- Dictionary<String, String> remoteData = remoteInfo();
|
|
|
+ // string remotePath = "";
|
|
|
+ // Dictionary<String, String> remoteData = remoteInfo();
|
|
|
Hashtable param = new Hashtable();
|
|
|
|
|
|
int consentMstRidInt = 0;
|
|
@@ -549,6 +549,7 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
|
|
|
param.Add("consent-mst-rid", consentMstRidInt);
|
|
|
result = (List<ConsentImageVO>) dac.GetConsentImage(this.IbatisMapper, param);
|
|
|
+ /*
|
|
|
remotePath = result[0].imagePath;
|
|
|
|
|
|
// 계정을 choiadmin 으로 가장한다
|
|
@@ -586,7 +587,8 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
}
|
|
|
// ?? 왜 로컬에 있는 tempfile 들을 삭제할까?
|
|
|
//int iResult = DeleteTempFile();
|
|
|
-
|
|
|
+ */
|
|
|
+ }
|
|
|
return result;
|
|
|
} catch (Exception ex) {
|
|
|
CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm GetConsentImage error: {0}", ex.Message));
|
|
@@ -710,90 +712,112 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 임시저장, 확인저장
|
|
|
+ /// 전자동의서를 임시저장 한다.
|
|
|
/// </summary>
|
|
|
/// <param name="userId">로그인 사용자ID</param>
|
|
|
- /// <param name="userDeptCd">로그인 사용자 부서 코드</param>
|
|
|
- /// <param name="pid">환자 등록번호</param>
|
|
|
- /// <param name="formId">서식 ID</param>
|
|
|
- /// <param name="formCd">서식 코드</param>
|
|
|
- /// <param name="patientDeptCd">환자가 내원한, 속해있는 부서 코드</param>
|
|
|
- /// <param name="formXml">서식 정보</param>
|
|
|
- /// <param name="dataXml">사용자가 작성한 서식 내용</param>
|
|
|
+ /// <param name="patientCode">환자 등록번호</param>
|
|
|
+ /// <param name="clnDeptCode">진료과 코드</param>
|
|
|
+ /// <param name="formRid">(작성대상)서식 Rid</param>
|
|
|
+ /// <param name="formCd">서식코드</param>
|
|
|
/// <param name="consentMstRid">동의서 마스터 데이터 Rid</param>
|
|
|
- /// <param name="reWriteconsentMstRid">재 작성 대상 동의서 마스터 데이터 Rid</param>
|
|
|
+ /// <param name="rewriteConsentMstRid">재 작성 대상 동의서 마스터 데이터 Rid</param>
|
|
|
+ /// <param name="formXml">동의서 EPT Xml</param>
|
|
|
+ /// <param name="dataXml">동의서 Data(필드들) Xml</param>
|
|
|
/// <param name="deviceType">장비 유형 (WIN, AND, IOS, PRT 중1)</param>
|
|
|
- /// <param name="deviceMacAddr">장비 고유 식별자</param>
|
|
|
- /// <param name="ordType">내원 구분 입원 : I, 외래 : O, 수술 : OP, 응급 : ER</param>
|
|
|
- /// <param name="instCd">근무지 기관코드</param>
|
|
|
- /// <param name="inDd">내원 일자 입원 : inDd, 외래 : ordDd</param>
|
|
|
- /// <param name="ward">병동</param>
|
|
|
- /// <param name="roomCd">병실</param>
|
|
|
- /// <param name="ocrTag">ocrTag</param>
|
|
|
- /// <param name="cretNo">생성번호</param>
|
|
|
- /// <param name="mainDrId">환자를 담당하는 의사(담당교수, 주치의, 담당의사 등)</param>
|
|
|
- /// <param name="formPageCnt">동의서 총 장수</param>
|
|
|
- /// <param name="actionKind">임시저장 : T, 인증저장 : C</param>
|
|
|
- /// <param name="opRsrvNo">수술번호</param>
|
|
|
- /// <param name="consentState">동의서 상태</param>
|
|
|
- /// <param name="orderNo">처방번호</param> 20190822 원형만 유지하되 당장 사용하지 않음
|
|
|
- /// <param name="orderName">처방 이름</param> 20190822 원형만 유지하되 당장 사용하지 않음
|
|
|
- /// <param name="orderCd">처방 코드?</param> 20190822 원형만 유지하되 당장 사용하지 않음
|
|
|
- /// <param name="audioFileJson">음성녹음 바이너리 데이터</param>
|
|
|
- /// <param name="audioFileSize">음성녹음 파일 사이즈</param>
|
|
|
- /// <param name="imageFileJson">이미지 바이너리 데이터</param>
|
|
|
- /// <param name="fileSize">이미지 파일 사이즈</param>
|
|
|
- /// <returns></returns>
|
|
|
+ /// <param name="deviceIdentNo">장비 고유 식별자</param>
|
|
|
+ /// <param name="vistType">내원구분</param>
|
|
|
+ /// <param name="hosType">병원 구분</param>
|
|
|
+ /// <param name="clnDate">병원 구분이 "I" 일 경우 입원일자/병원 구분이 "O"일 경우 진료일자</param>
|
|
|
+ /// <param name="ward">병동 코드</param>
|
|
|
+ /// <param name="roomcd">병실 코드</param>
|
|
|
+ /// <param name="orderNo">처방번호</param>
|
|
|
+ /// <param name="orderName">처방명</param>
|
|
|
+ /// <param name="orderCd">처방코드</param>
|
|
|
+ /// <param name="ocrCode">OCR 코드</param>
|
|
|
+ /// <param name="cretno">생성번호</param>
|
|
|
+ /// <param name="createUserName">작성자명</param>
|
|
|
+ /// <param name="modifyUserName">수정자명</param>
|
|
|
+ /// <param name="mainDrId">주치의 아이디</param>
|
|
|
+ /// <param name="userDeptCd">사용자 부서 코드</param>
|
|
|
+ /// <param name="pageCnt">동의서 매수</param>
|
|
|
+ /// <param name="actKind">동작코드(T: 임시 저장, C: 인증 저장, P: 출력, CP: 삭제)</param>
|
|
|
+ /// <param name="clientType">Client구분 (P: PC, M: 모바일)</param>
|
|
|
+ /// <param name="opRsrvNo">수술예약번호</param>
|
|
|
+ /// <returns>
|
|
|
+ /// CONSENT_MST_RID
|
|
|
+ /// </returns>
|
|
|
[WebMethod(Description = "동의서 임시저장")]
|
|
|
- public SingleReturnData SaveTempData(string userId, string userDeptCd, string pid, string formId, string formCd, string patientDeptCd, string formXml, string dataXml,
|
|
|
- int consentMstRid, int reWriteConsentMstRid, string deviceType, string deviceMacAddr, string ordType, string instCd, string inDd, string dSchDd,
|
|
|
- string ward, string roomCd, string ocrTag, int cretNo, string mainDrId, string formPageCnt, string actionKind, string opRsrvNo, string consentState,
|
|
|
- int orderNo, string orderName, string orderCd, string audioFileJson, string audioFileSize, string imageFileJson, string fileSize) {
|
|
|
-
|
|
|
+ public SingleReturnData SaveTempData(string userId, string patientCode, string clnDeptCode, int formRid, string formCd,
|
|
|
+ int consentMstRid, int rewriteConsentMstRid, string formXml, string dataXml,
|
|
|
+ string deviceType, string deviceIdentNo, string vistType, string hosType, string clnDate,
|
|
|
+ string ward, string roomCd, int orderNo, string orderName, string orderCd, string ocrCode, int cretNo,
|
|
|
+ string createUserName, string modifyUserName, string mainDrId,
|
|
|
+ string userDeptCd, string pageCnt, string actKind, string clientType, string opRsrvNo,
|
|
|
+ string consentState) {
|
|
|
SingleReturnData result = new SingleReturnData();
|
|
|
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(String.Format("userId -- > [{0}]", userId));
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("userDeptCd -- > " + userDeptCd);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("pid -- > " + pid);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("formId -- > " + formId);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("formCd -- > " + formCd);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("patientDeptCd -- > " + patientDeptCd);
|
|
|
- ////CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("formXml -- > " + formXml);
|
|
|
- ////CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("dataXml -- > " + dataXml);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("consentMstRid -- > " + consentMstRid);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("reWriteConsentMstRid -- > " + reWriteConsentMstRid);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("deviceType -- > " + deviceType);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("deviceMacAddr -- > " + deviceMacAddr);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("ordType -- > " + ordType);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("instCd -- > " + instCd);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("inDd -- > " + inDd);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("ward -- > " + ward);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("roomCd -- > " + roomCd);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("ocrTag -- > " + ocrTag);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("cretNo -- > " + cretNo);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("mainDrId -- > " + mainDrId);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("formPageCnt -- > " + formPageCnt);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("actionKind -- > " + actionKind);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("opRsrvNo -- > " + opRsrvNo);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("consentState -- > " + consentState);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("orderNo -- > " + orderNo);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("orderName -- > " + orderName);
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error("orderCd -- > " + orderCd);
|
|
|
-
|
|
|
- consentMstRid = SaveData(userId, userDeptCd, pid, formId, formCd, patientDeptCd, formXml, dataXml,
|
|
|
- consentMstRid, reWriteConsentMstRid, deviceType, deviceMacAddr, ordType, instCd, inDd, dSchDd,
|
|
|
- ward, roomCd, ocrTag, cretNo, mainDrId, formPageCnt, actionKind, opRsrvNo, consentState,
|
|
|
- orderNo, orderName, orderCd, audioFileJson, audioFileSize, imageFileJson, fileSize);
|
|
|
+ int reissueConsentMstRid = 0;
|
|
|
+
|
|
|
+ consentState = string.IsNullOrEmpty(consentState) ? "TEMP" : consentState;
|
|
|
+
|
|
|
+ consentMstRid = SaveData(userId, patientCode, clnDeptCode, formRid, formCd,
|
|
|
+ consentMstRid, 0, reissueConsentMstRid, consentState, "N", formXml, dataXml,
|
|
|
+ deviceType, deviceIdentNo, vistType, hosType, clnDate,
|
|
|
+ ward, roomCd, string.Empty, orderNo, orderName, orderCd, ocrCode, cretNo,
|
|
|
+ createUserName, modifyUserName, null, null, null, mainDrId,
|
|
|
+ userDeptCd, pageCnt, actKind, clientType, opRsrvNo);
|
|
|
|
|
|
result.responseData = Convert.ToString(consentMstRid);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public int SaveData(string userId, string userDeptCd, string pid, string formId, string formCd, string patientDeptCd, string formXml, string dataXml,
|
|
|
- int consentMstRid, int reWriteConsentMstRid, string deviceType, string deviceMacAddr, string ordType, string instCd, string inDd, string dSchDd,
|
|
|
- string ward, string roomCd, string ocrTag, int cretNo, string mainDrId, string formPageCnt, string actionKind, string opRsrvNo, string consentState,
|
|
|
- int orderNo, string orderName, string orderCd, string audioFileJson, string audioFileSize, string imageFileJson, string fileSize) {
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// Saves the data.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="userId">The user identifier.</param>
|
|
|
+ /// <param name="patientCode">The patient code.</param>
|
|
|
+ /// <param name="clnDeptCode">The CLN dept code.</param>
|
|
|
+ /// <param name="formRid">The form rid.</param>
|
|
|
+ /// <param name="formCd">The form cd.</param>
|
|
|
+ /// <param name="consentMstRid">The consent MST rid.</param>
|
|
|
+ /// <param name="rewriteConsentMstRid">The rewrite consent MST rid.</param>
|
|
|
+ /// <param name="reissueConsentMstRid">The reissue consent MST rid.</param>
|
|
|
+ /// <param name="consentState">State of the consent.</param>
|
|
|
+ /// <param name="paperYn">The paper yn.</param>
|
|
|
+ /// <param name="formXml">The form XML.</param>
|
|
|
+ /// <param name="dataXml">The data XML.</param>
|
|
|
+ /// <param name="deviceType">Type of the device.</param>
|
|
|
+ /// <param name="deviceIdentNo">The device ident no.</param>
|
|
|
+ /// <param name="vistType">Type of the vist.</param>
|
|
|
+ /// <param name="hosType">Type of the hos.</param>
|
|
|
+ /// <param name="clnDate">The CLN date.</param>
|
|
|
+ /// <param name="ward">The ward.</param>
|
|
|
+ /// <param name="roomcd">The roomcd.</param>
|
|
|
+ /// <param name="reasonForUseN">The reason for use n.</param>
|
|
|
+ /// <param name="orderNo">The order no.</param>
|
|
|
+ /// <param name="orderName">Name of the order.</param>
|
|
|
+ /// <param name="orderCd">The order cd.</param>
|
|
|
+ /// <param name="ocrCode">The ocr code.</param>
|
|
|
+ /// <param name="cretno">The cretno.</param>
|
|
|
+ /// <param name="createUserName">Name of the create user.</param>
|
|
|
+ /// <param name="modifyUserName">Name of the modify user.</param>
|
|
|
+ /// <param name="imageFileName">Name of the image file.</param>
|
|
|
+ /// <param name="certTarget">The cert target.</param>
|
|
|
+ /// <param name="certResult">The cert result.</param>
|
|
|
+ /// <param name="mainDrId">The main dr identifier.</param>
|
|
|
+ /// <param name="userDeptCd">The user dept cd.</param>
|
|
|
+ /// <param name="pageCnt">The page count.</param>
|
|
|
+ /// <param name="actKind">Kind of the act.</param>
|
|
|
+ /// <param name="clientType">Type of the client.</param>
|
|
|
+ /// <param name="opRsrvNo">The op RSRV no.</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private int SaveData(string userId, string patientCode, string clnDeptCode, int formRid, string formCd,
|
|
|
+ int consentMstRid, int rewriteConsentMstRid, int reissueConsentMstRid, string consentState, string paperYn, string formXml, string dataXml,
|
|
|
+ string deviceType, string deviceIdentNo, string vistType, string hosType, string clnDate,
|
|
|
+ string ward, string roomcd, string reasonForUseN, int orderNo, string orderName, string orderCd, string ocrCode, int cretno,
|
|
|
+ string createUserName, string modifyUserName, string imageFileName, string certTarget, string certResult,
|
|
|
+ string mainDrId, string userDeptCd, string pageCnt, string actKind, string clientType, string opRsrvNo) {
|
|
|
+
|
|
|
bool isNewConsentMasterCase = false;
|
|
|
if (consentMstRid < 1) {
|
|
|
isNewConsentMasterCase = true;
|
|
@@ -806,94 +830,78 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
try {
|
|
|
using (SaveConsentDac dac = new SaveConsentDac()) {
|
|
|
|
|
|
- int updateResult = 0;
|
|
|
- int deleteResult = 0;
|
|
|
+ Hashtable paramHashTable = GetParamHashTable(userId, patientCode, clnDeptCode, formRid, formCd, consentMstRid, rewriteConsentMstRid,
|
|
|
+ reissueConsentMstRid, consentState, paperYn, formXml, dataXml, deviceType, deviceIdentNo,
|
|
|
+ vistType, hosType, clnDate, ward, roomcd, reasonForUseN,
|
|
|
+ orderNo, orderName, orderCd, ocrCode, cretno, createUserName, modifyUserName,
|
|
|
+ certTarget, certResult, mainDrId, opRsrvNo, pageCnt);
|
|
|
|
|
|
- Hashtable imrParam = new Hashtable();
|
|
|
- imrParam.Add("ocrTag", "'" + ocrTag + "%'");
|
|
|
- int imrCount = (int) dac.ImrCount(this.IbatisMapper, imrParam);
|
|
|
+ consentMstRid = (int) paramHashTable["consentMstRid"];
|
|
|
+
|
|
|
+ //새로 작성하는 경우
|
|
|
+ if (isNewConsentMasterCase) {
|
|
|
+ //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("");
|
|
|
+ dac.InsertConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
+ dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
|
|
|
- ImrData imrData = new ImrData();
|
|
|
- if (imrCount > 0) {
|
|
|
- imrData = (ImrData) dac.ImrData(this.IbatisMapper, imrParam);
|
|
|
- }
|
|
|
+ } else { //새로 작성 아닌 경우
|
|
|
|
|
|
- Hashtable paramHashTable = GetParamHashTable(userId, userDeptCd, pid, formId, formCd, patientDeptCd, formXml, dataXml,
|
|
|
- consentMstRid, reWriteConsentMstRid, deviceType, deviceMacAddr, ordType, instCd, inDd,
|
|
|
- ward, roomCd, ocrTag, cretNo, mainDrId, formPageCnt, actionKind, opRsrvNo, consentState,
|
|
|
- orderNo, orderName, orderCd, null, null);
|
|
|
+ if (reissueConsentMstRid > 0) {
|
|
|
|
|
|
- //reasonForUseN
|
|
|
- paramHashTable.Add("macAddress", deviceMacAddr);
|
|
|
- consentMstRid = (int) paramHashTable["consentMstRid"];
|
|
|
+ if (string.IsNullOrEmpty(reasonForUseN)) {
|
|
|
+ //종이->종이 재발행
|
|
|
+ int newConsentMstRid = this.GetSequence("CONSENT_MST");
|
|
|
+ paramHashTable["consentMstRid"] = newConsentMstRid;
|
|
|
+ consentMstRid = newConsentMstRid;
|
|
|
|
|
|
- if (isNewConsentMasterCase == true) {
|
|
|
- dac.InsertConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
- dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
- } else {
|
|
|
- dac.UpdateConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
- dac.UpdateConsentData(this.IbatisMapper, paramHashTable);
|
|
|
- }
|
|
|
+ dac.InsertConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
+ dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(audioFileJson)) {
|
|
|
- audioUpLoad(dac, paramHashTable, userId, consentMstRid, formId, audioFileJson, audioFileSize, ocrTag, pid);
|
|
|
- }
|
|
|
+ } else { // 삭제
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(imageFileJson)) {
|
|
|
- imageUpload(dac, paramHashTable, userId, pid, ordType, inDd, dSchDd, cretNo, ocrTag, consentMstRid, consentState, formCd, formId, dataXml, imageFileJson, instCd, patientDeptCd, fileSize);
|
|
|
- }
|
|
|
+ dac.UpdateConsentMstForDelete(this.IbatisMapper, paramHashTable);
|
|
|
|
|
|
- if (imrCount > 0) {
|
|
|
- String[] strAr = imrData.fileName.Split(new char[] { '_' });
|
|
|
- imrData.fileName = strAr[0] + "_" + strAr[1];
|
|
|
+ }
|
|
|
|
|
|
- imrParam.Add("fileName", "'" + imrData.fileName + "%'");
|
|
|
- imrParam.Add("inputDate", imrData.inputDate);
|
|
|
- imrParam.Add("userId", imrData.userId);
|
|
|
+ } else { //임시저장 또는 저장인 경우
|
|
|
|
|
|
- updateResult = dac.ImrScanFileUpdate(this.IbatisMapper, imrParam);
|
|
|
- if (updateResult > 0) {
|
|
|
- deleteResult = dac.ImrScanFileDelete(this.IbatisMapper, imrParam);
|
|
|
- }
|
|
|
+ dac.UpdateConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
+ dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
|
|
|
- if (imrCount != deleteResult) {
|
|
|
- throw new Exception();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+ // OCR 테이블 연계
|
|
|
Hashtable ocrParam = new Hashtable {
|
|
|
- { "instcd", instCd },
|
|
|
- { "ocrtag", ocrTag },
|
|
|
- { "pid", pid },
|
|
|
- { "ordtype", ordType },
|
|
|
- { "orddd", inDd },
|
|
|
- { "cretno", cretNo },
|
|
|
+ { "instcd", hosType },
|
|
|
+ { "ocrtag", ocrCode },
|
|
|
+ { "pid", patientCode },
|
|
|
+ { "ordtype", vistType },
|
|
|
+ { "orddd", clnDate },
|
|
|
+ { "cretno", cretno },
|
|
|
{ "orddrid", mainDrId },
|
|
|
- { "orddeptcd", patientDeptCd },
|
|
|
+ { "orddeptcd", clnDeptCode },
|
|
|
{ "formcd", formCd },
|
|
|
{ "fstprntdeptcd", userDeptCd },
|
|
|
{ "fstprntid", userId },
|
|
|
{ "updtdeptcd", userDeptCd },
|
|
|
{ "updtuserid", userId },
|
|
|
{ "updtdt", DateTime.Now.ToString("yyyyMMddHHmmss")},
|
|
|
- { "pagecnt", formPageCnt },
|
|
|
- //{ "updtresncnts", reasonForUseN },
|
|
|
- { "actkind", actionKind },
|
|
|
- { "clienttype", "M" }
|
|
|
+ { "pagecnt", pageCnt },
|
|
|
+ { "updtresncnts", reasonForUseN },
|
|
|
+ { "actkind", actKind },
|
|
|
+ { "clienttype", clientType }
|
|
|
};
|
|
|
|
|
|
dac.InsertPrintData(this.IbatisMapper, ocrParam);
|
|
|
-
|
|
|
- if (this.IbatisSession != null) this.IbatisSession.CommitTransaction();
|
|
|
-
|
|
|
}
|
|
|
} catch (Exception ex) {
|
|
|
if (this.IbatisSession != null) this.IbatisSession.RollBackTransaction();
|
|
|
CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SaveData ERROR : [{0}]", ex.ToString()));
|
|
|
+ return -1;
|
|
|
throw ex;
|
|
|
+ } finally {
|
|
|
}
|
|
|
-
|
|
|
return consentMstRid;
|
|
|
}
|
|
|
|
|
@@ -1002,93 +1010,6 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private Hashtable GetParamHashTable(string userId, string userDeptCd, string pid, string formId, string formCd, string patientDeptCd, string formXml, string dataXml,
|
|
|
- int consentMstRid, int reWriteConsentMstRid, string deviceType, string deviceMacAddr, string ordType, string instCd, string inDd,
|
|
|
- string ward, string roomCd, string ocrTag, int cretNo, string mainDrId, string formPageCnt, string actionKind, string opRsrvNo, string consentState,
|
|
|
- int orderNo, string orderName, string orderCd, string certResult, string certTarget) {
|
|
|
-
|
|
|
- Hashtable paramHashTable = new Hashtable();
|
|
|
- paramHashTable.Add("userId", userId);
|
|
|
-
|
|
|
- if (consentMstRid < 1) {
|
|
|
- consentMstRid = this.GetSequence("CONSENT_MST");
|
|
|
- }
|
|
|
-
|
|
|
- paramHashTable.Add("consentMstRid", consentMstRid);
|
|
|
- paramHashTable.Add("patientCode", pid);
|
|
|
- paramHashTable.Add("clnDeptCd", patientDeptCd);
|
|
|
- paramHashTable.Add("vistType", ordType);
|
|
|
- paramHashTable.Add("hosType", instCd);
|
|
|
- paramHashTable.Add("clnDate", inDd);
|
|
|
- paramHashTable.Add("ward", ward);
|
|
|
- paramHashTable.Add("roomcd", roomCd);
|
|
|
- paramHashTable.Add("orderNo", orderNo);
|
|
|
- paramHashTable.Add("orderName", orderName);
|
|
|
- paramHashTable.Add("orderCd", orderCd);
|
|
|
- paramHashTable.Add("ocrCode", ocrTag);
|
|
|
- paramHashTable.Add("cretno", cretNo);
|
|
|
- paramHashTable.Add("createUserName", userId);
|
|
|
- paramHashTable.Add("modifyUserName", userId);
|
|
|
- paramHashTable.Add("formRid", formId);
|
|
|
- paramHashTable.Add("formCd", formCd);
|
|
|
- paramHashTable.Add("consentState", consentState);
|
|
|
- paramHashTable.Add("certTarget", certTarget); // TODO 원무 pass
|
|
|
- paramHashTable.Add("certResult", certResult); // TODO 원무 pass
|
|
|
- paramHashTable.Add("mainDrId", mainDrId);
|
|
|
- paramHashTable.Add("opRsrvNo", opRsrvNo ?? string.Empty);
|
|
|
-
|
|
|
- string completeYn = "N"; // 완료 여부
|
|
|
- switch (consentState) {
|
|
|
- case "ELECTR_CMP":
|
|
|
- case "CERTIFY_CMP":
|
|
|
- completeYn = "Y";
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- paramHashTable.Add("completeYn", completeYn);
|
|
|
-
|
|
|
- string completeDateTimeToChars = string.Empty;
|
|
|
- if (completeYn.Equals("Y")) {
|
|
|
- completeDateTimeToChars = "TO_CHAR(SYSDATE,'YYYY-MM-DD hh24:mi:ss')";
|
|
|
- paramHashTable.Add("completeDateTimeToChars", completeDateTimeToChars);
|
|
|
- } else {
|
|
|
- paramHashTable.Add("completeDateTimeToChars", "''");
|
|
|
- }
|
|
|
-
|
|
|
- string rewriteYn = "N"; // 재 작성 여부
|
|
|
- if (reWriteConsentMstRid > 1) {
|
|
|
- rewriteYn = "Y";
|
|
|
- }
|
|
|
- paramHashTable.Add("rewriteYn", rewriteYn);
|
|
|
- paramHashTable.Add("rewriteConsentMstRid", reWriteConsentMstRid);
|
|
|
-
|
|
|
- int consentDataRid = this.GetSequence("CONSENT_DATA");
|
|
|
- paramHashTable.Add("consentDataRid", consentDataRid);
|
|
|
-
|
|
|
- paramHashTable.Add("useYn", "Y");
|
|
|
-
|
|
|
- Encoding encoding = Encoding.GetEncoding("UTF-8");
|
|
|
-
|
|
|
- byte[] formBytesConent = null;
|
|
|
- if (!string.IsNullOrEmpty(formXml)) {
|
|
|
- formBytesConent = encoding.GetBytes(formXml);
|
|
|
- }
|
|
|
- byte[] dataBytesConent = null;
|
|
|
- if (!string.IsNullOrEmpty(dataXml)) {
|
|
|
- dataBytesConent = encoding.GetBytes(dataXml);
|
|
|
- }
|
|
|
- paramHashTable.Add("formXml", formBytesConent);
|
|
|
- paramHashTable.Add("dataXml", dataBytesConent);
|
|
|
-
|
|
|
- paramHashTable.Add("deviceType", deviceType);
|
|
|
- paramHashTable.Add("deviceMacAddr", deviceMacAddr);
|
|
|
- paramHashTable.Add("pageCnt", formPageCnt);
|
|
|
- //paramHashTable.Add("reasonForUseN", reasonForUseN);
|
|
|
-
|
|
|
- return paramHashTable;
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 일괄인증저장
|
|
|
/// </summary>
|
|
@@ -1206,61 +1127,87 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 임시저장, 확인저장
|
|
|
+ /// 전자 동의서를 완료저장 한다.
|
|
|
/// </summary>
|
|
|
/// <param name="userId">로그인 사용자ID</param>
|
|
|
- /// <param name="userDeptCd">로그인 사용자 부서 코드</param>
|
|
|
- /// <param name="pid">환자 등록번호</param>
|
|
|
- /// <param name="formId">서식 ID</param>
|
|
|
- /// <param name="formCd">서식 코드</param>
|
|
|
- /// <param name="patientDeptCd">환자가 내원한, 속해있는 부서 코드</param>
|
|
|
- /// <param name="formXml">서식 정보</param>
|
|
|
- /// <param name="dataXml">사용자가 작성한 서식 내용</param>
|
|
|
+ /// <param name="patientCode">환자 등록번호</param>
|
|
|
+ /// <param name="clnDeptCode">진료과 코드</param>
|
|
|
+ /// <param name="formRid">(작성대상)서식 Rid</param>
|
|
|
+ /// <param name="formCd">서식코드</param>
|
|
|
/// <param name="consentMstRid">동의서 마스터 데이터 Rid</param>
|
|
|
- /// <param name="reWriteconsentMstRid">재 작성 대상 동의서 마스터 데이터 Rid</param>
|
|
|
+ /// <param name="rewriteConsentMstRid">재 작성 대상 동의서 마스터 데이터 Rid</param>
|
|
|
+ /// <param name="formXml">동의서 EPT Xml</param>
|
|
|
+ /// <param name="dataXml">동의서 Data(필드들) Xml</param>
|
|
|
/// <param name="deviceType">장비 유형 (WIN, AND, IOS, PRT 중1)</param>
|
|
|
- /// <param name="deviceMacAddr">장비 고유 식별자</param>
|
|
|
- /// <param name="ordType">내원 구분 입원 : I, 외래 : O, 수술 : OP, 응급 : ER</param>
|
|
|
- /// <param name="instCd">근무지 기관코드</param>
|
|
|
- /// <param name="inDd">내원 일자 입원 : inDd, 외래 : ordDd</param>
|
|
|
- /// <param name="ward">병동</param>
|
|
|
- /// <param name="roomCd">병실</param>
|
|
|
- /// <param name="ocrTag">ocrTag</param>
|
|
|
- /// <param name="cretNo">생성번호</param>
|
|
|
- /// <param name="mainDrId">환자를 담당하는 의사(담당교수, 주치의, 담당의사 등)</param>
|
|
|
- /// <param name="formPageCnt">동의서 총 장수</param>
|
|
|
- /// <param name="actionKind">임시저장 : T, 인증저장 : C</param>
|
|
|
- /// <param name="opRsrvNo">수술번호</param>
|
|
|
- /// <param name="consentState">동의서 상태</param>
|
|
|
- /// <param name="orderNo">처방번호</param> 20190822 원형만 유지하되 당장 사용하지 않음
|
|
|
- /// <param name="orderName">처방 이름</param> 20190822 원형만 유지하되 당장 사용하지 않음
|
|
|
- /// <param name="orderCd">처방 코드?</param> 20190822 원형만 유지하되 당장 사용하지 않음
|
|
|
+ /// <param name="deviceIdentNo">장비 고유 식별자</param>
|
|
|
+ /// <param name="vistType">내원구분</param>
|
|
|
+ /// <param name="hosType">병원 구분</param>
|
|
|
+ /// <param name="clnDate">병원 구분이 "I" 일 경우 입원일자/병원 구분이 "O"일 경우 진료일자</param>
|
|
|
+ /// <param name="ward">병동 코드</param>
|
|
|
+ /// <param name="roomcd">병실 코드</param>
|
|
|
+ /// <param name="orderNo">처방번호</param>
|
|
|
+ /// <param name="orderCd">처방코드</param>
|
|
|
+ /// <param name="orderName">처방명</param>
|
|
|
+ /// <param name="createUserName">작성자명</param>
|
|
|
+ /// <param name="modifyUserName">수정자명</param>
|
|
|
/// <param name="imageFileJson">이미지 파일 정보(전자동의서 서버)</param>
|
|
|
- /// <param name="fileSize">이미지 파일 사이즈(전자동의서 서버)</param>
|
|
|
- /// <param name="audioFileJson">오디오 파일 정보(전자동의서 서버)</param>
|
|
|
- /// <param name="audioFileSize">오디오 파일 사이즈</param>
|
|
|
+ /// <param name="certTarget">이미지 파일 공인인증 대상정보</param>
|
|
|
+ /// <param name="certResult">이미지 파일 공인인증 처리정보</param>
|
|
|
+ /// <param name="dschdd">퇴원일자</param>
|
|
|
+ /// <param name="consentState">상태</param>
|
|
|
+ /// <param name="mainDrId">주치의 아이디</param>
|
|
|
+ /// <param name="userDeptCd">사용자 부서 코드</param>
|
|
|
+ /// <param name="pageCnt">동의서 매수</param>
|
|
|
+ /// <param name="actKind">동작코드(T: 임시 저장, C: 인증 저장, P: 출력, CP: 삭제)</param>
|
|
|
+ /// <param name="clientType">Client구분 (P: PC, M: 모바일)</param>
|
|
|
+ /// <param name="fileSize">이미지 파일 사이즈</param>
|
|
|
[WebMethod(Description = "동의서 서명 완료")]
|
|
|
- public SingleReturnData SaveCompleteAll(string userId, string userDeptCd, string pid, string formId, string formCd, string patientDeptCd, string formXml, string dataXml,
|
|
|
- int consentMstRid, int reWriteConsentMstRid, string deviceType, string deviceMacAddr, string ordType, string instCd, string inDd, string dSchDd,
|
|
|
- string ward, string roomCd, string ocrTag, int cretNo, string mainDrId, string formPageCnt, string actionKind, string opRsrvNo, string consentState,
|
|
|
- int orderNo, string orderName, string orderCd, string imageFileJson, string fileSize, string certResult, string certTarget,
|
|
|
- string audioFileJson, string audioFileSize) {
|
|
|
+ public SingleReturnData SaveCompleteAll(string userId, string patientCode, string clnDeptCode, int formRid, string formCd,
|
|
|
+ int consentMstRid, int rewriteConsentMstRid, string formXml, string dataXml,
|
|
|
+ string deviceType, string deviceIdentNo, string vistType, string hosType, string clnDate,
|
|
|
+ string ward, string roomCd, int orderNo, string orderName, string orderCd, string ocrCode, int cretNo,
|
|
|
+ string createUserName, string modifyUserName, string imageFileJson, string certTarget, string certResult,
|
|
|
+ string dschDd, string consentState, string mainDrId,
|
|
|
+ string userDeptCd, string pageCnt, string actKind, string clientType, string opRsrvNo, string fileSize) {
|
|
|
|
|
|
SingleReturnData result = new SingleReturnData();
|
|
|
|
|
|
- consentMstRid = SaveDataAll(userId, userDeptCd, pid, formId, formCd, patientDeptCd, formXml, dataXml,
|
|
|
- consentMstRid, reWriteConsentMstRid, deviceType, deviceMacAddr, ordType, instCd, inDd, dSchDd,
|
|
|
- ward, roomCd, ocrTag, cretNo, mainDrId, formPageCnt, actionKind, opRsrvNo, consentState,
|
|
|
- orderNo, orderName, orderCd, imageFileJson, fileSize, certResult, certTarget, audioFileJson, audioFileSize, out int rslt);
|
|
|
+ //string paramLog = "";
|
|
|
+ //paramLog += "clnDept[" + userId + "]patientCode[" + patientCode + "]clnDeptCode[" + clnDeptCode + "]formRid[" + formRid + "]";
|
|
|
+ //paramLog += "formCd[" + formCd + "]consentMstRid[" + consentMstRid + "]rewriteConsentMstRid[" + rewriteConsentMstRid + "]";
|
|
|
+ //paramLog += "deviceType[" + deviceType + "]vistType[" + vistType + "]hosType[" + hosType + "]";
|
|
|
+ //paramLog += "clnDate[" + clnDate + "]ward[" + ward + "]roomcd[" + roomCd + "]orderNo[" + orderNo + "]";
|
|
|
+ //paramLog += "orderName[" + orderName + "]orderCd[" + orderCd + "]ocrCode[" + ocrCode + "]cretno[" + cretNo + "]";
|
|
|
+ //paramLog += "createUserName[" + createUserName + "]modifyUserName[" + modifyUserName + "]imageFileJson[" + imageFileJson + "]certTarget[" + certTarget + "]";
|
|
|
+ //paramLog += "dschdd[" + dschDd + "]consentState[" + consentState + "]mainDrId[" + mainDrId + "]";
|
|
|
+ //paramLog += "dataXml[" + dataXml + "]formXml[" + formXml + "]certResult[" + certResult + "]" + "fileSize[" + fileSize + "]";
|
|
|
+ //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("CLIP.eForm SaveCompleteAll param : " + paramLog);
|
|
|
+ CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("json : " + imageFileJson);
|
|
|
+
|
|
|
+ int reissueConsentMstRid = 0;
|
|
|
+ string paperYn = "N";
|
|
|
+ string reasonForUseN = string.Empty;
|
|
|
+
|
|
|
+ rewriteConsentMstRid = 0;
|
|
|
+
|
|
|
+ consentMstRid = SaveDataAll(userId, patientCode, clnDeptCode, formRid, formCd,
|
|
|
+ consentMstRid, rewriteConsentMstRid, reissueConsentMstRid, consentState, paperYn, formXml, dataXml,
|
|
|
+ deviceType, deviceIdentNo, vistType, hosType, clnDate,
|
|
|
+ ward, roomCd, reasonForUseN, orderNo, orderName, orderCd, ocrCode, cretNo,
|
|
|
+ createUserName, modifyUserName, imageFileJson, certTarget, certResult, dschDd, mainDrId,
|
|
|
+ userDeptCd, pageCnt, actKind, clientType, opRsrvNo, fileSize);
|
|
|
|
|
|
- result.responseData = Convert.ToString(rslt);
|
|
|
+ result.responseData = Convert.ToString(consentMstRid);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public int SaveDataAll(string userId, string userDeptCd, string pid, string formId, string formCd, string patientDeptCd, string formXml, string dataXml,
|
|
|
- int consentMstRid, int reWriteConsentMstRid, string deviceType, string deviceMacAddr, string ordType, string instCd, string inDd, string dSchDd,
|
|
|
- string ward, string roomCd, string ocrTag, int cretNo, string mainDrId, string formPageCnt, string actionKind, string opRsrvNo, string consentState,
|
|
|
- int orderNo, string orderName, string orderCd, string imageFileJson, string fileSize, string certResult, string certTarget, string audioFileJson, string audioFileSize, out int result) {
|
|
|
+ private int SaveDataAll(string userId, string patientCode, string clnDeptCode, int formRid, string formCd,
|
|
|
+ int consentMstRid, int rewriteConsentMstRid, int reissueConsentMstRid, string consentState, string paperYn, string formXml, string dataXml,
|
|
|
+ string deviceType, string deviceIdentNo, string vistType, string hosType, string clnDate,
|
|
|
+ string ward, string roomcd, string reasonForUseN, int orderNo, string orderName, string orderCd, string ocrCode, int cretno,
|
|
|
+ string createUserName, string modifyUserName, string imageFileJson, string certTarget,
|
|
|
+ string certResult, string dschdd, string mainDrId,
|
|
|
+ string userDeptCd, string pageCnt, string actKind, string clientType, string opRsrvNo, string fileSize) {
|
|
|
|
|
|
bool isNewConsentMasterCase = false;
|
|
|
if (consentMstRid < 1) {
|
|
@@ -1273,119 +1220,135 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
|
|
|
try {
|
|
|
using (SaveConsentDac dac = new SaveConsentDac()) {
|
|
|
+ Hashtable paramHashTable = GetParamHashTable(userId, patientCode, clnDeptCode, formRid, formCd, consentMstRid, rewriteConsentMstRid,
|
|
|
+ reissueConsentMstRid, consentState, paperYn, formXml, dataXml, deviceType, deviceIdentNo,
|
|
|
+ vistType, hosType, clnDate, ward, roomcd, reasonForUseN,
|
|
|
+ orderNo, orderName, orderCd, ocrCode, cretno, createUserName, modifyUserName,
|
|
|
+ certTarget, certResult, mainDrId, opRsrvNo, pageCnt);
|
|
|
|
|
|
- int updateResult = 0;
|
|
|
- int deleteResult = 0;
|
|
|
-
|
|
|
- Hashtable imrParam = new Hashtable();
|
|
|
- imrParam.Add("ocrTag", "'" + ocrTag + "%'");
|
|
|
- int imrCount = (int) dac.ImrCount(this.IbatisMapper, imrParam);
|
|
|
-
|
|
|
- ImrData imrData = new ImrData();
|
|
|
- if (imrCount > 0) {
|
|
|
- imrData = (ImrData) dac.ImrData(this.IbatisMapper, imrParam);
|
|
|
- }
|
|
|
-
|
|
|
- Hashtable paramHashTable = GetParamHashTable(userId, userDeptCd, pid, formId, formCd, patientDeptCd, formXml, dataXml,
|
|
|
- consentMstRid, reWriteConsentMstRid, deviceType, deviceMacAddr, ordType, instCd, inDd,
|
|
|
- ward, roomCd, ocrTag, cretNo, mainDrId, formPageCnt, actionKind, opRsrvNo, consentState,
|
|
|
- orderNo, orderName, orderCd, certResult, certTarget);
|
|
|
-
|
|
|
- paramHashTable.Add("macAddress", deviceMacAddr);
|
|
|
consentMstRid = (int) paramHashTable["consentMstRid"];
|
|
|
- result = consentMstRid;
|
|
|
|
|
|
- if (isNewConsentMasterCase == true) {
|
|
|
+ //새로 작성하는 경우
|
|
|
+ if (isNewConsentMasterCase) {
|
|
|
dac.InsertConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
- imageUpload(dac, paramHashTable, userId, pid, ordType, inDd, dSchDd, cretNo, ocrTag, consentMstRid, consentState, formCd, formId, dataXml, imageFileJson, instCd, patientDeptCd, fileSize);
|
|
|
- } else {
|
|
|
|
|
|
- if (consentState == "CERTIFY_CMP" && reWriteConsentMstRid > 0) {
|
|
|
+
|
|
|
+ /*
|
|
|
+ imageUpload(dac, paramHashTable, userId
|
|
|
+ , patientCode, vistType, clnDate, dschdd, cretno, ocrCode
|
|
|
+ , consentMstRid, consentState, formCd, formRid, dataXml
|
|
|
+ , imageFileJson, certTarget, certResult, hosType, createUserName, hosType, fileSize);
|
|
|
+ */
|
|
|
+ }
|
|
|
+ //새로 작성 아닌 경우
|
|
|
+ else {
|
|
|
+ if (reissueConsentMstRid > 0) {
|
|
|
+ //종이->종이 재발행
|
|
|
int newConsentMstRid = this.GetSequence("CONSENT_MST");
|
|
|
- paramHashTable["rewriteConsentMstRid"] = newConsentMstRid;
|
|
|
- dac.ReWriteUpdateConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
-
|
|
|
+ paramHashTable["consentMstRid"] = newConsentMstRid;
|
|
|
consentMstRid = newConsentMstRid;
|
|
|
- paramHashTable["consentMstRid"] = consentMstRid;
|
|
|
- paramHashTable["rewriteYn"] = "N";
|
|
|
- paramHashTable["useYn"] = "Y";
|
|
|
- paramHashTable["rewriteConsentMstRid"] = 0;
|
|
|
|
|
|
dac.InsertConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
- imageUpload(dac, paramHashTable, userId, pid, ordType, inDd, dSchDd, cretNo, ocrTag, consentMstRid, consentState, formCd, formId, dataXml, imageFileJson, instCd, patientDeptCd, fileSize);
|
|
|
- } else {
|
|
|
- dac.UpdateConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
- dac.UpdateConsentData(this.IbatisMapper, paramHashTable);
|
|
|
- imageUpload(dac, paramHashTable, userId, pid, ordType, inDd, dSchDd, cretNo, ocrTag, consentMstRid, consentState, formCd, formId, dataXml, imageFileJson, instCd, patientDeptCd, fileSize);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(audioFileJson)) {
|
|
|
- audioUpLoad(dac, paramHashTable, userId, consentMstRid, formId, audioFileJson, audioFileSize, ocrTag, pid);
|
|
|
- }
|
|
|
-
|
|
|
- if (imrCount > 0) {
|
|
|
- String[] strAr = imrData.fileName.Split(new char[] { '_' });
|
|
|
- imrData.fileName = strAr[0] + "_" + strAr[1];
|
|
|
-
|
|
|
- imrParam.Add("fileName", "'" + imrData.fileName + "%'");
|
|
|
- imrParam.Add("inputDate", imrData.inputDate);
|
|
|
- imrParam.Add("userId", imrData.userId);
|
|
|
-
|
|
|
- updateResult = dac.ImrScanFileUpdate(this.IbatisMapper, imrParam);
|
|
|
- if (updateResult > 0) {
|
|
|
- deleteResult = dac.ImrScanFileDelete(this.IbatisMapper, imrParam);
|
|
|
}
|
|
|
+ //임시저장 또는 저장인 경우
|
|
|
+ else {
|
|
|
|
|
|
- if (imrCount != deleteResult) {
|
|
|
- throw new Exception();
|
|
|
+ dac.UpdateConsentMst(this.IbatisMapper, paramHashTable);
|
|
|
+ dac.InsertConsentData(this.IbatisMapper, paramHashTable);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ imageSaveData(dac, imageFileJson, consentMstRid, userId, formRid);
|
|
|
+
|
|
|
+ // OCR 테이블 연계
|
|
|
Hashtable ocrParam = new Hashtable {
|
|
|
- { "instcd", instCd },
|
|
|
- { "ocrtag", ocrTag },
|
|
|
- { "pid", pid },
|
|
|
- { "ordtype", ordType },
|
|
|
- { "orddd", inDd },
|
|
|
- { "cretno", cretNo },
|
|
|
+ { "instcd", hosType },
|
|
|
+ { "ocrtag", ocrCode },
|
|
|
+ { "pid", patientCode },
|
|
|
+ { "ordtype", vistType },
|
|
|
+ { "orddd", clnDate },
|
|
|
+ { "cretno", cretno },
|
|
|
{ "orddrid", mainDrId },
|
|
|
- { "orddeptcd", patientDeptCd },
|
|
|
+ { "orddeptcd", clnDeptCode },
|
|
|
{ "formcd", formCd },
|
|
|
{ "fstprntdeptcd", userDeptCd },
|
|
|
{ "fstprntid", userId },
|
|
|
{ "updtdeptcd", userDeptCd },
|
|
|
{ "updtuserid", userId },
|
|
|
{ "updtdt", DateTime.Now.ToString("yyyyMMddHHmmss")},
|
|
|
- { "pagecnt", formPageCnt },
|
|
|
- //{ "updtresncnts", reasonForUseN },
|
|
|
- { "actkind", actionKind },
|
|
|
- { "clienttype", "M" }
|
|
|
+ { "pagecnt", pageCnt },
|
|
|
+ { "updtresncnts", reasonForUseN },
|
|
|
+ { "actkind", actKind },
|
|
|
+ { "clienttype", clientType }
|
|
|
};
|
|
|
|
|
|
- dac.InsertPrintData(this.IbatisMapper, ocrParam, isNewConsentMasterCase);
|
|
|
+ dac.InsertPrintData(this.IbatisMapper, ocrParam);
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ if (this.IbatisSession != null) this.IbatisSession.RollBackTransaction();
|
|
|
+ CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SaveDataAll ERROR : [{0}]", ex.ToString()));
|
|
|
+ return -1;
|
|
|
+ throw ex;
|
|
|
+ } finally {
|
|
|
+ }
|
|
|
+ return consentMstRid;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void imageSaveData(SaveConsentDac dac, String imageFileJson, int consentMstRid, string userId, int formId) {
|
|
|
+ Dictionary<string, object> jsonRoot = fastJSON.JSON.Parse(imageFileJson) as Dictionary<string, object>;
|
|
|
+ int consentImageRid = this.GetSequence("CONSENT_IMAGE");
|
|
|
+ string sPath = string.Empty;
|
|
|
+ string sFileName = string.Empty;
|
|
|
|
|
|
- //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug("formCd -- > " + formCd);
|
|
|
- if (formCd == "1200005463" || formCd == "1800014564") {
|
|
|
- SavePatientConsentInfo(formCd, pid, ocrTag, userId, dataXml);
|
|
|
+ int nowCnt = 1;
|
|
|
+
|
|
|
+ try {
|
|
|
+ foreach (KeyValuePair<string, object> jr in jsonRoot) {
|
|
|
+ Hashtable imageHashTable = new Hashtable();
|
|
|
+ imageHashTable.Add("consentMstRid", consentMstRid);
|
|
|
+
|
|
|
+ consentImageRid = this.GetSequence("CONSENT_IMAGE");
|
|
|
+
|
|
|
+ imageHashTable.Add("consentImageRid", consentImageRid);
|
|
|
+ imageHashTable.Add("userId", userId);
|
|
|
+ imageHashTable.Add("formRid", formId);
|
|
|
+
|
|
|
+ if (jr.Value != null && !string.IsNullOrEmpty(jr.Value.ToString())) {
|
|
|
+ sPath = "";
|
|
|
+ sFileName = "";
|
|
|
+ string[] filePath = jr.Value.ToString().Split('/');
|
|
|
+
|
|
|
+ for (int i = 0; i < filePath.Length; i++) {
|
|
|
+ if (i == 0) {
|
|
|
+ sPath = filePath[i];
|
|
|
+ } else if ((i + 1) == filePath.Length) {
|
|
|
+ sFileName = filePath[i];
|
|
|
+ } else {
|
|
|
+ sPath += "/" + filePath[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if (this.IbatisSession != null) this.IbatisSession.CommitTransaction();
|
|
|
+ imageHashTable.Add("imagePath", sPath);
|
|
|
+ imageHashTable.Add("imageFilename", sFileName);
|
|
|
+ imageHashTable.Add("completeYn", "Y");
|
|
|
|
|
|
+ dac.InsertConsentImage(this.IbatisMapper, imageHashTable);
|
|
|
}
|
|
|
- } catch (Exception ex) {
|
|
|
|
|
|
- if (this.IbatisSession != null) this.IbatisSession.RollBackTransaction();
|
|
|
- CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm SaveDataAll ERROR : [{0}]", ex.ToString()));
|
|
|
- result = -1;
|
|
|
+ nowCnt++;
|
|
|
+ } catch(Exception ex) {
|
|
|
+ CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Error(string.Format("CLIP.eForm imageSaveData ERROR : [{0}]", ex.ToString()));
|
|
|
throw ex;
|
|
|
}
|
|
|
|
|
|
- return result;
|
|
|
}
|
|
|
|
|
|
private void imageUpload(SaveConsentDac dac, Hashtable paramHashTable, string userId, string pid, string ordType, string inDd, string dSchDd, int cretNo, string ocrTag,
|
|
@@ -2444,7 +2407,7 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
reissueConsentMstRid, consentState, paperYn, formXml, dataXml, deviceType, deviceIdentNo,
|
|
|
vistType, hosType, clnDate, ward, roomcd, reasonForUseN,
|
|
|
orderNo, orderName, orderCd, ocrCode, cretno, createUserName, modifyUserName,
|
|
|
- certTarget, certResult, mainDrId, opRsrvNo);
|
|
|
+ certTarget, certResult, mainDrId, opRsrvNo, pageCnt);
|
|
|
|
|
|
consentMstRid = (int) paramHashTable["consentMstRid"];
|
|
|
|
|
@@ -2636,7 +2599,8 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
string certTarget, // 서명데이터 원본
|
|
|
string certResult, // 서명데이터 결과값
|
|
|
string mainDrId, // 주치의 아이디
|
|
|
- string opRsrvNo // 수술 예약 번호
|
|
|
+ string opRsrvNo, // 수술 예약 번호
|
|
|
+ string pageCnt
|
|
|
) {
|
|
|
Hashtable paramHashTable = new Hashtable();
|
|
|
paramHashTable.Add("userId", userId);
|
|
@@ -2666,6 +2630,7 @@ namespace CLIP.eForm.Consent.WebService {
|
|
|
paramHashTable.Add("certResult", certResult); // TODO 원무 pass
|
|
|
paramHashTable.Add("mainDrId", mainDrId);
|
|
|
paramHashTable.Add("opRsrvNo", opRsrvNo ?? string.Empty);
|
|
|
+ paramHashTable.Add("pageCnt", pageCnt);
|
|
|
|
|
|
Encoding encoding = Encoding.GetEncoding("UTF-8");
|
|
|
//if (certResult != null)
|