示例#1
0
        ///<summary>MUST be validated by IsValidEntry before coming here.  All user entered toothnumbers are run through this method which automatically checks to see if using international toothnumbers.  So the procedurelog class will always contain the american toothnum.</summary>
        public static string GetToothId(string tooth_label)
        {
            ToothNumberingNomenclature nomenclature = (ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers);

            if (nomenclature == ToothNumberingNomenclature.Universal)
            {
                return(tooth_label);
            }
            int index = 0;

            if (nomenclature == ToothNumberingNomenclature.FDI)
            {
                if (CultureInfo.CurrentCulture.Name.EndsWith("CA") && tooth_label == "99")
                {
                    return("51");                   //supernumerary tooth: It is documented in the cdha website that 99 is the only valid number for supernumerary teeth.
                }
                index = Array.IndexOf(labelsFDI, tooth_label);
            }
            else if (nomenclature == ToothNumberingNomenclature.Haderup)
            {
                index = Array.IndexOf(labelsHaderup, tooth_label);
            }
            else if (nomenclature == ToothNumberingNomenclature.Palmer)
            {
                index = Array.IndexOf(labelsPalmer, tooth_label);
            }
            return(labelsUniversal[index]);
        }
示例#2
0
        ///<summary>Identical to GetToothLabel, but just used in the 3D tooth chart because with Palmer, we don't want the UR, UL, etc.</summary>
        public static string GetToothLabelGraphic(string tooth_id, ToothNumberingNomenclature nomenclature)
        {
            if (tooth_id == null || tooth_id == "")
            {
                return("");                // CWI: We should fix the source of these
            }
            //int nomenclature = PrefC.GetInt(PrefName.UseInternationalToothNumbers);
            if (nomenclature == ToothNumberingNomenclature.Universal)
            {
                return(tooth_id);
            }
            int index = Array.IndexOf(labelsUniversal, tooth_id);

            if (index == -1)
            {
                return("-");
            }
            if (nomenclature == ToothNumberingNomenclature.FDI)
            {
                return(labelsFDI[index]);
            }
            else if (nomenclature == ToothNumberingNomenclature.Haderup)
            {
                return(labelsHaderup[index]);
            }
            else if (nomenclature == ToothNumberingNomenclature.Palmer)
            {
                return(labelsPalmerSimple[index]);
            }
            return("-");            // Should never happen
        }
示例#3
0
 ///<summary>For nomenclature, use pref UseInternationalToothNumbers, or a hard coded value.</summary>
 public static string GetSextant(string surf, ToothNumberingNomenclature nomenclature)
 {
     if (nomenclature == ToothNumberingNomenclature.Universal)
     {
         return(surf);
     }
     if (nomenclature == ToothNumberingNomenclature.FDI)
     {
         if (surf == "1")               //Upper Right
         {
             return("03");
         }
         else if (surf == "2")               //Upper Anterior
         {
             return("04");
         }
         else if (surf == "3")               //Upper Left
         {
             return("05");
         }
         else if (surf == "4")               //Lower Left
         {
             return("06");
         }
         else if (surf == "5")               //Lower Anterior
         {
             return("07");
         }
         else if (surf == "6")               //Lower Right
         {
             return("08");
         }
         return("00");               //Invalid or unspecified sextant.  This is also the number that represents "whole mouth" in Canada.
     }
     //All others, return the surface.
     //Note to reviewer: I don't know what the numbering scheme is for the other nomenclatures but it'd be easy enough to implement.
     return(surf);
 }
示例#4
0
        ///<summary>Sometimes validated by IsValidDB before coming here, otherwise an invalid toothnum .  This should be run on all displayed tooth numbers. It will handle checking for whether user is using international tooth numbers.  All tooth numbers are passed in american values until the very last moment.  Just before display, the string is converted using this method.</summary>
        public static string GetToothLabel(string tooth_id, ToothNumberingNomenclature nomenclature)
        {
            if (tooth_id == null || tooth_id == "")
            {
                return("");                // CWI: We should fix the source of these
            }
            //int nomenclature = PrefC.GetInt(PrefName.UseInternationalToothNumbers);
            if (nomenclature == ToothNumberingNomenclature.Universal)
            {
                return(tooth_id);
            }
            int index = Array.IndexOf(labelsUniversal, tooth_id);

            if (index == -1)
            {
                if (nomenclature == ToothNumberingNomenclature.FDI &&
                    CultureInfo.CurrentCulture.Name.EndsWith("CA") &&
                    tooth_id == "51")
                {
                    return("99");                   //supernumerary tooth: It is documented in the cdha website that 99 is the only valid number for supernumerary teeth.
                }
                return("-");
            }
            if (nomenclature == ToothNumberingNomenclature.FDI)
            {
                return(labelsFDI[index]);
            }
            else if (nomenclature == ToothNumberingNomenclature.Haderup)
            {
                return(labelsHaderup[index]);
            }
            else if (nomenclature == ToothNumberingNomenclature.Palmer)
            {
                return(labelsPalmer[index]);
            }
            return("-");            // Should never happen
        }
示例#5
0
文件: Tooth.cs 项目: nampn/ODental
        ///<summary>MUST be validated by IsValidEntry before coming here.  All user entered toothnumbers are run through this method which automatically checks to see if using international toothnumbers.  So the procedurelog class will always contain the american toothnum.</summary>
        public static string GetToothId(string tooth_label)
        {
            ToothNumberingNomenclature nomenclature = (ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers);

            if (nomenclature == ToothNumberingNomenclature.Universal)
            {
                return(tooth_label);
            }
            int index = 0;

            if (nomenclature == ToothNumberingNomenclature.FDI)
            {
                index = Array.IndexOf(labelsFDI, tooth_label);
            }
            else if (nomenclature == ToothNumberingNomenclature.Haderup)
            {
                index = Array.IndexOf(labelsHaderup, tooth_label);
            }
            else if (nomenclature == ToothNumberingNomenclature.Palmer)
            {
                index = Array.IndexOf(labelsPalmer, tooth_label);
            }
            return(labelsUniversal[index]);
        }
