OFFIS DCMTK  Version 3.6.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DSRDocument Class Reference

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

Inheritance diagram for DSRDocument:
[legend]
Collaboration diagram for DSRDocument:
[legend]

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.
 
OFCondition print (STD_NAMESPACE 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 (STD_NAMESPACE ostream &stream, const size_t flags=0)
 write current SR document in XML format.
 
OFCondition renderHTML (STD_NAMESPACE ostream &stream, const size_t flags=0, const char *styleSheet=NULL)
 render current SR document in HTML/XHTML format.
 
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_PreliminaryFlag getPreliminaryFlag () const
 get document preliminary flag.
 
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 * getPatientName () const
 get patient's name
 
const char * getPatientBirthDate () const
 get patient's birth date
 
const char * getPatientSex () const
 get patient's sex
 
const char * getReferringPhysicianName () 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 * getManufacturerModelName () const
 get manufacturer's model name
 
const char * getDeviceSerialNumber () const
 get device serial number
 
const char * getSoftwareVersions () const
 get software version(s)
 
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 OFStringgetPatientName (OFString &value) const
 get patient's name
 
const OFStringgetPatientBirthDate (OFString &value) const
 get patient's birth date
 
const OFStringgetPatientSex (OFString &value) const
 get patient's sex
 
const OFStringgetReferringPhysicianName (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 OFStringgetManufacturerModelName (OFString &value) const
 get manufacturer's model name
 
const OFStringgetDeviceSerialNumber (OFString &value) const
 get device serial number
 
const OFStringgetSoftwareVersions (OFString &value) const
 get software version(s).
 
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 setPreliminaryFlag (const E_PreliminaryFlag flag)
 set document preliminary flag.
 
OFCondition setCompletionFlagDescription (const OFString &value)
 set document completion flag description.
 
OFCondition setPatientName (const OFString &value)
 set patient's name.
 
OFCondition setPatientBirthDate (const OFString &value)
 set patient's birth date.
 
OFCondition setPatientSex (const OFString &value)
 set patient's sex.
 
OFCondition setReferringPhysicianName (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 setManufacturerModelName (const OFString &value)
 set manufacturer's model name.
 
OFCondition setDeviceSerialNumber (const OFString &value)
 set device serial number.
 
OFCondition setSoftwareVersions (const OFString &value)
 set software version(s).
 
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 (STD_NAMESPACE ostream &stream, const size_t flags)
 render patient name, sex, birthdate and ID in HTML/XHTML format
 
void renderHTMLReferenceList (STD_NAMESPACE ostream &stream, DSRSOPInstanceReferenceList &refList, const size_t flags)
 render list of referenced SOP instances in HTML/XHTML format
 
OFCondition checkDatasetForReading (DcmItem &dataset, E_DocumentType &documentType)
 check the given dataset before reading.
 
void updateAttributes (const OFBool updateAll=OFTrue)
 update several DICOM attributes.
 
- Protected Member Functions inherited from DSRTypes
virtual ~DSRTypes ()
 destructor.
 

Private Member Functions

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

Private Attributes

DSRDocumentTree DocumentTree
 SR document tree.
 
OFBool FinalizedFlag
 flag indicating whether is document is finalized or not
 
E_PreliminaryFlag PreliminaryFlagEnum
 enumerated value: preliminary, final
 
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 ReferringPhysicianName
 ReferringPhysicianName: (PN, 1, 2)
 
DcmShortString StudyID
 Study ID: (SH, 1, 2)
 
DcmShortString AccessionNumber
 Accession Number: (SH, 1, 2)
 
DcmLongString StudyDescription
 Study Description: (LO, 1, 3)
 
DcmPersonName PatientName
 Patient's Name: (PN, 1, 2)
 
DcmLongString PatientID
 Patient ID: (LO, 1, 2)
 
DcmDate PatientBirthDate
 Patient's Birth Date: (DA, 1, 2)
 
DcmCodeString PatientSex
 Patient's Sex: (CS, 1, 2)
 
DcmLongString Manufacturer
 Manufacturer: (LO, 1, 2)
 
DcmLongString ManufacturerModelName
 Manufacturer's Model Name: (LO, 1, 3)
 
DcmLongString DeviceSerialNumber
 Device Serial Number: (LO, 1, 3)
 
DcmLongString SoftwareVersions
 Software Version(s): (LO, 1-n, 3)
 
DcmCodeString Modality
 Manufacturer's Model Name: (LO, 1, 1)
 
DcmUniqueIdentifier SeriesInstanceUID
 Series Instance Number: (UI, 1, 1)
 
DcmIntegerString SeriesNumber
 Series Number: (IS, 1, 1)
 
DcmLongString SeriesDescription
 Series Description: (LO, 1, 3)
 
DcmSequenceOfItems ReferencedPerformedProcedureStep
 Referenced Performed Procedure Step Sequence: (SQ, 1, 2)
 
DcmIntegerString InstanceNumber
 Instance Number: (IS, 1, 1)
 
DcmCodeString PreliminaryFlag
 Preliminary Flag: (CS, 1, 3)
 
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)
 

Additional Inherited Members

- Protected Types inherited from DSRTypes
enum  E_DocumentType {
  DT_invalid, DT_unknown = DT_invalid, DT_BasicTextSR, DT_EnhancedSR,
  DT_ComprehensiveSR, DT_KeyObjectSelectionDocument, DT_MammographyCadSR, DT_ChestCadSR,
  DT_ColonCadSR, DT_ProcedureLog, DT_XRayRadiationDoseSR, DT_SpectaclePrescriptionReport,
  DT_MacularGridThicknessAndVolumeReport, DT_ImplantationPlanSRDocument, DT_last = DT_ImplantationPlanSRDocument
}
 SR document types. More...
 
enum  E_RelationshipType {
  RT_invalid, RT_unknown, RT_isRoot, RT_contains,
  RT_hasObsContext, RT_hasAcqContext, RT_hasConceptMod, RT_hasProperties,
  RT_inferredFrom, RT_selectedFrom, RT_last = RT_selectedFrom
}
 SR relationship types. More...
 
enum  E_ValueType {
  VT_invalid, VT_Text, VT_Code, VT_Num,
  VT_DateTime, VT_Date, VT_Time, VT_UIDRef,
  VT_PName, VT_SCoord, VT_SCoord3D, VT_TCoord,
  VT_Composite, VT_Image, VT_Waveform, VT_Container,
  VT_byReference, VT_last = VT_byReference
}
 SR value types. More...
 
enum  E_GraphicType {
  GT_invalid, GT_unknown = GT_invalid, GT_Point, GT_Multipoint,
  GT_Polyline, GT_Circle, GT_Ellipse, GT_last = GT_Ellipse
}
 SR graphic types. More...
 
enum  E_GraphicType3D {
  GT3_invalid, GT3_unknown = GT3_invalid, GT3_Point, GT3_Multipoint,
  GT3_Polyline, GT3_Polygon, GT3_Ellipse, GT3_Ellipsoid,
  GT3_last = GT3_Ellipsoid
}
 SR graphic types (3D). More...
 
enum  E_TemporalRangeType {
  TRT_invalid, TRT_unknown = TRT_invalid, TRT_Point, TRT_Multipoint,
  TRT_Segment, TRT_Multisegment, TRT_Begin, TRT_End,
  TRT_last = TRT_End
}
 SR temporal range types. More...
 
enum  E_ContinuityOfContent { COC_invalid, COC_Separate, COC_Continuous, COC_last = COC_Continuous }
 SR continuity of content flag. More...
 
enum  E_PreliminaryFlag { PF_invalid, PF_Preliminary, PF_Final, PF_last = PF_Final }
 SR document preliminary flag. More...
 
enum  E_CompletionFlag { CF_invalid, CF_Partial, CF_Complete, CF_last = CF_Complete }
 SR document completion flag. More...
 
enum  E_VerificationFlag { VF_invalid, VF_Unverified, VF_Verified, VF_last = VF_Verified }
 SR document verification flag. More...
 
enum  E_CharacterSet {
  CS_invalid, CS_unknown = CS_invalid, CS_ASCII, CS_Latin1,
  CS_Latin2, CS_Latin3, CS_Latin4, CS_Cyrillic,
  CS_Arabic, CS_Greek, CS_Hebrew, CS_Latin5,
  CS_Japanese, CS_Thai, CS_UTF8, CS_last = CS_UTF8
}
 Specific character set. More...
 
enum  E_AddMode { AM_afterCurrent, AM_beforeCurrent, AM_belowCurrent }
 Add node mode. More...
 
- Static Protected Member Functions inherited from DSRTypes
static const char * documentTypeToSOPClassUID (const E_DocumentType documentType)
 convert SR document type to SOP class UID
 
static const char * documentTypeToModality (const E_DocumentType documentType)
 convert SR document type to modality
 
static const char * documentTypeToReadableName (const E_DocumentType documentType)
 convert SR document type to readable name.
 
static const char * documentTypeToDocumentTitle (const E_DocumentType documentType, OFString &documentTitle)
 convert SR document type to document title.
 
static OFBool requiresEnhancedEquipmentModule (const E_DocumentType documentType)
 check whether SR document type requires Enhanced General Equipment Module
 
static const char * relationshipTypeToDefinedTerm (const E_RelationshipType relationshipType)
 convert relationship type to DICOM defined term
 
static const char * relationshipTypeToReadableName (const E_RelationshipType relationshipType)
 convert relationship type to readable name.
 
static const char * valueTypeToDefinedTerm (const E_ValueType valueType)
 convert value type to DICOM defined term
 
static const char * valueTypeToXMLTagName (const E_ValueType valueType)
 convert value type to XML tag name
 
static const char * valueTypeToReadableName (const E_ValueType valueType)
 convert value type to readable name.
 
static const char * graphicTypeToEnumeratedValue (const E_GraphicType graphicType)
 convert graphic type to DICOM enumerated value
 
static const char * graphicTypeToReadableName (const E_GraphicType graphicType)
 convert graphic type to readable name.
 
static const char * graphicType3DToEnumeratedValue (const E_GraphicType3D graphicType)
 convert graphic type (3D) to DICOM enumerated value
 
static const char * graphicType3DToReadableName (const E_GraphicType3D graphicType)
 convert graphic type (3D) to readable name.
 
static const char * temporalRangeTypeToEnumeratedValue (const E_TemporalRangeType temporalRangeType)
 convert temporal range type to DICOM enumerated value
 
static const char * temporalRangeTypeToReadableName (const E_TemporalRangeType temporalRangeType)
 convert temporal range type to readable name.
 
static const char * continuityOfContentToEnumeratedValue (const E_ContinuityOfContent continuityOfContent)
 convert continuity of content flag to DICOM enumerated value
 
static const char * preliminaryFlagToEnumeratedValue (const E_PreliminaryFlag preliminaryFlag)
 convert preliminary flag to DICOM enumerated value
 
static const char * completionFlagToEnumeratedValue (const E_CompletionFlag completionFlag)
 convert completion flag to DICOM enumerated value
 
static const char * verificationFlagToEnumeratedValue (const E_VerificationFlag verificationFlag)
 convert verification flag to DICOM enumerated value
 
static const char * characterSetToDefinedTerm (const E_CharacterSet characterSet)
 convert character set to DICOM defined term
 
static const char * characterSetToHTMLName (const E_CharacterSet characterSet)
 convert character set to HTML name.
 
static const char * characterSetToXMLName (const E_CharacterSet characterSet)
 convert character set to XML name.
 
static E_DocumentType sopClassUIDToDocumentType (const OFString &sopClassUID)
 convert SOP class UID to SR document type
 
static E_RelationshipType definedTermToRelationshipType (const OFString &definedTerm)
 convert DICOM defined term to relationship type
 
static E_ValueType definedTermToValueType (const OFString &definedTerm)
 convert DICOM defined term to value type
 
static E_ValueType xmlTagNameToValueType (const OFString &xmlTagName)
 convert XML tag name to value type
 
static E_GraphicType enumeratedValueToGraphicType (const OFString &enumeratedValue)
 convert DICOM enumerated value to graphic type
 
static E_GraphicType3D enumeratedValueToGraphicType3D (const OFString &enumeratedValue)
 convert DICOM enumerated value to graphic type (3D)
 
static E_TemporalRangeType enumeratedValueToTemporalRangeType (const OFString &enumeratedValue)
 convert DICOM enumerated value to temporal range type
 
static E_ContinuityOfContent enumeratedValueToContinuityOfContent (const OFString &enumeratedValue)
 convert DICOM enumerated value to continuity of content flag
 
static E_PreliminaryFlag enumeratedValueToPreliminaryFlag (const OFString &enumeratedValue)
 convert DICOM enumerated value to preliminary flag
 
static E_CompletionFlag enumeratedValueToCompletionFlag (const OFString &enumeratedValue)
 convert DICOM enumerated value to completion flag
 
static E_VerificationFlag enumeratedValueToVerificationFlag (const OFString &enumeratedValue)
 convert DICOM enumerated value to verification flag
 
static E_CharacterSet definedTermToCharacterSet (const OFString &definedTerm)
 convert DICOM defined term to character set
 
static OFBool isDocumentTypeSupported (const E_DocumentType documentType)
 check whether specified SR document type is supported by this library.
 
static const OFStringcurrentDate (OFString &dateString)
 get current date in DICOM 'DA' format.
 
static const OFStringcurrentTime (OFString &timeString)
 get current time in DICOM 'TM' format.
 
static const OFStringcurrentDateTime (OFString &dateTimeString)
 get current date and time in DICOM 'DT' format.
 
static const OFStringdicomToReadableDate (const OFString &dicomDate, OFString &readableDate)
 convert DICOM date string to readable format.
 
static const OFStringdicomToReadableTime (const OFString &dicomTime, OFString &readableTime)
 convert DICOM time string to readable format.
 
static const OFStringdicomToReadableDateTime (const OFString &dicomDateTime, OFString &readableDateTime)
 convert DICOM date time string to readable format.
 
static const OFStringdicomToReadablePersonName (const OFString &dicomPersonName, OFString &readablePersonName)
 convert DICOM person name to readable format.
 
static const OFStringdicomToXMLPersonName (const OFString &dicomPersonName, OFString &xmlPersonName, const OFBool writeEmptyValue=OFFalse)
 convert DICOM person name to XML format.
 
static const char * numberToString (const size_t number, char *stringValue)
 convert unsigned integer number to character string
 
static size_t stringToNumber (const char *stringValue)
 convert string to unsigned integer number
 
static const OFStringconvertToPrintString (const OFString &sourceString, OFString &printString)
 convert character string to print string.
 
static const OFStringconvertToHTMLString (const OFString &sourceString, OFString &markupString, const size_t flags=0, const OFBool newlineAllowed=OFFalse)
 convert character string to HTML mnenonic string.
 
static const OFStringconvertToXMLString (const OFString &sourceString, OFString &markupString)
 convert character string to XML mnenonic string.
 
static OFBool checkForValidUIDFormat (const OFString &stringValue)
 check string for valid UID format.
 
static DSRIODConstraintCheckercreateIODConstraintChecker (const E_DocumentType documentType)
 create specified SR IOD content relationship contraint checker object.
 
static DSRDocumentTreeNodecreateDocumentTreeNode (const E_RelationshipType relationshipType, const E_ValueType valueType)
 create specified document tree node.
 
static OFCondition addElementToDataset (OFCondition &result, DcmItem &dataset, DcmElement *delem, const OFString &vm, const OFString &type, const char *moduleName=NULL)
 add given element to the dataset.
 
static void removeAttributeFromSequence (DcmSequenceOfItems &sequence, const DcmTagKey &tagKey)
 remove given attribute from the sequence.
 
static OFCondition getElementFromDataset (DcmItem &dataset, DcmElement &delem)
 get element from dataset
 
static const char * getStringValueFromElement (const DcmElement &delem)
 get string value from element
 
static const OFStringgetStringValueFromElement (const DcmElement &delem, OFString &stringValue)
 get string value from element
 
static const OFStringgetPrintStringFromElement (const DcmElement &delem, OFString &stringValue)
 get string value from element and convert to "print" format
 
static const OFStringgetMarkupStringFromElement (const DcmElement &delem, OFString &stringValue, const OFBool convertNonASCII=OFFalse)
 get string value from element and convert to HTML/XML
 
static OFCondition getStringValueFromDataset (DcmItem &dataset, const DcmTagKey &tagKey, OFString &stringValue)
 get string value from dataset
 
static OFCondition putStringValueToDataset (DcmItem &dataset, const DcmTag &tag, const OFString &stringValue, const OFBool allowEmpty=OFTrue)
 put string value to dataset
 
static OFBool checkElementValue (DcmElement &delem, const OFString &vm, const OFString &type, const OFCondition &searchCond=EC_Normal, const char *moduleName=NULL)
 check element value for correct value multipicity and type.
 
static OFCondition getAndCheckElementFromDataset (DcmItem &dataset, DcmElement &delem, const OFString &vm, const OFString &type, const char *moduleName=NULL)
 get element from dataset and check it for correct value multipicity and type.
 
static OFCondition getAndCheckStringValueFromDataset (DcmItem &dataset, const DcmTagKey &tagKey, OFString &stringValue, const OFString &vm, const OFString &type, const char *moduleName=NULL)
 get string value from dataset and check it for correct value multipicity and type.
 
static void printInvalidContentItemMessage (const char *action, const DSRDocumentTreeNode *node, const char *location=NULL)
 print the warning message that the current content item is invalid/incomplete.
 
static void printContentItemErrorMessage (const char *action, const OFCondition &result, const DSRDocumentTreeNode *node, const char *location=NULL)
 print an error message for the current content item.
 
static void printUnknownValueWarningMessage (const char *valueName, const char *readValue=NULL, const char *action="Reading")
 print a warning message that an unknown/unsupported value has been determined
 
static OFBool writeStringValueToXML (STD_NAMESPACE ostream &stream, const OFString &stringValue, const OFString &tagName, const OFBool writeEmptyValue=OFFalse)
 write string value to XML output stream.
 
static OFBool writeStringFromElementToXML (STD_NAMESPACE ostream &stream, DcmElement &delem, const OFString &tagName, const OFBool writeEmptyValue=OFFalse)
 write string value from DICOM element to XML output stream.
 
static size_t createHTMLAnnexEntry (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, const OFString &referenceText, size_t &annexNumber, const size_t flags=0)
 create an HTML annex entry with hyperlinks.
 
static size_t createHTMLFootnote (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &footnoteStream, size_t &footnoteNumber, const size_t nodeID, const size_t flags=0)
 create an HTML footnote with hyperlinks
 
static OFCondition appendStream (STD_NAMESPACE ostream &mainStream, OFOStringStream &tempStream, const char *heading=NULL)
 append one output stream to another.
 
- Static Protected Attributes inherited from DSRTypes
static const size_t RF_readDigitalSignatures
 read digital signatures from dataset
 
static const size_t RF_acceptUnknownRelationshipType
 accept unknown/missing relationship type
 
static const size_t RF_ignoreRelationshipConstraints
 ignore relationship constraints for this document class
 
static const size_t RF_ignoreContentItemErrors
 do not abort on content item errors (e.g. missing value type specific attributes)
 
static const size_t RF_skipInvalidContentItems
 do not abort when detecting an invalid content item, skip invalid sub-tree instead
 
static const size_t RF_showCurrentlyProcessedItem
 show the currently processed content item (e.g. "1.2.3")
 
static const size_t HF_neverExpandChildrenInline
 external: never expand child nodes inline
 
static const size_t HF_alwaysExpandChildrenInline
 external: always expand child nodes inline
 
static const size_t HF_renderInlineCodes
 external: render codes even if they appear inline
 
static const size_t HF_useCodeDetailsTooltip
 external: render code details as a tooltip (not with HTML 3.2)
 
static const size_t HF_renderConceptNameCodes
 external: render concept name codes (default: code meaning only)
 
static const size_t HF_renderNumericUnitCodes
 external: render the code of the numeric measurement unit
 
static const size_t HF_useCodeMeaningAsUnit
 external: use code meaning for the numeric measurement unit (default: code value)
 
static const size_t HF_renderPatientTitle
 external: use patient information as document title (default: document type)
 
static const size_t HF_renderNoDocumentHeader
 external: render no general document information (header)
 
static const size_t HF_renderDcmtkFootnote
 external: render dcmtk/dcmsr comment at the end of the document
 
static const size_t HF_renderFullData
 external: render the full data of all content items
 
static const size_t HF_renderSectionTitlesInline
 external: render section titles inline (default: separate paragraph)
 
static const size_t HF_copyStyleSheetContent
 external: copy Cascading Style Sheet (CSS) content to HTML file
 
static const size_t HF_HTML32Compatibility
 external: output compatible to HTML version 3.2 (default: 4.01)
 
static const size_t HF_XHTML11Compatibility
 external: output compatible to XHTML version 1.1 (default: HTML 4.01)
 
static const size_t HF_addDocumentTypeReference
 external: add explicit reference to HTML document type (DTD)
 
static const size_t HF_omitGeneratorMetaElement
 external: omit generator meta element referring to the DCMTK
 
static const size_t HF_renderItemsSeparately
 internal: render items separately (for container with SEPARATE flag)
 
static const size_t HF_renderItemInline
 internal: expand items inline when they are short and have no child nodes
 
static const size_t HF_currentlyInsideAnnex
 internal: content item is rendered fully inside the annex
 
static const size_t HF_createFootnoteReferences
 internal: create footnote references
 
static const size_t HF_convertNonASCIICharacters
 internal: convert non-ASCII characters (> #127) to &#nnn;
 
static const size_t HF_renderAllCodes
 shortcut: render all codes
 
static const size_t HF_internalUseOnly
 shortcut: filter all flags that are only used internally
 
static const size_t XF_writeEmptyTags
 write: write all tags even if their value is empty
 
static const size_t XF_writeTemplateIdentification
 write: write template identification information (TID and mapping resource)
 
static const size_t XF_alwaysWriteItemIdentifier
 write: always write item identifier "id", not only when item is referenced
 
static const size_t XF_codeComponentsAsAttribute
 write: encode code value, coding scheme designator and coding scheme version as attribute instead of element text
 
static const size_t XF_relationshipTypeAsAttribute
 write: encode relationship type as attribute instead of element text
 
static const size_t XF_valueTypeAsAttribute
 write: encode value type as attribute instead of element text
 
static const size_t XF_templateIdentifierAsAttribute
 write: encode template identifier as attribute instead of element text
 
static const size_t XF_useDcmsrNamespace
 write: add DCMSR namespace declaration to the XML output
 
static const size_t XF_addSchemaReference
 write: add Schema reference to XML document
 
static const size_t XF_validateSchema
 read: validate content of XML document against Schema
 
static const size_t XF_templateElementEnclosesItems
 read/write: template identification element encloses content items
 
static const size_t XF_encodeEverythingAsAttribute
 shortcut: combines all XF_xxxAsAttribute write flags (see above)
 
static const size_t PF_printItemPosition
 print item position ("1.2.3") instead of line indentation
 
static const size_t PF_shortenLongItemValues
 shorten long item value (e.g. long texts)
 
static const size_t PF_printSOPInstanceUID
 print SOP instance UID of referenced objects
 
static const size_t PF_printConceptNameCodes
 print coding scheme designator/version and code value of concept names
 
static const size_t PF_printNoDocumentHeader
 print no general document information (header)
 
static const size_t PF_printTemplateIdentification
 print template identification (TID and mapping resource)
 
static const size_t PF_printAllCodes
 shortcut: print all codes
 
static const size_t CM_updatePositionString
 update the position string using the node ID
 
static const size_t CM_updateNodeID
 update the node ID using the position string
 
static const size_t CM_resetReferenceTargetFlag
 reset the reference target flag for all nodes
 

Detailed Description

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

This class supports reading, writing, creation, printing and rendering of DICOM Structured Reporting (SR) documents. The list of supported SOP classes is available in file "dsrtypes.h".

Definition at line 52 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
documentTypetype 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
datasetDICOM dataset to be checked
documentTypeSR document type retrieved from the SOP class UID
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
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
descriptionexplanation 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::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
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
documentTypetype of the SR document (see DSRTypes::E_DocumentType)
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
studyUIDstudy 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). The preliminary flag is not modified by this method. Not applicable to Key Object Selection Documents.

Parameters
clearListclear 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. Please note that this method has nothing to do with the preliminary flag.

Returns
status, EC_Normal if successful, an error code otherwise
const char* DSRDocument::getAccessionNumber ( ) const

get accession number

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getAccessionNumber ( OFString value) const

get accession number

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
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 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::getCompletionFlagDescription ( OFString description) const

get document completion flag description.

Not applicable to Key Object Selection Documents.

Parameters
descriptionreference to character string in which the value should be stored
Returns
character string (might be empty)
const char* DSRDocument::getContentDate ( ) const

get content date

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getContentDate ( OFString value) const

get content date

Parameters
valuereference 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)
const OFString& DSRDocument::getContentTime ( OFString value) const

get content time

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
DSRSOPInstanceReferenceList& DSRDocument::getCurrentRequestedProcedureEvidence ( )

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

The DICOM standard 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 "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." 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."

Returns
reference to list object
const char* DSRDocument::getDeviceSerialNumber ( ) const

get device serial number

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getDeviceSerialNumber ( OFString value) const

get device serial number

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
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. The DICOM standard 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 char* DSRDocument::getInstanceCreationDate ( ) const

get instance creation date

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getInstanceCreationDate ( OFString value) const

get instance creation date

Parameters
valuereference 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::getInstanceCreationTime ( OFString value) const

get instance creation time

Parameters
valuereference 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::getInstanceCreatorUID ( OFString value) const

get instance creator UID

Parameters
valuereference 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::getInstanceNumber ( OFString value) const

get instance number

Parameters
valuereference 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::getManufacturer ( OFString value) const

get manufacturer

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
const char* DSRDocument::getManufacturerModelName ( ) const

get manufacturer's model name

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getManufacturerModelName ( OFString value) const

get manufacturer's model name

Parameters
valuereference 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)
const OFString& DSRDocument::getModality ( OFString value) const

