DSRDocument Class Reference

Interface class for 'dcmsr' (DICOM Structured Reporting Documents). More...

Inheritance diagram for DSRDocument:

DSRTypes List of all members.

Public Member Functions

 DSRDocument (const E_DocumentType documentType=DT_BasicTextSR)
 (default) constructor.
virtual ~DSRDocument ()
 destructor
void clear ()
 clear all internal member variables
OFBool isValid ()
 check whether the current internal state is valid.
OFBool isFinalized () const
 check whether the document is finalized.
void setLogStream (OFConsole *stream)
 set the log stream.
OFCondition print (ostream &stream, const size_t flags=0)
 print current SR document to specified output stream.
OFCondition read (DcmItem &dataset, const size_t flags=0)
 read SR document from DICOM dataset.
OFCondition write (DcmItem &dataset, DcmStack *markedItems=NULL)
 write current SR document to DICOM dataset.
OFCondition readXML (const OFString &filename, const size_t flags=0)
 read SR document from XML file.
OFCondition writeXML (ostream &stream, const size_t flags=0)
 write current SR document in XML format.
OFCondition renderHTML (ostream &stream, const size_t flags=0, const char *styleSheet=NULL)
 render current SR document in HTML format.
virtual OFBool containsExtendedCharacters ()
 check if this document contains non-ASCII characters in one of the strings affected by SpecificCharacterSet in DICOM
E_DocumentType getDocumentType () const
 get the current SR document type
DSRDocumentTreegetTree ()
 get document tree
E_CharacterSet getSpecificCharacterSetType () const
 get specific character set type.
OFCondition setSpecificCharacterSetType (const E_CharacterSet characterSet)
 set specific character set type.
E_CompletionFlag getCompletionFlag () const
 get document completion flag.
const char * getCompletionFlagDescription () const
 get document completion flag description.
const OFStringgetCompletionFlagDescription (OFString &description) const
 get document completion flag description.
E_VerificationFlag getVerificationFlag () const
 get document verification flag.
size_t getNumberOfVerifyingObservers ()
 get number of verifying observers.
OFCondition getVerifyingObserver (const size_t idx, OFString &dateTime, OFString &observerName, OFString &organization)
 get information about a verifying observer.
OFCondition getVerifyingObserver (const size_t idx, OFString &dateTime, OFString &observerName, DSRCodedEntryValue &observerCode, OFString &organization)
 get information about a verifying observer.
DSRSOPInstanceReferenceListgetPredecessorDocuments ()
 get list of predecessor documents.
DSRSOPInstanceReferenceListgetIdenticalDocuments ()
 get list of identical documents.
DSRSOPInstanceReferenceListgetCurrentRequestedProcedureEvidence ()
 get list of referenced SOP instances (Current Requested Procedure Evidence).
DSRSOPInstanceReferenceListgetPertinentOtherEvidence ()
 get list of referenced SOP instances (Pertinent Other Evidence).
DSRCodingSchemeIdentificationListgetCodingSchemeIdentification ()
 get list of coding schemes used (Coding Scheme Identification).
const char * getModality () const
 get modality
const char * getSOPClassUID () const
 get SOP class UID
const char * getStudyInstanceUID () const
 get study instance UID
const char * getSeriesInstanceUID () const
 get series instance UID
const char * getSOPInstanceUID () const
 get SOP instance UID
const char * getInstanceCreatorUID () const
 get instance creator UID
const char * getSpecificCharacterSet () const
 get specific character set
const char * getPatientsName () const
 get patient's name
const char * getPatientsBirthDate () const
 get patient's birth date
const char * getPatientsSex () const
 get patient's sex
const char * getReferringPhysiciansName () const
 get referring physicians name
const char * getStudyDescription () const
 get study description
const char * getSeriesDescription () const
 get series description
const char * getManufacturer () const
 get manufacturer
const char * getStudyDate () const
 get study date
const char * getStudyTime () const
 get study time
const char * getInstanceCreationDate () const
 get instance creation date
const char * getInstanceCreationTime () const
 get instance creation time
const char * getContentDate () const
 get content date
const char * getContentTime () const
 get content time
const char * getStudyID () const
 get study ID
const char * getPatientID () const
 get patient ID
const char * getSeriesNumber () const
 get series number
const char * getInstanceNumber () const
 get instance number
const char * getAccessionNumber () const
 get accession number
const OFStringgetModality (OFString &value) const
 get modality
const OFStringgetSOPClassUID (OFString &value) const
 get SOP class UID
const OFStringgetStudyInstanceUID (OFString &value) const
 get study instance UID
const OFStringgetSeriesInstanceUID (OFString &value) const
 get series instance UID
const OFStringgetSOPInstanceUID (OFString &value) const
 get SOP instance UID
const OFStringgetInstanceCreatorUID (OFString &value) const
 get instance creator UID
const OFStringgetSpecificCharacterSet (OFString &value) const
 get specific character set
const OFStringgetPatientsName (OFString &value) const
 get patient's name
const OFStringgetPatientsBirthDate (OFString &value) const
 get patient's birth date
const OFStringgetPatientsSex (OFString &value) const
 get patient's sex
const OFStringgetReferringPhysiciansName (OFString &value) const
 get referring physicians name
const OFStringgetStudyDescription (OFString &value) const
 get study description
const OFStringgetSeriesDescription (OFString &value) const
 get series description
const OFStringgetManufacturer (OFString &value) const
 get manufacturer
const OFStringgetStudyDate (OFString &value) const
 get study date
const OFStringgetStudyTime (OFString &value) const
 get study time
const OFStringgetInstanceCreationDate (OFString &value) const
 get instance creation date
const OFStringgetInstanceCreationTime (OFString &value) const
 get instance creation time
const OFStringgetContentDate (OFString &value) const
 get content date
const OFStringgetContentTime (OFString &value) const
 get content time
const OFStringgetStudyID (OFString &value) const
 get study ID
const OFStringgetPatientID (OFString &value) const
 get patient ID
const OFStringgetSeriesNumber (OFString &value) const
 get series number
const OFStringgetInstanceNumber (OFString &value) const
 get instance number
const OFStringgetAccessionNumber (OFString &value) const
 get accession number
OFCondition setSpecificCharacterSet (const OFString &value)
 set specific character set.
OFCondition setCompletionFlagDescription (const OFString &value)
 set document completion flag description.
OFCondition setPatientsName (const OFString &value)
 set patient's name.
OFCondition setPatientsBirthDate (const OFString &value)
 set patient's birth date.
OFCondition setPatientsSex (const OFString &value)
 set patient's sex.
OFCondition setReferringPhysiciansName (const OFString &value)
 set referring physicians name.
OFCondition setStudyDescription (const OFString &value)
 set study description.
OFCondition setSeriesDescription (const OFString &value)
 set series description.
OFCondition setManufacturer (const OFString &value)
 set manufacturer.
OFCondition setContentDate (const OFString &value)
 set content date.
OFCondition setContentTime (const OFString &value)
 set content time.
OFCondition setStudyID (const OFString &value)
 set study ID.
OFCondition setPatientID (const OFString &value)
 set patient ID.
OFCondition setSeriesNumber (const OFString &value)
 set series number.
OFCondition setInstanceNumber (const OFString &value)
 set instance number.
OFCondition setAccessionNumber (const OFString &value)
 set accession number.
void createNewStudy ()
 create new study.
void createNewSeries ()
 create a new series.
OFCondition createNewSeriesInStudy (const OFString &studyUID)
 create a new series within a given study.
void createNewSOPInstance ()
 create a new SOP instance.
OFCondition createNewDocument ()
 create a new document.
OFCondition createNewDocument (const E_DocumentType documentType)
 create a new document of the specified type.
OFCondition createRevisedVersion (const OFBool clearList=OFTrue)
 create a revised version of the current document.
OFCondition completeDocument ()
 complete the current document.
OFCondition completeDocument (const OFString &description)
 complete the current document and set a completion description.
OFCondition verifyDocument (const OFString &observerName, const OFString &organization)
 verify the current document by a specific observer.
OFCondition verifyDocument (const OFString &observerName, const OFString &organization, const OFString &dateTime)
 verify the current document by a specific observer.
OFCondition verifyDocument (const OFString &observerName, const DSRCodedEntryValue &observerCode, const OFString &organization)
 verify the current document by a specific observer.
OFCondition verifyDocument (const OFString &observerName, const DSRCodedEntryValue &observerCode, const OFString &organization, const OFString &dateTime)
 verify the current document by a specific observer.
void removeVerification ()
 remove verification information.
OFCondition finalizeDocument ()
 finalize the current state of the document.

Protected Member Functions