示例#6
0
        public static DataTable GetData(List <long> listProvNums, List <long> listClinicNums, DateTime dateStart, DateTime dateEnd, bool includeNoNotes,
                                        bool includeUnsignedNotes, ToothNumberingNomenclature toothNumberFormat, ProcNoteGroupBy groupBy)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetTable(MethodBase.GetCurrentMethod(), listProvNums, listClinicNums, dateStart, dateEnd, includeNoNotes, includeUnsignedNotes,
                                     toothNumberFormat, groupBy));
            }
            string whereNoNote       = "";
            string whereUnsignedNote = "";
            string whereNotesClause  = "";

            if (includeNoNotes)
            {
                whereNoNote = @"
					LEFT JOIN (
						SELECT procedurelog.PatNum,procedurelog.ProcDate
						FROM procedurelog
						INNER JOIN procnote ON procnote.ProcNum=procedurelog.ProcNum
						INNER JOIN procedurecode ON procedurecode.CodeNum=procedurelog.CodeNum
							AND procedurecode.ProcCode NOT IN ('D9986','D9987')
						WHERE procedurelog.ProcDate BETWEEN "                         + POut.Date(dateStart) + " AND " + POut.Date(dateEnd) + @"
						AND (procedurelog.ProcStatus="                         + POut.Int((int)ProcStat.C) + " OR (procedurelog.ProcStatus=" + POut.Int((int)ProcStat.EC)
                              + @" AND procedurecode.ProcCode='~GRP~'))"
                              + @" GROUP BY procedurelog.PatNum,procedurelog.ProcDate
					) hasNotes ON hasNotes.PatNum=procedurelog.PatNum AND hasNotes.ProcDate=procedurelog.ProcDate "                    ;
                whereNotesClause = "AND (n1.ProcNum IS NOT NULL OR hasNotes.PatNum IS NULL) ";
            }
            if (includeUnsignedNotes)
            {
                if (includeNoNotes)
                {
                    whereNotesClause = "AND (n1.ProcNum IS NOT NULL OR hasNotes.PatNum IS NULL OR unsignedNotes.ProcNum IS NOT NULL)";
                }
                else
                {
                    whereNotesClause = "AND (n1.ProcNum IS NOT NULL OR unsignedNotes.ProcNum IS NOT NULL)";
                }
                whereUnsignedNote = @"
					LEFT JOIN procnote unsignedNotes ON unsignedNotes.ProcNum=procedurelog.ProcNum
						AND unsignedNotes.Signature=''
						AND unsignedNotes.EntryDateTime= (SELECT MAX(n2.EntryDateTime) 
								FROM procnote n2 
								WHERE unsignedNotes.ProcNum = n2.ProcNum) "                                ;
            }
            string command = @"SELECT MAX(procedurelog.ProcDate) ProcDate,MAX(CONCAT(CONCAT(patient.LName, ', '),patient.FName)) PatName,procedurelog.PatNum,
				(CASE WHEN COUNT(procedurelog.ProcNum)=1 THEN MAX(procedurecode.ProcCode) ELSE '' END) ProcCode,
				(CASE WHEN COUNT(procedurelog.ProcNum)=1 THEN MAX(procedurecode.Descript) ELSE '"                 + Lans.g("FormRpProcNote", "Multiple procedures") + @"' END) Descript,
				(CASE WHEN COUNT(procedurelog.ProcNum)=1 THEN MAX(procedurelog.ToothNum) ELSE '' END) ToothNum,
				(CASE WHEN COUNT(procedurelog.ProcNum)=1 THEN MAX(procedurelog.Surf) ELSE '' END) Surf "
                             + (includeNoNotes || includeUnsignedNotes?",(CASE WHEN MAX(n1.ProcNum) IS NOT NULL THEN 'X' ELSE '' END) AS Incomplete ":"")
                             + (includeNoNotes?",(CASE WHEN MAX(hasNotes.PatNum) IS NULL THEN 'X' ELSE '' END) AS HasNoNote ":"")
                             + (includeUnsignedNotes?",(CASE WHEN MAX(unsignedNotes.ProcNum) IS NOT NULL THEN 'X' ELSE '' END) AS HasUnsignedNote ":"") + @" 
				FROM procedurelog
				INNER JOIN patient ON procedurelog.PatNum = patient.PatNum 
				INNER JOIN procedurecode ON procedurelog.CodeNum = procedurecode.CodeNum 
					AND procedurecode.ProcCode NOT IN ('D9986','D9987')
				"                 + (includeNoNotes || includeUnsignedNotes?"LEFT":"INNER") + @" JOIN procnote n1 ON procedurelog.ProcNum = n1.ProcNum 
					AND (n1.Note LIKE '%""""%' OR n1.Note REGEXP '"                     + @"\[Prompt:""[a-zA-Z_0-9 ]+""\]') "//looks for either "" (pre 17.3) or [Prompt:"{word}"] (post 17.3)
                             + @" AND n1.EntryDateTime= (SELECT MAX(n2.EntryDateTime) 
				FROM procnote n2 
				WHERE n1.ProcNum = n2.ProcNum) "
                             + whereNoNote + " "
                             + whereUnsignedNote + @"
				WHERE procedurelog.ProcDate BETWEEN "                 + POut.Date(dateStart) + " AND " + POut.Date(dateEnd) + @"
				AND (procedurelog.ProcStatus="                 + POut.Int((int)ProcStat.C)
                             + " OR (procedurelog.ProcStatus=" + POut.Int((int)ProcStat.EC) + " "
                             + @" AND procedurecode.ProcCode='~GRP~')) "
                             + whereNotesClause;

            if (listProvNums.Count > 0)
            {
                command += @"AND procedurelog.ProvNum IN (" + String.Join(",", listProvNums) + ") ";
            }
            if (listClinicNums.Count > 0)
            {
                command += @"AND procedurelog.ClinicNum IN (" + String.Join(",", listClinicNums) + ") ";
            }
            if (groupBy == ProcNoteGroupBy.Patient)
            {
                command += @"GROUP BY procedurelog.PatNum ";
            }
            else if (groupBy == ProcNoteGroupBy.DateAndPatient)
            {
                command += @"GROUP BY procedurelog.ProcDate,procedurelog.PatNum ";
            }
            else
            {
                command += "GROUP BY procedurelog.ProcNum ";
            }
            command += @"ORDER BY ProcDate, LName";
            DataTable table = ReportsComplex.RunFuncOnReportServer(() => Db.GetTable(command));

            foreach (DataRow row in table.Rows)
            {
                row["ToothNum"] = Tooth.ToInternat(row["ToothNum"].ToString(), toothNumberFormat);
            }
            return(table);
        }
		public void SetToothNumberingNomenclature(ToothNumberingNomenclature nomenclature) {
			tcData.ToothNumberingNomenclature=nomenclature;
			Invalidate();
		}
示例#8
0
 ///<summary>Sometimes validated by IsValidDB before coming here, otherwise an invalid toothnum.  This should be run on all displayed tooth
 ///numbers. It will handle checking for whether user is using international tooth numbers.  All tooth numbers are passed in american values until
 ///the very last moment.  Just before display, the string is converted using this method.</summary>
 public static string ToInternat(string toothNum, ToothNumberingNomenclature nomenclature)
 {
     return(GetToothLabel(toothNum, nomenclature));
 }
示例#9
0
        ///<summary>MUST be validated by IsValidEntry before coming here. All user entered toothnumbers are run through this method which
        ///automatically checks to see if using international toothnumbers. So the procedurelog class will always contain the american toothnum.</summary>
        public static string GetToothId(string tooth_label)
        {
            ToothNumberingNomenclature nomenclature = (ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers);

            return(GetToothId(tooth_label, nomenclature));
        }
示例#10
0
 public void SetToothNumberingNomenclature(ToothNumberingNomenclature nomenclature)
 {
     tcData.ToothNumberingNomenclature = nomenclature;
     Invalidate();
 }
示例#11
0
		///<summary>Identical to GetToothLabel, but just used in the 3D tooth chart because with Palmer, we don't want the UR, UL, etc.</summary>
		public static string GetToothLabelGraphic(string tooth_id,ToothNumberingNomenclature nomenclature){
			if(tooth_id==null || tooth_id==""){
				return ""; // CWI: We should fix the source of these
			}
			//int nomenclature = PrefC.GetInt(PrefName.UseInternationalToothNumbers);
			if(nomenclature==ToothNumberingNomenclature.Universal) {
				return tooth_id;
			}
			int index = Array.IndexOf(labelsUniversal, tooth_id);
			if(index==-1){
				return "-";
			}
			if(nomenclature == ToothNumberingNomenclature.FDI) {
				return labelsFDI[index];
			}
			else if(nomenclature == ToothNumberingNomenclature.Haderup) { 
				return labelsHaderup[index];
			}
			else if(nomenclature == ToothNumberingNomenclature.Palmer) {
				return labelsPalmerSimple[index];
			}
			return "-"; // Should never happen
		}
示例#12
0
文件: Tooth.cs 项目: mnisl/OD
		///<summary>Sometimes validated by IsValidDB before coming here, otherwise an invalid toothnum .  This should be run on all displayed tooth numbers. It will handle checking for whether user is using international tooth numbers.  All tooth numbers are passed in american values until the very last moment.  Just before display, the string is converted using this method.</summary>
		public static string GetToothLabel(string tooth_id,ToothNumberingNomenclature nomenclature) {
			if(tooth_id==null || tooth_id==""){
				return ""; // CWI: We should fix the source of these
			}
			//int nomenclature = PrefC.GetInt(PrefName.UseInternationalToothNumbers);
			if(nomenclature == ToothNumberingNomenclature.Universal) {
				return tooth_id; 
			}
			int index = Array.IndexOf(labelsUniversal, tooth_id);
			if(index==-1){
				if(nomenclature == ToothNumberingNomenclature.FDI
					&& CultureInfo.CurrentCulture.Name.EndsWith("CA")
					&& tooth_id=="51")
				{
					return "99";//supernumerary tooth: It is documented in the cdha website that 99 is the only valid number for supernumerary teeth.
				}
				return "-";
			}
			if(nomenclature == ToothNumberingNomenclature.FDI) {
				return labelsFDI[index];
			}
			else if(nomenclature == ToothNumberingNomenclature.Haderup) { 
				return labelsHaderup[index];
			}
			else if(nomenclature == ToothNumberingNomenclature.Palmer) { 
				return labelsPalmer[index];
			}
			return "-"; // Should never happen
		}