get modality

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
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 char* DSRDocument::getPatientBirthDate ( ) const

get patient's birth date

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getPatientBirthDate ( OFString value) const

get patient's birth date

Parameters
valuereference 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::getPatientID ( OFString value) const

get patient ID

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
const char* DSRDocument::getPatientName ( ) const

get patient's name

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getPatientName ( OFString value) const

get patient's name

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
const char* DSRDocument::getPatientSex ( ) const

get patient's sex

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getPatientSex ( OFString value) const

get patient's sex

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
DSRSOPInstanceReferenceList& DSRDocument::getPertinentOtherEvidence ( )

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

The DICOM standard 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. The DICOM standard 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
E_PreliminaryFlag DSRDocument::getPreliminaryFlag ( ) const

get document preliminary flag.

Not applicable to Key Object Selection Documents.

Returns
preliminary flag (might be PF_invalid if not specified)
const char* DSRDocument::getReferringPhysicianName ( ) const

get referring physicians name

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getReferringPhysicianName ( OFString value) const

get referring physicians name

Parameters
valuereference 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::getSeriesDescription ( OFString value) const

get series description

Parameters
valuereference 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::getSeriesInstanceUID ( OFString value) const

get series instance UID

Parameters
valuereference 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::getSeriesNumber ( OFString value) const

