I am trying to replace index file code with SQL code in the dcmqrdb module and now I'm stuck in the part where I have to parse Dicom queries into SQL. I'm using movescu and findscu along with the Dicom Standard to understand the specifications of the query. The problem is that the Dicom Standard and even movescu documentation specifies that the C-MOVE query should contain at least one of the four Unique Keys of the Query/Retrieve Level, but when I use movescu on a running dcmqrscp I can successfully retrieve images using a simple query as the following :
Code: Select all
movescu localhost 22222 -d +P 33333 -P -k QueryRetrieveLevel=PATIENT -k PatientName=ANON*
Code: Select all
OFCondition DcmQueryRetrieveIndexDatabaseHandle::hierarchicalCompare (
DB_Private_Handle *phandle,
IdxRecord *idxRec,
DB_LEVEL level,
DB_LEVEL infLevel,
int *match,
CharsetConsideringMatcher& dbmatch)
{
int i ;
DcmTagKey XTag ;
DB_ElementList *plist ;
DB_LEVEL XTagLevel = PATIENT_LEVEL; // DB_GetTagLevel() will set this correctly
/**** If current level is above the QueryLevel
***/
if (level < phandle->queryLevel) {
/** Get UID Tag for current level
*/
DB_GetUIDTag (level, &XTag) ;
/** Find Element with this XTag in Identifier list
*/
for (plist = phandle->findRequestList ; plist ; plist = plist->next)
if (plist->elem. XTag == XTag)
break ;
/** Element not found
*/
if (plist == NULL) {
*match = OFFalse ;
DCMQRDB_WARN("hierarchicalCompare : No UID Key found at level " << (int) level);
return QR_EC_IndexDatabaseError ;
}
...