Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#1 Post by Stephen D. Scotti »

In the final stages of setting up Modality Worklists to be used with a custom RIS application and with an Orthanc PACS. The RIS is just sending an HL7 message to a Python Script on Orthanc, and that creates a .txt template, which is then converted to a .wl file by dump2dcm. Orthanc then uses those .wl files in its WorkLists folder to respond to C-Find requests from the scanner, which is an Esaote G-scan at this point that we are working with. It can get a little complicated, so I am providing what I think is essential to address the question. Things are actually "working", with a couple of issues regarding the StudyDescription Tag and the way that annotations are displayed for a study in various viewers. There is some dummy data in there.

The issue that I am having mostly is that the StudyDescription Tag for the study is not getting populated, even though (0008,1030) LO [MWL Testing] # 12, 1 StudyDescription is in the MWL. I realize that it probably has to pull from a different sequence or something, and it may also be that for the G-scan, the operator is actually forced to enter that manually for some reason. The probably is that the the name for the study ordered through the RIS is not automatically populating that field. The StudyInstanceID does get populated, but I need to tweak the algorithm for that. I did read somewhere also that it might need to be padded with a NULL byte in some cases ?

Another issue I notied is that the AccessionNumber is not being displayed as an annotation like it usually does, even though that tag is populated.

Another issue is that I am still a bit unfamiliar with how to use the MWL. I would like to be able specify multiple exams / Step Sequences in a single order, which I guess you can by just specifying another Sequence, but I want to get it working as desired with just one study for now. Also, Orthanc does not support MPPS out of the box, but it might be possible to do that with a Python script, something that I would like to do later.

Would appreciate feedback and suggestions. It seems that it just needs a bit of tweaking to get it working as desired.

The dicom tags that I get back from Orthanc when I do a query on the study are like shown below, so StudyDescription is missing. StudyID is helpful because that can also cross-reference to our internal system.

