Subject:Need actual Author:Rick Bomar Date:04 Apr 2007 11:35 AM Originally Posted: 04 Apr 2007 11:33 AM
How would I setup my xsl to put a literal "space" between a tag if the field is blank? I have attached an example of my xml file and my stylesheet for your review. The Tag I'm interested in is the PRESENT_ON_ADMIT Tag.
Subject:Need actual Author:Rick Bomar Date:06 Apr 2007 11:09 AM Originally Posted: 06 Apr 2007 11:08 AM
Ivan, your code did work. I tried to dup your code to another Tag line, <EXTERNAL_CAUSE> and it is working, however, the tags are being duplicated at the end of the file. I have attached my output file and my stylesheet for your review. Thanks for your help.
Subject:Need actual Author:Rick Bomar Date:09 Apr 2007 11:02 AM
No, not exactly. Look at my out put file.
<ADMIT_DIAGNOSIS>959.09</ADMIT_DIAGNOSIS>
<EXTERNAL_CAUSE>E823.0</EXTERNAL_CAUSE>
<PRESENT_ON_ADMIT>E</PRESENT_ON_ADMIT>...THIS SHOULD SHOW > <
<EXTERNAL_CAUSE>E849.8</EXTERNAL_CAUSE>
<PRESENT_ON_ADMIT>E</PRESENT_ON_ADMIT>...THIS SHOULD SHOW > <
<ARRIVAL_HOUR>04</ARRIVAL_HOUR>
<PRESENT_ON_ADMIT> </PRESENT_ON_ADMIT>..THIS LINE SHOULD REPLACE ABOVE
<PRESENT_ON_ADMIT> </PRESENT_ON_ADMIT>..THIS LINE SHOULD REPLACE ABOVE
The code I added is replacing E with a blank but putting the tag at the end of the record when it should be replacing the value of the original tag.
Subject:Need actual Author:Rick Bomar Date:09 Apr 2007 03:29 PM Originally Posted: 09 Apr 2007 03:09 PM
After making your suggested change, it is still putting the modified tags at the END of the file instead of replacing the tag where it belongs. I believe the problem lies in the following line:
<xsl:copy-of select="ATTENDING_PHYS_ID/following-sibling::*"/>
The probelm is there are 26 TAGS after <ATTENDING_PHYS_ID> before I get to my first <EXTERNAL_CAUSE> tag. Then I need to process the <PRESENT_ON_ADMIT> tag. then, copy the rest of the file in normal order of the tags to the end of record.
HERES MY CODE...
Subject:Need actual Author:Ivan Pedruzzi Date:09 Apr 2007 05:17 PM
Rick
When i apply the styleshet to the data you have posted I get an output that does not contain any
<PRESENT_ON_ADMIT>E</PRESENT_ON_ADMIT>
In your input document there is not such element PRESENT_ON_ADMIT with value E. However there are other values that you may need to escape like ., -, V, A, U ect.
A single template should do the work, see the attached solution.
Subject:Need actual Author:Rick Bomar Date:11 Apr 2007 09:33 AM Originally Posted: 11 Apr 2007 09:31 AM
I don't think you are following what it is I need. If you look at the following record, after <ADMIT_DIAGNOSIS>, If the following <PRESENT_ON_ADMIT> is equal to an 'E' and only and 'E', then replace the 'E' with a ' '(blank). The ,PRESENT_ON_ADMIT> tag occurs three times, after each <EXTERNAL_CAUSE> tag, if there was an External Cause value, if no value it does not output.
Subject:Need actual Author:Rick Bomar Date:18 Apr 2007 09:41 AM
Ok, Ivan, I still need help. After adding your changes to my xsl, I am still not able to translate <PRESENT_ON_ADMIT> if it contains an 'E' character to a ' ' blank. This is only a one character field and should be translated to a blank if it contains an 'E'. As you can see in my final Output file, TEST 07 IP.xml, the <PRESENT_ON_ADMIT> for <OTHER_CODE> works fine. However, the <PRESENT_ON_ADMIT> which comes after the <ADMIT_DIAGNOSIS> is not working. Please help me solve this problem.