OFCondition readXMLDocumentHeader (DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML document header
OFCondition readXMLPatientData (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML "patient" data
OFCondition readXMLStudyData (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML "study" data
OFCondition readXMLSeriesData (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML "series" data
OFCondition readXMLInstanceData (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML "instance" data
OFCondition readXMLDocumentData (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML "document" data
OFCondition readXMLVerifyingObserverData (const DSRXMLDocument &doc, DSRXMLCursor cursor, const size_t flags)
 read XML verifying observer data
void renderHTMLPatientData (ostream &stream, const size_t flags)
 render patient name, sex, birthdate and ID in HTML format
void renderHTMLReferenceList (ostream &stream, DSRSOPInstanceReferenceList &refList, const size_t flags)
 render list of referenced SOP instances in HTML format
OFCondition checkDatasetForReading (DcmItem &dataset, E_DocumentType &documentType)
 check the given dataset before reading.
void updateAttributes (const OFBool updateAll=OFTrue)
 update several DICOM attributes.

Private Member Functions

 DSRDocument (const DSRDocument &)
DSRDocumentoperator= (const DSRDocument &)

Private Attributes

DSRDocumentTree DocumentTree
 SR document tree.
OFConsoleLogStream
 output stream for error messages, NULL for no messages
OFBool FinalizedFlag
 flag indicating whether is document is finalized or not
E_CompletionFlag CompletionFlagEnum
 enumerated value: partial, complete
E_VerificationFlag VerificationFlagEnum
 enumerated value: unverified, verified
E_CharacterSet SpecificCharacterSetEnum
 defined term: see class DSRTypes
DcmUniqueIdentifier SOPClassUID
 SOP Class UID: (UI, 1, 1).
DcmUniqueIdentifier SOPInstanceUID
 SOP Instance UID: (UI, 1, 1).
DcmCodeString SpecificCharacterSet
 Specific Character Set: (CS, 1-n, 1C).
DcmDate InstanceCreationDate
 Instance Creation Date: (DA, 1, 3).
DcmTime InstanceCreationTime
 Instance Creation Time: (TM, 1, 3).
DcmUniqueIdentifier InstanceCreatorUID
 Instance Creator UID: (UI, 1, 3).
DSRCodingSchemeIdentificationList CodingSchemeIdentification
 Coding Scheme Identification Sequence: (SQ, 1, 3).
DcmUniqueIdentifier StudyInstanceUID
 Study Instance UID: (UI, 1, 1).
DcmDate StudyDate
 Study Date: (DA, 1, 2).
DcmTime StudyTime
 StudyTime: (TM, 1, 2).
DcmPersonName ReferringPhysiciansName
 ReferringPhysiciansName: (PN, 1, 2).
DcmShortString StudyID
 Study ID: (SH, 1, 2).
DcmShortString AccessionNumber
 Accession Number: (SH, 1, 2).
DcmLongString StudyDescription
 Study Description: (LO, 1, 3).
DcmLongString SeriesDescription
 Series Description: (LO, 1, 3).
DcmPersonName PatientsName
 Person Name: (PN, 1, 2).
DcmLongString PatientID
 Patient ID: (LO, 1, 2).
DcmDate PatientsBirthDate
 Patient Birth Date: (DA, 1, 2).
DcmCodeString PatientsSex
 Patient Sex: (CS, 1, 2).
DcmLongString Manufacturer
 Manufacturer: (LO, 1, 2).
DcmCodeString Modality
 Modality: (CS, 1, 1).
DcmUniqueIdentifier SeriesInstanceUID
 Series Instance Number: (UI, 1, 1).
DcmIntegerString SeriesNumber
 Series Number: (IS, 1, 1).
DcmSequenceOfItems ReferencedPerformedProcedureStepSequence
 Referenced Performed Procedure Step Sequence: (SQ, 1, 2).
DcmIntegerString InstanceNumber
 Instance Number: (IS, 1, 1).
DcmCodeString CompletionFlag
 Completion Flag: (CS, 1, 1).
DcmLongString CompletionFlagDescription
 Completion Flag Description: (LO, 1, 3).
DcmCodeString VerificationFlag
 Verification Flag: (CS, 1, 1).
DcmDate ContentDate
 Content Date: (DA, 1, 1).
DcmTime ContentTime
 Content Time: (TM, 1, 1).
DcmSequenceOfItems VerifyingObserver
 Verifying Observer Sequence: (SQ, 1, 1C).
DSRSOPInstanceReferenceList PredecessorDocuments
 Predecessor Documents Sequence: (SQ, 1, 1C).
DSRSOPInstanceReferenceList IdenticalDocuments
 Identical Documents Sequence: (SQ, 1, 1C).
DcmSequenceOfItems PerformedProcedureCode
 Performed Procedure Code Sequence: (SQ, 1, 2).
DSRSOPInstanceReferenceList CurrentRequestedProcedureEvidence
 Current Requested Procedure Evidence Sequence: (SQ, 1, 1C).
DSRSOPInstanceReferenceList PertinentOtherEvidence
 Pertinent Other Evidence Sequence: (SQ, 1, 1C).

Detailed Description

Interface class for 'dcmsr' (DICOM Structured Reporting Documents).

This class supports reading, writing, creation, printing and rendering of DICOM SR documents (according to DICOM PS 3.x-2004, formerly known as Supplement 23). The list of supported SOP classes is available in file "dsrtypes.h".

Definition at line 56 of file dsrdoc.h.


Constructor & Destructor Documentation

DSRDocument::DSRDocument const E_DocumentType  documentType = DT_BasicTextSR  ) 
 

(default) constructor.

The parameter 'documentType' is optional and has a default value.

Parameters:
documentType type of the SR document (see DSRTypes::E_DocumentType)


Member Function Documentation

OFCondition DSRDocument::checkDatasetForReading DcmItem dataset,
E_DocumentType documentType
[protected]
 

check the given dataset before reading.

This methods checks whether the dataset contains at least the DICOM attributes SOP class UID and modality. Any incorrectness regarding these two attributes is reported to the log stream (if valid). Currently unsupported SOP classes are also reported as an error.

Parameters:
dataset DICOM dataset to be checked
documentType SR document type retrieved from the SOP class UID
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::completeDocument const OFString description  ) 
 

complete the current document and set a completion description.

Sets the completion flag to COMPLETE if not already done (fails otherwise). The completion flag description can be modified independently from the flag by means of the method setCompletionFlagDescription() - see above. Not applicable to Key Object Selection Documents.

Parameters:
description explanation of the value set for completion flag. (optional, see previous method, VR=LO)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::completeDocument  ) 
 

complete the current document.

Sets the completion flag to COMPLETE if not already done (fails otherwise). The completion flag description is set to an empty string (i.e. absent in DICOM dataset). Not applicable to Key Object Selection Documents.

Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFBool DSRDocument::containsExtendedCharacters  )  [virtual]
 

check if this document contains non-ASCII characters in one of the strings affected by SpecificCharacterSet in DICOM

Returns:
true if node contains non-ASCII characters, false otherwise

OFCondition DSRDocument::createNewDocument const E_DocumentType  documentType  ) 
 

create a new document of the specified type.

A new SOP instance is only created if the current document type was valid/supported. Please note that the current document is deleted by this method.

Parameters:
documentType type of the SR document (see DSRTypes::E_DocumentType)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::createNewDocument  ) 
 

