Class DicomDatabaseInformationModel
- Direct Known Subclasses:
MinimalPatientStudySeriesInstanceModel
,PatientStudySeriesConcatenationInstanceModel
,StudySeriesInstanceModel
The DicomDatabaseInformationModel
class
is an abstract class that specializes DatabaseInformationModel
by adding methods specific to a typical DICOM composite object information model.
These methods include support for naming the standard DICOM information entities, building insert statements using all the dictionary attributes for a partcular DICOM information entity, and generating local primary keys.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
Fields inherited from class com.pixelmed.database.DatabaseInformationModel
additionalIndexMapOfColumnsToTables, databaseConnection, databaseRootName, defaultDatabaseRootName, dictionary, externalServerInstance, FILE_COPIED, FILE_REFERENCED, listsOfAttributesByInformationEntity, localFileName, localFileReferenceTypeColumnName, localParentReferenceColumnName, localPrimaryKeyColumnName, localRecordInsertionTimeColumnName, personNameCanonicalColumnNamePrefix, personNameCanonicalColumnNameSuffix, personNamePhoneticCanonicalColumnNamePrefix, personNamePhoneticCanonicalColumnNameSuffix, rootInformationEntity, userColumnName1, userColumnName2, userColumnName3, userColumnName4
-
Constructor Summary
ConstructorsConstructorDescriptionDicomDatabaseInformationModel
(String databaseFileName, InformationEntity rootInformationEntity, DicomDictionary dictionary) DicomDatabaseInformationModel
(String databaseFileName, InformationEntity rootInformationEntity, DicomDictionary dictionary, String databaseRootName) DicomDatabaseInformationModel
(String databaseFileName, String databaseServerName, InformationEntity rootInformationEntity, DicomDictionary dictionary) DicomDatabaseInformationModel
(String databaseFileName, String databaseServerName, InformationEntity rootInformationEntity, DicomDictionary dictionary, String databaseRootName) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Create a new unique key which may be used to identify a new instance of an entity.protected void
Extend a SQL CREATE TABLE statement in the process of being constructed with any derived attributes (columns) that the model requires.protected void
extendInsertStatementStringWithAttributeNamesForSelectedInformationEntity
(StringBuffer b, AttributeList list, InformationEntity ie) Extend a SQL INSERT statement in the process of being constructed with the names of the attributes in the instance for the entity.protected void
extendInsertStatementStringWithAttributeValuesForSelectedInformationEntity
(StringBuffer b, AttributeList list, InformationEntity ie, String fileName, String fileReferenceType) Extend a SQL INSERT statement in the process of being constructed with the values of the attributes in the instance for the entity.protected void
extendInsertStatementStringWithDerivedAttributeNamesForSelectedInformationEntity
(StringBuffer b, AttributeList list, InformationEntity ie) Extend a SQL INSERT statement in the process of being constructed with the names of the derived attributes in the instance for the entity.protected void
extendInsertStatementStringWithDerivedAttributeValuesForSelectedInformationEntity
(StringBuffer b, AttributeList list, InformationEntity ie) Extend a SQL INSERT statement in the process of being constructed with the values of the derived attributes in the instance for the entity.protected void
extendInsertStatementStringWithPersonNameSearchColumnsForSelectedInformationEntity
(StringBuffer b, AttributeList list, InformationEntity ie) Extend a SQL INSERT statement in the process of being constructed with the names of the additional search columns derived from person name attributes in the instance for the entity.protected void
extendInsertStatementStringWithPersonNameSearchValuesForSelectedInformationEntity
(StringBuffer b, AttributeList list, InformationEntity ie) Extend a SQL INSERT statement in the process of being constructed with the values of the additional search columns derived from person name attributes in the instance for the entity.getDateFromDicomDateAndTime
(String dateTime) getDateFromDicomDateAndTime
(String date, String time, String timezone) getNametoDescribeThisInstanceOfInformationEntity
(InformationEntity ie, Map returnedAttributes) For a particular instance of an information entity, find a descriptive name for the entity suitable for rendering.Get a factory to manufacture a query response generator capable of performing a query and returning the results.getQueryResponseGeneratorFactory
(int debugLevel) Get a factory to manufacture a query response generator capable of performing a query and returning the results.static String
Make a quoted string value suitable for using in a SQL statement from a DICOM attribute.static String
getQuotedSingleStringValueOrNull
(Attribute a, boolean escapeSpecialCharacters) Make a quoted string value suitable for using in a SQL statement from a DICOM attribute.static String
Make a quoted string value suitable for using in a SQL statement from a DICOM attribute.static String
getQuotedValueOrNULL
(String value) Make a quoted string value suitable for using in a SQL statement from a (possibly null or empty) string.Get a factory to manufacture a retrieve response generator capable of performing a retrieve and returning the results.getRetrieveResponseGeneratorFactory
(int debugLevel) Get a factory to manufacture a retrieve response generator capable of performing a retrieve and returning the results.getTimestampFromDate
(Date javaDate) getTimestampFromDicomDateAndTime
(String sdatetime) getTimestampFromDicomDateAndTime
(String date, String time, String timezone) Methods inherited from class com.pixelmed.database.DatabaseInformationModel
appendExactOrIsNullMatch, close, createAdditionalIndexes, deleteRecord, doCommonConstructorStuff, extendCreateStatementStringWithAnyExtraAttributes, extendCreateStatementStringWithUserColumns, extendStatementStringWithMatchingAttributesForSelectedInformationEntity, finalize, findAllAttributeValuesForAllRecordsForThisInformationEntity, findAllAttributeValuesForAllRecordsForThisInformationEntityWithMatchingParent, findAllAttributeValuesForAllRecordsForThisInformationEntityWithSpecifiedKeyValue, findAllAttributeValuesForAllRecordsForThisInformationEntityWithSpecifiedParent, findAllAttributeValuesForAllRecordsForThisInformationEntityWithSpecifiedUID, findAllAttributeValuesForSelectedRecord, findSelectedAttributeValuesForSelectedRecord, getAttributeTagFromDatabaseColumnName, getChildTypeForParent, getChildTypeForParent, getChildTypeForParent, getDatabaseColumnNameFromDicomName, getDatabaseColumnNameFromDicomTag, getDescriptiveColumnName, getDicomNameFromDatabaseColumnName, getInformationEntityFromTag, getLocalFileNameColumnName, getLocalFileReferenceTypeColumnName, getLocalParentReferenceColumnName, getLocalPrimaryKeyColumnName, getLocalRecordInsertionTimeColumnName, getOtherDescriptiveColumnName, getOtherOtherDescriptiveColumnName, getSQLTypeFromDicomValueRepresentation, getTableNameForInformationEntity, getUIDColumnNameForInformationEntity, insertObject, isInformationEntityInModel, isInformationEntityInModel, toString, updateSelectedRecord
-
Field Details
-
derivedStudyDateTimeColumnName
- See Also:
-
derivedSeriesDateTimeColumnName
- See Also:
-
derivedContentDateTimeColumnName
- See Also:
-
derivedAcquisitionDateTimeColumnName
- See Also:
-
derivedLossyImageCompressionColumnName
- See Also:
-
-
Constructor Details
-
DicomDatabaseInformationModel
public DicomDatabaseInformationModel(String databaseFileName, InformationEntity rootInformationEntity, DicomDictionary dictionary) throws DicomException - Parameters:
databaseFileName
-rootInformationEntity
-dictionary
-- Throws:
DicomException
-
DicomDatabaseInformationModel
public DicomDatabaseInformationModel(String databaseFileName, InformationEntity rootInformationEntity, DicomDictionary dictionary, String databaseRootName) throws DicomException - Parameters:
databaseFileName
-rootInformationEntity
-dictionary
-databaseRootName
-- Throws:
DicomException
-
DicomDatabaseInformationModel
public DicomDatabaseInformationModel(String databaseFileName, String databaseServerName, InformationEntity rootInformationEntity, DicomDictionary dictionary) throws DicomException - Parameters:
databaseFileName
-rootInformationEntity
-dictionary
-- Throws:
DicomException
-
DicomDatabaseInformationModel
public DicomDatabaseInformationModel(String databaseFileName, String databaseServerName, InformationEntity rootInformationEntity, DicomDictionary dictionary, String databaseRootName) throws DicomException - Parameters:
databaseFileName
-rootInformationEntity
-dictionary
-databaseRootName
-- Throws:
DicomException
-
-
Method Details
-
getNametoDescribeThisInstanceOfInformationEntity
public String getNametoDescribeThisInstanceOfInformationEntity(InformationEntity ie, Map returnedAttributes) Description copied from class:DatabaseInformationModel
For a particular instance of an information entity, find a descriptive name for the entity suitable for rendering.
For a patient, this might be the name
Patient
. For an instance, this will depend on the SOPClassUID, and might be anImage
, aWaveform
, etc.- Specified by:
getNametoDescribeThisInstanceOfInformationEntity
in classDatabaseInformationModel
- Parameters:
ie
-returnedAttributes
-- Returns:
- a human-readable string name of the entity
-
extendInsertStatementStringWithPersonNameSearchColumnsForSelectedInformationEntity
protected void extendInsertStatementStringWithPersonNameSearchColumnsForSelectedInformationEntity(StringBuffer b, AttributeList list, InformationEntity ie) throws DicomException Extend a SQL INSERT statement in the process of being constructed with the names of the additional search columns derived from person name attributes in the instance for the entity.
Called when inserting a new record for an instance of the entity.
Specific to each concrete information model extending
DatabaseInformationModel
.- Specified by:
extendInsertStatementStringWithPersonNameSearchColumnsForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedlist
- the DICOM attributes of a composite object, containing the attributes describing this instance of the entityie
- theInformationEntity
for which a select statement is being constructed- Throws:
DicomException
- thrown if there are problems extracting the DICOM attributes
-
extendInsertStatementStringWithPersonNameSearchValuesForSelectedInformationEntity
protected void extendInsertStatementStringWithPersonNameSearchValuesForSelectedInformationEntity(StringBuffer b, AttributeList list, InformationEntity ie) throws DicomException Extend a SQL INSERT statement in the process of being constructed with the values of the additional search columns derived from person name attributes in the instance for the entity.
Called when inserting a new record for an instance of the entity.
Specific to each concrete information model extending
DatabaseInformationModel
.- Specified by:
extendInsertStatementStringWithPersonNameSearchValuesForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedlist
- the DICOM attributes of a composite object, containing the attributes describing this instance of the entityie
- theInformationEntity
for which a select statement is being constructed- Throws:
DicomException
- thrown if there are problems extracting the DICOM attributes
-
extendInsertStatementStringWithAttributeNamesForSelectedInformationEntity
protected void extendInsertStatementStringWithAttributeNamesForSelectedInformationEntity(StringBuffer b, AttributeList list, InformationEntity ie) throws DicomException Extend a SQL INSERT statement in the process of being constructed with the names of the attributes in the instance for the entity.
Called when inserting a new record for an instance of the entity.
The default implementation adds values for all attributes that are present in the database tables and present in the instance.
At the INSTANCE level, InstanceNumber is always added.
At the INSTANCE level, ImageOrientationPatient within PlaneOrientationSequence within SharedFunctionalGroupsSequence is always added, if present.
- Specified by:
extendInsertStatementStringWithAttributeNamesForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedlist
- the DICOM attributes of a composite object, containing the attributes describing this instance of the entityie
- theInformationEntity
for which an insert statement is being constructed- Throws:
DicomException
- thrown if there are problems extracting the DICOM attributes
-
extendInsertStatementStringWithAttributeValuesForSelectedInformationEntity
protected void extendInsertStatementStringWithAttributeValuesForSelectedInformationEntity(StringBuffer b, AttributeList list, InformationEntity ie, String fileName, String fileReferenceType) throws DicomException Extend a SQL INSERT statement in the process of being constructed with the values of the attributes in the instance for the entity.
Called when inserting a new record for an instance of the entity.
The default implementation adds values for all attributes that are present in the database tables and present in the instance.
At the INSTANCE level, InstanceNumber is always added.
At the INSTANCE level, ImageOrientationPatient within PlaneOrientationSequence within SharedFunctionalGroupsSequence is always added, if present.
- Specified by:
extendInsertStatementStringWithAttributeValuesForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedlist
- the DICOM attributes of a composite object, containing the attributes describing this instance of the entityie
- theInformationEntity
for which an insert statement is being constructedfileName
- the local filename, which may be non-null forINSTANCE
level insertionsfileReferenceType
- "C" for copied (i.e., delete on purge), "R" for referenced (i.e., do not delete on purge)- Throws:
DicomException
- thrown if there are problems extracting the DICOM attributes
-
extendInsertStatementStringWithDerivedAttributeNamesForSelectedInformationEntity
protected void extendInsertStatementStringWithDerivedAttributeNamesForSelectedInformationEntity(StringBuffer b, AttributeList list, InformationEntity ie) throws DicomException Extend a SQL INSERT statement in the process of being constructed with the names of the derived attributes in the instance for the entity.
Called when inserting a new record for an instance of the entity.
Specific to each concrete information model extending
DatabaseInformationModel
.- Specified by:
extendInsertStatementStringWithDerivedAttributeNamesForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedlist
- the DICOM attributes of a composite object, containing the attributes describing this instance of the entityie
- theInformationEntity
for which an insert statement is being constructed- Throws:
DicomException
- thrown if there are problems extracting the DICOM attributes
-
getTimestampFromDate
-
getDateFromDicomDateAndTime
-
getDateFromDicomDateAndTime
-
getTimestampFromDicomDateAndTime
-
getTimestampFromDicomDateAndTime
-
extendInsertStatementStringWithDerivedAttributeValuesForSelectedInformationEntity
protected void extendInsertStatementStringWithDerivedAttributeValuesForSelectedInformationEntity(StringBuffer b, AttributeList list, InformationEntity ie) throws DicomException Extend a SQL INSERT statement in the process of being constructed with the values of the derived attributes in the instance for the entity.
Called when inserting a new record for an instance of the entity.
Specific to each concrete information model extending
DatabaseInformationModel
.- Specified by:
extendInsertStatementStringWithDerivedAttributeValuesForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedlist
- the DICOM attributes of a composite object, containing the attributes describing this instance of the entityie
- theInformationEntity
for which an insert statement is being constructed- Throws:
DicomException
- thrown if there are problems extracting the DICOM attributes
-
extendCreateStatementStringWithDerivedAttributes
protected void extendCreateStatementStringWithDerivedAttributes(StringBuffer b, InformationEntity ie) Extend a SQL CREATE TABLE statement in the process of being constructed with any derived attributes (columns) that the model requires.
Called when creating the tables for a new database.
Specific to each concrete information model extending
DatabaseInformationModel
. Defaults to adding no extra columns if not overridden (i.e. it is not abstract).For example, there may be dates and times derived from DICOM attributes.
- Overrides:
extendCreateStatementStringWithDerivedAttributes
in classDatabaseInformationModel
- Parameters:
b
- the statement being constructedie
- theInformationEntity
for which a create table statement is being constructed
-
createPrimaryKeyForSelectedInformationEntity
Description copied from class:DatabaseInformationModel
Create a new unique key which may be used to identify a new instance of an entity.
Called when inserting a new record for an instance of the entity.
- Specified by:
createPrimaryKeyForSelectedInformationEntity
in classDatabaseInformationModel
- Parameters:
ie
-- Returns:
- string value of a unique key
-
getQuotedValueOrNULL
Make a quoted string value suitable for using in a SQL statement from a (possibly null or empty) string.
No attempt at escaping specially characters is made ... this is assumed already done.
Leading or trailing whitespace is trimmed.
- Parameters:
value
- the string, which may be null or zero length- Returns:
- the quoted string value of the attribute, or the (unquoted) string NULL if the value is null or zero length
-
getQuotedEscapedSingleStringValueOrNull
Make a quoted string value suitable for using in a SQL statement from a DICOM attribute.
Special characters should be escaped (actually they are just replaced with a hyphen).
Multiple values are collapsed and separated by the usual DICOM backslash delimiter character (which doesn't bother SQL).
- Parameters:
a
- the DICOM attribute, which may be null, zero length or multi-valued- Returns:
- the quoted string value of the attribute, or the (unquoted) string NULL if attribute is absent, has no value or is zero length
- Throws:
DicomException
-
getQuotedUnescapedSingleStringValueOrNull
Make a quoted string value suitable for using in a SQL statement from a DICOM attribute.
Does NOT escape special characters.
Multiple values are collapsed and separated by the usual DICOM backslash delimiter character (which doesn't bother SQL).
- Parameters:
a
- the DICOM attribute, which may be null, zero length or multi-valued- Returns:
- the quoted string value of the attribute, or the (unquoted) string NULL if attribute is absent, has no value or is zero length
- Throws:
DicomException
-
getQuotedSingleStringValueOrNull
public static String getQuotedSingleStringValueOrNull(Attribute a, boolean escapeSpecialCharacters) throws DicomException Make a quoted string value suitable for using in a SQL statement from a DICOM attribute.
Special characters may be escaped (actually they are just replaced with a hyphen).
Multiple values are collapsed and separated by the usual DICOM backslash delimiter character (which doesn't bother SQL).
Leading or trailing whitespace in each value is trimmed.
- Parameters:
a
- the DICOM attribute, which may be null, zero length or multi-valuedescapeSpecialCharacters
- whether or not to escape special characters (currently only single quote)- Returns:
- the quoted string value of the attribute, or the (unquoted) string NULL if attribute is absent, has no value or is zero length
- Throws:
DicomException
-
getQueryResponseGeneratorFactory
Get a factory to manufacture a query response generator capable of performing a query and returning the results.
- Overrides:
getQueryResponseGeneratorFactory
in classDatabaseInformationModel
- Returns:
- the response generator factory
-
getQueryResponseGeneratorFactory
Get a factory to manufacture a query response generator capable of performing a query and returning the results.
- Overrides:
getQueryResponseGeneratorFactory
in classDatabaseInformationModel
- Parameters:
debugLevel
- ignored- Returns:
- the response generator factory
-
getRetrieveResponseGeneratorFactory
Get a factory to manufacture a retrieve response generator capable of performing a retrieve and returning the results.
- Overrides:
getRetrieveResponseGeneratorFactory
in classDatabaseInformationModel
- Returns:
- the response generator factory
-
getRetrieveResponseGeneratorFactory
Get a factory to manufacture a retrieve response generator capable of performing a retrieve and returning the results.
- Overrides:
getRetrieveResponseGeneratorFactory
in classDatabaseInformationModel
- Parameters:
debugLevel
- ignored- Returns:
- the response generator factory
-