32 #include "dcmtk/config/osconfig.h" 33 #include "dcmtk/dcmqrdb/dcmqrdba.h" 35 #include "dcmtk/dcmnet/dicom.h" 36 #include "dcmtk/dcmnet/dimse.h" 37 #include "dcmtk/ofstd/offname.h" 46 #define DBINDEXFILE "index.dat" 52 #define LOCK_IMAGE_FILES 76 enum DVIFhierarchyStatus
83 DVIF_objectContainsNewSubobjects
87 #define DB_UpperMaxStudies 500 90 #define DB_UpperMaxBytesPerStudy 0x40000000L 111 const char *storageArea,
112 long maxStudiesPerStorageArea,
113 long maxBytesPerStudy,
139 const char *SOPClassUID,
140 const char *SOPInstanceUID,
141 char *newImageFileName);
155 const char *SOPClassUID,
156 const char *SOPInstanceUID,
157 const char *imageFileName,
159 OFBool isNew = OFTrue );
175 const char *SOPClassUID,
216 const char *SOPClassUID,
241 char *SOPInstanceUID,
243 unsigned short *numberOfRemainingSubOperations,
342 const char *SOPInstanceUID,
const char *StudyInstanceUID,
353 int matchStudyUIDInStudyDesc (
StudyDescRecord *pStudyDesc,
char *StudyUID,
int maxStudiesAllowed);
367 DB_LEVEL lowestLevel);
373 DB_LEVEL lowestLevel);
417 const char *callingAETitle,
418 const char *calledAETitle,
~DcmQueryRetrieveIndexDatabaseHandle()
Destructor.
OFCondition nextMoveResponse(char *SOPClassUID, char *SOPInstanceUID, char *imageFileName, unsigned short *numberOfRemainingSubOperations, DcmQueryRetrieveDatabaseStatus *status)
Constructs the information required for the next available C-MOVE sub-operation (the image SOP class ...
DcmQueryRetrieveIndexDatabaseHandle(const char *storageArea, long maxStudiesPerStorageArea, long maxBytesPerStudy, OFCondition &result)
Constructor.
OFCondition DB_unlock()
release lock on database
this struct defines the structure of each "Study Record" in the index.dat file maintained by this mod...
OFCondition startMoveRequest(const char *SOPClassUID, DcmDataset *moveRequestIdentifiers, DcmQueryRetrieveDatabaseStatus *status)
initiate MOVE operation using the given SOP class UID (which identifies the retrieve model) and DICOM...
OFCondition DB_GetStudyDesc(StudyDescRecord *pStudyDesc)
get study descriptor record from start of index file
const DcmQueryRetrieveConfig * config_
pointer to system configuration
OFCondition nextFindResponse(DcmDataset **findResponseIdentifiers, DcmQueryRetrieveDatabaseStatus *status)
return the next available FIND response as a new DICOM dataset.
OFCondition deleteImageFile(char *imgFile)
deletes the given file only if the quota mechanism is enabled.
const char * getStorageArea() const
return name of storage area
OFCondition instanceReviewed(int idx)
clear the "is new" flag for the instance with the given index
abstract base class for database handles.
OFCondition startFindRequest(const char *SOPClassUID, DcmDataset *findRequestIdentifiers, DcmQueryRetrieveDatabaseStatus *status)
initiate FIND operation using the given SOP class UID (which identifies the query model) and DICOM da...
Index database factory class.
OFFilenameCreator fnamecreator
helper object for file name creation
This class maintains database handles based on the classical "index.dat" file.
void enableQuotaSystem(OFBool enable)
enable/disable the DB quota system (default: enabled) which causes images to be deleted if certain bo...
OFCondition DB_lock(OFBool exclusive)
create lock on database
OFCondition DB_IdxInitLoop(int *idx)
seek to beginning of image records in index file
OFBool doCheckMoveIdentifier
flag indicating whether or not the check function for MOVE requests is enabled
this class provides a primitive interface for handling a list of flat DICOM elements, similar to DcmItem, but only for use within the database module
OFCondition cancelFindRequest(DcmQueryRetrieveDatabaseStatus *status)
cancel the ongoing FIND request, stop and reset every running operation associated with this request...
a class handling the DICOM dataset format (files without meta header)
OFCondition makeNewStoreFileName(const char *SOPClassUID, const char *SOPInstanceUID, char *newImageFileName)
create a filename under which a DICOM object that is currently being received through a C-STORE opera...
const char * getIndexFilename() const
return path to index file
this class provides a primitive interface for handling a flat DICOM element, similar to DcmElement...
this class manages an instance entry of the index file.
OFCondition DB_StudyDescChange(StudyDescRecord *pStudyDesc)
write study descriptor record to start of index file
DB_Private_Handle * handle_
database handle
OFCondition storeRequest(const char *SOPClassUID, const char *SOPInstanceUID, const char *imageFileName, DcmQueryRetrieveDatabaseStatus *status, OFBool isNew=OFTrue)
register the given DICOM object, which has been received through a C-STORE operation and stored in a ...
OFCondition DB_IdxRemove(int idx)
deactivate index record at given index by setting an empty filename
A class for automatically creating unique pseudo-random filenames.
this class describes configuration settings for a Query/Retrieve SCP Service
OFCondition DB_IdxGetNext(int *idx, IdxRecord *idxRec)
Get next Index record that is in use (i.e.
this class describes the result of a database operation (for an incoming C-FIND, C-MOVE, C-GET or C-STORE request) in a format that can directly be communicated to the remote SCU in a DIMSE RSP message.
OFCondition cancelMoveRequest(DcmQueryRetrieveDatabaseStatus *status)
cancel the ongoing MOVE request, stop and reset every running operation associated with this request...
OFCondition DB_IdxRead(int idx, IdxRecord *idxRec)
read index record at given index
static void printIndexFile(char *storeArea)
dump database index file to stdout.
OFBool quotaSystemEnabled
flag indicating whether or not the quota system is enabled
OFBool doCheckFindIdentifier
flag indicating whether or not the check function for FIND requests is enabled
OFCondition pruneInvalidRecords()
Prune invalid records from the database.
General purpose class for condition codes.
void setIdentifierChecking(OFBool checkFind, OFBool checkMove)
Configure the DB module to perform (or not perform) checking of FIND and MOVE request identifiers...