create a new document.

A new SOP instance is only created if the current document type was valid/supported. Please note that the current document is deleted (cleared).

Returns:
status, EC_Normal if successful, an error code otherwise

void DSRDocument::createNewSeries  ) 
 

create a new series.

After generating a new series instance UID the method createNewSOPInstance() is called, i.e. also a SOP instance UID is generated. This is a requirement of the DICOM standard.

OFCondition DSRDocument::createNewSeriesInStudy const OFString studyUID  ) 
 

create a new series within a given study.

After generating a new series instance UID within the given study the method createNewSOPInstance() is called, i.e. also a SOP instance UID is generated. This is a requirement of the DICOM standard.

Parameters:
studyUID study instance UID to be set (should be a valid UID)
Returns:
status, EC_Normal if successful, an error code otherwise

void DSRDocument::createNewSOPInstance  ) 
 

create a new SOP instance.

Generate a new SOP instance UID, set the instance creation date/time and reset the finalized flag (OFFalse). This method is used internally for createNewDocument(), createRevisedVersion() and during object initialization. It could also be used explicitly from the calling application if a new UID should be created (this is the case if the study instance UID or series instance UID has changed as well as any other attribute within the SR Document General Module or SR Document Content Module, see DICOM standard for details). This method also updates the other DICOM header attributes (calling updateAttributes()).

void DSRDocument::createNewStudy  ) 
 

create new study.

After generating a new study instance UID the method createNewSeries() is called, i.e. also a new series instance UID and SOP instance UID are generated. This is a requirement of the DICOM standard.

OFCondition DSRDocument::createRevisedVersion const OFBool  clearList = OFTrue  ) 
 

create a revised version of the current document.

A revised version can only be created if the current document is already completed (see completion flag). If so, a reference to the current document is added to the predecessor documents sequence. If all revised versions of a SR document are stored (written to datasets/files) it is possible to trace back the full chain of previous versions. A new SOP instance is created and the content date/time are set automatically. Furthermore, the verifying observer and identical documents sequence are deleted, the verification flag is set to UNVERIFIED, the completion flag is set to PARTIAL (i.e. not complete), the completion flag description is deleted, all digital signatures contained in the document tree are deleted and the finalized flag is reset (OFFalse). Not applicable to Key Object Selection Documents.

Parameters:
clearList clear list of predecessor documents before adding the current document if OFTrue. Append current document to existing list otherwise.
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::finalizeDocument  ) 
 

finalize the current state of the document.

A new document is originally not finalized but can be finalized using this method. This internal flag is e.g. used to indicate whether the entire document is digitally signed and, therefore, each newly added verifying observer would corrupt all previous signatures. NB: A document needs to be completed first in order to be finalized. Some of the above document management functions do reset the flag (i.e. set the FinalizedFlag to OFFalse), other methods (e.g. setXXX) do not change the flag though the state of the document is not finalized any more after they have been called. Not applicable to Key Object Selection Documents since there's no Completion Flag in this type of SR document.

Returns:
status, EC_Normal if successful, an error code otherwise

const OFString& DSRDocument::getAccessionNumber OFString value  )  const
 

get accession number

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getAccessionNumber  )  const
 

get accession number

Returns:
pointer to string value (might be NULL)

DSRCodingSchemeIdentificationList& DSRDocument::getCodingSchemeIdentification  ) 
 

get list of coding schemes used (Coding Scheme Identification).

The Coding Scheme Identification Sequence maps Coding Scheme Designators to an external coding system registration, or to a private or local coding scheme. See DICOM standard for details.

Returns:
reference to list object

E_CompletionFlag DSRDocument::getCompletionFlag  )  const
 

get document completion flag.

Not applicable to Key Object Selection Documents.

Returns:
completion flag (might be CF_invalid if read from dataset)

const OFString& DSRDocument::getCompletionFlagDescription OFString description  )  const
 

get document completion flag description.

Not applicable to Key Object Selection Documents.

Parameters:
description reference to character string in which the value should be stored
Returns:
character string (might be empty)

const char* DSRDocument::getCompletionFlagDescription  )  const
 

get document completion flag description.

Not applicable to Key Object Selection Documents.

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getContentDate OFString value  )  const
 

get content date

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getContentDate  )  const
 

