hieviewer.xsl 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="2.0" xmlns:lxslt="http://xml.apache.org/xslt"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:n3="http://www.w3.org/1999/xhtml" xmlns:n1="urn:hl7-org:v3" xmlns:n2="urn:hl7-org:v3/meta/voc" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  5. <xsl:variable name="title">
  6. <xsl:choose>
  7. <xsl:when test="/n1:ClinicalDocument/n1:title">
  8. <xsl:value-of select="/n1:ClinicalDocument/n1:title"/>
  9. </xsl:when>
  10. <xsl:otherwise>Clinical Document</xsl:otherwise>
  11. </xsl:choose>
  12. </xsl:variable>
  13. <xsl:template match="/">
  14. <html lang="ko" xmlns="http://www.w3.org/1999/xhtml" xmlns:cda="urn:hl7-org:cda" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
  15. <head>
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8"/>
  17. <meta name="viewport" content="width=device-width"/>
  18. <title>
  19. <xsl:value-of select="$title"/>
  20. </title>
  21. <style>
  22. html,body { margin: 0; padding: 0; width: 100%; height: 100%;
  23. -ms-user-select: none;
  24. -moz-user-select: -moz-none;
  25. -khtml-user-select: none;
  26. -webkit-user-select: none;
  27. user-select: none; }
  28. img { border: 0; vertical-align: middle; }
  29. a { text-decoration: none; }
  30. ol,ul,li { margin: 0; padding: 0; list-style: none; }
  31. .container { position: relative; margin: 0 auto; width: 90%; max-width: 1200px; overflow: hidden; }
  32. .title { font-size: 17px; font-weight: bold; }
  33. .header .container{ border-bottom: 1px solid black; }
  34. .header .title { float: left; margin: 0 0 15px 0; font-size: 51px; }
  35. .header .title { float: left; margin: 0 0 15px 0; font-size: 42px; }
  36. .header .date { position: absolute; right: 0; bottom: 15px; font-size: 13px; }
  37. .request { padding: 20px 0 40px 0; }
  38. .request .left { float: left; width: 50%; }
  39. .request .right { float: left; width: 50%; }
  40. .request .title { float: left; width: 160px; height: 90px; overflow: hidden; }
  41. .request .content { height: 90px; overflow: hidden; }
  42. .request .content p { margin: 0 0 14px 0; }
  43. .patient { padding-bottom: 40px; }
  44. .patient .title { padding-bottom: 11px; }
  45. .patient table { width: 100%; border-top: 1px solid black; border-spacing: 0; text-align: left; font-size: 13px; table-layout:fixed; word-break:break-all; }
  46. .patient table th { padding: 13px 11px; border-bottom: 1px solid #a9a9a9; background-color: #f2f2f2; table-layout:fixed; word-break:break-all; }
  47. .patient table td { padding: 13px 11px; border-bottom: 1px solid #a9a9a9; table-layout:fixed; word-break:break-all; }
  48. .detail { padding-bottom: 40px; }
  49. .detail .top { padding-bottom: 10px; border-bottom: 1px solid black; overflow: hidden; }
  50. .detail .top .title { float: left; }
  51. .detail .top .all-hide-show { float: right; font-size: 14px; }
  52. .all-hide-show-button { cursor: pointer; }
  53. .detail .top .all-hide-show-button input { display: none; }
  54. .detail .top .all-hide-show-button .icon-show { display: none; }
  55. .detail .top .all-hide-show-button.active .icon-hide { display: none; }
  56. .detail .top .all-hide-show-button.active .icon-show { display: inline; }
  57. .detail .section { display: block; margin-top: 19px; }
  58. .detail .section input { display: none; }
  59. .detail .section .section-title { background-color: #cedbee; cursor: pointer; }
  60. .detail .section .section-title .padding { padding: 15px 23px; font-size: 14px; }
  61. .detail .section .section-title .icon-show { display: none; }
  62. .detail .section .content { display: none; background-color: #f3f6fd; overflow: hidden; width: 100%; }
  63. .detail .section .content .padding { padding: 15px 23px; font-size: 14px; }
  64. .detail .section .content .title { padding: 20px 0 0 0; }
  65. .detail .section .content p { margin: 0 0 5px 0; }
  66. .detail .section .content table { margin: 9px 0 20px 0; width: 100%; border: 1px solid #8ea6cc; border-bottom: 0; border-spacing: 0; text-align: left; font-size: 13px; table-layout:fixed; }
  67. .detail .section .content table th { padding: 9px 20px; background-color: #afcbfa; }
  68. .detail .section .content table td { padding: 9px 20px; border-bottom: 1px solid #d7dde9; background-color: white; }
  69. .detail .section .content table tr:last-child td { border-bottom: 1px solid #8ea6cc; }
  70. .detail .section .content table pre { white-space: pre-wrap; }
  71. .detail .section.show-content .content { display: block; }
  72. .detail .section.show-content .icon-hide { display: none; }
  73. .detail .section.show-content .icon-show { display: inline; }
  74. .title-icon-bar { border: 1px solid #000; height: 15px; width: 0px; float: left; margin-top: 5px; margin-right: 5px; }
  75. </style>
  76. </head>
  77. <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" onload="all_show(this)">
  78. <xsl:apply-templates select="n1:ClinicalDocument"/>
  79. </body>
  80. </html>
  81. </xsl:template>
  82. <xsl:template match="n1:ClinicalDocument">
  83. <div class="header">
  84. <div class="container">
  85. <xsl:if test="/n1:ClinicalDocument/n1:code/@code!='57016-8'">
  86. <h1 class="title">
  87. <xsl:value-of select="$title"/>
  88. </h1>
  89. </xsl:if>
  90. <xsl:if test="/n1:ClinicalDocument/n1:code/@code='57016-8'">
  91. <h1 class="title2">
  92. <xsl:value-of select="$title"/>
  93. </h1>
  94. </xsl:if>
  95. <div class="date">
  96. 작성일 :
  97. <xsl:call-template name="getDate2">
  98. <xsl:with-param name="date" select="/n1:ClinicalDocument/n1:effectiveTime"/>
  99. </xsl:call-template>
  100. </div>
  101. </div>
  102. </div>
  103. <xsl:variable name="sendingOrgType">
  104. <xsl:choose>
  105. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='57133-1'">
  106. 의뢰병원
  107. </xsl:when>
  108. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='11488-4'">
  109. 회신병원
  110. </xsl:when>
  111. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='18761-7'">
  112. 회송병원
  113. </xsl:when>
  114. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='34133-9'">
  115. 작성병원정보
  116. </xsl:when>
  117. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='57016-8'">
  118. 작성병원정보
  119. </xsl:when>
  120. </xsl:choose>
  121. </xsl:variable>
  122. <div class="request">
  123. <div class="container">
  124. <div class="left">
  125. <div class="title">
  126. <div class="title-icon-bar"></div>
  127. <xsl:value-of select="$sendingOrgType"/>
  128. </div>
  129. <div class="content">
  130. <p>
  131. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:representedOrganization/n1:asOrganizationPartOf/n1:wholeOrganization/n1:name"/>
  132. <xsl:text xml:space="preserve"> </xsl:text>
  133. /
  134. <xsl:text xml:space="preserve"> </xsl:text>
  135. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:representedOrganization/n1:name"/>
  136. </p>
  137. <p>
  138. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:assignedPerson/n1:name/n1:family"/>
  139. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:assignedPerson/n1:name/n1:given"/>
  140. </p>
  141. <p>
  142. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:telecom/@value"/>
  143. </p>
  144. </div>
  145. </div>
  146. <xsl:if test="/n1:ClinicalDocument/n1:informationRecipient/n1:intendedRecipient/n1:receivedOrganization/n1:asOrganizationPartOf/n1:wholeOrganization/n1:name !=''">
  147. <div class="right">
  148. <div class="title">
  149. <div class="title-icon-bar"></div>
  150. 협력병원
  151. </div>
  152. <div class="content">
  153. <p>
  154. <xsl:value-of select="/n1:ClinicalDocument/n1:informationRecipient/n1:intendedRecipient/n1:receivedOrganization/n1:asOrganizationPartOf/n1:wholeOrganization/n1:name"/>
  155. <xsl:text xml:space="preserve"> </xsl:text>
  156. /
  157. <xsl:text xml:space="preserve"> </xsl:text>
  158. <xsl:value-of select="/n1:ClinicalDocument/n1:informationRecipient/n1:intendedRecipient/n1:receivedOrganization/n1:name"/>
  159. </p>
  160. <p>
  161. <xsl:value-of select="/n1:ClinicalDocument/n1:informationRecipient/n1:intendedRecipient/n1:informationRecipient/n1:name/n1:family"/>
  162. <xsl:value-of select="/n1:ClinicalDocument/n1:informationRecipient/n1:intendedRecipient/n1:informationRecipient/n1:name/n1:given"/>
  163. </p>
  164. <p>
  165. <xsl:value-of select="/n1:ClinicalDocument/n1:informationRecipient/n1:intendedRecipient/n1:telecom/@value"/>
  166. </p>
  167. </div>
  168. </div>
  169. </xsl:if>
  170. </div>
  171. </div>
  172. <div class="patient">
  173. <div class="container">
  174. <div class="title">
  175. <div class="title-icon-bar"></div>
  176. 환자정보
  177. </div>
  178. <table>
  179. <colgroup>
  180. <col style="width:80px"/>
  181. <col style="width:auto"/>
  182. <col style="width:80px"/>
  183. <col style="width:auto"/>
  184. <col style="width:80px"/>
  185. <col style="width:auto"/>
  186. </colgroup>
  187. <tr>
  188. <th>성명</th>
  189. <td>
  190. <xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:patient/n1:name/n1:family"/>
  191. <xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:patient/n1:name/n1:given"/>
  192. </td>
  193. <th>생년월일</th>
  194. <td>
  195. <xsl:call-template name="getDate2">
  196. <xsl:with-param name="date" select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:patient/n1:birthTime"/>
  197. </xsl:call-template>
  198. </td>
  199. <th>성별</th>
  200. <td>
  201. <xsl:variable name='sex' select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:patient/n1:administrativeGenderCode/@code"/>
  202. <xsl:if test='$sex="M"'>남</xsl:if>
  203. <xsl:if test='$sex="F"'>여</xsl:if>
  204. <xsl:if test='$sex="O"'>기타</xsl:if>
  205. <xsl:if test='$sex="U"'>알수없음</xsl:if>
  206. </td>
  207. </tr>
  208. <tr>
  209. <th>주소</th>
  210. <td colspan="3">
  211. <xsl:if test="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:addr/n1:streetAddressLine !=''">
  212. <xsl:text xml:space="preserve"> </xsl:text>
  213. </xsl:if>
  214. <xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:addr/n1:streetAddressLine"/>
  215. <xsl:if test="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:addr/n1:additionalLocator !=''">
  216. <xsl:text xml:space="preserve"> </xsl:text>
  217. </xsl:if>
  218. <xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:addr/n1:additionalLocator"/>
  219. <xsl:if test="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:addr/n1:postalCode !=''">
  220. <xsl:text xml:space="preserve"> </xsl:text>
  221. (
  222. <xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:addr/n1:postalCode"/>
  223. )
  224. </xsl:if>
  225. </td>
  226. <th>전화번호</th>
  227. <td>
  228. <xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:telecom/@value"/>
  229. </td>
  230. </tr>
  231. <tr>
  232. <th>진료일</th>
  233. <td>
  234. <xsl:call-template name="getDate2">
  235. <xsl:with-param name="date" select="/n1:ClinicalDocument/n1:effectiveTime"/>
  236. </xsl:call-template>
  237. </td>
  238. <th>진료과</th>
  239. <td>
  240. <xsl:if test="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:representedOrganization/n1:asOrganizationPartOf/n1:wholeOrganization/n1:name != ''">
  241. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:representedOrganization/n1:name"/>
  242. </xsl:if>
  243. </td>
  244. <th>진료의</th>
  245. <td>
  246. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:assignedPerson/n1:name/n1:family"/>
  247. <xsl:value-of select="/n1:ClinicalDocument/n1:author/n1:assignedAuthor/n1:assignedPerson/n1:name/n1:given"/>
  248. </td>
  249. </tr>
  250. </table>
  251. </div>
  252. </div>
  253. <div class="detail">
  254. <div class="container">
  255. <div class="top">
  256. <div class="title">
  257. <div class="title-icon-bar"></div>
  258. 상세정보
  259. </div>
  260. <div class="all-hide-show">
  261. <!--<label class="all-hide-show-button" id="all-hide-show-button">
  262. <input type="checkbox" value="1" onclick="all_show(this)" />
  263. <span id="all-hide-show-text">펼쳐보기</span>
  264. <span class="icon-hide">▶</span>
  265. <span class="icon-show">▼</span>
  266. </label>-->
  267. </div>
  268. </div>
  269. <xsl:if test="/n1:ClinicalDocument/n1:code/@code='57016-8'">
  270. <label class="section show-content">
  271. <div class="section-title" onclick="hide_show(this)">
  272. <div class="padding">
  273. <span class="icon-hide">▶</span>
  274. <span class="icon-show">▼</span>
  275. 동의서내용
  276. </div>
  277. </div>
  278. <div class="content">
  279. <div class="padding">
  280. <p>
  281. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='57017-6']/n1:section/n1:text"/>
  282. </p>
  283. </div>
  284. </div>
  285. </label>
  286. </xsl:if>
  287. <xsl:if test="/n1:ClinicalDocument/n1:code/@code!='57016-8'">
  288. <xsl:if test="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='42349-1']/n1:section/n1:text !=''">
  289. <xsl:variable name="reasonForReferralTitle">
  290. <xsl:choose>
  291. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='57133-1'">
  292. 의뢰사유
  293. </xsl:when>
  294. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='11488-4'">
  295. 회신사유
  296. </xsl:when>
  297. <xsl:when test="/n1:ClinicalDocument/n1:code/@code='18761-7'">
  298. 회송사유
  299. </xsl:when>
  300. </xsl:choose>
  301. </xsl:variable>
  302. <label class="section show-content">
  303. <div class="section-title" onclick="hide_show(this)">
  304. <div class="padding">
  305. <span class="icon-hide">▶</span>
  306. <span class="icon-show">▼</span>
  307. 의뢰사유
  308. </div>
  309. </div>
  310. <div class="content">
  311. <div class="padding">
  312. <p>
  313. <xsl:value-of select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='42349-1']/n1:section/n1:text"/>
  314. </p>
  315. </div>
  316. </div>
  317. </label>
  318. </xsl:if>
  319. <xsl:if test="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='10164-2']/n1:section/n1:text !=''">
  320. <label class="section show-content">
  321. <div class="section-title" onclick="hide_show(this)">
  322. <div class="padding">
  323. <span class="icon-hide">▶</span>
  324. <span class="icon-show">▼</span>
  325. 과거병력
  326. </div>
  327. </div>
  328. <div class="content">
  329. <div class="padding">
  330. <p>
  331. <xsl:value-of select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='10164-2']/n1:section/n1:text"/>
  332. </p>
  333. </div>
  334. </div>
  335. </label>
  336. </xsl:if>
  337. <xsl:if test="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='51848-0']/n1:section/n1:text !=''">
  338. <label class="section show-content">
  339. <div class="section-title" onclick="hide_show(this)">
  340. <div class="padding">
  341. <span class="icon-hide">▶</span>
  342. <span class="icon-show">▼</span>
  343. 소견 및 주의사항
  344. </div>
  345. </div>
  346. <div class="content">
  347. <div class="padding">
  348. <p>
  349. <xsl:value-of select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='51848-0']/n1:section/n1:text"/>
  350. </p>
  351. </div>
  352. </div>
  353. </label>
  354. </xsl:if>
  355. <xsl:variable name="diagnosisCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='11450-4']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  356. <xsl:if test="$diagnosisCnt &gt; 0">
  357. <label class="section show-content">
  358. <div class="section-title" onclick="hide_show(this)">
  359. <div class="padding">
  360. <span class="icon-hide">▶</span>
  361. <span class="icon-show">▼</span>
  362. 진단명(
  363. <xsl:value-of select="$diagnosisCnt"/>
  364. )
  365. </div>
  366. </div>
  367. <div class="content">
  368. <div class="padding">
  369. <p>
  370. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='11450-4']/n1:section/n1:text"/>
  371. </p>
  372. </div>
  373. </div>
  374. </label>
  375. </xsl:if>
  376. <xsl:variable name="medicationCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='10160-0']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  377. <xsl:if test="$medicationCnt &gt; 0">
  378. <label class="section show-content">
  379. <div class="section-title" onclick="hide_show(this)">
  380. <div class="padding">
  381. <span class="icon-hide">▶</span>
  382. <span class="icon-show">▼</span>
  383. 투약오더(
  384. <xsl:value-of select="$medicationCnt"/>
  385. )
  386. </div>
  387. </div>
  388. <div class="content">
  389. <div class="padding">
  390. <p>
  391. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='10160-0']/n1:section/n1:text"/>
  392. </p>
  393. </div>
  394. </div>
  395. </label>
  396. </xsl:if>
  397. <xsl:variable name="admissionMedicationCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='42346-7']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  398. <xsl:if test="$admissionMedicationCnt &gt; 0">
  399. <label class="section show-content">
  400. <div class="section-title" onclick="hide_show(this)">
  401. <div class="padding">
  402. <span class="icon-hide">▶</span>
  403. <span class="icon-show">▼</span>
  404. 입원투약내역(
  405. <xsl:value-of select="$admissionMedicationCnt"/>
  406. )
  407. </div>
  408. </div>
  409. <div class="content">
  410. <div class="padding">
  411. <p>
  412. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='42346-7']/n1:section/n1:text"/>
  413. </p>
  414. </div>
  415. </div>
  416. </label>
  417. </xsl:if>
  418. <xsl:variable name="labResultCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='30954-2']/n1:section/n1:text/n1:list/n1:item)"/>
  419. <xsl:if test="$labResultCnt &gt; 0">
  420. <label class="section show-content">
  421. <div class="section-title" onclick="hide_show(this)">
  422. <div class="padding">
  423. <span class="icon-hide">▶</span>
  424. <span class="icon-show">▼</span>
  425. 검사결과(
  426. <xsl:value-of select="$labResultCnt"/>
  427. )
  428. </div>
  429. </div>
  430. <div class="content">
  431. <div class="padding">
  432. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='30954-2']/n1:section/n1:text/n1:list"/>
  433. </div>
  434. </div>
  435. </label>
  436. </xsl:if>
  437. <xsl:variable name="procedureCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='47519-4']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  438. <xsl:if test="$procedureCnt &gt; 0">
  439. <label class="section show-content">
  440. <div class="section-title" onclick="hide_show(this)">
  441. <div class="padding">
  442. <span class="icon-hide">▶</span>
  443. <span class="icon-show">▼</span>
  444. 수술내역(
  445. <xsl:value-of select="$procedureCnt"/>
  446. )
  447. </div>
  448. </div>
  449. <div class="content">
  450. <div class="padding">
  451. <p>
  452. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='47519-4']/n1:section/n1:text"/>
  453. </p>
  454. </div>
  455. </div>
  456. </label>
  457. </xsl:if>
  458. <xsl:variable name="immunizationCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='11369-6']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  459. <xsl:if test="$immunizationCnt &gt; 0">
  460. <label class="section show-content">
  461. <div class="section-title" onclick="hide_show(this)">
  462. <div class="padding">
  463. <span class="icon-hide">▶</span>
  464. <span class="icon-show">▼</span>
  465. 예방접종내역(
  466. <xsl:value-of select="$immunizationCnt"/>
  467. )
  468. </div>
  469. </div>
  470. <div class="content">
  471. <div class="padding">
  472. <p>
  473. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='11369-6']/n1:section/n1:text"/>
  474. </p>
  475. </div>
  476. </div>
  477. </label>
  478. </xsl:if>
  479. <xsl:variable name="allergyCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='48765-2']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  480. <xsl:if test="$allergyCnt &gt; 0">
  481. <label class="section show-content">
  482. <div class="section-title" onclick="hide_show(this)">
  483. <div class="padding">
  484. <span class="icon-hide">▶</span>
  485. <span class="icon-show">▼</span>
  486. 알러지 및 부작용(
  487. <xsl:value-of select="$allergyCnt"/>
  488. )
  489. </div>
  490. </div>
  491. <div class="content">
  492. <div class="padding">
  493. <p>
  494. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='48765-2']/n1:section/n1:text"/>
  495. </p>
  496. </div>
  497. </div>
  498. </label>
  499. </xsl:if>
  500. <xsl:variable name="smokeCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='29762-2']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  501. <xsl:if test="$smokeCnt &gt; 0">
  502. <label class="section show-content">
  503. <div class="section-title" onclick="hide_show(this)">
  504. <div class="padding">
  505. <span class="icon-hide">▶</span>
  506. <span class="icon-show">▼</span>
  507. 흡연상태(
  508. <xsl:value-of select="$smokeCnt"/>
  509. )
  510. </div>
  511. </div>
  512. <div class="content">
  513. <div class="padding">
  514. <p>
  515. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='29762-2']/n1:section/n1:text"/>
  516. </p>
  517. </div>
  518. </div>
  519. </label>
  520. </xsl:if>
  521. <xsl:variable name="infectionCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='56838-6']/n1:section/n1:text/n1:table)"/>
  522. <xsl:if test="$infectionCnt &gt; 0">
  523. <label class="section show-content">
  524. <div class="section-title" onclick="hide_show(this)">
  525. <div class="padding">
  526. <span class="icon-hide">▶</span>
  527. <span class="icon-show">▼</span>
  528. 법정 전염성 감염병(
  529. <xsl:value-of select="$infectionCnt"/>
  530. )
  531. </div>
  532. </div>
  533. <div class="content">
  534. <div class="padding">
  535. <p>
  536. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='56838-6']/n1:section/n1:text"/>
  537. </p>
  538. </div>
  539. </div>
  540. </label>
  541. </xsl:if>
  542. <xsl:variable name="planCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='18776-5']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  543. <xsl:if test="$planCnt &gt; 0">
  544. <label class="section show-content">
  545. <div class="section-title" onclick="hide_show(this)">
  546. <div class="padding">
  547. <span class="icon-hide">▶</span>
  548. <span class="icon-show">▼</span>
  549. 예약관련 정보(
  550. <xsl:value-of select="$planCnt"/>
  551. )
  552. </div>
  553. </div>
  554. <div class="content">
  555. <div class="padding">
  556. <p>
  557. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='18776-5']/n1:section/n1:text"/>
  558. </p>
  559. </div>
  560. </div>
  561. </label>
  562. </xsl:if>
  563. <xsl:variable name="vitalSignCnt" select="count(/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='8716-3']/n1:section/n1:text/n1:table/n1:tbody/n1:tr)"/>
  564. <xsl:if test="$vitalSignCnt &gt; 0">
  565. <label class="section show-content">
  566. <div class="section-title" onclick="hide_show(this)">
  567. <div class="padding">
  568. <span class="icon-hide">▶</span>
  569. <span class="icon-show">▼</span>
  570. 생체정보(
  571. <xsl:value-of select="$vitalSignCnt"/>
  572. )
  573. </div>
  574. </div>
  575. <div class="content">
  576. <div class="padding">
  577. <p>
  578. <xsl:apply-templates select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component[n1:section/n1:code/@code='8716-3']/n1:section/n1:text"/>
  579. </p>
  580. </div>
  581. </div>
  582. </label>
  583. </xsl:if>
  584. </xsl:if>
  585. </div>
  586. </div>
  587. </xsl:template>
  588. <xsl:template name="getDate1">
  589. <xsl:param name="date"/>
  590. <xsl:choose>
  591. <xsl:when test="$date/@value">
  592. <xsl:value-of select="concat(substring($date/@value,1,4),'.',substring($date/@value,5,2),'.',substring($date/@value,7,2),'')"/>
  593. <xsl:text> </xsl:text>
  594. </xsl:when>
  595. <xsl:otherwise>
  596. <xsl:value-of select="$date"/>
  597. </xsl:otherwise>
  598. </xsl:choose>
  599. </xsl:template>
  600. <xsl:template name="getDate2">
  601. <xsl:param name="date"/>
  602. <xsl:choose>
  603. <xsl:when test="$date/@value">
  604. <xsl:value-of select="concat(substring($date/@value,1,4),'년 ',substring($date/@value,5,2),'월 ',substring($date/@value,7,2),'일')"/>
  605. <xsl:text> </xsl:text>
  606. </xsl:when>
  607. <xsl:otherwise>
  608. <xsl:value-of select="$date"/>
  609. </xsl:otherwise>
  610. </xsl:choose>
  611. </xsl:template>
  612. <xsl:template name="getDate3">
  613. <xsl:param name="date"/>
  614. <xsl:choose>
  615. <xsl:when test="$date">
  616. <xsl:if test="$date !='Unknown'">
  617. <xsl:value-of select="concat(substring($date,1,4),'. ',substring($date,5,2),'. ',substring($date,7,2),'')"/>
  618. </xsl:if>
  619. <xsl:text> </xsl:text>
  620. </xsl:when>
  621. <xsl:otherwise>
  622. <xsl:value-of select="$date"/>
  623. </xsl:otherwise>
  624. </xsl:choose>
  625. </xsl:template>
  626. <xsl:template match="n1:table/@*|n1:thead/@*|n1:tfoot/@*|n1:tbody/@*|n1:colgroup/@*|n1:col/@*|n1:tr/@*|n1:th/@*|n1:td/@*">
  627. <xsl:copy>
  628. <xsl:copy-of select="@*"/>
  629. <xsl:apply-templates/>
  630. </xsl:copy>
  631. </xsl:template>
  632. <xsl:template match="n1:table">
  633. <div style="font-size: 15px;">
  634. <strong>
  635. <xsl:value-of select="substring-before(@summary,'|')" disable-output-escaping="yes"/>
  636. <p/>
  637. </strong>
  638. </div>
  639. <table class="table" width="100%">
  640. <xsl:copy-of select="@*"/>
  641. <xsl:apply-templates/>
  642. </table>
  643. </xsl:template>
  644. <xsl:template match="n1:thead">
  645. <thead>
  646. <xsl:copy-of select="@*"/>
  647. <xsl:apply-templates/>
  648. </thead>
  649. </xsl:template>
  650. <xsl:template match="n1:tfoot">
  651. <tfoot>
  652. <xsl:copy-of select="@*"/>
  653. <xsl:apply-templates/>
  654. </tfoot>
  655. </xsl:template>
  656. <xsl:template match="n1:tbody">
  657. <tbody>
  658. <xsl:copy-of select="@*"/>
  659. <xsl:apply-templates/>
  660. </tbody>
  661. </xsl:template>
  662. <xsl:template match="n1:colgroup">
  663. <colgroup>
  664. <xsl:copy-of select="@*"/>
  665. <xsl:apply-templates/>
  666. </colgroup>
  667. </xsl:template>
  668. <xsl:template match="n1:col">
  669. <col>
  670. <xsl:copy-of select="@*"/>
  671. <xsl:apply-templates/>
  672. </col>
  673. </xsl:template>
  674. <xsl:template match="n1:tr">
  675. <tr class="narr_tr">
  676. <xsl:copy-of select="@*"/>
  677. <xsl:apply-templates/>
  678. </tr>
  679. </xsl:template>
  680. <xsl:template match="n1:th">
  681. <th class="narr_th">
  682. <xsl:copy-of select="@*"/>
  683. <xsl:apply-templates/>
  684. </th>
  685. </xsl:template>
  686. <xsl:template match="n1:td">
  687. <td style="white-space:normal;">
  688. <xsl:choose>
  689. <xsl:when test="@styleCode='HIGH'">
  690. <xsl:copy-of select="@*"/>
  691. <pre style="color : red;">
  692. <xsl:apply-templates/>
  693. </pre>
  694. </xsl:when>
  695. <xsl:when test="@styleCode='LOW'">
  696. <xsl:copy-of select="@*"/>
  697. <pre style="color : blue">
  698. <xsl:apply-templates/>
  699. </pre>
  700. </xsl:when>
  701. <xsl:otherwise>
  702. <xsl:copy-of select="@*"/>
  703. <pre>
  704. <xsl:apply-templates/>
  705. </pre>
  706. </xsl:otherwise>
  707. </xsl:choose>
  708. </td>
  709. </xsl:template>
  710. <xsl:template match="n1:table/n1:caption">
  711. <span style="font-weight:bold; ">
  712. <xsl:apply-templates/>
  713. </span>
  714. </xsl:template>
  715. </xsl:stylesheet>