CreateAppointment and EditAppointment now call stripC30C31 to remove ascii 30 and ascii 31 from the note. Windows Input allows users to enter either of these from the Unicode menu, causing the program to crash when it tries to parse the note as the 30 and 31 are used as the delimiters for the data coming from Mumps.
Fixes bug EHS#0000282.
This commit is contained in:
parent
944999a279
commit
d821206743
|
@ -960,7 +960,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
TimeSpan sp = rApptInfo.EndTime - rApptInfo.StartTime;
|
||||
string sLen = sp.TotalMinutes.ToString();
|
||||
string sPatID = rApptInfo.PatientID.ToString();
|
||||
string sNote = rApptInfo.Note;
|
||||
string sNote = stripC30C31(rApptInfo.Note);
|
||||
string sResource = rApptInfo.Resource;
|
||||
|
||||
string sApptID;
|
||||
|
@ -1003,12 +1003,32 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
return nApptID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces ascii 30 and 31 as they are used as delimiters. Funny users can crash the program.
|
||||
/// </summary>
|
||||
/// <param name="s">Input String</param>
|
||||
/// <returns>Output Stripped String</returns>
|
||||
public string stripC30C31(string s)
|
||||
{
|
||||
if (s != null && s.Length > 0)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder(s.Length);
|
||||
foreach (char c in s)
|
||||
{
|
||||
sb.Append(((c==30)||(c==31)) ? ' ' : c);
|
||||
}
|
||||
s = sb.ToString();
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
public void EditAppointment(CGAppointment pAppt, string sNote)
|
||||
{
|
||||
try
|
||||
{
|
||||
int nApptID = pAppt.AppointmentKey;
|
||||
string sSql = "BSDX EDIT APPOINTMENT^" + nApptID.ToString() + "^" + sNote;
|
||||
string sSql = "BSDX EDIT APPOINTMENT^" + nApptID.ToString() + "^" + stripC30C31(sNote);
|
||||
|
||||
System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "EditAppointment");
|
||||
|
||||
|
|
Loading…
Reference in New Issue