Author: Pablo Sau <psau@cadpet.es> 
LastChanged: Wed, 28 May 2008 19:38:32 +0200
Description: make the ctn working properly with the mysql server > 4.2.

--- a/cfg_scripts/mysql/CreateDIMTables.script
+++ b/cfg_scripts/mysql/CreateDIMTables.script
@@ -49,7 +49,7 @@ ALTER TABLE StudyLevel ADD INDEX SL_PatP
 \g
 CREATE TABLE SeriesLevel
 	(
-	Mod		char(16)	not null,
+	Modality	char(16)	not null,
 	SerNum		char(12)	not null,
 	SerInsUID	char(64)	not null,
 	ProNam		char(64),
--- a/cfg_scripts/mysql/CreateFISTables.script
+++ b/cfg_scripts/mysql/CreateFISTables.script
@@ -62,7 +62,7 @@ ALTER TABLE InterpretationTable ADD UNIQ
 CREATE TABLE StudyCmpTable (
 	StuComUID	char(64) 	not null,
 	StuInsUID	char(64)	not null,
-	Mod		char(16)	not null,
+	Modality	char(16)	not null,
 	ProCodVal	char(16),
 	ProCodSchDes	char(16),
 	ProCodMea	char(64),
--- a/cfg_scripts/mysql/FillDIMTables.script
+++ b/cfg_scripts/mysql/FillDIMTables.script
@@ -140,7 +140,7 @@ INSERT INTO StudyLevel(
 	'P0001')
 \g
 INSERT INTO SeriesLevel(
-	Mod,
+	Modality,
 	SerNum,
 	SerInsUID,
 	ProNam,
@@ -169,7 +169,7 @@ INSERT INTO SeriesLevel(
 	'STUDY1.1')
 \g
 INSERT INTO SeriesLevel(
-	Mod,
+	Modality,
 	SerNum,
 	SerInsUID,
 	ProNam,
@@ -198,7 +198,7 @@ INSERT INTO SeriesLevel(
 	'STUDY1.2')
 \g
 INSERT INTO SeriesLevel(
-	Mod,
+	Modality,
 	SerNum,
 	SerInsUID,
 	ProNam,
--- a/facilities/idb/idb.c
+++ b/facilities/idb/idb.c
@@ -319,7 +319,7 @@ static TBL_FIELD
 static TBL_FIELD
     GS_SERSEL_Field[] =
 {
-    "Mod", TBL_STRING, DICOM_CS_LENGTH + 1, DICOM_CS_LENGTH + 1, 0, GS_SERSEL_Mod,
+    "Modality", TBL_STRING, DICOM_CS_LENGTH + 1, DICOM_CS_LENGTH + 1, 0, GS_SERSEL_Mod,
     "SerNum", TBL_STRING, DICOM_IS_LENGTH + 1, DICOM_IS_LENGTH + 1, 0, GS_SERSEL_SerNum,
     "SerInsUID", TBL_STRING, DICOM_UI_LENGTH + 1, DICOM_UI_LENGTH + 1, 0, GS_SERSEL_SerInsUID,
     "ProNam", TBL_STRING, DICOM_LO_LENGTH + 1, DICOM_LO_LENGTH + 1, 0, GS_SERSEL_ProNam,
@@ -3541,7 +3541,7 @@ CBSel_CollectSeries(TBL_FIELD * fp, int
     i = GS_NumSerNodes - 1;
     GS_NullSerFlag[i] = 0;
     while (fp->FieldName != 0) {
-	if (strcmp(fp->FieldName, "Mod") == 0) {
+	if (strcmp(fp->FieldName, "Modality") == 0) {
 	    if (fp->Value.IsNull)
 		GS_NullSerFlag[i] |= QF_SER_Mod;
 	    else
@@ -4682,7 +4682,7 @@ IDB_ConvertDicomQuerytoSQL(IDB_Query * p
 		    return (0);
 		}
 		op = likeOrEqualOperator(pssi->series.Mod);
-		TBL_CRITERIA_LOAD_BYTE(GS_sercl[i], "Mod", cs, TBL_STRING, op);
+		TBL_CRITERIA_LOAD_BYTE(GS_sercl[i], "Modality", cs, TBL_STRING, op);
 		i++;
 	    }
 	}
@@ -5433,7 +5433,7 @@ IDB_InsertImage(IDB_HANDLE ** handle, ID
     } else {			/* Need Series Insertion */
 
 	i = 0;
-	TBL_FIELD_LOAD_BYTE(serfld[i], "Mod", pssi->series.Mod, TBL_STRING);
+	TBL_FIELD_LOAD_BYTE(serfld[i], "Modality", pssi->series.Mod, TBL_STRING);
 	i++;
 	TBL_FIELD_LOAD_BYTE(serfld[i], "SerNum", pssi->series.SerNum, TBL_STRING);
 	i++;