get content date

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getContentTime OFString value  )  const
 

get content time

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getContentTime  )  const
 

get content time

Returns:
pointer to string value (might be NULL)

DSRSOPInstanceReferenceList& DSRDocument::getCurrentRequestedProcedureEvidence  ) 
 

get list of referenced SOP instances (Current Requested Procedure Evidence).

PS 3.3-2004 states: "The intent of the Current Requested Procedure Evidence Sequence is to reference all evidence created in order to satisfy the current Requested Procedure(s) for this SR Document. This shall include, but is not limited to, all current evidence referenced in the content tree." and "In the context of the Key Object Selection, the current evidence is considered to be only the set of instances referenced within the Key Object Selection." Supplement 66 (FT) adds: "For a completed SR Document satisfying (i.e., being the final report for) the current Requested Procedure(s), this sequence shall list the full set of Composite SOP Instances created for the current Requested Procedure(s). For other SOP Instances that include the SR Document General Module, this sequence shall contain at minimum the set of Composite SOP Instances from the current Requested Procedure(s) that are referenced in the content tree."

Returns:
reference to list object

E_DocumentType DSRDocument::getDocumentType  )  const
 

get the current SR document type

Returns:
document type (might be DT_invalid if read from dataset)

DSRSOPInstanceReferenceList& DSRDocument::getIdenticalDocuments  ) 
 

get list of identical documents.

Please note that currently the user is responsible for filling and modifying the content of this list. However, the list is automatically cleared when a new instance is created (incl. a revised version of the current document). Possibly, there will be a createDuplicate() method or the like in the future which creates an identical copy of the current document in a new study/series. PS 3.3-2004 states: "If identical copies of an SR Document are to be included in multiple Studies then the entire SR Document shall be duplicated with appropriate changes for inclusion into the different Studies (i.e. Study Instance UID, Series Instance UID, SOP Instance UID, Identical Documents Sequence etc.). The Identical Documents Sequence Attribute in each SOP Instance shall contain references to all other duplicate SOP Instances."

Returns:
reference to list object

const OFString& DSRDocument::getInstanceCreationDate OFString value  )  const
 

get instance creation date

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getInstanceCreationDate  )  const
 

get instance creation date

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getInstanceCreationTime OFString value  )  const
 

get instance creation time

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getInstanceCreationTime  )  const
 

get instance creation time

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getInstanceCreatorUID OFString value  )  const
 

get instance creator UID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getInstanceCreatorUID  )  const
 

get instance creator UID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getInstanceNumber OFString value  )  const
 

get instance number

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getInstanceNumber  )  const
 

get instance number

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getManufacturer OFString value  )  const
 

get manufacturer

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getManufacturer  )  const
 

get manufacturer

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getModality OFString value  )  const
 

get modality

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getModality  )  const
 

get modality

Returns:
pointer to string value (might be NULL)

size_t DSRDocument::getNumberOfVerifyingObservers  ) 
 

get number of verifying observers.

A document can be verified more than once. The verification flag should be VERIFIED if any verifying observer is specified. The details on the observer can be retrieved using the getVerifyingObserver() methods. Not applicable to Key Object Selection Documents.

Returns:
number of verifying observers (if any), 0 otherwise

const OFString& DSRDocument::getPatientID OFString value  )  const
 

get patient ID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getPatientID  )  const
 

get patient ID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getPatientsBirthDate OFString value  )  const
 

get patient's birth date

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getPatientsBirthDate  )  const
 

get patient's birth date

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getPatientsName OFString value  )  const
 

get patient's name

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getPatientsName  )  const
 

get patient's name

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getPatientsSex OFString value  )  const
 

get patient's sex

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getPatientsSex  )  const
 

get patient's sex

Returns:
pointer to string value (might be NULL)

DSRSOPInstanceReferenceList& DSRDocument::getPertinentOtherEvidence  ) 
 

get list of referenced SOP instances (Pertinent Other Evidence).

PS 3.3-2004 states: "The Pertinent Other Evidence Sequence attribute is used to reference all other evidence considered pertinent for this SR Document that is not listed in the Current Requested Procedure Evidence Sequence. This requires that the same SOP Instance shall not be referenced in both of these Sequences." Not applicable to Key Object Selection Documents.

Returns:
reference to list object

DSRSOPInstanceReferenceList& DSRDocument::getPredecessorDocuments  ) 
 

get list of predecessor documents.

A document can have more than one (direct) predecessor document. This is e.g. the case when two or more documents have been merged to create it. The corresponding method createRevisedVersion() automatically adds a reference to the current document. PS 3.3-2004 states: "[The Predecessor Documents Sequence] Shall refer to SR SOP Instances (e.g. prior or provisional reports) whose content has been wholly or partially included in this document with or without modification." and "[...] the use of the Predecessor Document Sequence allows tracing back to the input SR Document, which in this case is the previous version." Not applicable to Key Object Selection Documents.

Returns:
reference to list object

const OFString& DSRDocument::getReferringPhysiciansName OFString value  )  const
 

get referring physicians name

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getReferringPhysiciansName  )  const
 

get referring physicians name

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getSeriesDescription OFString value  )  const
 

get series description

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getSeriesDescription  )  const
 

get series description

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getSeriesInstanceUID OFString value  )  const
 

get series instance UID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getSeriesInstanceUID  )  const
 

get series instance UID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getSeriesNumber OFString value  )  const
 

get series number

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getSeriesNumber  )  const
 

get series number

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getSOPClassUID OFString value  )  const
 

get SOP class UID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getSOPClassUID  )  const
 

get SOP class UID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getSOPInstanceUID OFString value  )  const
 

get SOP instance UID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getSOPInstanceUID  )  const
 

get SOP instance UID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getSpecificCharacterSet OFString value  )  const
 

get specific character set

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getSpecificCharacterSet  )  const
 

get specific character set

Returns:
pointer to string value (might be NULL)

E_CharacterSet DSRDocument::getSpecificCharacterSetType  )  const
 

get specific character set type.

If the type is unknown the original DICOM defined term can be retrieved with the method getSpecificCharacterSet(). Please note that only the first of possibly multiple values is used to determine the type from the DICOM code string (multiple character sets are not yet supported).

Returns:
character set (might be CS_invalid/unknown if not supported)

const OFString& DSRDocument::getStudyDate OFString value  )  const
 

get study date

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getStudyDate  )  const
 

get study date

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getStudyDescription OFString value  )  const
 

get study description

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getStudyDescription  )  const
 

get study description

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getStudyID OFString value  )  const
 

get study ID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getStudyID  )  const
 

get study ID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getStudyInstanceUID OFString value  )  const
 

get study instance UID

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getStudyInstanceUID  )  const
 

get study instance UID

Returns:
pointer to string value (might be NULL)

const OFString& DSRDocument::getStudyTime OFString value  )  const
 

get study time

Parameters:
value reference to character string in which the value should be stored
Returns:
character string (might empty)

const char* DSRDocument::getStudyTime  )  const
 

get study time

Returns:
pointer to string value (might be NULL)

DSRDocumentTree& DSRDocument::getTree  )  [inline]
 

get document tree

Returns:
reference to the document tree

Definition at line 205 of file dsrdoc.h.

References DocumentTree.

E_VerificationFlag DSRDocument::getVerificationFlag  )  const
 

get document verification flag.

Not applicable to Key Object Selection Documents.

Returns:
verification flag (might be VF_invalid if read from dataset)

OFCondition DSRDocument::getVerifyingObserver const size_t  idx,
OFString dateTime,
OFString observerName,
DSRCodedEntryValue observerCode,
OFString organization
 

get information about a verifying observer.

All reference variables are cleared before the information is retrieved, i.e. if an error occurs (return value != EC_Normal) non-empty variables do contain valid (empty) data. Not applicable to Key Object Selection Documents.

Parameters:
idx index of the verifying observer to be retrieved (starting with 1). Use getNumberOfVerifyingObservers() to get the maximum value.
dateTime reference to variable where the date and time when this document has been verified should be stored (required)
observerName reference to variable where the name of the person who has verified this document should be stored (required)
observerCode reference to variable where the observer code should be stored. code identifying the verifying observer (optional, see previous method)
organization reference to variable where the name of the organization to which the observer belongs should be stored (required)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::getVerifyingObserver const size_t  idx,
OFString dateTime,
OFString observerName,
OFString organization
 

get information about a verifying observer.

All reference variables are cleared before the information is retrieved, i.e. if an error occurs (return value != EC_Normal) non-empty variables do contain valid (empty) data. Not applicable to Key Object Selection Documents.

Parameters:
idx index of the verifying observer to be retrieved (starting with 1). Use getNumberOfVerifyingObservers() to get the maximum value.
dateTime reference to variable where the date and time when this document has been verified should be stored (required)
observerName reference to variable where the name of the person who has verified this document should be stored (required)
organization reference to variable where the name of the organization to which the observer belongs should be stored (required)
Returns:
status, EC_Normal if successful, an error code otherwise

OFBool DSRDocument::isFinalized  )  const
 

check whether the document is finalized.

A new document is originally not finalized but can be finalized using the method finalizeDocument(). This flag is e.g. used to indicate whether the entire document is digitally signed and, therefore, each newly added verifying observer would corrupt all previous signatures.

Returns:
OFTrue if finalized, OFFalse otherwise

OFBool DSRDocument::isValid  ) 
 

check whether the current internal state is valid.

The SR document is valid if the corresponding document tree is valid and the SOP instance UID as well as the SOP class UID are not "empty".

Returns:
OFTrue if valid, OFFalse otherwise

OFCondition DSRDocument::print ostream &  stream,
const size_t  flags = 0
 

print current SR document to specified output stream.

The output format is identical to that of the dsrdump command line tool.

