Perhaps the code used to create this sample SR is incorrect. In any case, since there is a dearth of information on how to actually build an SR using fo-dicom, here is some working code in C#
var dataset = new DicomDataset
{
{ DicomTag.SOPClassUID, DicomUID.BasicTextSRStorage},
{ DicomTag.SOPInstanceUID, DicomUID.Generate()},
{ DicomTag.StudyInstanceUID, DicomUID.Generate()},
{ DicomTag.SeriesInstanceUID, DicomUID.Generate()},
{ DicomTag.MediaStorageSOPClassUID, DicomUID.MediaStorageDirectoryStorage },
{ DicomTag.MediaStorageSOPInstanceUID, DicomUID.Generate() },
{ DicomTag.TransferSyntaxUID, DicomTransferSyntax.ExplicitVRLittleEndian },
{ DicomTag.ImplementationClassUID, DicomImplementation.ClassUID },
{ DicomTag.ImplementationVersionName, DicomImplementation.Version },
{ DicomTag.Modality, "SR" },
};
try
{
// Create the root content item which is the title
DicomCodeItem titleCode = new DicomCodeItem("121144", "DCM", "Document Title");
// Prepare the one content item
DicomCodeItem textCode = new DicomCodeItem("111412", "DCM", "Narrative Summary");
DicomContentItem textItem = new DicomContentItem(textCode, DicomRelationship.Contains, DicomValueType.Text, "Hello World!!");
// Now we can create a special content item called a 'structured report'
DicomStructuredReport report = new DicomStructuredReport(titleCode, textItem);
// We need to add the dataset with all the patient, study, series stuff to the report (not the other way around)
report.Dataset.Add(dataset);
// Save the dataset to a file
DicomFile file = new DicomFile();
file.Dataset.Add(report.Dataset);
DicomIOWriter.DicomWriteOptions options = new DicomIOWriter.DicomWriteOptions();
options.ExplicitLengthSequenceItems = true;
options.ExplicitLengthSequences = true;
file.Save(dicom_file, options);
}
catch (DicomStructuredReportException exception)
{
System.Diagnostics.Trace.WriteLine("Error creating structured report ...");
System.Diagnostics.Trace.WriteLine(exception.ToString());
}
Note that the code is missing the end of sequence delimeters tags. I haven't yet figured out how to add these. This might be why the innolitics browser can't parse the resulting dicom file.