Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 3rd, 2008, 08:45 AM
Authorized User
Points: 168, Level: 3
Points: 168, Level: 3 Points: 168, Level: 3 Points: 168, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: New Market, Maryland, USA.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default IF Statements with OID

If an OID address is used is there something that needs to be done in the statement to accept the decimal points in the #? The following is an example of this. I am only getting a return of one value.

<xsl:for-each select="/n1:ClinicalDocument/n1:component/n1:structuredBody/n1:component">
<xsl:sort select="./n1:section/n1:effectiveTime/n1:low/@value"/>
<xsl:if test="./n1:section/n1:templateId/@root='2.16.840.1.113883.10.20.1.8'">
<td width='10%' align='left' valign="top">
<xsl:value-of select="./n1:section/n1:entry/n1:substanceAdministration/n1:effectiveTime/n1:period/@value"/><xsl:value-of select="./n1:entry/n1:substanceAdministration/n1:effectiveTime/n1:period/@unit"/>
</td>
</xsl:if>
</xsl:for-each>

Thanks!

Reply With Quote
  #2 (permalink)  
Old June 3rd, 2008, 09:07 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please give some context: what's in your source document, what do you mean by an OID (you can't assume there is only one meaning for an abbreviation like this), what output do you want, what output are you getting, what XSLT version are you using.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old June 3rd, 2008, 10:52 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I think you mean this:

<xsl:if test="./n1:section/n1:templateId[@root='2.16.840.1.113883.10.20.1.8']">

/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
  #4 (permalink)  
Old June 3rd, 2008, 11:26 AM
Authorized User
Points: 168, Level: 3
Points: 168, Level: 3 Points: 168, Level: 3 Points: 168, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: New Market, Maryland, USA.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My apologizes. Thank you for the reply.

xsl:stylesheet version="1.0"
xml version="1.0"

The OID is an object identifier to identify a section within an XML healthcare document. This specific root OID is a Healthcare OID that specifies a patient's "Problem List". There are multiple OIDs listed throughout the XML document that could reference different items within the document.

I am wanting the XSLT to go through the XML document find this specific OID and return all selected values listed under the OID.

XML data (Portion of the data)
<component>
        <section>

          <templateId root="2.16.840.1.113883.10.20.1.11" />
          <code code="11450-4" displayName="Problem list" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
          <title>Problems</title>
          <text />

          <entry typeCode="DRIV">

            <act classCode="ACT" moodCode="EVN">

              <templateId root="2.16.840.1.113883.10.20.1.27" />
              <templateId root="2.16.840.1.113883.3.88.11.32.7." />
              <id root="ec8a6ff8-ed4b-4f7e-82c3-e98e58b45de7" />
              <code nullFlavor="NA" />
              <entryRelationship typeCode="SUBJ">
                <observation classCode="OBS" moodCode="EVN">

                  <templateId root="2.16.840.1.113883.10.20.1.28" />
                  <id root="ab1791b0-5c71-11db-b0de-0800200c9a66" />

                  <effectiveTime>
                    <low value="20070509" />
                  </effectiveTime>

                  <code code="55607006" displayName="Problem" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" />
                  <statusCode code="completed" />
                  <text>
                    <reference value="#prob1" />
                  </text>

                  <value xsi:type="CD" code="251166008" displayName="AV Nodal Reentry Tachycardia" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />

                  <entryRelationship typeCode="REFR">
                    <observation classCode="OBS" moodCode="EVN">

                      <templateId root="2.16.840.1.113883.10.20.1.50"></templateId>
                      <templateId root="2.16.840.1.113883.10.20.1.57" />
                      <code code="33999-4" displayName="Status" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
                      <statusCode code="completed" />

                      <value xsi:type="CE" code="413322009" displayName="Resolved" codeSystem="2.16.840.1.113883.1.11.20.13" codeSystemName="ProblemStatusCode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
                    </observation>
                  </entryRelationship>
                </observation>
              </entryRelationship>
            </act>

Reply With Quote
  #5 (permalink)  
Old June 3rd, 2008, 12:08 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I can't see anything immediately wrong with your code. Your expression

<xsl:if test="./n1:section/n1:templateId/@root='2.16.840.1.113883.10.20.1.8'">

is equivalent to Sam's

test="./n1:section/n1:templateId[@root='2.16.840.1.113883.10.20.1.8']">

When you're dealing with a schema as complex as these healthcare vocabularies, there can be a lot of benefit in the XSLT 2.0 feature of writing schema-aware stylesheets. If you get into the habit of using schema-aware types in your match patterns and variable declarations, a lot of coding mistakes will be reported at compile time that otherwise take hours of run-time debugging.


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements brainchild Javascript 2 March 1st, 2007 06:08 AM
If Then Statements in XSL deltree XSLT 2 June 6th, 2006 03:02 PM
Openquery statements aven SQL Server 2000 2 January 11th, 2006 01:33 AM
IF ELSE statements gmpurple Classic ASP Databases 4 November 15th, 2004 04:30 PM
If, else if statements Joel JSP Basics 0 March 18th, 2004 06:17 PM



All times are GMT -4. The time now is 02:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.