Parameters:
stream output stream (e.g. COUT from "ofconsol.h")
flags optional flag used to customize the output (see DSRTypes::PF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::read DcmItem dataset,
const size_t  flags = 0
 

read SR document from DICOM dataset.

Please note that the current document is also deleted if the reading process fails. If the log stream is set and valid the reason for any error might be obtained from the error/warning output.

Parameters:
dataset reference to DICOM dataset from which the document should be read
flags optional flag used to customize the reading process (see DSRTypes::RF_xxx). E.g. RF_readDigitalSignatures indicates whether to read the digital signatures from the dataset or not. If set the MACParametersSequence and the DigitalSignaturesSequence are read for the general document header (equivilent to top-level content item) and each content item of the document tree. If not removed manually (with 'DSRDocumentTreeremoveSignatures') the signatures are written back to the dataset when the method 'write' is called. Please note that the two signature sequences for any other sequence (e.g. VerifyingObserver or PredecessorDocuments) are never read.
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXML const OFString filename,
const size_t  flags = 0
 

read SR document from XML file.

The format (Schema) of the XML document is expected to conform to the output format of the writeXML() method. In addition, the document can be validated against an XML Schema by setting the flag XF_validateSchema. For debug output (errors, warnings, etc.) from 'libxml' the flag XF_enableLibxmlErrorOutput has to be set. Digital signatures in the XML document are not yet supported. Please note that the current document is also deleted if the parsing process fails.

Parameters:
filename name of the file from which the XML document is read ("-" for stdin)
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLDocumentData const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML "document" data

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLDocumentHeader DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML document header

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLInstanceData const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML "instance" data

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLPatientData const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML "patient" data

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLSeriesData const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML "series" data

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLStudyData const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML "study" data

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::readXMLVerifyingObserverData const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const size_t  flags
[protected]
 

read XML verifying observer data

Parameters:
doc document containing the XML file content
cursor cursor pointing to the starting node
flags optional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

void DSRDocument::removeVerification  ) 
 

remove verification information.

The list of verifying observers is cleared, the verification flag is set to UNVERIFIED and the finalized flag is reset (set to OFFalse). Normally, there should be no need to call this method. On the other hand, it is useful to guarantee a consistent state when processing documents which have not been created with this module/toolkit.

OFCondition DSRDocument::renderHTML ostream &  stream,
const size_t  flags = 0,
const char *  styleSheet = NULL
 

render current SR document in HTML format.

The output format is identical to that of the dsr2html command line tool.

Parameters:
stream output stream to which the HTML document is written
flags optional flag used to customize the output (see DSRTypes::HF_xxx)
styleSheet optional filename/URL of a Cascading Style Sheet (CSS)
Returns:
status, EC_Normal if successful, an error code otherwise

void DSRDocument::renderHTMLPatientData ostream &  stream,
const size_t  flags
[protected]
 

render patient name, sex, birthdate and ID in HTML format

Parameters:
stream output stream to which the HTML document is written
flags flag used to customize the output (see DSRTypes::HF_xxx)

void DSRDocument::renderHTMLReferenceList ostream &  stream,
DSRSOPInstanceReferenceList refList,
const size_t  flags
[protected]
 

render list of referenced SOP instances in HTML format

Parameters:
stream output stream to which the HTML document is written
refList list of referenced SOP instances to be rendered
flags flag used to customize the output (see DSRTypes::HF_xxx)

OFCondition DSRDocument::setAccessionNumber const OFString value  ) 
 

set accession number.

The passed string must be a valid DICOM Short String (SH).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setCompletionFlagDescription const OFString value  ) 
 

set document completion flag description.

The description can be removed from the DICOM dataset (type 3) by setting an empty string.

Parameters:
value explanation of the value set for completion flag (optional, VR=LO)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setContentDate const OFString value  ) 
 

set content date.

The passed string must be a valid DICOM Date (DA). If an empty string is passed the current date is set when displaying or writing the document since the corresponding DICOM attribute is type 1 (= mandatory).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setContentTime const OFString value  ) 
 

set content time.

The passed string must be a valid DICOM Time (TM). If an empty string is passed the current time is set when displaying or writing the document since the corresponding DICOM attribute is type 1 (= mandatory).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setInstanceNumber const OFString value  ) 
 

set instance number.

The passed string must be a valid DICOM Integer String (IS). If an empty string is passed the value "1" is set when displaying or writing the document since the corresponding DICOM attribute is type 1 (= mandatory).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

void DSRDocument::setLogStream OFConsole stream  ) 
 

set the log stream.

The log stream is used to report warning and error messages. Unfortunately, the stream cannot be used for 'libxml' messages. Therefore, the error output of 'libxml' is disabled by default (see readXML() for details).

Parameters:
stream pointer to the log stream (might be NULL = no messages)

OFCondition DSRDocument::setManufacturer const OFString value  ) 
 

set manufacturer.

The passed string must be a valid DICOM Long String (LO).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setPatientID const OFString value  ) 
 

set patient ID.

The passed string must be a valid DICOM Long String (LO).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setPatientsBirthDate const OFString value  ) 
 

set patient's birth date.

The passed string must be a valid DICOM Date (DA).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setPatientsName const OFString value  ) 
 

set patient's name.

The passed string must be a valid DICOM Person Name (PN).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setPatientsSex const OFString value  ) 
 

set patient's sex.

The passed string must be a valid DICOM Code String (CS).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setReferringPhysiciansName const OFString value  ) 
 

set referring physicians name.

The passed string must be a valid DICOM Person Name (PN).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setSeriesDescription const OFString value  ) 
 

set series description.

The passed string must be a valid DICOM Long String (LO).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setSeriesNumber const OFString value  ) 
 

set series number.

The passed string must be a valid DICOM Short String (SH). If an empty string is passed the value "1" is set when displaying or writing the document since the corresponding DICOM attribute is type 1 (= mandatory).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setSpecificCharacterSet const OFString value  ) 
 

set specific character set.

The passed string must be a valid DICOM Code String (CS). The internal enumerated value is set accordingly.

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setSpecificCharacterSetType const E_CharacterSet  characterSet  ) 
 

set specific character set type.

The DICOM defined term (see SpecificCharacterSet) is set accordingly.

Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setStudyDescription const OFString value  ) 
 

set study description.

The passed string must be a valid DICOM Long String (LO).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::setStudyID const OFString value  ) 
 

set study ID.

The passed string must be a valid DICOM Short String (SH).

Parameters:
value character string specifying the value to be set
Returns:
status, EC_Normal if successful, an error code otherwise

void DSRDocument::updateAttributes const OFBool  updateAll = OFTrue  )  [protected]
 

update several DICOM attributes.

(e.g. set the modality attribute, generate a new SOP instance UID if required, set date/time, etc.)

Parameters:
updateAll flag indicating whether all DICOM attributes should be updated or only the completion and verification flag. (set DICOM defined terms from enum values)

OFCondition DSRDocument::verifyDocument const OFString observerName,
const DSRCodedEntryValue observerCode,
const OFString organization,
const OFString dateTime
 

verify the current document by a specific observer.

Same as above but allows to specify the verification date time value. Only required since Sun CC 2.0.1 compiler does not support default parameter values for "complex types" like OFString. Reports the error message: "Sorry not implemented" :-/

Parameters:
observerName name of the person who has verified this document (required, VR=PN)
observerCode code identifying the verifying observer (optional, see previous method)
organization name of the organization to which the observer belongs (required, VR=LO)
dateTime verification date time (optional). If empty/absent the current date and time are used.
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::verifyDocument const OFString observerName,
const DSRCodedEntryValue observerCode,
const OFString organization
 

verify the current document by a specific observer.

A document can be verified more than once. The observer information is added to a sequence stored in the dataset. The verification flag is automatically set to VERIFIED (if not already done) and the finalized flag is reset (set to OFFalse). Please note that only completed documents (see completion flag) can be verified and that a new SOP instance UID has to be generated (manually) according to the DICOM standard when creating a dataset/file from this document. Not applicable to Key Object Selection Documents.

Parameters:
observerName name of the person who has verified this document (required, VR=PN)
observerCode code identifying the verifying observer (optional, see previous method)
organization name of the organization to which the observer belongs (required, VR=LO)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::verifyDocument const OFString observerName,
const OFString organization,
const OFString dateTime
 

verify the current document by a specific observer.

Same as above but allows to specify the verification date time value. Only required since Sun CC 2.0.1 compiler does not support default parameter values for "complex types" like OFString. Reports the error message: "Sorry not implemented" :-/

Parameters:
observerName name of the person who has verified this document (required, VR=PN)
organization name of the organization to which the observer belongs (required, VR=LO)
dateTime verification date time (optional). If empty/absent the current date and time are used.
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::verifyDocument const OFString observerName,
const OFString organization
 

verify the current document by a specific observer.

A document can be verified more than once. The observer information is added to a sequence stored in the dataset. The verification flag is automatically set to VERIFIED (if not already done) and the finalized flag is reset (set to OFFalse). Please note that only completed documents (see completion flag) can be verified and that a new SOP instance UID has to be generated (manually) according to the DICOM standard when creating a dataset/file from this document. Not applicable to Key Object Selection Documents.

Parameters:
observerName name of the person who has verified this document (required, VR=PN)
organization name of the organization to which the observer belongs (required, VR=LO)
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::write DcmItem dataset,
DcmStack markedItems = NULL
 

write current SR document to DICOM dataset.

Please note that the ContentTemplateSequence for the root content item is not written automatically for particular SOP Classes (e.g. Key Object Selection Document). Instead, the template identification has to be set manually for the root CONTAINER (see DSRDocumentTreeNode::setTemplateIdentification()). This is because the template constraints cannot be checked yet.

Parameters:
dataset reference to DICOM dataset to which the current document should be written
markedItems optional stack where pointers to all 'marked' content items (DICOM datasets/items) are added to during the write process. Can be used to digitally sign parts of the document tree.
Returns:
status, EC_Normal if successful, an error code otherwise

OFCondition DSRDocument::writeXML ostream &  stream,
const size_t  flags = 0
 

write current SR document in XML format.

The output format is identical to that of the dsr2xml command line tool. Digital signatures in the XML document are not yet supported.

Parameters:
stream output stream to which the XML document is written
flags optional flag used to customize the output (see DSRTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise


The documentation for this class was generated from the following file:


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5