general question about referring doctor format for DICOM vs. HL7

I was looking at the specs for referring physician in HL7 and DICOM. For HL7 I think the format is: see https://hl7-definition.caristix.com/v2/HL7v2.5.1/Fields/PV1.8

The DICOM standard: http://dicom.nema.org
&

DICOM Tag reference: https://dicom.innolitics.com/ciods

defines a person name as below: family name, given name, middle name, name prefix and name suffix.

and it looks like there are two DICOM tags for referring physician (1 a tag and another a sequence)

Referring Physician’s Name Attribute, (0008,0090) &## Referring Physician Identification Sequence Attribute (0008,0096), looks like this is not always used.

The reason I ask is because I’d like to have a referring physician on DICOM (e.g. for the tag 0008,0090) have a physician ID included, but that is non-standard:

e.g.: 0001^Last^First^Middle^^, Last^FIrst^MIddle^0001^suffix, something like one of those. That makes it possible to search on a partial match (0001) for the referring physician field in Orthanc to get a result set for a particular physician.

(0008,0096) looks like it has a place for an ID, as well as contact information for the referring physician, but that is a sequence.

Just wondering if it is possible to populate those fields for (0008,0096) using the MWL somehow. I presume that 0008,0090 can be defined in an MWL file.

If anyone else has pondered or worked through that issue, feedback would be appreciated.

Thanks.

Have you tried to simply define these “Referring Physician’s Name Attribute” (0008,0090) and “Referring Physician Identification Sequence Attribute” (0008,0096) tags using the “dump2dcm” software from DCMTK, as explained in the Orthanc Book?
https://book.orthanc-server.com/plugins/worklists-plugin.html#how-to-create-a-worklist-file

These tags have nothing special, and can certainly be embedded in a DICOM worklist.

Regarding HL7, note that this forum is about Orthanc (and a bit of DICOM). Please use another dedicated discussion group if you want support about HL7.

Thanks. I took a test study image and did:

scotti-imac:W_KNEE_LAT_Right_4 sscotti$ dcmodify -nb -i "(0008,0096)[0].(0040,1101)[0].(0008,0100)=0001" “/Users/sscotti/Downloads/W_KNEE_LAT_Right_4/IM-0002-0001.dcm”
scotti-imac:W_KNEE_LAT_Right_4 sscotti$ dcmodify -nb -i "(0008,0096)[0].(0040,1101)[0].(0008,0102)=L" “/Users/sscotti/Downloads/W_KNEE_LAT_Right_4/IM-0002-0001.dcm”
scotti-imac:W_KNEE_LAT_Right_4 sscotti$ dcmdump /Users/sscotti/Downloads/W_KNEE_LAT_Right_4/IM-0002-0001.dcm

and then a dcmdump, although I also set the root level 0008,0100 to 0001 and root level 0008,0102 to L by accident before that.