get series number

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
const char* DSRDocument::getSoftwareVersions ( ) const

get software version(s)

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getSoftwareVersions ( OFString value) const

get software version(s).

Please note that only the first component is returned.

Parameters
valuereference 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::getSOPClassUID ( OFString value) const

get SOP class UID

Parameters
valuereference 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::getSOPInstanceUID ( OFString value) const

get SOP instance UID

Parameters
valuereference 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)
const OFString& DSRDocument::getSpecificCharacterSet ( OFString value) const

get specific character set

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
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 char* DSRDocument::getStudyDate ( ) const

get study date

Returns
pointer to string value (might be NULL)
const OFString& DSRDocument::getStudyDate ( OFString value) const

get study date

Parameters
valuereference 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::getStudyDescription ( OFString value) const

get study description

Parameters
valuereference 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::getStudyID ( OFString value) const

get study ID

Parameters
valuereference 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::getStudyInstanceUID ( OFString value) const

get study instance UID

Parameters
valuereference 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)
const OFString& DSRDocument::getStudyTime ( OFString value) const

get study time

Parameters
valuereference to character string in which the value should be stored
Returns
character string (might empty)
DSRDocumentTree& DSRDocument::getTree ( )
inline

get document tree

Returns
reference to the document tree

Definition at line 187 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,
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
idxindex of the verifying observer to be retrieved (starting with 1). Use getNumberOfVerifyingObservers() to get the maximum value.
dateTimereference to variable where the date and time when this document has been verified should be stored (required)
observerNamereference to variable where the name of the person who has verified this document should be stored (required)
organizationreference 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,
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
idxindex of the verifying observer to be retrieved (starting with 1). Use getNumberOfVerifyingObservers() to get the maximum value.
dateTimereference to variable where the date and time when this document has been verified should be stored (required)
observerNamereference to variable where the name of the person who has verified this document should be stored (required)
observerCodereference to variable where the observer code should be stored. code identifying the verifying observer (optional, see previous method)
organizationreference 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 ( STD_NAMESPACE 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
streamoutput stream (e.g. COUT from "ofconsol.h")
flagsoptional 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
datasetreference to DICOM dataset from which the document should be read
flagsoptional 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 'DSRDocumentTree::removeSignatures') 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. 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
filenamename of the file from which the XML document is read ("-" for stdin)
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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
docdocument containing the XML file content
cursorcursor pointing to the starting node
flagsoptional 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 ( STD_NAMESPACE ostream &  stream,
const size_t  flags = 0,
const char *  styleSheet = NULL 
)