AccessionNumber""DEVACC00000042"
InstitutionName"""
ReferringPhysicianName""0001:Scotti^Stephen"
StudyDate""20210503"
StudyID""0055"
StudyInstanceUID""1.3.6.1.4.1.56016.1.112"
StudyTime""122923"
ParentPatient""4a46f887-cbc8e696-54c9d8ff-8b225177-acbf3a81"

PatientBirthDate""20210415"
PatientID""5388.668940371"
PatientName""QC^Esaote G-scan"
PatientSex""M"
Type""Study"
imagecount"10
modalities"[ "MR" ]
LastUpdate_formatted""2021-05-03 17:39:12"



Below are a number of logs and dcmdumps of the relevant files:

ORTHANC LOG OF C-FIND REQUEST:

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0008,0050) SH (no value available) # 0, 0 AccessionNumber
(0008,0090) PN (no value available) # 0, 0 ReferringPhysicianName
(0008,1080) LO (no value available) # 0, 0 AdmittingDiagnosesDescription
(0008,1110) SQ (Sequence with explicit length #=0) # 0, 1 ReferencedStudySequence
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0010,0010) PN (no value available) # 0, 0 PatientName
(0010,0020) LO (no value available) # 0, 0 PatientID
(0010,0030) DA (no value available) # 0, 0 PatientBirthDate
(0010,0040) CS (no value available) # 0, 0 PatientSex
(0010,1020) DS (no value available) # 0, 0 PatientSize
(0010,1030) DS (no value available) # 0, 0 PatientWeight
(0010,2180) SH (no value available) # 0, 0 Occupation
(0010,21b0) LT (no value available) # 0, 0 AdditionalPatientHistory
(0010,4000) LT (no value available) # 0, 0 PatientComments
(0020,000d) UI (no value available) # 0, 0 StudyInstanceUID
(0032,1060) LO (no value available) # 0, 0 RequestedProcedureDescription
(0032,1064) SQ (Sequence with explicit length #=0) # 0, 1 RequestedProcedureCodeSequence
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,0100) SQ (Sequence with undefined length #=1) # u/l, 1 ScheduledProcedureStepSequence
(fffe,e000) na (Item with undefined length #=7) # u/l, 1 Item
(0008,0060) CS [MR] # 2, 1 Modality
(0040,0001) AE [NmrEsaote] # 10, 1 ScheduledStationAETitle
(0040,0002) DA [20210426-20210426] # 18, 1 ScheduledProcedureStepStartDate
(0040,0003) TM (no value available) # 0, 0 ScheduledProcedureStepStartTime
(0040,0007) LO (no value available) # 0, 0 ScheduledProcedureStepDescription
(0040,0008) SQ (Sequence with explicit length #=0) # 0, 1 ScheduledProtocolCodeSequence
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,0009) SH (no value available) # 0, 0 ScheduledProcedureStepID
(fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
(0040,1001) SH (no value available) # 0, 0 RequestedProcedureID

T0426 15:53:22.363126 OrthancPlugins.cpp:5005] (plugins) Calling service 7003 from plugin /usr/share/orthanc/plugins/libModalityWorklists.so
T0426 15:53:22.363377 OrthancPlugins.cpp:5005] (plugins) Calling service 21 from plugin /usr/share/orthanc/plugins/libModalityWorklists.so
I0426 15:53:22.363754 PluginsManager.cpp:172] (plugins) Received worklist query from remote modality NmrEsaote:
{
"0008,0050" : "",
"0008,0090" : "",
"0008,1080" : "",
"0008,1110" : [],
"0010,0010" : "",
"0010,0020" : "",
"0010,0030" : "",
"0010,0040" : "",
"0010,1020" : "",
"0010,1030" : "",
"0010,2180" : "",
"0010,21b0" : "",
"0010,4000" : "",
"0020,000d" : "",
"0032,1060" : "",
"0032,1064" : [],
"0040,0100" : [
{
"0008,0060" : "MR",
"0040,0001" : "NmrEsaote",
"0040,0002" : "20210426-20210426",
"0040,0003" : "",
"0040,0007" : "",
"0040,0008" : [],
"0040,0009" : ""
}
],
"0040,1001" : ""
}


ORTHANC RESPONSE TO C-FIND REQUEST

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0008,0005) CS [ISO_IR 192] # 10, 1 SpecificCharacterSet
(0008,0050) SH [DEVACC00000026] # 14, 1 AccessionNumber
(0008,0090) PN [0001:Scotti^Stephen^^^,] # 24, 1 ReferringPhysicianName
(0010,0010) PN [Mouse^Mickey^LIttle] # 20, 1 PatientName
(0010,0020) LO [DEV0000002] # 10, 1 PatientID
(0010,0030) DA [19571116] # 8, 1 PatientBirthDate
(0010,0040) CS [M] # 2, 1 PatientSex
(0010,21b0) LT [test] # 4, 1 AdditionalPatientHistory
(0020,000d) UI [1.3.6.1.4.1.56016.1.20210426110000] # 34, 1 StudyInstanceUID
(0040,0100) SQ (Sequence with explicit length #=1) # 0, 1 ScheduledProcedureStepSequence
(fffe,e000) na (Item with undefined length #=6) # u/l, 1 Item
(0008,0060) CS [MR] # 2, 1 Modality
(0040,0001) AE [NmrEsaote] # 10, 1 ScheduledStationAETitle
(0040,0002) DA [20210426] # 8, 1 ScheduledProcedureStepStartDate
(0040,0003) TM [110000] # 6, 1 ScheduledProcedureStepStartTime
(0040,0007) LO [MRI BRAIN / BRAIN STEM] # 22, 1 ScheduledProcedureStepDescription
(0040,0009) SH [0001] # 4, 1 ScheduledProcedureStepID
(fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem

so the query is filtering on the ScheduledProcedureStepSequence tags.

I have modifed the MWL files multiple times, with the current setup having a form like this:

CURRENT MWL SETUP

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0008,0005) CS [ISO_IR 192] # 10, 1 SpecificCharacterSet
(0008,0050) SH [DEVACC00000042] # 14, 1 AccessionNumber
(0008,0090) PN [0001:Scotti^Stephen^^^^] # 24, 1 ReferringPhysicianName
(0008,0096) SQ (Sequence with explicit length #=1) # 144, 1 ReferringPhysicianIdentificationSequence
(fffe,e000) na (Item with explicit length #=3) # 136, 1 Item
(0008,0080) LO [Cayman Medical Ltd.] # 20, 1 InstitutionName
(0040,1101) SQ (Sequence with explicit length #=1) # 48, 1 PersonIdentificationCodeSequence
(fffe,e000) na (Item with explicit length #=3) # 40, 1 Item
(0008,0100) SH [0001] # 4, 1 CodeValue
(0008,0102) SH [L] # 2, 1 CodingSchemeDesignator
(0008,0104) LO [Local Code] # 10, 1 CodeMeaning
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,1103) LO [US-6513130209^WPN^PH^sscotti@sscotti.org] # 40, 1 PersonTelephoneNumbers
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0008,1030) LO [MWL Testing] # 12, 1 StudyDescription
(0008,1080) LO [BILLER HAS A HEADEACHE] # 22, 1 AdmittingDiagnosesDescription
(0010,0010) PN [QC^Esaote G-scan^] # 18, 1 PatientName
(0010,0020) LO [5388.668940371] # 14, 1 PatientID
(0010,0030) DA [20210415] # 8, 1 PatientBirthDate
(0010,0040) CS [M] # 2, 1 PatientSex
(0010,1020) DS (no value available) # 0, 0 PatientSize
(0010,1030) DS (no value available) # 0, 0 PatientWeight
(0010,1040) LO [P.O. Box 32322^71 Eastern Ave^George Town^OS^KY1-1209^KY] # 56, 1 PatientAddress
(0010,2000) LO (no value available) # 0, 0 MedicalAlerts
(0010,2110) LO (no value available) # 0, 0 Allergies
(0010,2180) SH (no value available) # 0, 0 Occupation
(0010,21b0) LT [test] # 4, 1 AdditionalPatientHistory
(0010,4000) LT (no value available) # 0, 0 PatientComments
(0020,000d) UI [1.3.6.1.4.1.56016.1.112] # 24, 1 StudyInstanceUID
(0032,1060) LO [MWL Testing] # 12, 1 RequestedProcedureDescription
(0032,1064) SQ (Sequence with explicit length #=1) # 62, 1 RequestedProcedureCodeSequence
(fffe,e000) na (Item with explicit length #=3) # 54, 1 Item
(0008,0100) SH [0032,1064] # 10, 1 CodeValue
(0008,0102) SH [0032,1064] # 10, 1 CodingSchemeDesignator
(0008,0104) LO [0032,1064] # 10, 1 CodeMeaning
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,0100) SQ (Sequence with explicit length #=1) # 152, 1 ScheduledProcedureStepSequence
(fffe,e000) na (Item with explicit length #=6) # 144, 1 Item
(0008,0060) CS [MR] # 2, 1 Modality
(0040,0001) AE [NmrEsaote] # 10, 1 ScheduledStationAETitle
(0040,0002) DA [20210503] # 8, 1 ScheduledProcedureStepStartDate
(0040,0003) TM [110000] # 6, 1 ScheduledProcedureStepStartTime
(0040,0008) SQ (Sequence with explicit length #=1) # 62, 1 ScheduledProtocolCodeSequence
(fffe,e000) na (Item with explicit length #=3) # 54, 1 Item
(0008,0100) SH [0040,0008] # 10, 1 CodeValue
(0008,0102) SH [0040,0008] # 10, 1 CodingSchemeDesignator
(0008,0104) LO [0040,0008] # 10, 1 CodeMeaning
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,0009) SH [0055] # 4, 1 ScheduledProcedureStepID
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,1001) SH [0055] # 4, 1 RequestedProcedureID


A dcmdump of an instance created from that MWL file look like:

DCMDUMP OF INSTANCE CREATED FROM ABOVE MWL

# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: Little Endian Explicit
(0002,0000) UL 180 # 4, 1 FileMetaInformationGroupLength
(0002,0001) OB 00\01 # 2, 1 FileMetaInformationVersion
(0002,0002) UI =MRImageStorage # 26, 1 MediaStorageSOPClassUID
(0002,0003) UI [1.3.76.2.1.1.4.1.3.5388.670678236.2] # 36, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID
(0002,0012) UI [1.2.276.0.7230010.3.0.3.6.4] # 28, 1 ImplementationClassUID
(0002,0013) SH [OFFIS_DCMTK_364] # 16, 1 ImplementationVersionName

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
(0008,0008) CS [ORIGINAL\PRIMARY\T1 MAP] # 24, 3 ImageType
(0008,0016) UI =MRImageStorage # 26, 1 SOPClassUID
(0008,0018) UI [1.3.76.2.1.1.4.1.3.5388.670678236.2] # 36, 1 SOPInstanceUID
(0008,0020) DA [20210503] # 8, 1 StudyDate
(0008,0021) DA [20210503] # 8, 1 SeriesDate
(0008,0022) DA [20210503] # 8, 1 AcquisitionDate
(0008,0023) DA [20210503] # 8, 1 ContentDate
(0008,0030) TM [122923] # 6, 1 StudyTime
(0008,0031) TM [123035] # 6, 1 SeriesTime
(0008,0032) TM [123035] # 6, 1 AcquisitionTime
(0008,0033) TM [123037] # 6, 1 ContentTime
(0008,0050) SH [DEVACC00000042] # 14, 1 AccessionNumber
(0008,0060) CS [MR] # 2, 1 Modality
(0008,0070) LO [ESAOTE] # 6, 1 Manufacturer
(0008,0080) LO [Cayman Medical Ltd.] # 20, 1 InstitutionName
(0008,0090) PN [0001:Scotti^Stephen] # 20, 1 ReferringPhysicianName
(0008,1010) SH [G-scan Brio MRI] # 16, 1 StationName
(0008,103e) LO [0? - Scout] # 10, 1 SeriesDescription
(0008,1040) LO [George Town, Grand Cayman] # 26, 1 InstitutionalDepartmentName
(0008,1090) LO [G-scan Brio] # 12, 1 ManufacturerModelName
(0008,1111) SQ (Sequence with explicit length #=1) # 82, 1 ReferencedPerformedProcedureStepSequence
(fffe,e000) na (Item with explicit length #=2) # 74, 1 Item
(0008,1150) UI =ModalityPerformedProcedureStepSOPClass # 24, 1 ReferencedSOPClassUID
(0008,1155) UI [1.3.76.2.1.1.4.1.5.5388.670678061] # 34, 1 ReferencedSOPInstanceUID
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0010,0010) PN [QC^Esaote G-scan] # 16, 1 PatientName
(0010,0020) LO [5388.668940371] # 14, 1 PatientID
(0010,0030) DA [20210415] # 8, 1 PatientBirthDate
(0010,0040) CS [M] # 2, 1 PatientSex
(0010,1020) DS [0] # 2, 1 PatientSize
(0010,21b0) LT [test] # 4, 1 AdditionalPatientHistory
(0011,0010) LO [V1] # 2, 1 PrivateCreator
(0011,1001) OB 39\33\fe\a9\73\7d\d4\11\8d\b4\00\60\97\e3\f6\5e\90\ab\12\fe\31\00... # 8322, 1 Unknown Tag & Data
(0011,1002) DS [0.019734999] # 12, 1 Unknown Tag & Data
(0011,1003) DS [238\3071] # 8, 2 Unknown Tag & Data
(0011,1004) DS [340.64902] # 10, 1 Unknown Tag & Data
(0011,1008) DS [13020.833] # 10, 1 Unknown Tag & Data
(0018,0015) CS [OTHER] # 6, 1 BodyPartExamined
(0018,0020) CS [SE] # 2, 1 ScanningSequence
(0018,0021) CS [NONE] # 4, 1 SequenceVariant
(0018,0022) CS [PFP\PFF] # 8, 2 ScanOptions
(0018,0023) CS [2D] # 2, 1 MRAcquisitionType
(0018,0024) SH [SCOUT] # 6, 1 SequenceName
(0018,0050) DS [7] # 2, 1 SliceThickness
(0018,0080) DS [100] # 4, 1 RepetitionTime
(0018,0081) DS [16] # 2, 1 EchoTime
(0018,0083) DS [1] # 2, 1 NumberOfAverages
(0018,0084) DS [10.359198] # 10, 1 ImagingFrequency
(0018,0085) SH [1H] # 2, 1 ImagedNucleus
(0018,0086) IS [1] # 2, 1 EchoNumbers
(0018,0087) DS [0.25] # 4, 1 MagneticFieldStrength
(0018,0091) IS [1] # 2, 1 EchoTrainLength
(0018,0095) DS [81.380211] # 10, 1 PixelBandwidth
(0018,1000) LO [5388] # 4, 1 DeviceSerialNumber
(0018,1020) LO [Release 7.01.01 F070102 E-MRI Brio] # 34, 1 SoftwareVersions
(0018,1250) SH [1] # 2, 1 ReceiveCoilName
(0018,1310) US 0\160\128\0 # 8, 4 AcquisitionMatrix
(0018,1312) CS [ROW] # 4, 1 InPlanePhaseEncodingDirection
(0018,1314) DS [90] # 2, 1 FlipAngle
(0018,5100) CS [FFS] # 4, 1 PatientPosition
(0020,000d) UI [1.3.6.1.4.1.56016.1.112] # 24, 1 StudyInstanceUID
(0020,000e) UI [1.3.76.2.1.1.4.1.3.5388.670678236] # 34, 1 SeriesInstanceUID
(0020,0010) SH [0055] # 4, 1 StudyID
(0020,0011) IS [1] # 2, 1 SeriesNumber
(0020,0013) IS [3] # 2, 1 InstanceNumber
(0020,0032) DS [-90\0\90] # 8, 3 ImagePositionPatient
(0020,0037) DS [1\0\0\0\0\-1] # 12, 6 ImageOrientationPatient
(0020,0052) UI [1.3.76.2.1.1.4.1.4.5388.670678235] # 34, 1 FrameOfReferenceUID
(0020,1002) IS [3] # 2, 1 ImagesInAcquisition
(0020,1040) LO (no value available) # 0, 0 PositionReferenceIndicator
(0020,1041) DS [0] # 2, 1 SliceLocation
(0028,0002) US 1 # 2, 1 SamplesPerPixel
(0028,0004) CS [MONOCHROME2] # 12, 1 PhotometricInterpretation
(0028,0010) US 256 # 2, 1 Rows
(0028,0011) US 256 # 2, 1 Columns
(0028,0030) DS [0.703125\0.703125] # 18, 2 PixelSpacing
(0028,0100) US 16 # 2, 1 BitsAllocated
(0028,0101) US 12 # 2, 1 BitsStored
(0028,0102) US 11 # 2, 1 HighBit
(0028,0103) US 0 # 2, 1 PixelRepresentation
(0028,1050) DS [1255] # 4, 1 WindowCenter
(0028,1051) DS [2484] # 4, 1 WindowWidth
(0028,2110) CS [00] # 2, 1 LossyImageCompression
(0040,0244) DA [20210503] # 8, 1 PerformedProcedureStepStartDate
(0040,0245) TM [122923] # 6, 1 PerformedProcedureStepStartTime
(0040,0253) SH [670678163] # 10, 1 PerformedProcedureStepID
(0040,0275) SQ (Sequence with explicit length #=1) # 126, 1 RequestAttributesSequence
(fffe,e000) na (Item with explicit length #=4) # 118, 1 Item
(0032,1060) LO [MWL Testing] # 12, 1 RequestedProcedureDescription
(0040,0008) SQ (Sequence with explicit length #=1) # 62, 1 ScheduledProtocolCodeSequence
(fffe,e000) na (Item with explicit length #=3) # 54, 1 Item
(0008,0100) SH [0040,0008] # 10, 1 CodeValue
(0008,0102) SH [0040,0008] # 10, 1 CodingSchemeDesignator
(0008,0104) LO [0040,0008] # 10, 1 CodeMeaning
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0040,0009) SH [0055] # 4, 1 ScheduledProcedureStepID
(0040,1001) SH [0055] # 4, 1 RequestedProcedureID
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(7fe0,0010) OW 0000\0000\0000\0001\0001\0001\0001\0001\0001\0001\0001\0001\0001... # 131072, 1 PixelData

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#2 Post by Stephen D. Scotti »

I think the Conformance Statement for the scanner is available here: https://www.esaote.com/uploads/tx_esaot ... el_3-6.pdf

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#3 Post by Michael Onken »

Hi,
  • Study Description: The simple general rule is that the worklist server only returns what you ask it for. So the request must contain StudyDescription (with empty value) to get the description back from the worklist server.
  • Study Instance UID: Yes, a single(!) NULL byte is used to make the UID value even length, if it is odd.
  • AccessionNumber: It is up to the client to decide what is displayed or not. Scanning through the Conformance Statement the system should display the Accession Number (but I only took a thorough look).
  • Multiple exams: Every "exam" (i.e. job for the machine, or in DICOM terms scheduled procedure step) must be in a separate file.
Hope this helps :-)

Best regards,
Michael

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#4 Post by Stephen D. Scotti »

Hey Michael,

Thank you so much. Turns out one of the people that I am working with is "German".

So if Esaote added:

(0008,1030) LO (no value available) # 0, 0 StudyDescription

to the query, then that value would be returned to the scanner and they could use that to populate that tag ?

I've had some exchanges with the vendor, and it sounds like the system is designed in a way that the operator is required to manually type in the StudyDescription. Kind of weird, but I am handling all of this remotely, which is not easy because I've been using Skype to deal with the on-site IT person and the MRI tech. I have a screen shot from the tech that looks like this. You can see the exam populating the exam list, but the StudyDescription is blank.

For the StudyInstanceUID, we have our own root, so I might just use something like a unique RIS ID for the MWL file creator, a unique device ID for the acquisition device, a 1 or 0 for production vs. development, and then maybe the row id for the order in the RIS database (not the accession), and then pack it with a NULL byte at the end if necessary. Wondering if that sounds like it would work ?

The AccessionNumber is populating the instances, so not really sure why it is not showing in the viewers that I am using.

Re: Multiple exams. Is is possible to have say a MRI Brain & MRI C-spine specified in a single MWL file. We are only using MRI, but a similar request for CT would be a chest, abdomen and pelvis all under one accession, or a chest under one accession and an abdomen and pelvis under another, but in one MWL. There are billing implications for the way that they are ordered and read, but just wondering if 2 or more studies can be ordered with a single MWL.

Finally, regarding the use of MPPS. I think the machine automatically sends those once they start scanning from the MWL, but Orthanc and the RIS do not yet have that built in, although Orthanc could delete a MWL file when it receives a study my using a Lua script or a python plug-in.

Image

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#5 Post by Stephen D. Scotti »

Kind of wondering if I can use a Lua script on Orthanc server to modify incoming requests like, just modify it to query['0008,1030'] = '' ? Not sure what goes there, like *, NULL, etc. Presumably, Orthanc would then return that value if it is defined in the .wl file and send it in the response to the acquisition device. What I don't know is if the scanner will reject the response, or otherwise not use the value that is returned. If that works, would be a really nice feature to customize MWL responses.


function IncomingWorklistRequestFilter(query, origin)
PrintRecursive(query)
PrintRecursive(origin)

-- Implements the same behavior as the "FilterIssuerAet"
-- option of the sample worklist plugin
-- query['0040,0100'][1]['0040,0001'] = origin['RemoteAet']
query['0008,1030'] = '*'
return query
end

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#6 Post by Stephen D. Scotti »

That Lua script actually works. Do I need to, or can I, add that tag, query['0008,1030'], and others that I want to the Scheduled Procedure Step or at the root of the .wl file ? It may be that I have to do the same for AccessionNumber and StudyInstanceUID, put them in the Scheduled Procedure Step, and configure the Lua script to add them to the sequence module ? I can try that, but it is kind of tiral and error or succes at this point.

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#7 Post by Stephen D. Scotti »

Code: Select all

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0008,0005) CS [ISO_IR 192]                             #  10, 1 SpecificCharacterSet
(0008,0050) SH [DEVACC00000045]                         #  14, 1 AccessionNumber
(0008,0090) PN [0001:Scotti^Stephen^^^^]                #  24, 1 ReferringPhysicianName
(0008,0096) SQ (Sequence with explicit length #=1)      # 144, 1 ReferringPhysicianIdentificationSequence
  (fffe,e000) na (Item with explicit length #=3)          # 136, 1 Item
    (0008,0080) LO [Cayman Medical Ltd.]                    #  20, 1 InstitutionName
    (0040,1101) SQ (Sequence with explicit length #=1)      #  48, 1 PersonIdentificationCodeSequence
      (fffe,e000) na (Item with explicit length #=3)          #  40, 1 Item
        (0008,0100) SH [0001]                                   #   4, 1 CodeValue
        (0008,0102) SH [L]                                      #   2, 1 CodingSchemeDesignator
        (0008,0104) LO [Local Code]                             #  10, 1 CodeMeaning
      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
    (0040,1103) LO [US-6513130209^WPN^PH^sscotti@sscotti.org] #  40, 1 PersonTelephoneNumbers
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
(0008,1030) LO [MWL Testing]                            #  12, 1 StudyDescription
(0008,1080) LO [BILLER HAS A HEADEACHE]                 #  22, 1 AdmittingDiagnosesDescription
(0010,0010) PN [QC^Esaote G-scan^]                      #  18, 1 PatientName
(0010,0020) LO [5388.668940371]                         #  14, 1 PatientID
(0010,0030) DA [20210415]                               #   8, 1 PatientBirthDate
(0010,0040) CS [M]                                      #   2, 1 PatientSex
(0010,1020) DS (no value available)                     #   0, 0 PatientSize
(0010,1030) DS (no value available)                     #   0, 0 PatientWeight
(0010,1040) LO [P.O. Box 32322^71 Eastern Ave^George Town^OS^KY1-1209^KY] #  56, 1 PatientAddress
(0010,2000) LO (no value available)                     #   0, 0 MedicalAlerts
(0010,2110) LO (no value available)                     #   0, 0 Allergies
(0010,2180) SH (no value available)                     #   0, 0 Occupation
(0010,21b0) LT [test]                                   #   4, 1 AdditionalPatientHistory
(0010,4000) LT (no value available)                     #   0, 0 PatientComments
(0020,000d) UI [1.3.6.1.4.1.56016.1.116]                #  24, 1 StudyInstanceUID
(0032,1060) LO [MWL Testing]                            #  12, 1 RequestedProcedureDescription
(0032,1064) SQ (Sequence with explicit length #=1)      #  62, 1 RequestedProcedureCodeSequence
  (fffe,e000) na (Item with explicit length #=3)          #  54, 1 Item
    (0008,0100) SH [0032,1064]                              #  10, 1 CodeValue
    (0008,0102) SH [0032,1064]                              #  10, 1 CodingSchemeDesignator
    (0008,0104) LO [0032,1064]                              #  10, 1 CodeMeaning
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
(0040,0100) SQ (Sequence with explicit length #=1)      # 172, 1 ScheduledProcedureStepSequence
  (fffe,e000) na (Item with explicit length #=7)          # 164, 1 Item
    (0008,0060) CS [MR]                                     #   2, 1 Modality
    (0008,1030) LO [MWL Testing]                            #  12, 1 StudyDescription
    (0040,0001) AE [NmrEsaote]                              #  10, 1 ScheduledStationAETitle
    (0040,0002) DA [20210504]                               #   8, 1 ScheduledProcedureStepStartDate
    (0040,0003) TM [163000]                                 #   6, 1 ScheduledProcedureStepStartTime
    (0040,0008) SQ (Sequence with explicit length #=1)      #  62, 1 ScheduledProtocolCodeSequence
      (fffe,e000) na (Item with explicit length #=3)          #  54, 1 Item
        (0008,0100) SH [0040,0008]                              #  10, 1 CodeValue
        (0008,0102) SH [0040,0008]                              #  10, 1 CodingSchemeDesignator
        (0008,0104) LO [0040,0008]                              #  10, 1 CodeMeaning
      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
    (0040,0009) SH [0055]                                   #   4, 1 ScheduledProcedureStepID
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
(0040,1001) SH [0055]                                   #   4, 1 RequestedProcedureID
sscotti@iMac-Catalina ~ % 


Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#8 Post by Michael Onken »

Hi Stephen,
So if Esaote added:

Code: Select all

(0008,1030) LO (no value available) # 0, 0 StudyDescription
to the query, then that value would be returned to the scanner and they could use that to populate that tag ?
Exactly, otherwise you will never get it back. However, note that support for returning this field is optional for the Worklist server, so you might not getting it back nevertheless (which then means: not supported). You must look into the worklist provider's Conformance Statement if you want to know (or just try).
Sounds like the system is designed in a way that the operator is required to manually type in the StudyDescription.
This is probably a bad idea. If the Study already has Series in the PACS, i.e. the Study is just amended by the Esaote modality, then there could already be a Study Description in the PACS. So entering it manually would lead to an error when sending the data into the PACS (e.g. the image is rejected, or your manual Study Description "vanishes" in preference of the existing one, or you "overwrite" the existing one in the PACS). So on Study level, do not invent values that have not been on the worklist. At a maximum you could send Study Description empty from the modality but that does not help for anything.

There are two description fields that are more appropriate: Series Description and Scheduled Procedure Step Description which both are under full control of the modality since they are below Study level.
For the StudyInstanceUID, we have our own root, so I might just use something like a unique RIS ID for the MWL file creator, a unique device ID for the acquisition device, a 1 or 0 for production vs. development, and then maybe the row id for the order in the RIS database (not the accession), and then pack it with a NULL byte at the end if necessary. Wondering if that sounds like it would work ?

Sounds medium safe to me. How are clashes between different sites avoided? How do you avoid that row ids in the DB are re-used after deleting data from the DB or migrating the DB to another DB server? Most (all?) DICOM toolkits allow you to create a random, world-wide UID from scratch. Just use that. In DCMTK, you can also add your own UID root in the compilation phase, so generated UIDs will use your root. Otherwise UIDs will have DCMTK root, which is ok as well.
Is is possible to have say a MRI Brain & MRI C-spine specified in a single MWL file.
You mean one file in terms of Orthanc, i.e. one of the worklist files? As I wrote earlier, there can only be one Job (Scheduled Procedure Step) in such a file. You would create two files, one for Brain and one for Spine and place then under a common "higher" identifier, which could be Accession Number (typical for billing purposes), Requested Procedure ID. So the trick is by grouping images/examinations by a common identifier in the various worklist files you write, not to put them into the same file.
But just wondering if 2 or more studies can be ordered with a single MWL.
No, place multiple worklist jobs onto the worklist.
Finally, regarding the use of MPPS. I think the machine automatically sends those once they start scanning from the MWL, but Orthanc and the RIS do not yet have that built in, although Orthanc could delete a MWL file when it receives a study my using a Lua script or a python plug-in.
My colleagues from OFFIS have a commercial DCMTK add on to handle MPPS requests. If you are interested, just drop them a mail (dicom at offis dot de). If you just need a dummy receiver, you could use DVTK's RIS emulator.

Do I need to, or can I, add that tag, query['0008,1030'], and others that I want to the Scheduled Procedure Step or at the root of the .wl file ?

Yes you can. Make sure they are at the right position, especially whether they need to be on main level (true for Study Description) or within the ScheduledProcedureStepSequence item (e.g. ScheduledProcedureStepStartDate, Modality, ...). See this table in the standard for details: http://dicom.nema.org/medical/dicom/201 ... able_K.6-1.

I did not check the DICOM query dump that you have sent.

Note that this is a DCMTK forum, so usually we only answer questions on how to use DCMTK tools and libraries, if there are questions. Your questions are about different tools and cover DICOM standard and best-practice issues. I cannot take too much time to go through such thorough questions for fun over a long time :roll:

Best regards,
Michael

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#9 Post by Stephen D. Scotti »

Thank you for the diligent response. With regards to the StudyInstanceUID generation, I like the idea of using DCMTK for that, but I have that installed in a Docker Container using apt-get Debian system. Not sure I can configure that to use an alternate ROOT ID for studies. Orthanc actually also has a tool for generating uid's for various levels:

e.g. /tools/generate-uid?level=study -> 1.2.276.0.7230010.3.1.2.313263872.1.1620218440.658412 (something like that) I do no think it allows one to change the Root ID that is uses there to a configurable root id. That actually looks like it might be using the ROOT that dcmtk uses because that is what they use in their package.

I guess an option would be to actually compile dcmtk in the DockerFile build while specifying the ROOT ID, and then I would have to use PHP to execute a dcmtk binary or procedure to return a StudyInstanceUID. Might be worth doing that actually.

I'll keep working on those other issues. I can apparently implement MPPS with the MWL by listenting for a SOP class UID that is like: "1.2.840.10008.3.1.2.3.*"

Stephen D. Scotti
Posts: 16
Joined: Fri, 2020-06-19, 07:56

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#10 Post by Stephen D. Scotti »

Wanted to add this to this thread, and then I think finished. Might be useful for someone else.

E: dump2dcm: /var/lib/orthanc/worklists/DEVACC00000031.txt: incorrect value specification (line 19). [1.3.6.1.4.1.56016.1.1.1.92.1620224104�]

I am seeing that when there is presumably a null byte at the end. That is added using PHP to append "\0" if the byte count is odd. I might try just appending "" and see what that does. That is about the only remaining issue. That is dump2dcm that is throwing that error.

Also, apparently Orthanc has configuring a ROOT ID on their roadmap for future releases. I think they currently just use dcmtk for much of their code, which is written in mostly CPP. That would be the easiest solution for us if using Orthanc for a PACS.

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Issue with Modality Worklist Config and Setup for Esaote G-Scan and Orthanc

#11 Post by Michael Onken »

Hi Stephen,

regarding dump2dcm: The tool adds, if necessary, the null byte itself, you dont need to specify it.
regarding the root: You could also use the Orthanc root, or write a little tool (few lines with DCMTK) to generate a UID locally, if this is an option for you.

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest