123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837 |
- <?xml version="1.0" encoding="utf-8" ?>
- <sqlMap namespace="CLIP.e-Form.Consent.Dfh" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
- <statements>
- <statement id="GET_PATIENT_DETAIL_INFO" parameterClass="System.Collections.Hashtable" resultMap="PatientMap">
- <![CDATA[
- select #pid# IO_Pt_ID,
- 'M/90y05m' IO_sex_age_y_m,
- '홍길동' IO_Pt_Name,
- '123456-1234567' IO_JuminNo,
- '111' IO_HosType,
- #cretno# IO_CretNo,
- '본관' IO_Ward,
- '906' IO_roomNO,
- '2016-07-01' IO_ADdate,
- #ordtype# IO_VisitType,
- #ordddeptcd# IO_DeptCd,
- #ordddeptcd# IO_DeptNm,
- 'CV' IO_OPdeptCd,
- '신경정신과' IO_OPdeptNm,
- '123456' IO_OPdrId,
- '나의사' IO_OPdrNm,
- '' IO_DxCd,
- '진단명' IO_DxNm,
- null IO_bp, null IO_dm, null IO_heart, null IO_kidney, null IO_respiration,
- null IO_hx, null IO_allergy, null IO_drug, null IO_smoking,
- null IO_idio, null IO_nacrotics, null IO_airway, null IO_hemorrhage,
- '요거이 테스트' IO_status_etc,
- 456 IO_OrderNo,
- '' IO_printtime,
- '' IO_maindrId,
- '' IO_maindrNm,
- '' IO_ocrcd,
- '' IO_INPUTId,
- '' IO_INPUTNM,
- '' IO_SIGNIMG
- from DUAL
- ]]>
- </statement>
-
- <statement id="GET_TRMT_DATE_LIST2" parameterClass="System.Collections.Hashtable" resultMap="ClnDateForDropdownMap">
- <isEqual property="searchType" compareValue="=">
- <![CDATA[
- select '20160701' ClnDate, '2016-07-01' ClnFormatDate, 'CV' VisitType, '외래' VisitTypeName, 'CV' ClnDeptCode, '신경정신과' ClnDeptName
- from DUAL
- ]]>
- </isEqual>
- <isNotEqual property="searchType" compareValue="=">
- <![CDATA[
- select '20160613' ClnDate, '2016-06-13' ClnFormatDate, 'CV' VisitType, '외래' VisitTypeName, 'CV2' ClnDeptCode, '치과' ClnDeptName
- from DUAL
- union
- select '20160625' ClnDate, '2016-06-25' ClnFormatDate, 'CV' VisitType, '외래' VisitTypeName, 'CV' ClnDeptCode, '신경정신과' ClnDeptName
- from DUAL
- union
- select '20160701' ClnDate, '2016-07-01' ClnFormatDate, 'CV' VisitType, '외래' VisitTypeName, 'CV' ClnDeptCode, '신경정신과' ClnDeptName
- from DUAL
- ]]>
- </isNotEqual>
- </statement>
-
- <statement id="GET_TRMT_DATE_LIST" parameterClass="System.Collections.Hashtable" resultMap="ClnDateForDropdownMap">
- <isEqual property="searchType" compareValue="=">
- <![CDATA[
- SELECT '1' AS ORDERBY,
- indd as ClnDate,
- substr(indd, 1, 4) || '-' || substr(indd, 5, 2) || '-' ||
- substr(indd, 7, 2) as ClnFormatDate,
- inpt.ordtype as VisitType,
- case
- when ordtype = 'O' then
- '외래'
- when ordtype = 'I' then
- '입원'
- when ordtype = 'E' then
- '응급'
- end as VisitTypeName,
- dept.deptengabbr as ClnDeptCode,
- dept.depthngnm as ClnDeptName,
- dept.deptcd as DeptCd,
- inpt.cretno,
- inpt.medispclid as orddrid
- FROM pam.pmihinpt inpt
- left outer join com.zsdddept dept
- on (dept.instcd = inpt.instcd and dept.deptcd = inpt.orddeptcd and
- dept.valitodd = '99991231')
- WHERE inpt.instcd = #instcd#
- AND inpt.pid = #pid#
- AND inpt.indd = #searchClnDate#
- AND inpt.histstat = 'Y'
- AND inpt.mskind = 'M'
- AND inpt.ORDDEPTCD = #orddeptcd#
- union all
- SELECT '1' AS ORDERBY,
- orddd as ClnDate,
- substr(orddd, 1, 4) || '-' || substr(orddd, 5, 2) || '-' ||
- substr(orddd, 7, 2) as ClnFormatDate,
- otpt.ordtype as VisitType,
- case
- when ordtype = 'O' then
- '외래'
- when ordtype = 'I' then
- '입원'
- when ordtype = 'E' then
- '응급'
- end as VisitTypeName,
- dept.deptengabbr as ClnDeptCode,
- dept.depthngnm as ClnDeptName,
- dept.deptcd as DeptCd,
- otpt.cretno,
- otpt.orddrid as orddrid
- FROM pam.pmohotpt otpt
- left outer join com.zsdddept dept
- on (dept.instcd = otpt.instcd and dept.deptcd = otpt.orddeptcd and
- dept.valitodd = '99991231')
- WHERE otpt.instcd = #instcd#
- AND otpt.pid = #pid#
- AND otpt.orddd = #searchClnDate#
- AND OTPT.ORDDEPTCD = #orddeptcd#
- AND otpt.HISTSTAT IN ('R', 'T')
- AND otpt.MSKIND = 'M'
- UNION ALL
- SELECT '99' AS ORDERBY,
- indd as ClnDate,
- substr(indd, 1, 4) || '-' || substr(indd, 5, 2) || '-' ||
- substr(indd, 7, 2) as ClnFormatDate,
- inpt.ordtype as VisitType,
- case
- when ordtype = 'O' then
- '외래'
- when ordtype = 'I' then
- '입원'
- when ordtype = 'E' then
- '응급'
- end as VisitTypeName,
- dept.deptengabbr as ClnDeptCode,
- dept.depthngnm as ClnDeptName,
- dept.deptcd as DeptCd,
- inpt.cretno,
- inpt.medispclid as orddrid
- FROM pam.pmihinpt inpt
- left outer join com.zsdddept dept
- on (dept.instcd = inpt.instcd and dept.deptcd = inpt.orddeptcd and
- dept.valitodd = '99991231')
- WHERE inpt.instcd = #instcd#
- AND inpt.pid = #pid#
- AND inpt.indd = #searchClnDate#
- AND inpt.histstat = 'Y'
- AND inpt.mskind = 'M'
- AND inpt.ORDDEPTCD != #orddeptcd#
- union all
- SELECT '99' AS ORDERBY,
- orddd as ClnDate,
- substr(orddd, 1, 4) || '-' || substr(orddd, 5, 2) || '-' ||
- substr(orddd, 7, 2) as ClnFormatDate,
- otpt.ordtype as VisitType,
- case
- when ordtype = 'O' then
- '외래'
- when ordtype = 'I' then
- '입원'
- when ordtype = 'E' then
- '응급'
- end as VisitTypeName,
- dept.deptengabbr as ClnDeptCode,
- dept.depthngnm as ClnDeptName,
- dept.deptcd as DeptCd,
- otpt.cretno,
- otpt.orddrid as orddrid
- FROM pam.pmohotpt otpt
- left outer join com.zsdddept dept
- on (dept.instcd = otpt.instcd and dept.deptcd = otpt.orddeptcd and
- dept.valitodd = '99991231')
- WHERE otpt.instcd = #instcd#
- AND otpt.pid = #pid#
- AND otpt.orddd = #searchClnDate#
- AND OTPT.ORDDEPTCD != #orddeptcd#
- AND otpt.HISTSTAT IN ('R', 'T')
- AND otpt.MSKIND = 'M'
- order by ORDERBY, cretno desc
- ]]>
- </isEqual>
- <isNotEqual property="searchType" compareValue="=">
- <![CDATA[
- SELECT indd as ClnDate,
- substr(indd, 1, 4) || '-' || substr(indd, 5, 2) || '-' ||
- substr(indd, 7, 2) as ClnFormatDate,
- inpt.ordtype as VisitType,
- case
- when ordtype = 'O' then
- '외래'
- when ordtype = 'I' then
- '입원'
- when ordtype = 'E' then
- '응급'
- end as VisitTypeName,
- dept.deptengabbr as ClnDeptCode,
- dept.depthngnm as ClnDeptName,
- inpt.cretno
- FROM pam.pmihinpt inpt
- left outer join com.zsdddept dept
- on (dept.instcd = inpt.instcd and dept.deptcd = inpt.orddeptcd and
- dept.valitodd = '99991231')
- WHERE inpt.instcd = #instcd#
- AND inpt.pid = #pid#
- AND inpt.indd >= #searchClnDate#
- AND inpt.histstat = 'Y'
- AND inpt.mskind = 'M'
- union all
- SELECT orddd as ClnDate,
- substr(orddd, 1, 4) || '-' || substr(orddd, 5, 2) || '-' ||
- substr(orddd, 7, 2) as ClnFormatDate,
- otpt.ordtype as VisitType,
- case
- when ordtype = 'O' then
- '외래'
- when ordtype = 'I' then
- '입원'
- when ordtype = 'E' then
- '응급'
- end as VisitTypeName,
- dept.deptengabbr as ClnDeptCode,
- dept.depthngnm as ClnDeptName,
- otpt.cretno
- FROM pam.pmohotpt otpt
- left outer join com.zsdddept dept
- on (dept.instcd = otpt.instcd and dept.deptcd = otpt.orddeptcd and
- dept.valitodd = '99991231')
- WHERE otpt.instcd = #instcd#
- AND otpt.pid = #pid#
- AND otpt.orddd >= #searchClnDate#
- AND otpt.HISTSTAT IN ('R', 'T')
- AND otpt.MSKIND = 'M'
- ]]>
- </isNotEqual>
- </statement>
-
- <statement id="getPatientInfoOut" parameterClass="System.Collections.Hashtable" resultMap="PatientMap">
- <![CDATA[
- SELECT a.orddeptcd,
- a.pid as IO_Pt_ID,
- to_char(a.cretno) as IO_CretNo,
- ( ptbs.sex || '/' ||
- com.FN_ZZ_GETAGE_REC(ptbs.rrgstno1,
- ptbs.rrgstno2,
- TO_CHAR(SYSDATE, 'YYYYMMDD'),
- 'A',
- ptbs.brthdd)) as IO_sex_age_y_m,
- ptbs.hngnm as IO_Pt_Name,
- (ptbs.rrgstno1 || '-' || substr(ptbs.rrgstno2, 1, 1) ||'******') IO_JuminNo,
- ptbs.zipcdaddr as IO_Zipcdaddr,
- ptbs.mpphontel as IO_Tel,
- (select cdnm from com.zbcmcode where cdgrupid='P0008' and cdid =a.insukind) as IO_Insukind,
- '' as IO_Ward,
- '' as IO_roomNO,
- a.orddd as IO_ADdate,
- a.orddd as IO_Dschdd,
- a.ordtype as IO_VisitType,
- a.orddeptcd as IO_DeptCd,
- (select dept.deptengabbr
- from com.zsdddept dept
- where dept.deptcd = a.orddeptcd
- and dept.instcd = a.instcd
- and dept.valitodd >= a.orddd
- and dept.valifromdd <= a.orddd) as IO_DeptNm,
- COM.FN_ZS_GETDEPTNAME(a.instcd, a.orddeptcd, a.orddd) AS IO_Dept2,
- '' AS IO_OPdeptCd,
- '' AS IO_OPdeptNm,
- '' AS IO_OPdrNm,
- '' AS IO_OPdrId,
- (SELECT diag.diagcd
- FROM emr.mmohdiag diag
- WHERE diag.pid = a.pid
- AND diag.orddd = a.orddd
- AND diag.cretno = a.cretno
- AND diag.diaghistcd = 'O'
- AND diag.diagtypecd = 'D'
- AND diag.diagkindcdflag = 'M'
- AND diag.genrflagcd = a.ordtype
- and diag.orddeptcd = a.orddeptcd
- and rownum = 1
- AND diag.diaghistno = (select max(diagh.diaghistno)
- from emr.mmohdiag diagh
- where diagh.pid = a.pid
- AND diagh.orddd = a.orddd
- AND diagh.cretno = a.cretno
- AND diagh.instcd = '111'
- AND diagh.diaghistcd = 'O'
- AND diagh.diagkindcdflag = 'M'
- AND diagh.genrflagcd = a.ordtype
- and diagh.orddeptcd = a.orddeptcd
- and rownum = 1
- group by pid)) as IO_DxCd,
- (SELECT term.diaghngnm
- FROM emr.mmohdiag diag,
- emr.mmbvdiag term
- WHERE diag.pid = a.pid
- AND diag.orddd = a.orddd
- AND diag.cretno = a.cretno
- AND diag.instcd = term.instcd
- AND diag.diagcd = term.orgdiagcd
- AND diag.diaghistcd = 'O'
- AND diag.diagtypecd = 'D'
- AND diag.diagkindcdflag = 'M'
- AND diag.diagdd >= term.termfromdd
- AND diag.diagdd <= term.termtodd
- AND diag.diagdd >= term.diagattrfromdd
- AND diag.diagdd <= term.diagattrtodd
- AND diag.genrflagcd = a.ordtype
- and diag.orddeptcd = a.orddeptcd
- and rownum = 1
- AND diag.diaghistno = (select max(diagh.diaghistno)
- from emr.mmohdiag diagh
- where diagh.pid = a.pid
- AND diagh.orddd = a.orddd
- AND diagh.cretno = a.cretno
- AND diagh.instcd = '111'
- AND diagh.diaghistcd = 'O'
- AND diagh.diagkindcdflag = 'M'
- AND diagh.genrflagcd = a.ordtype
- and diagh.orddeptcd = a.orddeptcd
- and rownum = 1
- group by pid)) as IO_DxNm,
- COM.FN_ZS_GETUSERNM(a.orddrid, a.orddd) as IO_MaindrNm,
- '111' as IO_HosType,
- case when ex.bp is null then null else ex.bp end as IO_bp,
- case when ex.dm is null then null else ex.dm end as IO_dm,
- case when ex.heart is null then null else ex.heart end as IO_heart,
- case when ex.kidney is null then null else ex.kidney end as IO_kidney,
- case when ex.respiration is null then null else ex.respiration end as IO_respiration,
- case when ex.hx is null then null else ex.hx end as IO_hx,
- case when ex.allergy is null then null else ex.allergy end as IO_allergy,
- case when ex.drug is null then null else ex.drug end as IO_drug,
- case when ex.smoking is null then null else ex.smoking end as IO_smoking,
- case when ex.idio is null then null else ex.idio end as IO_idio,
- case when ex.nacrotics is null then null else ex.nacrotics end as IO_nacrotics,
- case when ex.airway is null then null else ex.airway end as IO_airway,
- case when ex.hemorrhage is null then null else ex.hemorrhage end as IO_hemorrhage,
- ex.etc IO_status_etc,
- '111' as IO_OrderNo,
- '111' as IO_PrintTime,
- a.ORDDRID as IO_MaindrId,
- '' as IO_ErdrNm,
- COM.FN_ZS_GETUSERNM(a.ORDDRID, a.orddd) as IO_MaindrNm,
- '111' as IO_OcrCd,
- a.ORDDRID as IO_InputId,
- COM.FN_ZS_GETUSERNM(a.ORDDRID, a.orddd) as IO_InputNm,
- '111' as IO_SignImg,
- ptbs.detladdr
- FROM pam.pmohotpt a
- left outer join cmr.consent_data_ex ex
- on (ex.pid = a.pid and ex.cln_date = a.orddd)
- left outer join pam.pmcmptbs ptbs
- on (ptbs.pid = a.pid and ptbs.instcd = a.instcd)
- WHERE a.instcd = #instcd#
- AND a.pid = #pid#
- AND a.orddd = #orddd#
- AND A.HISTSTAT IN ('R', 'T')
- AND A.MSKIND = 'M'
- ]]>
- <isNotEmpty property="cretno">
- AND a.cretno = #cretno#
- </isNotEmpty>
- <isNotEmpty property="orddeptcd">
- AND a.orddeptcd = #orddeptcd#
- </isNotEmpty>
-
- </statement>
-
- <statement id="getPatientInfoIn" parameterClass="System.Collections.Hashtable" resultMap="PatientMap">
- <![CDATA[
- SELECT a.orddeptcd,
- a.pid as IO_Pt_ID,
- to_char(a.cretno) as IO_CretNo,
- (ptbs.sex || '/' ||
- com.FN_ZZ_GETAGE_REC(ptbs.rrgstno1,
- ptbs.rrgstno2,
- TO_CHAR(SYSDATE, 'YYYYMMDD'),
- 'A',
- ptbs.brthdd)) as IO_sex_age_y_m,
- ptbs.hngnm as IO_Pt_Name,
- (ptbs.rrgstno1 || '-' || substr(ptbs.rrgstno2, 1, 1) || '******') IO_JuminNo,
- ptbs.zipcdaddr as IO_Zipcdaddr,
- ptbs.mpphontel as IO_Tel,
- (select cdnm
- from com.zbcmcode
- where cdgrupid = 'P0008'
- and cdid = a.insukind) as IO_Insukind,
- (select dept.DEPTENGABBR
- from com.zsdddept dept
- where dept.deptcd = a.wardcd
- and dept.instcd = a.instcd
- and dept.valitodd >= a.indd
- and dept.valifromdd <= a.indd) as IO_Ward,
- a.roomcd as IO_roomNO,
- a.indd as IO_ADdate,
- a.dschdd as IO_Dschdd,
- a.ordtype as IO_VisitType,
- a.orddeptcd as IO_DeptCd,
- (select dept.deptengabbr
- from com.zsdddept dept
- where dept.deptcd = a.orddeptcd
- and dept.instcd = a.instcd
- and dept.valitodd >= a.indd
- and dept.valifromdd <= a.indd) as IO_DeptNm,
- COM.FN_ZS_GETDEPTNAME(a.instcd, a.orddeptcd, a.indd) AS IO_Dept2,
- '' AS IO_OPdeptCd,
- '' AS IO_OPdeptNm,
- '' AS IO_OPdrNm,
- '' AS IO_OPdrId,
- (SELECT diag.diagcd
- FROM emr.mmohdiag diag
- WHERE diag.pid = a.pid
- AND diag.orddd = a.indd
- AND diag.cretno = a.cretno
- AND diag.diaghistcd = 'O'
- AND diag.diagtypecd = 'D'
- AND diag.diagkindcdflag = 'M'
- AND diag.genrflagcd = a.ordtype
- and diag.orddeptcd = a.orddeptcd
- and rownum = 1
- AND
- diag.diaghistno = (select max(diagh.diaghistno)
- from emr.mmohdiag diagh
- where diagh.pid = a.pid
- AND diagh.orddd = a.indd
- AND diagh.cretno = a.cretno
- AND diagh.instcd = '111'
- AND diagh.diaghistcd = 'O'
- AND diagh.diagkindcdflag = 'M'
- AND diagh.genrflagcd = a.ordtype
- and diagh.orddeptcd = a.orddeptcd
- and rownum = 1
- group by pid)) as IO_DxCd,
- (SELECT term.diaghngnm
- FROM emr.mmohdiag diag,
- emr.mmbvdiag term
- WHERE diag.pid = a.pid
- AND diag.orddd = a.indd
- AND diag.cretno = a.cretno
- AND diag.instcd = term.instcd
- AND diag.diagcd = term.orgdiagcd
- AND diag.diaghistcd = 'O'
- AND diag.diagtypecd = 'D'
- AND diag.diagkindcdflag = 'M'
- AND diag.diagdd >= term.termfromdd
- AND diag.diagdd <= term.termtodd
- AND diag.diagdd >= term.diagattrfromdd
- AND diag.diagdd <= term.diagattrtodd
- AND diag.genrflagcd = a.ordtype
- and diag.orddeptcd = a.orddeptcd
- and rownum = 1
- AND
- diag.diaghistno = (select max(diagh.diaghistno)
- from emr.mmohdiag diagh
- where diagh.pid = a.pid
- AND diagh.orddd = a.indd
- AND diagh.cretno = a.cretno
- AND diagh.instcd = '111'
- AND diagh.diaghistcd = 'O'
- AND diagh.diagkindcdflag = 'M'
- AND diagh.genrflagcd = a.ordtype
- and diagh.orddeptcd = a.orddeptcd
- and rownum = 1
- group by pid)) as IO_DxNm,
- '111' as IO_HosType,
- case
- when ex.bp is null then
- null
- else
- ex.bp
- end as IO_bp,
- case
- when ex.dm is null then
- null
- else
- ex.dm
- end as IO_dm,
- case
- when ex.heart is null then
- null
- else
- ex.heart
- end as IO_heart,
- case
- when ex.kidney is null then
- null
- else
- ex.kidney
- end as IO_kidney,
- case
- when ex.respiration is null then
- null
- else
- ex.respiration
- end as IO_respiration,
- case
- when ex.hx is null then
- null
- else
- ex.hx
- end as IO_hx,
- case
- when ex.allergy is null then
- null
- else
- ex.allergy
- end as IO_allergy,
- case
- when ex.drug is null then
- null
- else
- ex.drug
- end as IO_drug,
- case
- when ex.smoking is null then
- null
- else
- ex.smoking
- end as IO_smoking,
- case
- when ex.idio is null then
- null
- else
- ex.idio
- end as IO_idio,
- case
- when ex.nacrotics is null then
- null
- else
- ex.nacrotics
- end as IO_nacrotics,
- case
- when ex.airway is null then
- null
- else
- ex.airway
- end as IO_airway,
- case
- when ex.hemorrhage is null then
- null
- else
- ex.hemorrhage
- end as IO_hemorrhage,
- ex.etc IO_status_etc,
- '' as IO_OrderNo,
- '111' as IO_PrintTime,
- a.medispclid as IO_MaindrId,
- COM.FN_ZS_GETUSERNM(a.ermedispclid, a.indd) as IO_ErdrNm,
- COM.FN_ZS_GETUSERNM(a.medispclid, a.indd) as IO_MaindrNm,
- '111' as IO_OcrCd,
- '111' as IO_InputId,
- '111' as IO_InputNm,
- '111' as IO_SignImg,
- a.fstrgstdt
- FROM pam.pmihinpt a
- left outer join cmr.consent_data_ex ex
- on (ex.pid = a.pid and ex.cln_date = a.indd)
- left outer join pam.pmcmptbs ptbs
- on (ptbs.pid = a.pid and ptbs.instcd = a.instcd)
- WHERE a.instcd = #instcd#
- AND a.pid = #pid#
- AND a.indd = #orddd#
- AND a.histstat = 'Y'
- AND a.mskind = 'M'
- ]]>
- <isNotEmpty property="cretno">
- AND a.cretno = #cretno#
- </isNotEmpty>
- <isNotEqual property="orddeptcd" compareValue="2280000000">
- <isNotEmpty property="orddeptcd">
- AND a.orddeptcd = #orddeptcd#
- </isNotEmpty>
- </isNotEqual>
- order by a.fstrgstdt desc
- </statement>
- <statement id="getOcrTag" parameterClass="System.Collections.Hashtable" resultClass="System.String">
- <!--<![CDATA[
- SELECT to_char(sysdate,'YYYYMMDDhh24miss') AS ocrtag
- FROM dual
- ]]>-->
- <![CDATA[
- SELECT to_char(sysdate,'YYYYMMDD') || SUBSTR(LPAD((EMR.SQ_MRFMOCRP_01.NEXTVAL), 10, '0'), 6, 5) AS ocrtag
- FROM dual
- ]]>
- </statement>
- <!--
- <statement id="getDiagList" parameterClass="System.Collections.Hashtable" resultClass="System.String">
- <![CDATA[
- select '신경성 위염'|| #pid# as diagengnm from dual
- union select '알레르기 비염'|| #orddd# as diagengnm from dual
- union select '손목터널증후군' as diagengnm from dual
- ]]>
- </statement>
- -->
- <statement id="getDiagList" parameterClass="System.Collections.Hashtable" resultClass="System.String">
- <![CDATA[
- SELECT term.diaghngnm
- FROM emr.mmohdiag diag,
- emr.mmbvdiag term,
- pam.pmihinpt inpt
- WHERE inpt.instcd = '111'
- AND inpt.pid = #pid#
- AND inpt.indd = #orddd#
- AND inpt.histstat = 'Y'
- AND inpt.mskind = 'M'
- AND inpt.pid = diag.pid
- AND inpt.indd = diag.orddd
- AND diag.cretno = inpt.cretno
- AND diag.instcd = inpt.instcd
- AND diag.instcd = term.instcd
- AND diag.diagcd = term.orgdiagcd
- AND diag.diaghistcd = 'O'
- AND diag.diagtypecd = 'D'
- AND diag.diagdd >= term.termfromdd
- AND diag.diagdd <= term.termtodd
- AND diag.diagdd >= term.diagattrfromdd
- AND diag.diagdd <= term.diagattrtodd
- AND diag.genrflagcd in ('I','E')
- union all
- SELECT term.diaghngnm as diaghngnm
- FROM emr.mmohdiag diag,
- emr.mmbvdiag term,
- pam.pmohotpt otpt
- WHERE otpt.instcd = '111'
- AND otpt.pid = #pid#
- AND otpt.orddd = #orddd#
- AND otpt.pid = diag.pid
- AND otpt.orddd = diag.orddd
- AND diag.cretno = otpt.cretno
- AND diag.instcd = otpt.instcd
- AND diag.instcd = term.instcd
- AND diag.diagcd = term.orgdiagcd
- AND diag.diaghistcd = 'O'
- AND diag.diagtypecd = 'D'
- AND diag.diagdd >= term.termfromdd
- AND diag.diagdd <= term.termtodd
- AND diag.diagdd >= term.diagattrfromdd
- AND diag.diagdd <= term.diagattrtodd
- AND diag.genrflagcd in ('O','S')
- ]]>
- </statement>
-
- <insert id="setFileName" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- declare
- I_PID VARCHAR2(10) := #pid#;
- I_IOFLAG VARCHAR2(1) := #ordtype#;
- I_ORDDD VARCHAR2(8) := #orddd#;
- I_DSCHDD VARCHAR2(8) := #dschdd#;
- I_CRETNO NUMBER(10) := #cretno#;
- I_FILESIZE NUMBER(18) := #filesize#;
- I_FORMCD VARCHAR2(10) := #formcd#;
- I_PAGE NUMBER(18) := #pageno#;
- I_OCRCODE VARCHAR2(13) := #ocrtag#;
- I_USERID VARCHAR2(10) := #userid#;
- I_ORDDEPTCD VARCHAR2(10) := #orddeptcd#;
- begin
- EMR.LCTECH_PROCESS(I_PID, I_IOFLAG, I_ORDDD, I_DSCHDD, I_CRETNO, I_FILESIZE, I_FORMCD, I_PAGE, I_OCRCODE, I_ORDDEPTCD, I_USERID);
- end;
- ]]>
- </insert>
- <insert id="delEformData" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- declare
- I_PID VARCHAR2(10) := #pid#; /* 등록번호 */
- I_IOFLAG VARCHAR2(1) := #ordtype#; /* 입원/외래 구분 */
- I_ORDDD VARCHAR2(8) := #orddd#; /* 입원일 또는 진료일 */
- I_DSCHDD VARCHAR2(8) := #dschdd#; /* 입원환자 퇴원일 외래환자면 값이 '' */
- I_CRETNO NUMBER(10) := #cretno#; /* 원무정보의 생성번호 */
- I_FORMCD VARCHAR2(10) := #formcd#; /* FORMCD */
- I_OCRCODE VARCHAR2(13) := #ocrtag#; /* OCRCODE */
- I_USERID VARCHAR2(10) := #userid#; /* 사용자 ID 실제 동의서 구득 행위를 하는 사람 */
- I_USERNM VARCHAR2(10) := #username#; /* 사용자 이름 */
- I_CONSENT_MST_RID NUMBER(18) := #consentmstrid#; /* 동의서 작성 마스터 ID */
- I_HOS_TYPE VARCHAR2(10) := #hostype#; /* 병원구분(대구파티마 - '111') */
- I_ORDDEPTCD VARCHAR2(10) := #orddeptcd#;
- begin
- EMR.EFORM_DELETE(I_PID, I_IOFLAG, I_ORDDD, I_DSCHDD, I_CRETNO, I_FORMCD, I_OCRCODE, I_USERID, I_USERNM, I_CONSENT_MST_RID, I_ORDDEPTCD, I_HOS_TYPE);
- end;
- ]]>
- </insert>
- <statement id="getFileName" parameterClass="System.Collections.Hashtable" resultClass="System.String">
- <![CDATA[
- SELECT d.alias||'\'||'fnuImage'||'\'||substr(c.cdate,1,6)||'\'||substr(c.cdate,7)||'\'||to_char(c.pageno) AS filename
- FROM cmr.treatt a, cmr.chartpaget b, cmr.paget c, cmr.patht d
- WHERE a.patid = #pid#
- AND a.class = #ordtype#
- AND a.indate = #orddd#
- ]]>
- <isNotEqual property="ordtype" compareValue="O">
- <isNotEqual property="ordtype" compareValue="S">
- AND a.outdate = #dschdd#
- </isNotEqual>
- </isNotEqual>
- <![CDATA[
- and a.TREATNO = b.TREATNO
- and b.formcode = #formcd#
- and b.ocrcode = #ocrtag#
- and b.page = #pageno#
- and b.pageno = c.pageno
- and d.pathid = c.pathid
- and d.active = 'Y'
- ]]>
- </statement>
- <statement id="getFormFromdt" parameterClass="System.Collections.Hashtable" resultClass="System.String">
- <![CDATA[
- select a.formfromdt
- from emr.mrfmform a
- where instcd = #instcd#
- and formcd = #formcd#
- and formtodt like '99991231%'
- ]]>
- </statement>
- <insert id="setOcrPrntInfo" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- merge into emr.mrfmocrprnt a
- using dual
- on(instcd = #instcd#
- and pid = #pid#
- and orddd = #orddd#
- and cretno = #cretno#
- and ocrtag = #ocrtag#
- )
- when not matched then
- INSERT (
- ocrtag,
- pid,
- ordtype,
- orddd,
- cretno,
- orddrid,
- orddeptcd,
- instcd,
- formcd,
- formfromdt,
- fstprntdt,
- fstprntdeptcd,
- fstprntid,
- updtdt,
- updtdeptcd,
- updtuserid,
- diagnm,
- opnm,
- fstrgstrid,
- fstrgstdt,
- lastupdtrid,
- lastupdtdt
- )
- VALUES(
- #ocrtag#,
- #pid#,
- #ordtype#,
- #orddd#,
- #cretno#,
- #orddrid#,
- #orddeptcd#,
- #instcd#,
- #formcd#,
- #formfromdt#,
- #fstprntdt#,
- #fstprntdeptcd#,
- #fstprntid#,
- #updtdt#,
- #updtdeptcd#,
- #updtuserid#,
- '',
- '',
- #fstprntid#,
- SYSTIMESTAMP,
- #fstprntid#,
- SYSTIMESTAMP
- )
- ]]>
- </insert><insert id="setOcrPrntHistInfo" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- merge into emr.mrfhocrprnt a
- using dual
- on(instcd = #instcd#
- and ocrtag = #ocrtag#
- )
- when not matched then
- INSERT (
- instcd,
- ocrtag,
- statcd,
- updtdt,
- updtresncnts,
- updtdeptcd,
- scanyn,
- updtuserid,
- pagecnt,
- scanpagecnt,
- fstrgstrid,
- fstrgstdt,
- lastupdtrid,
- lastupdtdt
- )
- VALUES(
- #instcd#,
- #ocrtag#,
- 'P',
- #updtdt#,
- '',
- #updtdeptcd#,
- 'N',
- #updtuserid#,
- #prntcnt#,
- 0,
- #updtuserid#,
- SYSTIMESTAMP,
- #updtuserid#,
- SYSTIMESTAMP
- )
- ]]>
- </insert>
- <update id="UPDATE_USERSETUP" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- UPDATE MIS.RPBMEMPL
- SET MOBILE = #status#
- WHERE EMPLNO = #userid#
- ]]>
- </update>
- <statement id="getHardCodeYN" parameterClass="System.Collections.Hashtable" resultClass="System.String">
- <![CDATA[
- select 'Y'
- from emr.mnwmcode a
- where a.instcd = '111'
- and a.cdgrupid in ('399')
- and substr(cdid, 3) = #formcd#
- and rownum = 1
- ]]>
- </statement>
- </statements>
- </sqlMap>
|