render current SR document in HTML/XHTML format.

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

Parameters
streamoutput stream to which the HTML/XHTML document is written
flagsoptional flag used to customize the output (see DSRTypes::HF_xxx)
styleSheetoptional filename/URL of a Cascading Style Sheet (CSS)
Returns
status, EC_Normal if successful, an error code otherwise
void DSRDocument::renderHTMLPatientData ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
)
protected

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

Parameters
streamoutput stream to which the HTML/XHTML document is written
flagsflag used to customize the output (see DSRTypes::HF_xxx)
void DSRDocument::renderHTMLReferenceList ( STD_NAMESPACE ostream &  stream,
DSRSOPInstanceReferenceList refList,
const size_t  flags 
)
protected

render list of referenced SOP instances in HTML/XHTML format

Parameters
streamoutput stream to which the HTML/XHTML document is written
refListlist of referenced SOP instances to be rendered
flagsflag 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
valuecharacter 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. Not applicable to Key Object Selection Documents.

Parameters
valueexplanation 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
valuecharacter 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
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setDeviceSerialNumber ( const OFString value)

set device serial number.

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

Parameters
valuecharacter 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
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setManufacturer ( const OFString value)

set manufacturer.

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

Parameters
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setManufacturerModelName ( const OFString value)

set manufacturer's model name.

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

