DICOM Structured Report revisited

1,049 views
Skip to first unread message

Cuauhtémoc Rossell

unread,
Dec 26, 2013, 11:55:05 AM12/26/13
to fo-d...@googlegroups.com
I have been working in a program for radiologic interpretation (using voice recognition and structured report) and now i wanto to save the report in DICOM-SR format, so the program creates the report in XML format and sends to creating and saving in PACS DB.
The first thing is interrogating the pacs about the studies (DicomCFindRequest.CreateStudyQuery(...)) once the list is processed the user can selecta a study, dictates it and sends to saving. IT WORKS!!!
    public int SaveData(string cXML)
    {
      int nRes = 0;
      string cText = "";
      doc = null;               // seguridad
      doc = new XmlDocument();
      doc.LoadXml(cXML);
      DicomDataset dataset = new DicomDataset();
      // Type 1 attributes
      dataset.Add(DicomTag.SOPClassUID, DicomUID.BasicTextSRStorage);
      dataset.Add(DicomTag.StudyInstanceUID, getNodeValue("studyInstUID"));
      dataset.Add(DicomTag.SeriesInstanceUID, GenerateUID());
     .
     .
      // Type 2 attributes
      dataset.Add(DicomTag.PatientID, getNodeValue("control"));
      dataset.Add(DicomTag.PatientName, getNodeValue("nom"));
      dataset.Add(DicomTag.PatientBirthDate, getNodeValue("fnac"));
      dataset.Add(DicomTag.PatientSex, getNodeValue("Sexo").Substring(0, 1));
     .
     .
      dataset.Add(DicomTag.SpecificCharacterSet, "ISO_IR 100");

      dataset.Add(DicomTag.ValueType, "CONTAINER");
      dataset.Add(creaConceptNameSeq("18748-4", "LN", "Reporte de Imagenologia"));
      dataset.Add(DicomTag.ContinuityOfContent, "SEPARATE");
      dataset.Add(creaVerifyingObserverSeq(getNodeValue("institucion"), dateToDICOM(DateTime.Now), getNodeValue("med_rad")));
      .
      .
      DicomSequence ds = new DicomSequence(DicomTag.ContentSequence, dds);
      ds.Items.Add(creaContentItem(getNodeValue("institucion"), DicomRelationship.HasObservationContext, DicomValueType.Text, "121009", "DCM", "Organizacion"));
      ds.Items.Add(creaContentItem(getSubNodes("Informacion_clinica"), DicomRelationship.Contains, DicomValueType.Text, "121109", "DCM", "Informacion clinica"));
           dataset.Add(ds);

      // save data
      DicomFile dicomfile = new DicomFile(dataset);
      try
      {
        DicomClient client = new DicomClient();
        client.AddRequest(new DicomCStoreRequest(dicomfile));
        client.Send(fAddress, fPort, false, fCallingAET, fCalledAET);
        nRes = 0;
      }
      catch (Exception ex)
      {
        nRes = 7;
        fXML = ex.Message;
      }
      return nRes;
    }


As you can see, it is not necesary saving temporary files to disk, it receives a string (xml), processes and sends to PACS DB.
I send the report to a OsiriX and dcm4chee databases. OsiriX validator reports a few warnings and errors that I'm working on.
Only a few doubts:
StudyInstanceUID is filles by the same StudyInstanceUID from the study read.
From where can I take SeriesInstanceUID, SeriesNumber and InstanceNumber?
The report is in spanish, so I put SpecificCharacterSet to "ISO_IR 100", but the report shows strange characters where there are accented characters or "ñ", what I am mising??

Thanks in advanced and Happy new year!
Dr. Cuauhtémoc Rossell


adil....@gmail.com

unread,
Dec 31, 2013, 6:10:04 AM12/31/13
to fo-d...@googlegroups.com
Hi,

I worked with DICOM SR and I can give you some informations.

Study Instance UID must be the same of your study.

For the Series Instance UID, SOP Instance UID, you need to generate your own by using code like:
      ds.Add(DicomTag.SOPInstanceUID, DicomUID.Generate().UID);
      ds.Add(DicomTag.SeriesInstanceUID, DicomUID.Generate().UID);

And you get put to the instance number, the value you want (in my case, I always set it to 1).

For your troubles with encoding, I invited you to look tothe file DicomPersonNameTest.cs in fo-dicom project.
If you don't find it or need more specific information, please copy and paste the original text and what you get with accented charcters.


Best regards and happy new year to you and all oak fellow community! ;)

I am a little curious...What sdk or software did you use for voice recognition?

Adil TIADI



Dr. Cuauhtémoc Rossell

unread,
Jan 2, 2014, 4:52:08 PM1/2/14
to fo-d...@googlegroups.com
Hi Adil TIADI
Thanks for your kind guidance.
I use the Windows Engine Voice Recognition (it works fine) with radiological lexicon and structured report templates from RSNA.
I will investigate the encoding issue.
Happy new year!!

Cuauhtémoc

Dr. Cuauhtémoc Rossell

unread,
Jan 3, 2014, 7:09:36 PM1/3/14
to fo-d...@googlegroups.com
Encoding issue resolved!!
As you said Adil TIADI, DicomPersonName() is the clue, there are a series of classes like DicomLongString(), DicomCodeString() and the like, and if you include DicomEncoding.GetEncoding(your charset) magically makes the encoding of accented characters.

Cuauhtémoc

Adil Tiadi

unread,
Feb 25, 2014, 2:57:40 AM2/25/14
to fo-d...@googlegroups.com
Hi,

I try to find your Windows Engine Voice Recognition with radiological lexicon without success.
Can you tell me on which website did you find the radiological lexicon and if it's free?

Best regards,

Adil TIADI

Rogerio Ribeiro

unread,
Aug 31, 2016, 9:28:16 AM8/31/16
to Fellow Oak DICOM
Hello dr. Cuahtémoc Rossell. 

I'm trying to do adapt a software that I developed in order to export dicom SR reports. I'm sorry for such stupid question, but looking at your code sample I coudn't find out in exactly what Dicom Tag the reporting text goes. Would you tell me?

Thank you in advance.

Rogerio Ribeiro, from Brazil

Prabha Power

unread,
Dec 10, 2019, 1:42:18 AM12/10/19
to Fellow Oak DICOM
Hi Adil tiadi,

Am looking for .Net C# code to create DICOM SR. 
Could you please share any sample code for reference that could help me.

Thank you

Siddhartha Saha

unread,
Sep 14, 2022, 10:57:02 PM9/14/22
to Fellow Oak DICOM
I am new to DICOM-SR. I have recently got a requirement of retrieving Measurement data from DICOM-SR and using those values in the Text Report. Can anyone guide me on how to do this?
Reply all
Reply to author
Forward
0 new messages