<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<!-- this Stylesheet is meant to fix 'unhyphenated' PIDS from CARDIOLOGY. -->
<!-- These studies to fix this way are coming from other site -->
<xsl:decimal-format name="dashes" grouping-separator='-'/>
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<!-- for when the PID is seven digits long -->
<xsl:variable name="modPatientID" select="DicomAttribute[@tag='00100020']/Value"/>
<xsl:variable name="Station" select="DicomAttribute[@tag='00081010']/Value"/>
<xsl:variable name="Acc" select="DicomAttribute[@tag='00080050']/Value"/>
<xsl:variable name="instName" select="DicomAttribute[@tag='00080080']/Value"/>
<xsl:variable name="studyDesc" select="DicomAttribute[@tag='00081030']/Value"/>
<!-- (0008,1010) Station_Name -->
<xsl:if test="string-length($modPatientID)=7">
<xsl:if test="not(contains($instName, 'JANE') or contains($instName, 'Bluestem'))">
<xsl:if test="contains($Station,'SJMC') or contains($Station, 'HOSP2') or contains($Station, 'OW_')">
<DicomAttribute tag="00100020" vr="LO">
<xsl:value-of select="concat(
substring($modPatientID, 1, 2), '-',
substring($modPatientID, 3, 2), '-',
substring($modPatientID, 5, 2), '-',
substring($modPatientID, 7)
)"/>
</DicomAttribute>
</xsl:if>
</xsl:if>
</xsl:if>
</NativeDicomModel>
</xsl:template>
</xsl:stylesheet>
--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+unsubscribe@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.
<?xml version="1.0" encoding="UTF-8"?><NativeDicomModel><DicomAttribute tag="00100020" vr="LO">11-22-33-4</DicomAttribute></NativeDicomModel>
2018-07-02 15:51:12,610 INFO [org.dcm4che3.net.Association] (EE-ManagedExecutorService-default-Thread-76) RADROUTE2<-RADARCH2(77) >> A-ASSOCIATE-RQ
2018-07-02 15:51:12,610 INFO [org.dcm4che3.net.Association] (EE-ManagedExecutorService-default-Thread-76) RADROUTE2<-RADARCH2(77) << A-ASSOCIATE-AC
2018-07-02 15:51:12,610 INFO [org.dcm4che3.net.Dimse] (EE-ManagedExecutorService-default-Thread-76) RADROUTE2<-RADARCH2(77) >> 1:C-STORE-RQ[pcid=5, prior=0
orig=RADARCH2 >> 9:C-MOVE-RQ
cuid=1.2.840.10008.5.1.4.1.1.1.1 - Digital X-Ray Image Storage - For Presentation
iuid=1.2.528.1.1001.100.4.85985.79905.2803629912.20180702203434357 - ?
tsuid=1.2.840.10008.1.2.4.90 - JPEG 2000 Image Compression (Lossless Only)
2018-07-02 15:51:12,891 INFO [org.dcm4chee.arc.store.impl.StoreServiceImpl] (EE-ManagedExecutorService-default-Thread-76) Coerce Attributes from rule: ArchiveAttributeCoercion[cn=RA600 test, priority=0, DIMSE=C_STORE_RQ, role=SCU, aets=[RADARCH2], hostNames=[], cuids=[], deIdentification=[], xslturi=${jboss.server.temp.url}/dcm4chee-arc/test.xsl, noKeywords=true, leadingCFindSCP=null, mergeMWLMatchingKey=null, mergeMWLTemplateURI=null, attributeUpdatePolicy=MERGE, nullifyIssuerOfPatientID=null, issuerOfPatientIDs=[], supplementFromDeviceName=null]
2018-07-02 15:51:12,907 INFO [org.dcm4che3.net.Association] (EE-ManagedExecutorService-default-Thread-76) RADROUTE2<-RADARCH2(77): processing 1:C-STORE-RQ[pcid=5, prior=0
orig=RADARCH2 >> 9:C-MOVE-RQ
cuid=1.2.840.10008.5.1.4.1.1.1.1 - Digital X-Ray Image Storage - For Presentation
iuid=1.2.528.1.1001.100.4.85985.79905.2803629912.20180702203434357 - ?
tsuid=1.2.840.10008.1.2.4.90 - JPEG 2000 Image Compression (Lossless Only) failed. Caused by: : org.dcm4che3.net.service.DicomServiceException: Patient ID missing in object.
<?xml version="1.0" encoding="UTF-8"?><NativeDicomModel/>
will leave the received data unchanged. So it would not explain, why the Patient ID is missing, if there was a value for the Patient ID in the original data set.--
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<!-- this Stylesheet is meant to fix 'unhyphenated' PIDS from CARDIOLOGY. -->
<!-- These studies to fix this way are coming from other site -->
<xsl:decimal-format name="dashes" grouping-separator='-'/>
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<!-- for when the PID is seven digits long -->
<xsl:variable name="modPatientID" select="DicomAttribute[@tag='00100020']/Value"/>
<xsl:variable name="Manuf" select="DicomAttribute[@tag='00080070']/Value"/>
<xsl:variable name="Acc" select="DicomAttribute[@tag='00080050']/Value"/>
<xsl:variable name="modality" select="DicomAttribute[@tag='00080060']/Value"/>
<xsl:variable name="studyDesc" select="DicomAttribute[@tag='00081030']/Value"/>
<!-- (0008,1010) Manuf_Name -->
<xsl:if test="string-length($modPatientID)=8">
<xsl:if test="not(contains($modality, 'CT') or contains($modality, 'MR'))">
<xsl:if test="contains($Manuf,'SIEMENS') or contains($Manuf, 'GE') or contains($Manuf, 'XXX')">
<DicomAttribute tag="00100020" vr="LO">
dcm2xml <dicom-file> -x <xsl-file>
<?xml version="1.0" encoding="UTF-8"?><NativeDicomModel><DicomAttribute tag="00100020" vr="LO">11-22-33-44</DicomAttribute></NativeDicomModel>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<!-- this Stylesheet is meant to join MG Phantoms into an already existing patient. -->
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<xsl:variable name="patId" select="DicomAttribute[@tag='00100020']"/>
<xsl:variable name="patName" select="DicomAttribute[@tag='00100010']"/>
<xsl:variable name="StudyDesc" select="DicomAttribute[@tag='00081030']"/>
<xsl:variable name="AccNum" select="DicomAttribute[@tag='00080050']"/>
<xsl:variable name="Mod" select="DicomAttribute[@tag='00080061']"/>
<xsl:variable name="instName" select="DicomAttribute[@tag='00080080']"/>
<xsl:variable name="station" select="DicomAttribute[@tag='00081010']"/>
<xsl:variable name="issuer" select="DicomAttribute[@tag='00100021']"/
<xsl:if test="contains($StudyDesc, 'Phantom')">
<DicomAttribute tag="00100021" vr="LO">HOSP1</DicomAttribute>
<DicomAttribute tag="00100010" vr="PN">QC^BAMG1^HOSP1</DicomAttribute>
<DicomAttribute tag="00100020" vr="LO">HOSP1-QC-MG</DicomAttribute>
<DicomAttribute tag="00080050" vr="SH">WEEKLY</DicomAttribute>
</xsl:if>
</NativeDicomModel>
</xsl:template>
</xsl:stylesheet>
<?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"/>
<!-- to correct MG phantom studies -->
<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"/>
<!-- HOSP1 MG QC-->
<xsl:if test="contains($StudyDesc, 'Phantom')"><!-- HOSP1 MG QC Weekly-->
<DicomAttribute tag="00100021" vr="LO">
<Value number="1">HOSP1</Value>
</DicomAttribute>
<DicomAttribute tag="00100010" vr="PN">
<PersonName number="1">QC^BAMG1^HOSP1</PersonName>
</DicomAttribute>
<DicomAttribute tag="00100020" vr="LO">
<Value number="1">HOSP1-QC-MG</Value>
</DicomAttribute>
<DicomAttribute tag="00080050" vr="SH">
<Value number="1">WEEKLY</Value>
</DicomAttribute>
</xsl:if>
</NativeDicomModel>
</xsl:template>
</xsl:stylesheet>
QC^BAMG1^HOSP1'
<DicomAttribute tag="00100010" vr="PN">
<PersonName number="1">QC</PersonName>
</DicomAttribute>
<DicomAttribute tag="00100010" vr="PN">
<PersonName number="2">BAMG1</PersonName>
</DicomAttribute>
<DicomAttribute tag="00100010" vr="PN">
<PersonName number="3">HOSP1</PersonName>
</DicomAttribute>
<DicomAttribute tag="00100010" vr="PN">
<PersonName number="1">
<Alphabetic>
<FamilyName>QC</
FamilyName>
<GivenName>
BAMG1</
GivenName>
<MiddleName>
HOSP1</MiddleName>
</Alphabetic>
</PersonName>
</DicomAttribute>
Gunter,
Thanks for pointing me the right direction on how to write this.
Now I can get the archive to accept my study without the error and do some coercions, but its not getting the patient name just right.
Here is what I have so far
<xsl:if test="contains($StudyDesc, 'Phantom')"><!-- HOSP1 MG QC Weekly-->
<DicomAttribute tag="00100021" vr="LO">
<Value number="1">HOSP1</Value>
</DicomAttribute>
<DicomAttribute tag="00100010" vr="PN">
<PersonName number="1">
<Alphabetic>
<FamilyName>QC</FamilyName>
<GivenName>BAMG1</GivenName>
<MiddleName>HOSP1</MiddleName>
</Alphabetic>
</PersonName>
</DicomAttribute>
<DicomAttribute tag="00100020" vr="LO">
<Value number="1">HOSP1-QC-MG</Value>
</DicomAttribute>
<DicomAttribute tag="00080050" vr="SH">
<Value number="1">WEEKLY</Value>
</DicomAttribute>
HOSP1-QC-MG, the first time added patient record with
PatID=HOSP1-QC-MG and PatName=
HOSP1^QC will stay in database. And all
the subsequent attempts to add new studies with
PatID=HOSP1-QC-MG will be double coerced, first time with your stylesheet and second time with archive rules. I had not found any method to delete such hidden records other than drop the entire database and to set
'Delete Patient On Delete Last Study' to 'true'.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<!-- this Stylesheet is meant to fix 'unhyphenated' PIDS from CARDIOLOGY. -->
<!-- These studies to fix this way are coming from other site -->
<xsl:decimal-format name="dashes" grouping-separator='-'/>
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<!-- for when the PID is seven digits long -->
<xsl:variable name="modPatientID" select="DicomAttribute[@tag='00100020']/Value"/>
<xsl:variable name="Station" select="DicomAttribute[@tag='00081010']/Value"/>
<xsl:variable name="Acc" select="DicomAttribute[@tag='00080050']/Value"/>
<xsl:variable name="instName" select="DicomAttribute[@tag='00080080']/Value"/>
<xsl:variable name="studyDesc" select="DicomAttribute[@tag='00081030']/Value"/>
<!-- (0008,1010) Station_Name -->
<xsl:if test="string-length($modPatientID)=7">
<xsl:if test="not(contains($instName, 'JANE') or contains($instName, 'Bluestem'))">
<xsl:if test="contains($Station,'HOSP1') or contains($Station, 'HOSP2') or contains($Station, 'OW_')">
<DicomAttribute tag="00100020" vr="LO">
<xsl:value-of select="concat(
substring($modPatientID, 1, 2), '-',
substring($modPatientID, 3, 2), '-',
substring($modPatientID, 5, 2), '-',
substring($modPatientID, 7)
)/Value"/>
</DicomAttribute>
</xsl:if>
</xsl:if>
</xsl:if>
</NativeDicomModel>
</xsl:template>
</xsl:stylesheet>
<DicomAttribute tag="00100020" vr="LO">
<xsl:value-of select="concat(
substring($modPatientID, 1, 2), '-',
substring($modPatientID, 3, 2), '-',
substring($modPatientID, 5, 2), '-',
substring($modPatientID, 7)
)/Value"/>
</DicomAttribute>
<DicomAttribute tag="00100020" vr="LO">
<xsl:value-of select="concat(
substring($modPatientID, 1, 2), '-',
substring($modPatientID, 3, 2), '-',
substring($modPatientID, 5, 2), '-',
substring($modPatientID, 7))"/>
</DicomAttribute>
Zaka,
2018-07-17 12:20:25,911 ERROR [stderr] (EE-ManagedExecutorService-default-Thread-22377) ERROR: 'Error checking type of the expression 'FilterParentPath(funcall(concat, [funcall(substring, [cast(variable-ref(modPatientID/node-set), string), cast(int-expr(1), real), cast(int-expr(2), real)]), literal-expr(-), funcall(substring, [cast(variable-ref(modPatientID/node-set), string), cast(int-expr(3), real), cast(int-expr(2), real)]), literal-expr(-), funcall(substring, [cast(variable-ref(modPatientID/node-set), string), cast(int-expr(5), real), cast(int-expr(2), real)]), literal-expr(-), funcall(substring, [cast(variable-ref(modPatientID/node-set), string), cast(int-expr(7), real)])]), step("child", 18))'.'
2018-07-17 12:20:25,911 ERROR [stderr] (EE-ManagedExecutorService-default-Thread-22377) FATAL ERROR: 'Could not compile stylesheet'
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<!-- this Stylesheet is meant to fix 'unhyphenated' PIDS from CARDIOLOGY. -->
<!-- These studies to fix this way are coming from HOSP1-->
<xsl:decimal-format name="dashes" grouping-separator='-'/>
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<!-- for when the PID is seven digits long -->
<xsl:variable name="modPatientID" select="DicomAttribute[@tag='00100020']/Value"/>
<xsl:variable name="Station" select="DicomAttribute[@tag='00081010']/Value"/>
<xsl:variable name="Acc" select="DicomAttribute[@tag='00080050']/Value"/>
<xsl:variable name="instName" select="DicomAttribute[@tag='00080080']/Value"/>
<xsl:variable name="studyDesc" select="DicomAttribute[@tag='00081030']/Value"/>
<!-- (0008,1010) Station_Name -->
<xsl:if test="string-length($modPatientID)=7">
<xsl:if test="not(contains($instName, 'HOSP1') or contains($instName, 'Bluestem'))">
<xsl:if test="contains($Station,'HOSP3')">
<DicomAttribute tag="00100020" vr="LO">
<xsl:value-of select=
"concat(
substring($modPatientID, 1, 2), '-',
substring($modPatientID, 3, 2), '-',
substring($modPatientID, 5, 2), '-',
substring($modPatientID, 7))/value"/>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<!-- this Stylesheet is meant to fix 'unhyphenated' PIDS from CARDIOLOGY. -->
<!-- These studies to fix this way are coming from HOSP1-->
<xsl:decimal-format name="dashes" grouping-separator='-'/>
<xsl:template match="/NativeDicomModel">
<NativeDicomModel>
<!-- for when the PID is seven digits long -->
<xsl:variable name="modPatientID" select="DicomAttribute[@tag='00100020']/Value"/>
<xsl:variable name="Station" select="DicomAttribute[@tag='00081010']/Value"/>
<xsl:variable name="Acc" select="DicomAttribute[@tag='00080050']/Value"/>
<xsl:variable name="instName" select="DicomAttribute[@tag='00080080']/Value"/>
<xsl:variable name="studyDesc" select="DicomAttribute[@tag='00081030']/Value"/>
<!-- (0008,1010) Station_Name -->
<xsl:choose>
<xsl:when test="string-length($modPatientID)=7 and
not(contains($instName, 'HOSP1') or contains($instName, 'Bluestem')) and
contains($Station,'HOSP3')">
<DicomAttribute tag="00100020" vr="LO">
<xsl:value-of select="concat(
substring($modPatientID, 1, 2), '-',
substring($modPatientID, 3, 2), '-',
substring($modPatientID, 5, 2), '-',
substring($modPatientID, 7))"/>
</DicomAttribute>
</xsl:when>
<xsl:otherwise>
<DicomAttribute tag="00100020" vr="LO">
<Value number="1">
<xsl:value-of select="$modPatientID"/>
</Value>
</DicomAttribute>
</xsl:otherwise>
</xsl:choose>
</NativeDicomModel>
</xsl:template>
</xsl:stylesheet>