Parameters
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setPatientBirthDate ( const OFString value)

set patient's birth date.

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

Parameters
valuecharacter 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
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setPatientName ( const OFString value)

set patient's name.

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

Parameters
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setPatientSex ( const OFString value)

set patient's sex.

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

Parameters
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setPreliminaryFlag ( const E_PreliminaryFlag  flag)

set document preliminary flag.

According to the DICOM standard, the concept of "completeness" is independent of the concept of "preliminary" or "final". Therefore, this flag can be specified separately.

Parameters
flagpreliminary flag to be set (use PF_invalid to omit this optional value)
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setReferringPhysicianName ( const OFString value)

set referring physicians name.

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

Parameters
valuecharacter 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
valuecharacter 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
valuecharacter string specifying the value to be set
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocument::setSoftwareVersions ( const OFString value)

set software version(s).

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

Parameters
valuecharacter 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
valuecharacter 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
valuecharacter 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
valuecharacter 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
updateAllflag 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 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
observerNamename of the person who has verified this document (required, VR=PN)
organizationname 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
observerNamename of the person who has verified this document (required, VR=PN)
organizationname of the organization to which the observer belongs (required, VR=LO)
dateTimeverification 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
observerNamename of the person who has verified this document (required, VR=PN)
observerCodecode identifying the verifying observer (optional, see previous method)
organizationname 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 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
observerNamename of the person who has verified this document (required, VR=PN)
observerCodecode identifying the verifying observer (optional, see previous method)
organizationname of the organization to which the observer belongs (required, VR=LO)
dateTimeverification 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::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
datasetreference to DICOM dataset to which the current document should be written
markedItemsoptional 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 ( STD_NAMESPACE 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
streamoutput stream to which the XML document is written
flagsoptional flag used to customize the output (see DSRTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Member Data Documentation

DcmCodeString DSRDocument::Modality
private

Manufacturer's Model Name: (LO, 1, 1)

Device Serial Number: (LO, 1, 1) Software Version(s): (LO, 1-n, 1) Modality: (CS, 1, 1)

Definition at line 1205 of file dsrdoc.h.


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


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2