dcmqrscp/imagectn PatientName Case Sensitivity

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Genghis86
Posts: 10
Joined: Mon, 2005-08-29, 13:50
Location: Toronto, Canada
Contact:

dcmqrscp/imagectn PatientName Case Sensitivity

#1 Post by Genghis86 »

Is it possible to make a command-line switch to toggle case sensitivity for PatientName matching?

DICOM standard part 4 specifies that the matching is implementation specific.

Genghis86
Posts: 10
Joined: Mon, 2005-08-29, 13:50
Location: Toronto, Canada
Contact:

#2 Post by Genghis86 »

I made the following patch to libsrc/dbutils.cxx:

Code: Select all

int
DB_StringUnify  (char *pmod, char *pstr)
{
    int uni;


    if (*pmod == '\0')
    return (*pstr == '\0');

#ifdef STRICT_COMPARE
    if (  *pmod == *pstr
#else
	#define lcase(c) (((c) >= 'A' && (c) <= 'Z') ? ((c) + 'a' - 'A') : (c))
    if (  lcase(*pmod) == lcase(*pstr)
	#undef lcase
#endif
      || (*pmod == '?' && *pstr != '\0')
    )
    return (DB_StringUnify (pmod + 1, pstr + 1));

...
However, you need additional changes to dbutils.cxx::DB_MatchStrings() (change the call to strcmp).

Genghis86
Posts: 10
Joined: Mon, 2005-08-29, 13:50
Location: Toronto, Canada
Contact:

#3 Post by Genghis86 »

As well as in dbfind.cxx::DB_MatchStrings:

Code: Select all

...

    if ((strchr (modl, '*') == NULL) && (strchr (modl, '?') == NULL))
#ifdef STRICT_COMPARE
	return (strcmp (modl, string) == 0) ;
#else
	return (strcmpi (modl, string) == 0) ;
#endif

    match = DB_StringUnify (modl, string) ;

...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest