Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <!-- Generated by Hand -->
- <!--
- This program is free software; you can redistribute it and/or
- Modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template name="prepend-pad">
- <!-- recursive template to right justify and prepend-->
- <!-- the value with whatever padChar is passed in -->
- <xsl:param name="padChar"> </xsl:param>
- <xsl:param name="padVar"/>
- <xsl:param name="length"/>
- <xsl:choose>
- <xsl:when test="string-length($padVar) < $length">
- <xsl:call-template name="prepend-pad">
- <xsl:with-param name="padChar" select="$padChar"/>
- <xsl:with-param name="padVar" select="concat($padChar,$padVar)"/>
- <xsl:with-param name="length" select="$length"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($padVar,string-length($padVar) - $length + 1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="append-pad">
- <!-- recursive template to left justify and append -->
- <!-- the value with whatever padChar is passed in -->
- <xsl:param name="padChar"> </xsl:param>
- <xsl:param name="padVar"/>
- <xsl:param name="length"/>
- <xsl:choose>
- <xsl:when test="string-length($padVar) < $length">
- <xsl:call-template name="append-pad">
- <xsl:with-param name="padChar" select="$padChar"/>
- <xsl:with-param name="padVar" select="concat($padVar,$padChar)"/>
- <xsl:with-param name="length" select="$length"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($padVar,1,$length)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ISA">
- <xsl:text disable-output-escaping="yes"><![CDATA[ISA*00* *00* *ZZ*]]></xsl:text>
- <xsl:call-template name="append-pad">
- <xsl:with-param name="padChar"><xsl:text> </xsl:text></xsl:with-param>
- <xsl:with-param name="padVar"><xsl:value-of select="@sender"/></xsl:with-param>
- <xsl:with-param name="length">15</xsl:with-param>
- </xsl:call-template>
- <xsl:text disable-output-escaping="yes"><![CDATA[*30*]]></xsl:text>
- <xsl:call-template name="append-pad">
- <xsl:with-param name="padChar"><xsl:text> </xsl:text></xsl:with-param>
- <xsl:with-param name="padVar"><xsl:value-of select="@recipient"/></xsl:with-param>
- <xsl:with-param name="length">15</xsl:with-param>
- </xsl:call-template>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@submission_date_YYMMDD"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@submission_time"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*U*00401*]]></xsl:text>
- <xsl:value-of select="@interchange_control_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@acknowledgement_requested"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@test_or_production"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*:~]]></xsl:text>
- <xsl:apply-templates select="*"/>
- </xsl:template>
- <xsl:template match="GS">
- <xsl:text disable-output-escaping="yes"><![CDATA[GS*]]></xsl:text>
- <xsl:value-of select="@document_type"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@sender"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@recipient"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@submission_date_YYYMMDD"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@submission_time"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@group_control_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*X*]]></xsl:text>
- <xsl:value-of select="@x12_version"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- <xsl:apply-templates select="*"/>
- </xsl:template>
- <xsl:template match="ST">
- <xsl:text disable-output-escaping="yes"><![CDATA[ST*]]></xsl:text>
- <xsl:value-of select="@transaction_set_identifier_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@transaction_control_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- <xsl:apply-templates select="*"/>
- </xsl:template>
- <xsl:template match="BHT">
- <xsl:text disable-output-escaping="yes"><![CDATA[BHT*]]></xsl:text>
- <xsl:value-of select="@heirarchical_structure_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@transaction_set_purpose_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@origionator_application_transaction_header"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@transaction_set_create_date"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@transaction_set_create_time"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@claim_or_encounter_identifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="REF">
- <xsl:text disable-output-escaping="yes"><![CDATA[REF*]]></xsl:text>
- <xsl:value-of select="@reference_identification_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@x12_version"/>
- <xsl:value-of select="@social_security_number"/>
- <xsl:value-of select="@prior_authorization"/>
- <xsl:value-of select="@medicaid_provider_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="NM1">
- <xsl:text disable-output-escaping="yes"><![CDATA[NM1*]]></xsl:text>
- <xsl:value-of select="@entity_identifier_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@entity_type_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@first_name"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@middle_initial"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@identification_code_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@identification_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="PER">
- <xsl:text disable-output-escaping="yes"><![CDATA[PER*]]></xsl:text>
- <xsl:value-of select="@contact_function_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@communication_number_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@communication_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="HL">
- <xsl:text disable-output-escaping="yes"><![CDATA[HL*]]></xsl:text>
- <xsl:value-of select="@heirarchical_unit_id"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@heirarchical_parent_id"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@heirarchical_level_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@heirarchical_child_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="PRV">
- <xsl:text disable-output-escaping="yes"><![CDATA[PRV*]]></xsl:text>
- <xsl:value-of select="@provider_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@reference_identification_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@reference_identifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="N3">
- <xsl:text disable-output-escaping="yes"><![CDATA[N3*]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="N4">
- <xsl:text disable-output-escaping="yes"><![CDATA[N4*]]></xsl:text>
- <xsl:value-of select="@city"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@state"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@zip"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="SBR">
- <xsl:text disable-output-escaping="yes"><![CDATA[SBR*]]></xsl:text>
- <xsl:value-of select="@payer_responsibility_sequence_number_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@insured_group_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@claim_filing_indicator_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="DMG">
- <xsl:text disable-output-escaping="yes"><![CDATA[DMG*]]></xsl:text>
- <xsl:value-of select="@date_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@birth_date"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@gender"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="CLM">
- <xsl:text disable-output-escaping="yes"><![CDATA[CLM*]]></xsl:text>
- <xsl:value-of select="@patient_account_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@facility_type_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[::]]></xsl:text>
- <xsl:value-of select="@claim_frequency_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@provider_signature_on_file"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@assignment_participation_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@benefit_assignment_certification_indicator"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@release_of_information_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@patient_signature_source_code"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="HI">
- <xsl:text disable-output-escaping="yes"><![CDATA[HI*]]></xsl:text>
- <xsl:value-of select="@principal_diagnosis_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[:]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:if test="@secondary_diagnosis_qualifier">
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@secondary_diagnosis_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[:]]></xsl:text>
- <xsl:value-of select="@secondary_diagnosis"/>
- </xsl:if>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="LX">
- <xsl:text disable-output-escaping="yes"><![CDATA[LX*]]></xsl:text>
- <xsl:value-of select="@service_line_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="SV1">
- <xsl:text disable-output-escaping="yes"><![CDATA[SV1*HC:]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@line_item_charge_amount"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*UN*]]></xsl:text>
- <xsl:value-of select="@quantity"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@diagnosis_pointers"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="DTP">
- <xsl:text disable-output-escaping="yes"><![CDATA[DTP*]]></xsl:text>
- <xsl:value-of select="@date_time_qualifier"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*RD8*]]></xsl:text>
- <xsl:value-of select="./text()"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="SE">
- <xsl:text disable-output-escaping="yes"><![CDATA[SE*]]></xsl:text>
- <xsl:value-of select="count(/ISA/GS/ST/*)+1"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@transaction_control_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="GE">
- <xsl:text disable-output-escaping="yes"><![CDATA[GE*]]></xsl:text>
- <xsl:value-of select="@number_of_transaction_sets_included"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@group_control_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- <xsl:template match="IEA">
- <xsl:text disable-output-escaping="yes"><![CDATA[IEA*]]></xsl:text>
- <xsl:value-of select="@number_of_included_functional_groups"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[*]]></xsl:text>
- <xsl:value-of select="@group_control_number"/>
- <xsl:text disable-output-escaping="yes"><![CDATA[~]]></xsl:text>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement