Advertisement
Guest User

Untitled

a guest
Feb 5th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.42 KB | None | 0 0
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!-- Generated by Hand -->
  3. <!--
  4.  
  5.  
  6. This program is free software; you can redistribute it and/or
  7. Modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. -->
  11. <xsl:stylesheet version="1.0"
  12. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  13. <xsl:template name="prepend-pad">
  14. <!-- recursive template to right justify and prepend-->
  15. <!-- the value with whatever padChar is passed in -->
  16. <xsl:param name="padChar"> </xsl:param>
  17. <xsl:param name="padVar"/>
  18. <xsl:param name="length"/>
  19. <xsl:choose>
  20. <xsl:when test="string-length($padVar) &lt; $length">
  21. <xsl:call-template name="prepend-pad">
  22. <xsl:with-param name="padChar" select="$padChar"/>
  23. <xsl:with-param name="padVar" select="concat($padChar,$padVar)"/>
  24. <xsl:with-param name="length" select="$length"/>
  25. </xsl:call-template>
  26. </xsl:when>
  27. <xsl:otherwise>
  28. <xsl:value-of select="substring($padVar,string-length($padVar) - $length + 1)"/>
  29. </xsl:otherwise>
  30. </xsl:choose>
  31. </xsl:template>
  32.  
  33. <xsl:template name="append-pad">
  34. <!-- recursive template to left justify and append -->
  35. <!-- the value with whatever padChar is passed in -->
  36. <xsl:param name="padChar"> </xsl:param>
  37. <xsl:param name="padVar"/>
  38. <xsl:param name="length"/>
  39. <xsl:choose>
  40. <xsl:when test="string-length($padVar) &lt; $length">
  41. <xsl:call-template name="append-pad">
  42. <xsl:with-param name="padChar" select="$padChar"/>
  43. <xsl:with-param name="padVar" select="concat($padVar,$padChar)"/>
  44. <xsl:with-param name="length" select="$length"/>
  45. </xsl:call-template>
  46. </xsl:when>
  47. <xsl:otherwise>
  48. <xsl:value-of select="substring($padVar,1,$length)"/>
  49. </xsl:otherwise>
  50. </xsl:choose>
  51. </xsl:template>
  52.  
  53. <xsl:template match="ISA">
  54. <xsl:text disable-output-escaping="yes"><![CDATA[ISA*00* *00* *ZZ*]]></xsl:text>
  55. <xsl:call-template name="append-pad">
  56. <xsl:with-param name="padChar"><xsl:text> </xsl:text></xsl:with-param>
  57. <xsl:with-param name="padVar"><xsl:value-of select="@sender"/></xsl:with-param>
  58. <xsl:with-param name="length">15</xsl:with-param>
  59.  
  60. </xsl:call-template>
  61. <xsl:text disable-output-escaping="yes"><![CDATA[*30*]]></xsl:text>
  62. <xsl:call-template name="append-pad">
  63. <xsl:with-param name="padChar"><xsl:text> </xsl:text></xsl:with-param>
  64. <xsl:with-param name="padVar"><xsl:value-of select="@recipient"/></xsl:with-param>
  65. <xsl:with-param name="length">15</xsl:with-param>
  66. </xsl:call-template>
  67. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  68. <xsl:value-of select="@submission_date_YYMMDD"/>
  69. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  70. <xsl:value-of select="@submission_time"/>
  71. <xsl:text disable-output-escaping="yes"><![CDATA[*U*00401*]]></xsl:text>
  72. <xsl:value-of select="@interchange_control_number"/>
  73. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  74. <xsl:value-of select="@acknowledgement_requested"/>
  75. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  76. <xsl:value-of select="@test_or_production"/>
  77. <xsl:text disable-output-escaping="yes"><![CDATA[*:~]]></xsl:text>
  78. <xsl:apply-templates select="*"/>
  79. </xsl:template>
  80.  
  81. <xsl:template match="GS">
  82. <xsl:text disable-output-escaping="yes"><![CDATA[GS*]]></xsl:text>
  83. <xsl:value-of select="@document_type"/>
  84. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  85. <xsl:value-of select="@sender"/>
  86. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  87. <xsl:value-of select="@recipient"/>
  88. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  89. <xsl:value-of select="@submission_date_YYYMMDD"/>
  90. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  91. <xsl:value-of select="@submission_time"/>
  92. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  93. <xsl:value-of select="@group_control_number"/>
  94. <xsl:text disable-output-escaping="yes"><![CDATA[*X*]]></xsl:text>
  95. <xsl:value-of select="@x12_version"/>
  96. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  97. <xsl:apply-templates select="*"/>
  98. </xsl:template>
  99.  
  100. <xsl:template match="ST">
  101. <xsl:text disable-output-escaping="yes"><![CDATA[ST*]]></xsl:text>
  102. <xsl:value-of select="@transaction_set_identifier_code"/>
  103. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  104. <xsl:value-of select="@transaction_control_number"/>
  105. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  106. <xsl:apply-templates select="*"/>
  107. </xsl:template>
  108.  
  109. <xsl:template match="BHT">
  110. <xsl:text disable-output-escaping="yes"><![CDATA[BHT*]]></xsl:text>
  111. <xsl:value-of select="@heirarchical_structure_code"/>
  112. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  113. <xsl:value-of select="@transaction_set_purpose_code"/>
  114. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  115. <xsl:value-of select="@origionator_application_transaction_header"/>
  116. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  117. <xsl:value-of select="@transaction_set_create_date"/>
  118.  
  119. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  120. <xsl:value-of select="@transaction_set_create_time"/>
  121. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  122. <xsl:value-of select="@claim_or_encounter_identifier"/>
  123. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  124. </xsl:template>
  125.  
  126. <xsl:template match="REF">
  127. <xsl:text disable-output-escaping="yes"><![CDATA[REF*]]></xsl:text>
  128. <xsl:value-of select="@reference_identification_qualifier"/>
  129. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  130. <xsl:value-of select="@x12_version"/>
  131. <xsl:value-of select="@social_security_number"/>
  132. <xsl:value-of select="@prior_authorization"/>
  133. <xsl:value-of select="@medicaid_provider_number"/>
  134. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  135. </xsl:template>
  136.  
  137. <xsl:template match="NM1">
  138. <xsl:text disable-output-escaping="yes"><![CDATA[NM1*]]></xsl:text>
  139. <xsl:value-of select="@entity_identifier_code"/>
  140. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  141. <xsl:value-of select="@entity_type_qualifier"/>
  142. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  143. <xsl:value-of select="./text()"/>
  144. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  145. <xsl:value-of select="@first_name"/>
  146. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  147. <xsl:value-of select="@middle_initial"/>
  148. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  149. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  150. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  151. <xsl:value-of select="@identification_code_qualifier"/>
  152. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  153. <xsl:value-of select="@identification_code"/>
  154. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  155. </xsl:template>
  156.  
  157. <xsl:template match="PER">
  158. <xsl:text disable-output-escaping="yes"><![CDATA[PER*]]></xsl:text>
  159. <xsl:value-of select="@contact_function_code"/>
  160. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  161. <xsl:value-of select="./text()"/>
  162. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  163. <xsl:value-of select="@communication_number_qualifier"/>
  164. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  165. <xsl:value-of select="@communication_number"/>
  166. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  167. </xsl:template>
  168.  
  169. <xsl:template match="HL">
  170. <xsl:text disable-output-escaping="yes"><![CDATA[HL*]]></xsl:text>
  171. <xsl:value-of select="@heirarchical_unit_id"/>
  172. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  173. <xsl:value-of select="@heirarchical_parent_id"/>
  174. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  175. <xsl:value-of select="@heirarchical_level_code"/>
  176.  
  177. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  178. <xsl:value-of select="@heirarchical_child_code"/>
  179. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  180. </xsl:template>
  181.  
  182. <xsl:template match="PRV">
  183. <xsl:text disable-output-escaping="yes"><![CDATA[PRV*]]></xsl:text>
  184. <xsl:value-of select="@provider_code"/>
  185. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  186. <xsl:value-of select="@reference_identification_qualifier"/>
  187. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  188. <xsl:value-of select="@reference_identifier"/>
  189. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  190. </xsl:template>
  191.  
  192. <xsl:template match="N3">
  193. <xsl:text disable-output-escaping="yes"><![CDATA[N3*]]></xsl:text>
  194. <xsl:value-of select="./text()"/>
  195. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  196. </xsl:template>
  197.  
  198. <xsl:template match="N4">
  199. <xsl:text disable-output-escaping="yes"><![CDATA[N4*]]></xsl:text>
  200. <xsl:value-of select="@city"/>
  201. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  202. <xsl:value-of select="@state"/>
  203. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  204. <xsl:value-of select="@zip"/>
  205. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  206. </xsl:template>
  207.  
  208. <xsl:template match="SBR">
  209. <xsl:text disable-output-escaping="yes"><![CDATA[SBR*]]></xsl:text>
  210. <xsl:value-of select="@payer_responsibility_sequence_number_code"/>
  211. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  212. <xsl:value-of select="@insured_group_number"/>
  213. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  214. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  215. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  216. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  217. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  218. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  219. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  220. <xsl:value-of select="@claim_filing_indicator_code"/>
  221. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  222. </xsl:template>
  223.  
  224. <xsl:template match="DMG">
  225. <xsl:text disable-output-escaping="yes"><![CDATA[DMG*]]></xsl:text>
  226. <xsl:value-of select="@date_qualifier"/>
  227. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  228. <xsl:value-of select="@birth_date"/>
  229. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  230. <xsl:value-of select="@gender"/>
  231. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  232. </xsl:template>
  233.  
  234.  
  235. <xsl:template match="CLM">
  236. <xsl:text disable-output-escaping="yes"><![CDATA[CLM*]]></xsl:text>
  237. <xsl:value-of select="@patient_account_number"/>
  238. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  239. <xsl:value-of select="./text()"/>
  240. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  241. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  242. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  243. <xsl:value-of select="@facility_type_code"/>
  244. <xsl:text disable-output-escaping="yes"><![CDATA[::]]></xsl:text>
  245. <xsl:value-of select="@claim_frequency_code"/>
  246. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  247. <xsl:value-of select="@provider_signature_on_file"/>
  248. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  249. <xsl:value-of select="@assignment_participation_code"/>
  250. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  251. <xsl:value-of select="@benefit_assignment_certification_indicator"/>
  252. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  253. <xsl:value-of select="@release_of_information_code"/>
  254. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  255. <xsl:value-of select="@patient_signature_source_code"/>
  256. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  257. </xsl:template>
  258.  
  259. <xsl:template match="HI">
  260. <xsl:text disable-output-escaping="yes"><![CDATA[HI*]]></xsl:text>
  261. <xsl:value-of select="@principal_diagnosis_qualifier"/>
  262. <xsl:text disable-output-escaping="yes"><![CDATA[:]]></xsl:text>
  263. <xsl:value-of select="./text()"/>
  264. <xsl:if test="@secondary_diagnosis_qualifier">
  265. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  266. <xsl:value-of select="@secondary_diagnosis_qualifier"/>
  267. <xsl:text disable-output-escaping="yes"><![CDATA[:]]></xsl:text>
  268. <xsl:value-of select="@secondary_diagnosis"/>
  269. </xsl:if>
  270.  
  271. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  272. </xsl:template>
  273.  
  274. <xsl:template match="LX">
  275. <xsl:text disable-output-escaping="yes"><![CDATA[LX*]]></xsl:text>
  276. <xsl:value-of select="@service_line_number"/>
  277. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  278. </xsl:template>
  279.  
  280. <xsl:template match="SV1">
  281. <xsl:text disable-output-escaping="yes"><![CDATA[SV1*HC:]]></xsl:text>
  282. <xsl:value-of select="./text()"/>
  283. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  284. <xsl:value-of select="@line_item_charge_amount"/>
  285. <xsl:text disable-output-escaping="yes"><![CDATA[*UN*]]></xsl:text>
  286. <xsl:value-of select="@quantity"/>
  287. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  288. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  289.  
  290. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  291. <xsl:value-of select="@diagnosis_pointers"/>
  292. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  293. </xsl:template>
  294.  
  295. <xsl:template match="DTP">
  296. <xsl:text disable-output-escaping="yes"><![CDATA[DTP*]]></xsl:text>
  297. <xsl:value-of select="@date_time_qualifier"/>
  298. <xsl:text disable-output-escaping="yes"><![CDATA[*RD8*]]></xsl:text>
  299. <xsl:value-of select="./text()"/>
  300. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  301. </xsl:template>
  302.  
  303. <xsl:template match="SE">
  304. <xsl:text disable-output-escaping="yes"><![CDATA[SE*]]></xsl:text>
  305. <xsl:value-of select="count(/ISA/GS/ST/*)+1"/>
  306. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  307. <xsl:value-of select="@transaction_control_number"/>
  308. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  309. </xsl:template>
  310.  
  311. <xsl:template match="GE">
  312. <xsl:text disable-output-escaping="yes"><![CDATA[GE*]]></xsl:text>
  313. <xsl:value-of select="@number_of_transaction_sets_included"/>
  314. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  315. <xsl:value-of select="@group_control_number"/>
  316. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  317. </xsl:template>
  318.  
  319. <xsl:template match="IEA">
  320. <xsl:text disable-output-escaping="yes"><![CDATA[IEA*]]></xsl:text>
  321. <xsl:value-of select="@number_of_included_functional_groups"/>
  322. <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
  323. <xsl:value-of select="@group_control_number"/>
  324. <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
  325. </xsl:template>
  326.  
  327. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement