DCM4CHEE V5.15.0
Hello all,
Trying to coerce the Institution name (tag 0008,0080') by testing if the patient is a certain value and I cannot get the tags coerced.
Can someone look at my stylesheet and maybe tell me if I need to set the variable of "patName" to somehow select the FamilyName? I've read over the wiki, but I don't see any examples that include Patient Name for what I'm looking to achieve here.
I want to test if the last name of the patient contains 'TEST-PROD' and if so, then replace the Issuer and the Institution Name according to my stylesheet below.
Thank you
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<xsl:variable name="patId" select="DicomAttribute[@tag='00100020']/Value"/>
<xsl:variable name="patName" select="DicomAttribute[@tag='00100010']/Value"/>
<xsl:variable name="StudyDesc" select="DicomAttribute[@tag='00081030']/Value"/>
<xsl:variable name="AccNum" select="DicomAttribute[@tag='00080050']/Value"/>
<xsl:variable name="Mod" select="DicomAttribute[@tag='00080061']/Value"/>
<xsl:variable name="instName" select="DicomAttribute[@tag='00080080']/Value"/>
<xsl:variable name="station" select="DicomAttribute[@tag='00081010']/Value"/>
<xsl:variable name="issuer" select="DicomAttribute[@tag='00100021']/Value"/>
<!-- TEST -->
<xsl:if test="contains($patName, 'TEST-PROD')"><!-- testing patient name here -->
<DicomAttribute tag="00100021" vr="LO">
<Value number="1">HOSP1</Value>
</DicomAttribute>
<DicomAttribute tag="00080080" vr="LO">
<Value number="1">HOSP1</Value>
</DicomAttribute>
</xsl:if>
</NativeDicomModel>
</xsl:template>
</xsl:stylesheet>