(0008,0096) SQ (Sequence with explicit length #=1) # 50, 1 ReferringPhysicianIdentificationSequence
(fffe,e000) na (Item with explicit length #=1) # 42, 1 Item
(0040,1101) SQ (Sequence with explicit length #=1) # 30, 1 PersonIdentificationCodeSequence
(fffe,e000) na (Item with explicit length #=2) # 22, 1 Item
(0008,0100) SH [0001] # 4, 1 CodeValue
(0008,0102) SH [L] # 2, 1 CodingSchemeDesignator
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(fffe,e00d) na (ItemDelimitationItem for re-encoding) # 0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
(0008,0100) SH [0001] # 4, 1 CodeValue
(0008,0102) SH [L] # 2, 1 CodingSchemeDesignator

It looks like you can actually use /tool/find to search for studies with {“0008,0100”:“0001”} as part of the query when the root level tag is set.

I then deleted the root level tags for CodeValue and CodingSchemeDesignator and tools/find does not work for searching down the tag hierarchy.

This might be a little out of scope, but it seems like the place to set a code value for a ReferringPhysician is in the ReferringPhysicianIdentificationSequence, in which case I would want to do that in the MWL file (similar to dcmodify) and then also use tools/find to search/filter on the code value in ReferringPhysicianIdentificationSequence.

It all actually does seem to work if I just set the root level tag values like shown above, but it looks like that always belongs in a tag sequence and not at the root level.

Just curious if /tools/find allows you to search a hierarchy and if the MWL file can write to a hierachy and not just the root level.

Thanks.

The URI “/tools/find” only searches DICOM patients, studies, series and instances.

This URI does NOT search for DICOM worklists stored in Orthanc.

You’ll have to use “findscu” command-line tool from DCMTK, or to use “/modalities/self/find-worklist” URI (if “self” corresponds to the Orthanc server itself mapped to the “DicomModalities” configuration option).

Example using “findscu”:

$ findscu -W localhost 4242 -k PatientID=B

Example using “/modalities/self/find-worklist”:

$ curl http://localhost:8042/modalities/self/find-worklist -v -d ‘{“PatientID”:“B”}’

Here is my full Orthanc configuration:

{
“Plugins” : [ “.” ],
“DicomModalities” : {
“self” : [ “ORTHANC”, “localhost”, 4242 ],
“findscu” : [ “FINDSCU”, “localhost”, 2000 ]
},
“Worklists” : {
“Enable”: true,
“Database”: “./WorklistsDatabase”
}
}

Sébastien-

Thanks for the information, which is helpful, but I guess I need to explain a bit further because the questions had multiple parts and must be confusing… You can probably just ignore (1) below because I’ll probably have to figure that out on my own while working with the vendor.

  1. Regarding the MWL, I do have that partially running, but not fully tested. but it seems like it is basically a way to provide a worklist for a modality and to prepopulate some DICOM tags for a study. My setup is similar to what you mention there and the RIS puts .wl files into the Worklists folders and the queries work. That is not the issue. The question regarding the worklist regards what tag(s) to use if I want to populate a study with a physician ID somewhere via the MWL. As I mentioned, “Referring Physician’s Name Attribute” (0008,0090) has a Person Name (PN) datatype. That is not meant to include an ID. I do have the DICOM conformance statement for the manufacturer and their MWL supports that tag. What I don’t know is if there is another root level tag that can be used, or if I could use the code sequence that I mentioned above to populate a study with the referring physician’s ID. I’m not sure how to even specify a code sequence in a MWL file, or if it is supported by the manufacturer.

  2. The other part of the question regards the tools/find and what the limits are on what you can specify when searching for matching resources (studies in my case) (not MWL files). If I have the ReferringPhysicianName tag set to something like ID^LAST^FIRST^MIDDLE^ or IDLAST^FIRST^MIDDLE^^, then tools find can do wildcard search to match the ID or parts of the name. That works, but that is not the standard way to specify a Person Name.

That is why I wanted to put an ID for the referring physician in another tag somewhere, like in the ReferringPhysicianIdentificationSequence as mentioned above, via the MWL, although I just added that manually from the CLI so that I would have a study to test with, and there are probably ways to add a referring physician id after the study is actually acquired.

As I also mentioned above, you can apparently specify the actual tag value instead of the shortname when using tools/find: e.g. {“0008,0100”:“0001”} or {“0008,0100”:“0001”}

So what I’m really looking for is a way to populate a study with an actual ID for a referring physician via the MWL or otherwise such that the study created is searchable on the referring physician ID. (i.e. what shortnames, tagvalues, or code sequences) can be used with tools/find. I originally just wanted to know if I can search for that "(0008,0096)[0].(0040,1101)[0].(0008,0100)=0001" tagvalue in a study using tools/find. I’ve seen other systems use a format like IDLAST^FIRST^MIDDLE^^ for a referring physician name and that actually is probably the easiest to implement, but it doesn’t follow the spec for PN. I’m not aware of a root level tag for a referring physician id.

I can actually follow up later about the MWL setup since I’ll have some help with that soon.

I originally just wanted to know if I can search for that "(0008,0096)[0].(0040,1101)[0].(0008,0100)=0001" tagvalue in a study using tools/find.

As of Orthanc 1.8.0, Orthanc only supports hierarchical matching for C-FIND on worklists. The “/tools/find” URI can only be used to search for DICOM tags at the root level, so you can’t use the construction above.

You can use “/tools/find” to do the main filtering of the root tags, then manually inspect the nested tag “0008,0096” for one of the instance of the returned study. For instance:

$ curl https://demo.orthanc-server.com/tools/find -d ‘{“Level”:“Study”,“Query”:{“PatientName”:“BRAINIX”}}’
[ “27f7126f-4f66fb14-03f4081b-f9341db2-53925988” ]

$ curl -s https://demo.orthanc-server.com/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/instances | grep ‘“ID”’ | head -n1

“ID” : “82cc1a6b-7b05d34e-cd74474b-594f0d43-94f609d8”,

$ curl -s https://demo.orthanc-server.com/instances/82cc1a6b-7b05d34e-cd74474b-594f0d43-94f609d8/tags?short | grep ‘0008,1032’ -A 6
“0008,1032” : [
{
“0008,0100” : “IRMCEREB”,
“0008,0102” : “XPLORE”,
“0008,0104” : “IRM cérébrale, neuro-crâne”,
“0008,010b” : “N”
}

This logic could be easily automated by a server-side Python plugin:
https://book.orthanc-server.com/plugins/python.html

Sébastien,

Thanks a lot for that. I’ll give that a try when I get a chance. Sort of depends on whether I can populate those fields via the MWL. Using the method you show above, any idea what the overhead would be to doing that ?

Otherwise, seems like just prefixing the Last Name with an ID for the (0008,0090) tag would also work, like: 0001Last^First^Middle^Prefix^Suffix. That at least sort of adheres to the standard and would be more efficient, and I know that works. I’ve seen that format in other studies, but using the Sequence would be nice since you can put a lot more information there also. I think some places do that because ID’s could be unique within a system, whereas you could have docs with non-unique Last^First^Middle^Prefix^Suffix.

On a different note, sounds like you are planning to release a version of the Stone of Orthanc soon ? Does the stuff here: Stone of Orthanc

here actually work in a web browser or with DICOM Web or something, or is it mostly a dev package ? Do you plan on having a Plug-in for that to use with Orthanc or is it going to be integrated in some other way ? Also, is that going to accommodate the display of PDF attachments like the Osimis viewer does ?

Thanks.

Thanks a lot for that. I’ll give that a try when I get a chance. Sort of depends on whether I can populate those fields via the MWL. Using the method you show above, any idea what the overhead would be to doing that ?

The overhead of using a Python plugin is negligible wrt. a search in the database.

On a different note, sounds like you are planning to release a version of the Stone of Orthanc soon ? Does the stuff here: Stone of Orthanc

here actually work in a web browser or with DICOM Web or something, or is it mostly a dev package ? Do you plan on having a Plug-in for that to use with Orthanc or is it going to be integrated in some other way ? Also, is that going to accommodate the display of PDF attachments like the Osimis viewer does ?

Stone of Orthanc is not only targeted at developers, at it will come with a Web viewer that is called “Stone Web viewer”. The Stone Web viewer is a plugin for Orthanc.

The goal of the first release of the “Stone Web viewer” is to have a similar set of features than the current “Osimis Web viewer”, which notably includes the display of PDF attachments.

This first release is planned for Q4 2020.

Just a follow up about this thread. I found a post on SO that has a much more detailed template for a MWL with tag sequences:

Stack Overflow Thread re: MWL’s

I have not tried that yet, but that looks like a format to use tag sequences like I mentioned above, and then I will be able to verify with the method you outlined above.

Thanks.

(0008,0005) CS [ISO_IR 100] # 0, 0 CharacterSet\r\n
(0008,0050) SH [vn123] # 0, 0 AccessionNumber\r\n
(0008,0090) PN [docname] # 0, 0 ReferringPhysicianName\r\n
(0008,1030) LO [vn123] # 0, 0 StudyDescription\r\n
(0008,1080) LO [] # 0, 0 AdmittingDiagnosesDescription\r\n
(0010,0010) PN [name] # 0, 0 PatientName\r\n
(0010,0020) LO [id] # 0, 0 PatientID\r\n
(0010,0030) DA [dob] # 0, 0 PatientBirthDate\r\n
(0010,0040) CS [sex] # 0, 0 PatientSex\r\n
(0010,1020) DS [] # 0, 0 PatientSize\r\n
(0010,1030) DS [] # 0, 0 PatientWeight\r\n
(0010,2000) LO [] # 0, 0 MedicalAlerts\r\n
(0010,2110) LO [] # 0, 0 Allergies\r\n
(0010,21c0) US [] # 0, 0 PregnancyStatus\r\n
(0010,21d0) DA [] # 0, 0 LastMenstrualDate\r\n
(0010,4000) LT [vn123] # 0, 0 PatientComments\r\n
(0020,000D) UI [123.1] # 0, 0 StudyInstanceUID\r\n
(0032,1032) PN [] # 0, 0 RequestingPhysician\r\n
(0032,1060) LO [] # 0, 0 RequestedProcedureDescription\r\n
(0038,0050) LO [] # 0, 0 SpecialNeeds\r\n
(0038,0500) LO [] # 0, 0 PatientState\r\n
(0008,1110) SQ # u/l, 1 ReferencedStudySequence\r\n
(fffe,e000) - # u/l, 1 Item\r\n
(0008,1150) UI [1.2.3.4] # 0, 0 ReferencedSOPClassUID\r\n
(0008,1155) UI [100.118.116.2005.2.1.1143729853.921.1] # 0, 0 ReferencedSOPInstanceUID\r\n
(fffe,e00d) - # 0, 0 ItemDelimitationItem\r\n
(fffe,e0dd) - # 0, 0 SequenceDelimitationItem\r\n
(0008,1120) SQ # u/l, 1 ReferencedPatientSequence\r\n
(fffe,e000) - # u/l, 1 Item\r\n
(0008,1150) UI [1.2.3.4.5] # 0, 0 ReferencedSOPClassUID\r\n
(0008,1155) UI [100.118.116.2005.2.1.1143729853.921.3] # 0, 0 ReferencedSOPInstanceUID\r\n
(fffe,e00d) - # 0, 0 ItemDelimitationItem\r\n
(fffe,e0dd) - # 0, 0 SequenceDelimitationItem\r\n
(0040,0100) SQ # 120, 1 ScheduledProcedureStepSequence\r\n
(fffe,e000) na # 112, 1 Item\r\n
(0008,0060) CS [US] # 0, 0 Modality\r\n
(0040,0001) AE [] # 0, 0 ScheduledStationAETitle\r\n
(0040,0002) DA [20201001] # 0, 0 ScheduledProcedureStepStartDate\r\n
(0040,0003) TM [] # 0, 0 ScheduledProcedureStepStartTime\r\n
(0040,0006) PN [] # 0, 0 ScheduledPerformingPhysicianName\r\n
(0040,0007) LO [USG] # 0, 0 ScheduledProcedureStepDescription\r\n
(0040,0008) SQ # 40, 1 ScheduledProtocolCodeSequence\r\n
(fffe,e000) na # 32, 1 Item\r\n
(0008,0100) SH [1] # 0, 0 CodeValue\r\n
(0008,0102) SH [1] # 0, 0 CodingSchemeDesignator\r\n
(0008,0103) SH [1] # 0, 0 CodingSchemeVersion\r\n
(0008,0104) LO [1] # 0, 0 CodeMeaning\r\n
(fffe,e00d) na # 0, 0 ItemDelimitationItem\r\n
(fffe,e0dd) na # 0, 0 SequenceDelimitationItem\r\n
(0040,0009) SH [1] # 0, 0 ScheduledProcedureStepID\r\n
(0040,0010) SH [] # 0, 0 Scheduled Station Name\r\n
(0040,0011) SH [] # 0, 0 Scheduled Procedure Step Location\r\n
(0040,0012) LO [] # 0, 0 Pre-Medication\r\n
(0032,1070) LO [] # 0, 0 Requested Contrast Agent\r\n
(0040,0400) LT [] # 0, 0 CommentsOnTheScheduledProcedureStep\r\n
(fffe,e00d) - # 0, 0 ItemDelimitationItem\r\n
(fffe,e0dd) - # 0, 0 SequenceDelimitationItem\r\n
(0040,1001) SH [] # 0, 0 RequestedProcedureID\r\n
(0040,1002) LO [] # 0, 0 ReasonForTheRequestedProcedure\r\n
(0040,1003) SH [] # 0, 0 Requested Procedure Priority\r\n
(0040,1004) SH []