1. Fix bug of not showing appointments in 7 day view if arabic locale on machine.

2. Fix printing of routing slip (add clinic and fix appointment time and HRN)
3. Add RTL support for letters printed in Arabic Locale.
This commit is contained in:
sam 2010-08-10 12:00:01 +00:00
parent 9edf1ba75a
commit 5c6797e0e5
5 changed files with 54 additions and 30 deletions

View File

@ -41,6 +41,8 @@
public override string ToString() public override string ToString()
{ {
//StringFormat sf = new StringFormat();
//sf.SetDigitSubstitution(System.Threading.Thread.CurrentThread.CurrentCulture.LCID, StringDigitSubstitute.National);
string patientName = ""; string patientName = "";
if (this.m_bAccessBlock) if (this.m_bAccessBlock)
{ {

View File

@ -658,39 +658,42 @@
DateTime startTime = a.StartTime; DateTime startTime = a.StartTime;
DateTime endTime = a.EndTime; DateTime endTime = a.EndTime;
string resource = a.Resource; string resource = a.Resource;
int num = 0; int originX = 0;
int num2 = 0; int originY = 0;
int num3 = 0; int recHeight = 0;
int num4 = 0; int recWidth = 0;
int num5 = 0; int columnToPutAppt = 0;
Rectangle rectangle = new Rectangle(); Rectangle rectangle = new Rectangle();
int totalMinutes = (int) startTime.TimeOfDay.TotalMinutes; int startTotalMinutesoffset = (int) startTime.TimeOfDay.TotalMinutes;
int num7 = (int) endTime.TimeOfDay.TotalMinutes; int endTotalMinutesoffset = (int) endTime.TimeOfDay.TotalMinutes;
// if grid has more than one reource
if (this.m_sResourcesArray.Count > 1) if (this.m_sResourcesArray.Count > 1)
{ {
num5 = (int) this.m_ColumnInfoTable[resource]; // get zero based index
num5++; columnToPutAppt = (int) this.m_ColumnInfoTable[resource];
// increment to 1 based index
columnToPutAppt++;
} }
else else
{ {
num5 = ((int) (startTime.DayOfWeek - this.m_dtStart.DayOfWeek)) + 1; columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
} }
if (num5 < 1) if (columnToPutAppt < 1)
{ {
bRet = false; bRet = false;
return rectangle; return rectangle;
} }
num = col0Width + (cellWidth * (num5 - 1)); originX = col0Width + (cellWidth * (columnToPutAppt - 1));
int num8 = totalMinutes + this.m_nTimeScale; int num8 = startTotalMinutesoffset + this.m_nTimeScale;
int num9 = (num7 > 0) ? num7 : 0x5a0; int num9 = (endTotalMinutesoffset > 0) ? endTotalMinutesoffset : 0x5a0;
num9 -= totalMinutes; num9 -= startTotalMinutesoffset;
num2 = (cellHeight * num8) / this.m_nTimeScale; originY = (cellHeight * num8) / this.m_nTimeScale;
num3 = (cellHeight * num9) / this.m_nTimeScale; recHeight = (cellHeight * num9) / this.m_nTimeScale;
num4 = cellWidth; recWidth = cellWidth;
rectangle.X = num; rectangle.X = originX;
rectangle.Y = num2; rectangle.Y = originY;
rectangle.Width = num4; rectangle.Width = recWidth;
rectangle.Height = num3; rectangle.Height = recHeight;
bRet = true; bRet = true;
return rectangle; return rectangle;
} }

View File

@ -35,7 +35,7 @@
<RemoteDebugMachine> <RemoteDebugMachine>
</RemoteDebugMachine> </RemoteDebugMachine>
<StartAction>Project</StartAction> <StartAction>Project</StartAction>
<StartArguments>/s=172.16.17.51 /p=9240 /a=shabiel12 /v=catdog.44 /e=windows-1256</StartArguments> <StartArguments>/s=10.161.20.25 /p=9235 /a=shabiel12 /v=abc,123! /e=windows-1256</StartArguments>
<StartPage> <StartPage>
</StartPage> </StartPage>
<StartProgram>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe</StartProgram> <StartProgram>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe</StartProgram>
@ -54,7 +54,7 @@
<RemoteDebugMachine> <RemoteDebugMachine>
</RemoteDebugMachine> </RemoteDebugMachine>
<StartAction>Project</StartAction> <StartAction>Project</StartAction>
<StartArguments>/s=172.16.17.51 /p=9240 /a=shabiel12 /v=catdog.44 /e=windows-1256</StartArguments> <StartArguments>/s=10.161.20.25 /p=9235 /a=shabiel12 /v=abc,123! /e=windows-1256</StartArguments>
<StartPage> <StartPage>
</StartPage> </StartPage>
<StartProgram> <StartProgram>

View File

@ -85,7 +85,7 @@ namespace IndianHealthService.ClinicalScheduling
dsPatientApptDisplay2.PatientApptsRow a = (dsPatientApptDisplay2.PatientApptsRow)appts[apptPrinting]; dsPatientApptDisplay2.PatientApptsRow a = (dsPatientApptDisplay2.PatientApptsRow)appts[apptPrinting];
StringBuilder apptPrintStr = new StringBuilder(200); StringBuilder apptPrintStr = new StringBuilder(200);
apptPrintStr.AppendLine(a.ApptDate.ToString() + "\t" + a.Name + "(" + a.Sex + ")" + "\t" + "DOB: " + a.DOB.ToString("dd-MMM-yyyy") + "\t" + "ID: " + a.HRN); apptPrintStr.AppendLine(a.ApptDate.ToString() + "\t" + a.Name + " (" + a.Sex + ")" + "\t" + "DOB: " + a.DOB.ToShortDateString() + "\t" + "ID: " + a.HRN);
apptPrintStr.AppendLine("P: " + a.HOMEPHONE + "\t" + "Address: " + a.STREET + ", " + a.CITY + ", " + a.STATE + " " + a.ZIP); apptPrintStr.AppendLine("P: " + a.HOMEPHONE + "\t" + "Address: " + a.STREET + ", " + a.CITY + ", " + a.STATE + " " + a.ZIP);
apptPrintStr.AppendLine("Note: " + a.NOTE); apptPrintStr.AppendLine("Note: " + a.NOTE);
apptPrintStr.AppendLine("Appointment made by " + a.APPT_MADE_BY + " on " + a.DATE_APPT_MADE); apptPrintStr.AppendLine("Appointment made by " + a.APPT_MADE_BY + " on " + a.DATE_APPT_MADE);
@ -157,8 +157,13 @@ namespace IndianHealthService.ClinicalScheduling
printArea.Y += strHeight; printArea.Y += strHeight;
printArea.Height -= strHeight; printArea.Height -= strHeight;
//Text Direction
StringFormat sf2 = new StringFormat();
if (System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
sf2.FormatFlags = StringFormatFlags.DirectionRightToLeft;
// write missive // write missive
g.DrawString(letter, fBody, Brushes.Black, printArea); g.DrawString(letter, fBody, Brushes.Black, printArea, sf2);
//print Address in lower left corner for windowed envolopes //print Address in lower left corner for windowed envolopes
printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66)); printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
@ -208,8 +213,13 @@ namespace IndianHealthService.ClinicalScheduling
printArea.Y += strHeight; printArea.Y += strHeight;
printArea.Height -= strHeight; printArea.Height -= strHeight;
//Text Direction
StringFormat sf2 = new StringFormat();
if (System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
sf2.FormatFlags = StringFormatFlags.DirectionRightToLeft;
// write missive // write missive
g.DrawString(letter, fBody, Brushes.Black, printArea); g.DrawString(letter, fBody, Brushes.Black, printArea, sf2);
//print Address in lower left corner for windowed envolopes //print Address in lower left corner for windowed envolopes
printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66)); printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
@ -260,8 +270,13 @@ namespace IndianHealthService.ClinicalScheduling
printArea.Y += strHeight; printArea.Y += strHeight;
printArea.Height -= strHeight; printArea.Height -= strHeight;
//Text Direction
StringFormat sf2 = new StringFormat();
if (System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
sf2.FormatFlags = StringFormatFlags.DirectionRightToLeft;
// write missive // write missive
g.DrawString(letter, fBody, Brushes.Black, printArea); g.DrawString(letter, fBody, Brushes.Black, printArea, sf2);
//print Address in lower left corner for windowed envolopes //print Address in lower left corner for windowed envolopes
printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66)); printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
@ -312,13 +327,17 @@ namespace IndianHealthService.ClinicalScheduling
// draw underline // draw underline
g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
// move down
printArea.Y += 15; printArea.Y += 15;
printArea.Height -= 15; printArea.Height -= 15;
//construct what to print //construct what to print
string toprint = "Patient: " + a.PatientName + "\t" + "ID: " + a.PatientID; string toprint = "Patient: " + a.PatientName + "\t" + "ID: " + a.HealthRecordNumber;
toprint += "\n\n"; toprint += "\n\n";
toprint += "Appointment Time: " + a.StartTime.ToLongDateString() + " " + a.StartTime.ToLongTimeString(); toprint += "Clinic: " + a.Resource;
toprint += "\n\n";
toprint += "Appointment Time: " + a.StartTime;
toprint += "\n\n"; toprint += "\n\n";
toprint += "Notes:\n" + a.Note; toprint += "Notes:\n" + a.Note;