CLIP.e-Form.Hospital.Dfh.User.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <sqlMap namespace="CLIP.e-Form.Consent.Dfh" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  3. <statements>
  4. <statement id="GET_USER_INFO" parameterClass="System.Collections.Hashtable" resultMap="UserMap">
  5. <![CDATA[
  6. select a.userid,
  7. a.usernm,
  8. b.dutplcecd,
  9. dept.depthngnm,
  10. dept.deptengabbr,
  11. b.jobkindcd,
  12. (select cdnm
  13. from com.zbcmcode code
  14. where code.cdgrupid = 'R0061'
  15. and code.cdid = b.jobkindcd
  16. and code.valitodd = '99991231')
  17. from com.zsumusrb a,
  18. com.zsumusrd b,
  19. com.zsdddept dept
  20. where a.dutinstcd = '111'
  21. and a.dutinstcd = b.dutplceinstcd
  22. and a.userid = b.userid
  23. and a.usertodd = b.todd
  24. and dept.instcd = a.dutinstcd
  25. and dept.deptcd = b.dutplcecd
  26. and dept.valitodd = '99991231'
  27. and a.userfromdd <= to_char(to_date(sysdate),'YYYYMMDD')
  28. and a.usertodd >= to_char(to_date(sysdate),'YYYYMMDD')
  29. and b.userid = #userid#
  30. order by b.psnworkyn desc, b.fstrgstdt desc
  31. ]]>
  32. </statement>
  33. <!--
  34. <statement id="getUserFormSet" parameterClass="System.Collections.Hashtable" resultMap="ConsentSetMap">
  35. <![CDATA[
  36. SELECT 'PERS_SET' AS SET_AUTH,
  37. 'bf159c4f-bb03-49ba-bc61-9d635f350c8d' AS FORM_GUID,
  38. '안와골절 정복술 설명 및 동의서' AS FORM_NAME,
  39. 109 AS FORM_RID,
  40. #userid# AS FORM_CD,
  41. 1 AS PRNTCNT
  42. FROM DUAL
  43. UNION ALL
  44. SELECT 'PERS_SET' AS SET_AUTH,
  45. '8095dad0-7318-4782-adfb-a2db2f0258e3' AS FORM_GUID,
  46. 'Safe Guard 사용 동의서' AS FORM_NAME,
  47. 110 AS FORM_RID,
  48. #userid# || '0000002' AS FORM_CD,
  49. 1 AS PRNTCNT
  50. FROM DUAL
  51. ]]>
  52. </statement>
  53. -->
  54. <statement id="getUserFormSet" parameterClass="System.Collections.Hashtable" resultMap="ConsentSetMap">
  55. <![CDATA[
  56. SELECT 'PERS_SET' AS SET_AUTH,
  57. a.linkcd AS FORM_CD,
  58. b.form_name as FORM_NAME,
  59. b.form_guid,
  60. b.FORM_RID,
  61. b.prntcnt,
  62. b.PRINT_ONLY,
  63. b.OCRTAGPRNTYN
  64. FROM emr.MRFMSETINDX a
  65. INNER JOIN cmr.v_eform_formdoc b
  66. ON a.LINKCD = b.FORM_CD
  67. WHERE a.userid = #userid#
  68. AND a.instcd = #instcd#
  69. and a.valiyn = 'Y'
  70. ORDER BY FORM_NAME
  71. ]]>
  72. </statement>
  73. <statement id="setUserFormSet" parameterClass="System.Collections.Hashtable">
  74. <![CDATA[
  75. INSERT INTO emr.mrfmsetindx(
  76. instcd,
  77. itemindxseq,
  78. supitemindxseq,
  79. indxflag,
  80. indxnm,
  81. indxcnts,
  82. deptcd,
  83. userid,
  84. linkflag,
  85. linkcd,
  86. comnseq,
  87. fstrgstrid,
  88. fstrgstdt,
  89. lastupdtrid,
  90. lastupdtdt,
  91. jobkind,
  92. slipno
  93. )
  94. VALUES(
  95. #instcd#,
  96. EMR.SQ_MRFMSETINDX_01.NEXTVAL,
  97. 472,
  98. 'O',
  99. '',
  100. '',
  101. '',
  102. #userid#,
  103. 'Y',
  104. #formcd#,
  105. '',
  106. #userid#,
  107. systimestamp,
  108. #userid#,
  109. systimestamp,
  110. '',
  111. '')
  112. ]]>
  113. </statement>
  114. <statement id="delUserFormSet" parameterClass="System.Collections.Hashtable">
  115. <![CDATA[
  116. update emr.mrfmsetindx
  117. set instcd = '999'
  118. where userid = #userid#
  119. and instcd = #instcd#
  120. and linkcd = #formcd#
  121. ]]>
  122. </statement>
  123. <statement id="getUserSignImage" parameterClass="System.Collections.Hashtable" resultMap="UserSignImageMap">
  124. <![CDATA[
  125. SELECT signdata
  126. FROM emr.mrfmsignimge
  127. WHERE userid = #userid#
  128. and repryn = 'Y'
  129. ]]>
  130. </statement>
  131. <statement id="GetUnfinishedListPerDoctor" parameterClass="System.Collections.Hashtable" resultMap="UnFinishedListMap">
  132. <![CDATA[
  133. select pid,
  134. (select ptbs.hngnm
  135. from pam.pmcmptbs ptbs
  136. where ptbs.pid = a.pid
  137. and ptbs.instcd = '111') as hngnm,
  138. (select v.FORM_CD
  139. from cmr.v_eform_formdoc v
  140. where v.FORM_RID = a.form_rid) as formcd,
  141. (select v.FORM_NAME
  142. from cmr.v_eform_formdoc v
  143. where v.FORM_RID = a.form_rid) as formnm,
  144. (select v.PRINT_ONLY
  145. from cmr.v_eform_formdoc v
  146. where v.FORM_RID = a.form_rid) as printonly,
  147. a.order_date as orderdate,
  148. (select s.cert_target
  149. from cmr.consent_image_sign s
  150. where s.consent_mst_rid = a.consent_mst_rid) as certtarget
  151. , a.consent_state as consentstate
  152. , a.consent_mst_rid as consentmstrid
  153. , a.cln_date as orddd
  154. , a.visit_type as ordtype
  155. , a.cln_dept_cd as orddeptcd
  156. , a.order_no as orderno
  157. , a.order_cd as ordercd
  158. , a.ocr_number as ocrnumber
  159. , a.cretno
  160. , a.create_user_name as createusername
  161. , a.form_rid as formrid
  162. , (select doc.form_guid from cmr.v_eform_formdoc doc where doc.form_rid = a.form_rid) as formguid
  163. from cmr.consent_mst a
  164. where a.modify_user_id = #userid#
  165. and a.hos_type = '111'
  166. and a.use_yn = 'Y'
  167. and substr(a.create_datetime, 1, 10) between
  168. to_char(to_date(#fromdd#, 'yyyymmdd'), 'yyyy-mm-dd') and
  169. to_char(to_date(#todd#, 'yyyymmdd'), 'yyyy-mm-dd')
  170. ]]>
  171. <isNotEqual property="status" compareValue="ALL">
  172. <![CDATA[
  173. and a.consent_state in ($status$)
  174. ]]>
  175. </isNotEqual>
  176. </statement>
  177. </statements>
  178. </sqlMap>