Creating Dose SR documents

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
prox
Posts: 2
Joined: Tue, 2008-10-07, 19:52

Creating Dose SR documents

#1 Post by prox »

In preparation for the NA Connectathon I am trying to generate dose reports for the REM profile. The problem I'm having is that the document title seems to be over written when I add other nodes under it in the tree. The code looks something like this:

DSRDocument *doc = new DSRDocument();

doc->createNewDocument(DSRTypes::DT_XRayRadiationDoseSR);
String^ strTemp;

doc->setSpecificCharacterSetType(DSRTypes::CS_Latin1);

//Patient DOB
doc->setPatientsBirthDate("20081023");


//content date
doc->setContentDate("20081023");

//content time
doc->setContentTime("000000.000");

//Patient ID
doc->setPatientID("PID1234");



doc->setSeriesDescription("Dose Report");

//Patient Name
doc->setPatientsName("Patient 1");
doc->setPatientsSex("M");



//Report Title
doc->getTree().addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("113701", "DCM", "X-Ray Radiation Dose Report"));


doc->getTree().addContentItem(DSRTypes::RT_hasConceptMod, DSRTypes::VT_Code);
doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("113704", "DCM", "Projection X-Ray"));


doc->getTree().addContentItem(DSRTypes::RT_hasObsContext, DSRTypes::VT_Code, DSRTypes::AM_belowCurrent);
doc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("113705", "DCM", "Scope of Accumulation"));
doc->getTree().getCurrentContentItem().setCodeValue(DSRCodedEntryValue("113016", "DCM", "Performed Procedure Step"));


doc->completeDocument();


//save the file (etc).

The resulting file looks like this:

(0008,0005) Specific Character Set CS 1 ISO_IR 100
(0008,0012) Instance Creation Date DA 1 20081007
(0008,0013) Instance Creation Time TM 1 153913
(0008,0014) Instance Creator UID UI 1 1.2.840.113698.7.1
(0008,0016) SOP Class UID UI 1 1.2.840.10008.5.1.4.1.1.88.67
(0008,0018) SOP Instance UID UI 1 1.2.276.0.7230010.3.1.4.4048913039.3832.1223408353.4
(0008,0020) Study Date DA 0
(0008,0023) Content Date DA 1 20081023
(0008,0030) Study Time TM 0
(0008,0033) Content Time TM 1 000000.000
(0008,0050) Accession Number SH 0
(0008,0060) Modality CS 1 SR
(0008,0070) Manufacturer LO 0
(0008,0090) Referring Physician's Name PN 0
(0008,103e) Series Description LO 1 Dose Report
(0008,1111) Referenced Performed Procedure Step Sequence SQ 1
(0010,0010) Patient's Name PN 1 Patient 1
(0010,0020) Patient ID LO 1 PID1234
(0010,0030) Patient's Birth Date DA 1 20081023
(0010,0040) Patient's Sex CS 1 M
(0020,000d) Study Instance UID UI 1 1.2.276.0.7230010.3.1.2.4048913039.3832.1223408353.5
(0020,000e) Series Instance UID UI 1 1.2.276.0.7230010.3.1.3.4048913039.3832.1223408353.6
(0020,0010) Study ID SH 0
(0020,0011) Series Number IS 1 1
(0020,0013) Instance Number IS 1 1
(0040,a040) Value Type CS 1 CONTAINER
(0040,a043) Concept Name Code Sequence SQ 1
>BEGIN ITEM 1
>(0008,0100) Code Value SH 1 113705
>(0008,0102) Coding Scheme Designator SH 1 DCM
>(0008,0104) Code Meaning LO 1 Scope of Accumulation
>END ITEM 1
(0040,a050) Continuity Of Content CS 1 SEPARATE
(0040,a372) Performed Procedure Code Sequence SQ 1
(0040,a491) Completion Flag CS 1 COMPLETE
(0040,a493) Verification Flag CS 1 UNVERIFIED

I've completely lost the title, any idea what I'm doing wrong?

Thanks in advance.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

The problem I'm having is that the document title seems to be over written when I add other nodes under it in the tree.
You should check what addContentItem() returns. I guess that you are trying to add invalid content items (combination of source value type, relationship type and target value type) to the document tree.

prox
Posts: 2
Joined: Tue, 2008-10-07, 19:52

#3 Post by prox »

Thanks for the response Jorg. I checked the return values of the addContentItem() calls and this one:

doc->getTree().addContentItem(DSRTypes::RT_hasConceptMod, DSRTypes::VT_Code);

was coming back false.

I changed it to
doc->getTree().addContentItem(DSRTypes::RT_hasConceptMod, DSRTypes::VT_Code, DSRTypes::AM_belowCurrent);

and it now works.

Many thanks.

Post Reply

Who is online

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