public class MCstructuredReport extends java.lang.Object implements MCdataSetSerializable
This class represents the SR Document using tree data structure which faciliates the tree based traversal
searching and manipulation. It can be serialized to a MCattributeSet
representation
using the write(com.merge.mcw.MCattributeSet)
method or is acquired from that representation using
the write(com.merge.mcw.MCattributeSet)
method.
Constructor and Description |
---|
MCstructuredReport()
Default constructor.
|
MCstructuredReport(java.lang.String templateId,
MCcontainerItem.Continuity continuityOfContent,
MCbasicCodedEntry documentTitle)
Creates a new instance of the structured report and initializes the root CONTAINER item.
|
Modifier and Type | Method and Description |
---|---|
MCcontentItem |
findContentItem(MCitemIdentifer itemId)
Returns the content item specified by item ID.
|
MCcontainerItem |
getRootItem()
Gets the root CONTAINER content item.
|
void |
read(MCattributeSet source)
Transforms a SR document from a
MCattributeSet representation to a tree data structure. |
void |
setRootItem(MCcontainerItem rootItem)
Sets the root CONTAINER content item.
|
void |
updateItemFactory(MCcontentItemType itemType,
java.lang.Class<? extends MCcontentItem> classType)
Updates the Content Item Class Factory with new extended classes.
|
void |
write(MCattributeSet destination)
Transforms a SR document from a tree data structure to a
MCattributeSet representation. |
public MCstructuredReport()
public MCstructuredReport(java.lang.String templateId, MCcontainerItem.Continuity continuityOfContent, MCbasicCodedEntry documentTitle)
templateId
- The DICOM Template identifier (0040,DB00) which is a string of digits,
without leading zeroes, and does not include the string "TID".continuityOfContent
- Specifies whether or not all the Content Items contained in a
CONTAINER are logically linked in a continuous textual flow, or are separate entities.documentTitle
- Document title.public MCcontainerItem getRootItem()
public void setRootItem(MCcontainerItem rootItem)
rootItem
- Root CONTAINER content item.public void updateItemFactory(MCcontentItemType itemType, java.lang.Class<? extends MCcontentItem> classType)
A structured report can be acquired from an attribute set by invoking
the read(com.merge.mcw.MCattributeSet)
method. During the reading, the classes instances are
created automatically according to the factory map which provides the correspondence between each value
type and the content item class. By default it always creates known classes as follows:
Content Item Type | Default Mapped Class |
---|---|
MCcontentItemType.TEXT | MCtextItem |
MCcontentItemType.NUM | MCnumItem |
MCcontentItemType.CODE | MCcodeItem |
MCcontentItemType.DATE | MCdateItem |
MCcontentItemType.TIME | MCtimeItem |
MCcontentItemType.DATETIME | MCdateTimeItem |
MCcontentItemType.UIDREF | MCuidReferenceItem |
MCcontentItemType.PNAME | MCpersonNameItem |
MCcontentItemType.COMPOSITE | MCcompositeItem |
MCcontentItemType.IMAGE | MCimageItem |
MCcontentItemType.WAVEFORM | MCwaveformItem |
MCcontentItemType.SCOORD | MCspatialCoordinatesItem |
MCcontentItemType.SCOORD3D | MCspatialCoordinates3DItem |
MCcontentItemType.TCOORD_DATE | MCtemporalCoordDateTimeItem |
MCcontentItemType.TCOORD_TIME | MCtemporalCoordTimeOffsetsItem |
MCcontentItemType.TCOORD_POSITION | MCtemporalCoordPositionsItem |
MCcontentItemType.CONTAINER | MCcontainerItem |
MCcontentItemType.TABLE | MCtableItem |
Factory map is local to the MCstructuredReport class instance and can be updated through this method. To make sure
the default classes resuable, the new class type is defined to be the subclass of the default class type as shown in the table
above. One special case is that there is no default specific class type for
MCcontentItemType.UNKNOWN
value type. By default MCexception
will
be thrown if it encounters any value type that is not defined by DICOM durint the reading. However, the class type for the unkown
value type can be specified here by the user to tolerate such kinds of illegal data instead of throwing an exception.
Any type that is derived from MCcontentItem
is acceptable for
MCcontentItemType.UNKNOWN
value type.
itemType
- Content Item type to be updated.classType
- New class type to be used for that content. It shall be derived from the default class for that type.MCexception
- If the new class type is null or isn't derived from the default class type.public MCcontentItem findContentItem(MCitemIdentifer itemId)
itemId
- Identifier of the conent item.public void read(MCattributeSet source)
MCattributeSet
representation to a tree data structure.
Note: This method removes all SR content items in this object and reads new ones from the source attribute set.
read
in interface MCdataSetSerializable
source
- Source attribute set.MCexception
- If the source attribute set doesn't have a root container;
contains unknown content items or factory map contains mapped class type that can't be instantiated
successfully.public void write(MCattributeSet destination)
MCattributeSet
representation.
Note: This method removes all SR content items from the destination attribute set and writes new ones.
write
in interface MCdataSetSerializable
destination
- Destination attribute set.MCexception
- If the root item is not initialized.