Changeset 1174 for Scheduling/trunk


Ignore:
Timestamp:
May 8, 2011, 5:17:53 AM (13 years ago)
Author:
Sam Habiel
Message:

Absorbed all changed from Radiology Support branch.
Patient and Provider classes now serializable to address new bug: Availablity slots cannot be saved b/c these classes are not serializable.

Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
18 edited
4 copied

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode

    • Property svn:mergeinfo set to (toggle deleted branches)
      /Scheduling/branches/Radiology-Support/cs/bsdx0200GUISourceCode1134-1171
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/AssemblyInfo.cs

    r1050 r1174  
    2828// by using the '*' as shown below:
    2929
    30 [assembly: AssemblyVersion("1.5.0.*")]
     30[assembly: AssemblyVersion("1.5.1.*")]
    3131
    3232//
     
    5858[assembly: AssemblyKeyFile("")]
    5959[assembly: AssemblyKeyName("")]
    60 [assembly: AssemblyFileVersionAttribute("1.5.0.0")]
     60[assembly: AssemblyFileVersionAttribute("1.5.1.0")]
    6161[assembly: ComVisibleAttribute(false)]
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAppointment.cs

    r1111 r1174  
    44    using System.Drawing;
    55    /// <summary>
    6     /// Data Structuer to Represent an Appointment
    7     ///
     6    /// Data Structure to Represent an Appointment
    87    /// </summary>
    98    [Serializable]
    109    public class CGAppointment
    1110    {
    12         private bool m_bAccessBlock;
    13         private bool m_bNoShow;
    14         private bool m_bSelected = false;
    15         private bool m_bWalkIn;
    16         public DateTime m_dAuxTime;
    17         public DateTime m_dCheckIn;
    18         private DateTime m_EndTime;
    19         public int m_nAccessTypeID = -1;
    20         private int m_nColumn;
    21         public int m_nKey;
    22         private string m_Note;
    23         public int m_nPatientID;
    24         public int m_nSlots;
    25         private Rectangle m_rectangle;
    26         public string m_sAccessTypeName;
    27         private string m_sHRN = "";
    28         private string m_sPatientName;
    29         public string m_sResource;
    30         private DateTime m_StartTime;
    31         private string m_Text;
     11        public int AccessTypeID { get; set; }
     12        public string AccessTypeName { get; set; }
     13
     14        public int AppointmentKey { get; set; }
     15
     16        public DateTime AuxTime { get; set; }
     17        public DateTime CheckInTime { get; set; }
     18        public DateTime EndTime { get; set; }
     19        public DateTime StartTime { get; set; }
     20
     21        public int GridColumn { get; set; }
     22        public Rectangle GridRectangle { get; set; }
     23       
     24        public bool IsAccessBlock { get; set; }
     25
     26        public bool NoShow { get; set; }
     27
     28        public string Note { get; set; }
     29
     30        public int PatientID { get; set; }
     31        public string PatientName { get; set; }
     32        public string Resource { get; set; }
     33        public string HealthRecordNumber { get; set; }
     34       
     35        public bool Selected { get; set; }
     36
     37        public int Slots { get; set; }
     38
     39        public bool WalkIn { get; set; }
     40
     41        public Patient Patient { get; set; }
     42        public Provider Provider { get; set; }
     43
     44        public int? RadiologyExamIEN { get; set; }
     45
     46
     47        public CGAppointment()
     48        {
     49            AccessTypeID = -1;
     50            Selected = false;
     51            HealthRecordNumber = "";
     52            }
    3253
    3354        public void CreateAppointment(DateTime StartTime, DateTime EndTime, string Note, int Key, string sResource)
    3455        {
    35             this.m_StartTime = StartTime;
    36             this.m_EndTime = EndTime;
    37             this.m_Note = Note;
    38             this.m_nKey = Key;
    39             this.m_sResource = sResource;
    40         }
     56            this.StartTime = StartTime;
     57            this.EndTime = EndTime;
     58            this.Note = Note;
     59            this.AppointmentKey = Key;
     60            this.Resource = sResource;
     61            }
     62
     63        public int Duration
     64        {
     65            get
     66            {
     67                TimeSpan span = (TimeSpan) (this.EndTime - this.StartTime);
     68                return (int) span.TotalMinutes;
     69            }
     70            }
    4171
    4272        public override string ToString()
    4373        {
    44             //StringFormat sf = new StringFormat();
    45             //sf.SetDigitSubstitution(System.Threading.Thread.CurrentThread.CurrentCulture.LCID, StringDigitSubstitute.National);
    4674            string patientName = "";
    47             if (this.m_bAccessBlock)
     75            if (this.IsAccessBlock)
    4876            {
    4977                string str2 = (this.Slots == 1) ? " Slot, " : " Slots, ";
     
    5785            return (patientName + " " + this.Note);
    5886        }
    59 
    60         public int AccessTypeID
    61         {
    62             get
    63             {
    64                 return this.m_nAccessTypeID;
    6587            }
    66             set
    67             {
    68                 this.m_nAccessTypeID = value;
    69             }
    70         }
    71 
    72         public string AccessTypeName
    73         {
    74             get
    75             {
    76                 return this.m_sAccessTypeName;
    77             }
    78             set
    79             {
    80                 this.m_sAccessTypeName = value;
    81             }
    82         }
    83 
    84         public int AppointmentKey
    85         {
    86             get
    87             {
    88                 return this.m_nKey;
    89             }
    90             set
    91             {
    92                 this.m_nKey = value;
    93             }
    94         }
    95 
    96         public DateTime AuxTime
    97         {
    98             get
    99             {
    100                 return this.m_dAuxTime;
    101             }
    102             set
    103             {
    104                 this.m_dAuxTime = value;
    105             }
    106         }
    107 
    108         public DateTime CheckInTime
    109         {
    110             get
    111             {
    112                 return this.m_dCheckIn;
    113             }
    114             set
    115             {
    116                 this.m_dCheckIn = value;
    117             }
    118         }
    119 
    120         public int Duration
    121         {
    122             get
    123             {
    124                 TimeSpan span = (TimeSpan) (this.EndTime - this.StartTime);
    125                 return (int) span.TotalMinutes;
    126             }
    127         }
    128 
    129         public DateTime EndTime
    130         {
    131             get
    132             {
    133                 return this.m_EndTime;
    134             }
    135             set
    136             {
    137                 this.m_EndTime = value;
    138             }
    139         }
    140 
    141         public int GridColumn
    142         {
    143             get
    144             {
    145                 return this.m_nColumn;
    146             }
    147             set
    148             {
    149                 this.m_nColumn = value;
    150             }
    151         }
    152 
    153         public Rectangle GridRectangle
    154         {
    155             get
    156             {
    157                 return this.m_rectangle;
    158             }
    159             set
    160             {
    161                 this.m_rectangle = value;
    162             }
    163         }
    164 
    165         public string HealthRecordNumber
    166         {
    167             get
    168             {
    169                 return this.m_sHRN;
    170             }
    171             set
    172             {
    173                 this.m_sHRN = value;
    174             }
    175         }
    176 
    177         public bool IsAccessBlock
    178         {
    179             get
    180             {
    181                 return this.m_bAccessBlock;
    182             }
    183             set
    184             {
    185                 this.m_bAccessBlock = value;
    186             }
    187         }
    188 
    189         public bool NoShow
    190         {
    191             get
    192             {
    193                 return this.m_bNoShow;
    194             }
    195             set
    196             {
    197                 this.m_bNoShow = value;
    198             }
    199         }
    200 
    201         public string Note
    202         {
    203             get
    204             {
    205                 return this.m_Note;
    206             }
    207             set
    208             {
    209                 this.m_Note = value;
    210             }
    211         }
    212 
    213         public int PatientID
    214         {
    215             get
    216             {
    217                 return this.m_nPatientID;
    218             }
    219             set
    220             {
    221                 this.m_nPatientID = value;
    222             }
    223         }
    224 
    225         public string PatientName
    226         {
    227             get
    228             {
    229                 return this.m_sPatientName;
    230             }
    231             set
    232             {
    233                 this.m_sPatientName = value;
    234             }
    235         }
    236 
    237         public string Resource
    238         {
    239             get
    240             {
    241                 return this.m_sResource;
    242             }
    243             set
    244             {
    245                 this.m_sResource = value;
    246             }
    247         }
    248 
    249         public bool Selected
    250         {
    251             get
    252             {
    253                 return this.m_bSelected;
    254             }
    255             set
    256             {
    257                 this.m_bSelected = value;
    258             }
    259         }
    260 
    261         public int Slots
    262         {
    263             get
    264             {
    265                 return this.m_nSlots;
    266             }
    267             set
    268             {
    269                 this.m_nSlots = value;
    270             }
    271         }
    272 
    273         public DateTime StartTime
    274         {
    275             get
    276             {
    277                 return this.m_StartTime;
    278             }
    279             set
    280             {
    281                 this.m_StartTime = value;
    282             }
    283         }
    284 
    285         public string Text
    286         {
    287             get
    288             {
    289                 this.m_Text = this.m_sPatientName;
    290                 return this.m_Text;
    291             }
    292         }
    293 
    294         public bool WalkIn
    295         {
    296             get
    297             {
    298                 return this.m_bWalkIn;
    299             }
    300             set
    301             {
    302                 this.m_bWalkIn = value;
    303             }
    304         }
    305 
    306         public Patient Patient { get; set; }
    307         public Provider Provider { get; set; }
    308     }
    30988}
    31089
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs

    r1143 r1174  
    238238                    sWalkIn = r["WALKIN"].ToString();
    239239                    bWalkIn = (sWalkIn == "1") ? true : false;
     240                    int? RadiologyExamIEN = r["RADIOLOGY_EXAM"] as Int32?; //new in v 1.6 - Get Radiology Exam
    240241
    241242                    Patient pt = new Patient()
     
    262263                    pAppointment.AccessTypeID = nAccessTypeID;
    263264                    pAppointment.WalkIn = bWalkIn;
     265                    pAppointment.RadiologyExamIEN = RadiologyExamIEN;
    264266                    this.m_appointments.AddAppointment(pAppointment);
    265267
     
    973975            }
    974976
    975             string sSql = "BSDX ADD NEW APPOINTMENT^" + sStart + "^" + sEnd + "^" + sPatID + "^" + sResource + "^" + sLen + "^" + sNote + "^" + sApptID;
     977            string sSql = "BSDX ADD NEW APPOINTMENT^" + sStart + "^" + sEnd + "^" + sPatID + "^" + sResource + "^" + sLen + "^" + sNote + "^" + sApptID + "^" + rApptInfo.RadiologyExamIEN;
    976978            System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "NewAppointment");
    977979
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGSchedLib.cs

    r1097 r1174  
    22using System.Data;
    33using System.Collections;
    4 using System.Diagnostics;
    5 using System.Drawing;
    64
    75namespace IndianHealthService.ClinicalScheduling
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs

    r1159 r1174  
    11using System;
    22using System.Collections;
     3using System.Collections.Generic;
    34using System.ComponentModel;
    45using System.Windows.Forms;
     
    4849                private System.Windows.Forms.Panel panelBottom;
    4950                private System.Windows.Forms.Label lblResource;
    50                 private System.Windows.Forms.ContextMenu contextMenu1;
     51                private System.Windows.Forms.ContextMenu ctxResourceTree;
    5152                private System.Windows.Forms.MenuItem ctxOpenSchedule;
    5253                private System.Windows.Forms.MenuItem ctxEditAvailability;
     
    9091                private System.Windows.Forms.MenuItem mnuPrintCancellationLetters;
    9192                private System.Windows.Forms.MenuItem mnuWalkIn;
    92                 private System.Windows.Forms.MenuItem menuItem5;
    93                 private System.Windows.Forms.MenuItem menuItem8;
     93                private System.Windows.Forms.MenuItem sepApptMenu1;
     94                private System.Windows.Forms.MenuItem sepApptMenu2;
    9495                private System.Windows.Forms.MenuItem ctxCalGridWalkin;
    95                 private System.Windows.Forms.MenuItem menuItem2;
    96                 private System.Windows.Forms.MenuItem menuItem9;
     96                private System.Windows.Forms.MenuItem ctxCalGridSep1;
     97                private System.Windows.Forms.MenuItem ctxCalGridSep2;
    9798                private System.Windows.Forms.MenuItem mnuOpenMultipleSchedules;
    9899                private System.Windows.Forms.MenuItem mnuDisplayWalkIns;
    99100        private System.Windows.Forms.MenuItem mnuRPMSDivision;
    100         private MenuItem menuItem10;
     101        private MenuItem ctxCalGridSep3;
    101102        private MenuItem ctxCalGridReprintApptSlip;
    102103        private MenuItem ctxCalGridUndoCheckin;
     
    106107        private MenuItem menuItem12;
    107108        private MenuItem mnuRefresh;
     109        private MenuItem ctxCalGridMkRadAppt;
     110        private MenuItem ctxCalGridCancelRadAppt;
     111        private MenuItem mnuMkRadAppt;
     112        private MenuItem mnuCancelRadAppt;
     113        private MenuItem mnuUndoCheckin;
     114        private MenuItem sepApptMenu3;
     115        private MenuItem mnuReprintApptSlip;
    108116        private IContainer components;
    109117
     
    194202            this.mnuAppointment = new System.Windows.Forms.MenuItem();
    195203            this.mnuNewAppointment = new System.Windows.Forms.MenuItem();
     204            this.mnuWalkIn = new System.Windows.Forms.MenuItem();
     205            this.mnuMkRadAppt = new System.Windows.Forms.MenuItem();
    196206            this.mnuEditAppointment = new System.Windows.Forms.MenuItem();
    197207            this.mnuDeleteAppointment = new System.Windows.Forms.MenuItem();
    198             this.menuItem5 = new System.Windows.Forms.MenuItem();
     208            this.mnuCancelRadAppt = new System.Windows.Forms.MenuItem();
     209            this.sepApptMenu1 = new System.Windows.Forms.MenuItem();
    199210            this.mnuNoShow = new System.Windows.Forms.MenuItem();
    200211            this.mnuNoShowUndo = new System.Windows.Forms.MenuItem();
    201             this.menuItem8 = new System.Windows.Forms.MenuItem();
     212            this.sepApptMenu2 = new System.Windows.Forms.MenuItem();
     213            this.mnuCheckIn = new System.Windows.Forms.MenuItem();
     214            this.mnuUndoCheckin = new System.Windows.Forms.MenuItem();
     215            this.sepApptMenu3 = new System.Windows.Forms.MenuItem();
     216            this.mnuFindAppt = new System.Windows.Forms.MenuItem();
    202217            this.mnuCopyAppointment = new System.Windows.Forms.MenuItem();
    203             this.mnuWalkIn = new System.Windows.Forms.MenuItem();
    204             this.mnuFindAppt = new System.Windows.Forms.MenuItem();
    205             this.mnuCheckIn = new System.Windows.Forms.MenuItem();
    206218            this.mnuViewPatientAppts = new System.Windows.Forms.MenuItem();
     219            this.mnuReprintApptSlip = new System.Windows.Forms.MenuItem();
    207220            this.mnuCalendar = new System.Windows.Forms.MenuItem();
    208221            this.mnuDisplayWalkIns = new System.Windows.Forms.MenuItem();
     
    225238            this.mnuTest1 = new System.Windows.Forms.MenuItem();
    226239            this.tvSchedules = new System.Windows.Forms.TreeView();
    227             this.contextMenu1 = new System.Windows.Forms.ContextMenu();
     240            this.ctxResourceTree = new System.Windows.Forms.ContextMenu();
    228241            this.ctxOpenSchedule = new System.Windows.Forms.MenuItem();
    229242            this.ctxEditAvailability = new System.Windows.Forms.MenuItem();
     
    246259            this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
    247260            this.ctxCalGridAdd = new System.Windows.Forms.MenuItem();
     261            this.ctxCalGridMkRadAppt = new System.Windows.Forms.MenuItem();
    248262            this.ctxCalGridEdit = new System.Windows.Forms.MenuItem();
    249263            this.ctxCalGridDelete = new System.Windows.Forms.MenuItem();
     264            this.ctxCalGridCancelRadAppt = new System.Windows.Forms.MenuItem();
    250265            this.ctxCalGridCheckIn = new System.Windows.Forms.MenuItem();
    251266            this.ctxCalGridUndoCheckin = new System.Windows.Forms.MenuItem();
    252             this.menuItem2 = new System.Windows.Forms.MenuItem();
     267            this.ctxCalGridSep1 = new System.Windows.Forms.MenuItem();
    253268            this.ctxCalGridNoShow = new System.Windows.Forms.MenuItem();
    254269            this.ctxCalGridNoShowUndo = new System.Windows.Forms.MenuItem();
    255             this.menuItem9 = new System.Windows.Forms.MenuItem();
     270            this.ctxCalGridSep2 = new System.Windows.Forms.MenuItem();
    256271            this.ctxCalGridWalkin = new System.Windows.Forms.MenuItem();
    257             this.menuItem10 = new System.Windows.Forms.MenuItem();
     272            this.ctxCalGridSep3 = new System.Windows.Forms.MenuItem();
    258273            this.ctxCalGridReprintApptSlip = new System.Windows.Forms.MenuItem();
    259274            this.panelBottom = new System.Windows.Forms.Panel();
     
    369384            //
    370385            this.mnuPrintReminderLetters.Index = 10;
    371             this.mnuPrintReminderLetters.Shortcut = System.Windows.Forms.Shortcut.CtrlI;
     386            this.mnuPrintReminderLetters.Shortcut = System.Windows.Forms.Shortcut.CtrlE;
    372387            this.mnuPrintReminderLetters.Text = "Print Rem&inder Letters";
    373388            this.mnuPrintReminderLetters.Click += new System.EventHandler(this.mnuPrintReminderLetters_Click);
     
    411426            this.mnuAppointment.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
    412427            this.mnuNewAppointment,
     428            this.mnuWalkIn,
     429            this.mnuMkRadAppt,
    413430            this.mnuEditAppointment,
    414431            this.mnuDeleteAppointment,
    415             this.menuItem5,
     432            this.mnuCancelRadAppt,
     433            this.sepApptMenu1,
    416434            this.mnuNoShow,
    417435            this.mnuNoShowUndo,
    418             this.menuItem8,
     436            this.sepApptMenu2,
     437            this.mnuCheckIn,
     438            this.mnuUndoCheckin,
     439            this.sepApptMenu3,
     440            this.mnuFindAppt,
    419441            this.mnuCopyAppointment,
    420             this.mnuWalkIn,
    421             this.mnuFindAppt,
    422             this.mnuCheckIn,
    423             this.mnuViewPatientAppts});
     442            this.mnuViewPatientAppts,
     443            this.mnuReprintApptSlip});
    424444            this.mnuAppointment.Text = "&Appointment";
    425445            this.mnuAppointment.Popup += new System.EventHandler(this.mnuAppointment_Popup);
     
    432452            this.mnuNewAppointment.Click += new System.EventHandler(this.mnuNewAppointment_Click);
    433453            //
     454            // mnuWalkIn
     455            //
     456            this.mnuWalkIn.Index = 1;
     457            this.mnuWalkIn.Shortcut = System.Windows.Forms.Shortcut.ShiftIns;
     458            this.mnuWalkIn.Text = "Create Wal&k-In Appointment";
     459            this.mnuWalkIn.Click += new System.EventHandler(this.mnuWalkIn_Click);
     460            //
     461            // mnuMkRadAppt
     462            //
     463            this.mnuMkRadAppt.Index = 2;
     464            this.mnuMkRadAppt.Shortcut = System.Windows.Forms.Shortcut.CtrlIns;
     465            this.mnuMkRadAppt.Text = "Make Radiology Appointment";
     466            this.mnuMkRadAppt.Click += new System.EventHandler(this.mnuMkRadAppt_Click);
     467            //
    434468            // mnuEditAppointment
    435469            //
    436             this.mnuEditAppointment.Index = 1;
     470            this.mnuEditAppointment.Index = 3;
    437471            this.mnuEditAppointment.Shortcut = System.Windows.Forms.Shortcut.F2;
    438472            this.mnuEditAppointment.Text = "&Edit Appointment";
     
    441475            // mnuDeleteAppointment
    442476            //
    443             this.mnuDeleteAppointment.Index = 2;
     477            this.mnuDeleteAppointment.Index = 4;
    444478            this.mnuDeleteAppointment.Shortcut = System.Windows.Forms.Shortcut.Del;
    445479            this.mnuDeleteAppointment.Text = "Cance&l Appointment";
    446480            this.mnuDeleteAppointment.Click += new System.EventHandler(this.mnuDeleteAppointment_Click);
    447481            //
    448             // menuItem5
    449             //
    450             this.menuItem5.Index = 3;
    451             this.menuItem5.Text = "-";
     482            // mnuCancelRadAppt
     483            //
     484            this.mnuCancelRadAppt.Index = 5;
     485            this.mnuCancelRadAppt.Shortcut = System.Windows.Forms.Shortcut.CtrlDel;
     486            this.mnuCancelRadAppt.Text = "Cancel Radiology Appointment";
     487            this.mnuCancelRadAppt.Click += new System.EventHandler(this.mnuCancelRadAppt_Click);
     488            //
     489            // sepApptMenu1
     490            //
     491            this.sepApptMenu1.Index = 6;
     492            this.sepApptMenu1.Text = "-";
    452493            //
    453494            // mnuNoShow
    454495            //
    455             this.mnuNoShow.Index = 4;
     496            this.mnuNoShow.Index = 7;
     497            this.mnuNoShow.Shortcut = System.Windows.Forms.Shortcut.CtrlN;
    456498            this.mnuNoShow.Text = "Mark as No Sho&w";
    457499            this.mnuNoShow.Click += new System.EventHandler(this.mnuNoShow_Click);
     
    459501            // mnuNoShowUndo
    460502            //
    461             this.mnuNoShowUndo.Index = 5;
     503            this.mnuNoShowUndo.Index = 8;
     504            this.mnuNoShowUndo.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftN;
    462505            this.mnuNoShowUndo.Text = "&Undo No Show";
    463506            this.mnuNoShowUndo.Click += new System.EventHandler(this.mnuNoShowUndo_Click);
    464507            //
    465             // menuItem8
    466             //
    467             this.menuItem8.Index = 6;
    468             this.menuItem8.Text = "-";
    469             //
    470             // mnuCopyAppointment
    471             //
    472             this.mnuCopyAppointment.Index = 7;
    473             this.mnuCopyAppointment.Text = "&Copy  Appointment to Clipboard";
    474             this.mnuCopyAppointment.Click += new System.EventHandler(this.mnuCopyAppointment_Click);
    475             //
    476             // mnuWalkIn
    477             //
    478             this.mnuWalkIn.Index = 8;
    479             this.mnuWalkIn.Text = "Create Wal&k-In Appointment";
    480             this.mnuWalkIn.Click += new System.EventHandler(this.mnuWalkIn_Click);
     508            // sepApptMenu2
     509            //
     510            this.sepApptMenu2.Index = 9;
     511            this.sepApptMenu2.Text = "-";
     512            //
     513            // mnuCheckIn
     514            //
     515            this.mnuCheckIn.Index = 10;
     516            this.mnuCheckIn.Shortcut = System.Windows.Forms.Shortcut.CtrlI;
     517            this.mnuCheckIn.Text = "Check &In Patient";
     518            this.mnuCheckIn.Click += new System.EventHandler(this.mnuCheckIn_Click);
     519            //
     520            // mnuUndoCheckin
     521            //
     522            this.mnuUndoCheckin.Index = 11;
     523            this.mnuUndoCheckin.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftI;
     524            this.mnuUndoCheckin.Text = "Undo Checkin";
     525            this.mnuUndoCheckin.Click += new System.EventHandler(this.mnuUndoCheckin_Click);
     526            //
     527            // sepApptMenu3
     528            //
     529            this.sepApptMenu3.Index = 12;
     530            this.sepApptMenu3.Text = "-";
    481531            //
    482532            // mnuFindAppt
    483533            //
    484             this.mnuFindAppt.Index = 9;
     534            this.mnuFindAppt.Index = 13;
    485535            this.mnuFindAppt.Shortcut = System.Windows.Forms.Shortcut.CtrlF;
    486536            this.mnuFindAppt.Text = "&Find Empty Slots";
    487537            this.mnuFindAppt.Click += new System.EventHandler(this.mnuFindAppt_Click);
    488538            //
    489             // mnuCheckIn
    490             //
    491             this.mnuCheckIn.Index = 10;
    492             this.mnuCheckIn.Text = "Check &In Patient";
    493             this.mnuCheckIn.Click += new System.EventHandler(this.mnuCheckIn_Click);
     539            // mnuCopyAppointment
     540            //
     541            this.mnuCopyAppointment.Index = 14;
     542            this.mnuCopyAppointment.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
     543            this.mnuCopyAppointment.Text = "&Copy  Appointment to Clipboard";
     544            this.mnuCopyAppointment.Click += new System.EventHandler(this.mnuCopyAppointment_Click);
    494545            //
    495546            // mnuViewPatientAppts
    496547            //
    497             this.mnuViewPatientAppts.Index = 11;
     548            this.mnuViewPatientAppts.Index = 15;
     549            this.mnuViewPatientAppts.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftZ;
    498550            this.mnuViewPatientAppts.Text = "&View Patient Appointments";
    499551            this.mnuViewPatientAppts.Click += new System.EventHandler(this.mnuViewPatientAppts_Click);
     552            //
     553            // mnuReprintApptSlip
     554            //
     555            this.mnuReprintApptSlip.Index = 16;
     556            this.mnuReprintApptSlip.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftP;
     557            this.mnuReprintApptSlip.Text = "Reprint Appointment Slip";
     558            this.mnuReprintApptSlip.Click += new System.EventHandler(this.mnuReprintApptSlip_Click);
    500559            //
    501560            // mnuCalendar
     
    519578            this.mnuDisplayWalkIns.Checked = true;
    520579            this.mnuDisplayWalkIns.Index = 0;
     580            this.mnuDisplayWalkIns.Shortcut = System.Windows.Forms.Shortcut.F12;
    521581            this.mnuDisplayWalkIns.Text = "&Display Walk-Ins";
    522582            this.mnuDisplayWalkIns.Click += new System.EventHandler(this.mnuDisplayWalkIns_Click);
     
    592652            // mnuViewScheduleTree
    593653            //
     654            this.mnuViewScheduleTree.Checked = true;
    594655            this.mnuViewScheduleTree.Index = 6;
     656            this.mnuViewScheduleTree.Shortcut = System.Windows.Forms.Shortcut.F4;
    595657            this.mnuViewScheduleTree.Text = "&Schedule Tree";
    596658            this.mnuViewScheduleTree.Click += new System.EventHandler(this.mnuViewScheduleTree_Click);
     
    645707            //
    646708            this.tvSchedules.BackColor = System.Drawing.SystemColors.ControlLight;
    647             this.tvSchedules.ContextMenu = this.contextMenu1;
     709            this.tvSchedules.ContextMenu = this.ctxResourceTree;
    648710            this.tvSchedules.Dock = System.Windows.Forms.DockStyle.Left;
    649711            this.tvSchedules.HotTracking = true;
    650712            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    651713            this.tvSchedules.Name = "tvSchedules";
    652             this.tvSchedules.Size = new System.Drawing.Size(128, 317);
     714            this.tvSchedules.Size = new System.Drawing.Size(128, 392);
    653715            this.tvSchedules.Sorted = true;
    654716            this.tvSchedules.TabIndex = 1;
     
    658720            this.tvSchedules.MouseEnter += new System.EventHandler(this.tvSchedules_MouseEnter);
    659721            //
    660             // contextMenu1
    661             //
    662             this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     722            // ctxResourceTree
     723            //
     724            this.ctxResourceTree.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
    663725            this.ctxOpenSchedule,
    664726            this.ctxEditAvailability,
     
    668730            this.ctxPrintScheduleT1,
    669731            this.ctxPrintScheduleT3});
    670             this.contextMenu1.Popup += new System.EventHandler(this.contextMenu1_Popup);
     732            this.ctxResourceTree.Popup += new System.EventHandler(this.contextMenu1_Popup);
    671733            //
    672734            // ctxOpenSchedule
     
    719781            this.panelRight.Location = new System.Drawing.Point(996, 0);
    720782            this.panelRight.Name = "panelRight";
    721             this.panelRight.Size = new System.Drawing.Size(128, 317);
     783            this.panelRight.Size = new System.Drawing.Size(128, 392);
    722784            this.panelRight.TabIndex = 3;
    723785            this.panelRight.Visible = false;
     
    815877            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    816878            this.panelCenter.Name = "panelCenter";
    817             this.panelCenter.Size = new System.Drawing.Size(857, 269);
     879            this.panelCenter.Size = new System.Drawing.Size(857, 344);
    818880            this.panelCenter.TabIndex = 7;
    819881            //
     
    822884            this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
    823885            this.ctxCalGridAdd,
     886            this.ctxCalGridMkRadAppt,
    824887            this.ctxCalGridEdit,
    825888            this.ctxCalGridDelete,
     889            this.ctxCalGridCancelRadAppt,
    826890            this.ctxCalGridCheckIn,
    827891            this.ctxCalGridUndoCheckin,
    828             this.menuItem2,
     892            this.ctxCalGridSep1,
    829893            this.ctxCalGridNoShow,
    830894            this.ctxCalGridNoShowUndo,
    831             this.menuItem9,
     895            this.ctxCalGridSep2,
    832896            this.ctxCalGridWalkin,
    833             this.menuItem10,
     897            this.ctxCalGridSep3,
    834898            this.ctxCalGridReprintApptSlip});
    835899            this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
     
    841905            this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
    842906            //
     907            // ctxCalGridMkRadAppt
     908            //
     909            this.ctxCalGridMkRadAppt.Index = 1;
     910            this.ctxCalGridMkRadAppt.Text = "Make Radiology Appointment";
     911            this.ctxCalGridMkRadAppt.Click += new System.EventHandler(this.ctxCalGridMkRadAppt_Click);
     912            //
    843913            // ctxCalGridEdit
    844914            //
    845             this.ctxCalGridEdit.Index = 1;
     915            this.ctxCalGridEdit.Index = 2;
    846916            this.ctxCalGridEdit.Text = "Edit Appointment";
    847917            this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
     
    849919            // ctxCalGridDelete
    850920            //
    851             this.ctxCalGridDelete.Index = 2;
     921            this.ctxCalGridDelete.Index = 3;
    852922            this.ctxCalGridDelete.Text = "Cancel Appointment";
    853923            this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
    854924            //
     925            // ctxCalGridCancelRadAppt
     926            //
     927            this.ctxCalGridCancelRadAppt.Index = 4;
     928            this.ctxCalGridCancelRadAppt.Text = "Cancel Radiology Appointment";
     929            this.ctxCalGridCancelRadAppt.Click += new System.EventHandler(this.ctxCalGridCancelRadAppt_Click);
     930            //
    855931            // ctxCalGridCheckIn
    856932            //
    857             this.ctxCalGridCheckIn.Index = 3;
     933            this.ctxCalGridCheckIn.Index = 5;
    858934            this.ctxCalGridCheckIn.Text = "Check In Patient";
    859935            this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
     
    861937            // ctxCalGridUndoCheckin
    862938            //
    863             this.ctxCalGridUndoCheckin.Index = 4;
     939            this.ctxCalGridUndoCheckin.Index = 6;
    864940            this.ctxCalGridUndoCheckin.Text = "&Undo Check In";
    865941            this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);
    866942            //
    867             // menuItem2
    868             //
    869             this.menuItem2.Index = 5;
    870             this.menuItem2.Text = "-";
     943            // ctxCalGridSep1
     944            //
     945            this.ctxCalGridSep1.Index = 7;
     946            this.ctxCalGridSep1.Text = "-";
    871947            //
    872948            // ctxCalGridNoShow
    873949            //
    874             this.ctxCalGridNoShow.Index = 6;
     950            this.ctxCalGridNoShow.Index = 8;
    875951            this.ctxCalGridNoShow.Text = "Mark as No Show";
    876952            this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
     
    878954            // ctxCalGridNoShowUndo
    879955            //
    880             this.ctxCalGridNoShowUndo.Index = 7;
     956            this.ctxCalGridNoShowUndo.Index = 9;
    881957            this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
    882958            this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
    883959            //
    884             // menuItem9
    885             //
    886             this.menuItem9.Index = 8;
    887             this.menuItem9.Text = "-";
     960            // ctxCalGridSep2
     961            //
     962            this.ctxCalGridSep2.Index = 10;
     963            this.ctxCalGridSep2.Text = "-";
    888964            //
    889965            // ctxCalGridWalkin
    890966            //
    891             this.ctxCalGridWalkin.Index = 9;
     967            this.ctxCalGridWalkin.Index = 11;
    892968            this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
    893969            this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
    894970            //
    895             // menuItem10
    896             //
    897             this.menuItem10.Index = 10;
    898             this.menuItem10.Text = "-";
     971            // ctxCalGridSep3
     972            //
     973            this.ctxCalGridSep3.Index = 12;
     974            this.ctxCalGridSep3.Text = "-";
    899975            //
    900976            // ctxCalGridReprintApptSlip
    901977            //
    902             this.ctxCalGridReprintApptSlip.Index = 11;
     978            this.ctxCalGridReprintApptSlip.Index = 13;
    903979            this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";
    904980            this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);
     
    908984            this.panelBottom.Controls.Add(this.statusBar1);
    909985            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    910             this.panelBottom.Location = new System.Drawing.Point(136, 293);
     986            this.panelBottom.Location = new System.Drawing.Point(136, 368);
    911987            this.panelBottom.Name = "panelBottom";
    912988            this.panelBottom.Size = new System.Drawing.Size(857, 24);
     
    9261002            this.splitter1.Location = new System.Drawing.Point(128, 24);
    9271003            this.splitter1.Name = "splitter1";
    928             this.splitter1.Size = new System.Drawing.Size(8, 293);
     1004            this.splitter1.Size = new System.Drawing.Size(8, 368);
    9291005            this.splitter1.TabIndex = 9;
    9301006            this.splitter1.TabStop = false;
     
    9351011            this.splitter2.Location = new System.Drawing.Point(993, 24);
    9361012            this.splitter2.Name = "splitter2";
    937             this.splitter2.Size = new System.Drawing.Size(3, 293);
     1013            this.splitter2.Size = new System.Drawing.Size(3, 368);
    9381014            this.splitter2.TabIndex = 10;
    9391015            this.splitter2.TabStop = false;
     
    9581034            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    9591035            this.calendarGrid1.SelectedAppointment = 0;
    960             this.calendarGrid1.Size = new System.Drawing.Size(857, 269);
     1036            this.calendarGrid1.Size = new System.Drawing.Size(857, 344);
    9611037            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    9621038            this.calendarGrid1.TabIndex = 0;
     
    9711047            //
    9721048            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    973             this.ClientSize = new System.Drawing.Size(1124, 317);
     1049            this.ClientSize = new System.Drawing.Size(1124, 392);
    9741050            this.Controls.Add(this.panelCenter);
    9751051            this.Controls.Add(this.panelBottom);
     
    10821158                #endregion
    10831159
    1084 
    10851160                #region AppointmentMenu Handlers
    10861161
    10871162                private void mnuAppointment_Popup(object sender, System.EventArgs e)
    10881163                {
    1089                         bool bEnabled = (this.Document.Resources.Count > 0)? true : false ;
    1090                         this.mnuFindAppt.Enabled = bEnabled;
    1091 
    1092                         //Toggle availability of make, edit, checkin and delete appointments
    1093                         //based on whether a range is selected.
    1094 
    1095                         mnuNewAppointment.Enabled = AddAppointmentEnabled();
    1096                         this.mnuWalkIn.Enabled = mnuNewAppointment.Enabled;
    1097                         bool bEditAppointments = this.EditAppointmentEnabled();
    1098 
    1099                         mnuDeleteAppointment.Enabled = bEditAppointments;
    1100                         mnuCheckIn.Enabled = bEditAppointments;
    1101                         mnuEditAppointment.Enabled = bEditAppointments;
    1102                         mnuNoShow.Enabled = bEditAppointments;
    1103                         mnuNoShowUndo.Enabled = bEditAppointments;
     1164            // our flags
     1165                        bool _findApptsEnabled = (this.Document.Resources.Count > 0)? true : false ;
     1166            bool _addApptsEnabled = AddAppointmentEnabled();
     1167            bool _editApptsEnabled = EditAppointmentEnabled();
     1168            bool _isRadAppt = IsThisARadiologyResource();
     1169            bool _noShowEnabled = NoShowEnabled();
     1170            bool _undoCheckinEnabled = UndoCheckinEnabled();
     1171            //end flags
     1172
     1173            mnuNewAppointment.Enabled = _addApptsEnabled && !_isRadAppt;
     1174            mnuWalkIn.Enabled = _addApptsEnabled && !_isRadAppt;
     1175            mnuMkRadAppt.Enabled = _isRadAppt && _addApptsEnabled;
     1176
     1177            mnuEditAppointment.Enabled = _editApptsEnabled && !_isRadAppt;
     1178            mnuDeleteAppointment.Enabled = _editApptsEnabled && !_isRadAppt;
     1179            mnuCancelRadAppt.Enabled = _isRadAppt && _editApptsEnabled;
     1180            mnuNoShow.Enabled = _noShowEnabled && _editApptsEnabled;
     1181            mnuNoShowUndo.Enabled = !_noShowEnabled && _editApptsEnabled;
     1182            mnuCheckIn.Enabled = _editApptsEnabled && !_isRadAppt;
     1183            mnuUndoCheckin.Enabled = _undoCheckinEnabled && !_isRadAppt;
     1184
     1185            mnuFindAppt.Enabled = _findApptsEnabled;
     1186            mnuCopyAppointment.Enabled = _editApptsEnabled && !_isRadAppt;
     1187            mnuViewPatientAppts.Enabled = true;
     1188            mnuReprintApptSlip.Enabled = _editApptsEnabled;
    11041189                }
    11051190
     
    11181203                                foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
    11191204                                {
    1120                                         if (m_ClipList.AppointmentTable.Contains((int) a.AppointmentKey))
     1205                    if (m_ClipList.AppointmentTable.Contains((int)a.AppointmentKey))
    11211206                                        {
    11221207                                                return;
    11231208                                        }
    11241209                                        m_ClipList.AddAppointment(a);
    1125                                         lstClip.Items.Add(a.PatientName);
     1210                    lstClip.Items.Add(a);
    11261211                                }
    11271212                        }
     
    11621247        {
    11631248            AppointmentUndoCheckin();
     1249        }
     1250
     1251        private void mnuMkRadAppt_Click(object sender, EventArgs e)
     1252        {
     1253            AppointmentAddNewRadiology();
     1254        }
     1255
     1256        private void mnuCancelRadAppt_Click(object sender, EventArgs e)
     1257        {
     1258            AppointmentDeleteOneRadiology();
     1259        }
     1260
     1261        private void mnuUndoCheckin_Click(object sender, EventArgs e)
     1262        {
     1263            AppointmentUndoCheckin();
     1264        }
     1265
     1266        private void mnuReprintApptSlip_Click(object sender, EventArgs e)
     1267        {
     1268            int apptID = this.CGrid.SelectedAppointment;
     1269            if (apptID <= 0) return;
     1270
     1271            CGAppointment a = (CGAppointment)this.Appointments.AppointmentTable[apptID];
     1272
     1273            PrintAppointmentSlip(a);
    11641274        }
    11651275
     
    12921402                private void ctxCalendarGrid_Popup(object sender, System.EventArgs e)
    12931403                {
     1404            bool bEditAppointments = (EditAppointmentEnabled() && (calendarGrid1.SelectedAppointment > 0)) ;
     1405
     1406            if (IsThisARadiologyResource())//this is a radiology resource
     1407            {
     1408                ctxCalGridAdd.Visible = false;
     1409                ctxCalGridDelete.Visible = false;
     1410                ctxCalGridEdit.Visible = false;
     1411                ctxCalGridCheckIn.Visible = false;
     1412                ctxCalGridNoShow.Visible = false;
     1413                ctxCalGridNoShowUndo.Visible = false;
     1414                ctxCalGridWalkin.Visible = false;
     1415                ctxCalGridUndoCheckin.Visible = false;
     1416                ctxCalGridSep1.Visible = false;
     1417                ctxCalGridSep2.Visible = false;
     1418
     1419                ctxCalGridMkRadAppt.Visible = true;
     1420                ctxCalGridCancelRadAppt.Visible = true;
     1421
     1422               
     1423            }
     1424
     1425            else // this is a normal resource
     1426            {
     1427                ctxCalGridAdd.Visible = true;
     1428                ctxCalGridDelete.Visible = true;
     1429                ctxCalGridEdit.Visible = true;
     1430                ctxCalGridCheckIn.Visible = true;
     1431                ctxCalGridNoShow.Visible = true;
     1432                ctxCalGridNoShowUndo.Visible = true;
     1433                ctxCalGridWalkin.Visible = true;
     1434                ctxCalGridUndoCheckin.Visible = true;
     1435                ctxCalGridSep1.Visible = true;
     1436                ctxCalGridSep2.Visible = true;
     1437
     1438                ctxCalGridMkRadAppt.Visible = false;
     1439                ctxCalGridCancelRadAppt.Visible = false;
     1440            }
     1441
    12941442                        //Toggle availability of make, edit, checkin and delete appointments
    12951443                        //based on whether appropriate element is selected.
    12961444                        ctxCalGridAdd.Enabled = AddAppointmentEnabled();
    1297                         bool bEditAppointments = (EditAppointmentEnabled() && (calendarGrid1.SelectedAppointment > 0)) ;
     1445                       
    12981446                        ctxCalGridDelete.Enabled = bEditAppointments;
    12991447                        ctxCalGridEdit.Enabled = bEditAppointments;
     
    13021450            ctxCalGridNoShowUndo.Enabled = !NoShowEnabled() && calendarGrid1.SelectedAppointment > 0;
    13031451                        ctxCalGridWalkin.Enabled = ctxCalGridAdd.Enabled;
    1304             //smh new code
    13051452            ctxCalGridReprintApptSlip.Enabled = bEditAppointments;
    13061453            ctxCalGridUndoCheckin.Enabled = UndoCheckinEnabled();
    1307             //end new code
     1454
     1455            //if the rad ones are visible, then these apply
     1456            ctxCalGridMkRadAppt.Enabled = !bEditAppointments;
     1457            ctxCalGridCancelRadAppt.Enabled = bEditAppointments;
    13081458        }
    13091459
     
    13441494                }
    13451495
    1346         //new code smh
     1496        private void ctxCalGridMkRadAppt_Click(object sender, EventArgs e)
     1497        {
     1498            AppointmentAddNewRadiology();
     1499        }
     1500
     1501        private void ctxCalGridCancelRadAppt_Click(object sender, EventArgs e)
     1502        {
     1503            AppointmentDeleteOneRadiology();
     1504        }
     1505
    13471506        private void ctxCalGridReprintApptSlip_Click(object sender, EventArgs e)
    13481507        {
     
    13541513            PrintAppointmentSlip(a);
    13551514        }
    1356         //end new code
    13571515
    13581516                #endregion ctxCalGridMenu Handlers
    13591517
    13601518                #region Methods
     1519
     1520        /// <summary>
     1521        /// Decides whether this is a Radiology Resource. Local Helper to decide what menu items to enable/display
     1522        /// </summary>
     1523        /// <returns></returns>
     1524        private bool IsThisARadiologyResource()
     1525        {
     1526            //I don't like this logic!!! but works for now!
     1527            //Note: I use banana peeling model below
     1528
     1529            //If no cell is selected AND no appointment is selected, then it's false
     1530            if (this.calendarGrid1.SelectedRange.Cells.CellCount < 1 && this.calendarGrid1.SelectedAppointment < 1)
     1531                return false;
     1532
     1533            //If an appointment is selected then...
     1534            if (this.calendarGrid1.SelectedAppointment > 0)
     1535            {
     1536                CGAppointment appt = this.Appointments.AppointmentTable[this.calendarGrid1.SelectedAppointment] as CGAppointment;
     1537                if (appt == null) return false; //appt doesn't exist; old appointment and grid wasn't refreshed yet
     1538                if (appt.RadiologyExamIEN.HasValue && appt.RadiologyExamIEN.Value > 0) return true; //this appointment is a radiology appointment since it has that member
     1539                else return false;
     1540
     1541            }
     1542
     1543            //Otherwise, we are for sure dealing with a cell.
     1544            //We need to determine if the cell resource is mapped to a Radiology Hospital Location.
     1545            DateTime dStart;
     1546            DateTime dEnd;
     1547            string sResource;
     1548           
     1549            // Get resource
     1550            bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
     1551           
     1552            // If we fail, return false (but this is not supposed to ever happen)
     1553            if (bRet == false)
     1554            {
     1555                return false;
     1556            }
     1557
     1558            // see if resource is mapped to a Radiology Hospital Location.
     1559            return IsThisARadiologyResource(sResource);
     1560        }
     1561
     1562        private bool IsThisARadiologyResource(string sResource)
     1563        {
     1564            // see if resource is mapped to a Radiology Hospital Location.
     1565            return (   //select all Hospital Locations which are radiology locations
     1566                       from hl in CGDocumentManager.Current.GlobalDataSet.Tables["HospitalLocation"].AsEnumerable()
     1567                       where hl.Field<string>("IS_RADIOLOGY_LOCATION") == "1"
     1568                       //join this to the resources table using the foreign ID (plain jane relational join)
     1569                       join res in CGDocumentManager.Current.GlobalDataSet.Tables["Resources"].AsEnumerable()
     1570                       on hl.Field<int>("HOSPITAL_LOCATION_ID") equals res.Field<int>("HOSPITAL_LOCATION_ID")
     1571                       //then filter this down to the resource that we have
     1572                       where res.Field<string>("RESOURCE_NAME") == sResource
     1573                       //if we have any row left, then it is true.
     1574                       select hl).Any();
     1575        }
    13611576
    13621577        private bool EditAppointmentEnabled()
     
    19812196
    19822197                /// <summary>
     2198        /// Delete one Radiology Appointment
     2199        /// </summary>
     2200        private void AppointmentDeleteOneRadiology()
     2201        {
     2202            Debug.Assert(this.calendarGrid1.SelectedAppointment > 0);
     2203
     2204            CGAppointment a = this.Appointments.AppointmentTable[this.calendarGrid1.SelectedAppointment] as CGAppointment;
     2205
     2206            Debug.Assert(a.RadiologyExamIEN.HasValue);
     2207
     2208            //Prior to making expensive db calls, tell the grid nothing is selected anymore so nobody would try to pick it up
     2209            this.calendarGrid1.SelectedAppointment = 0;
     2210
     2211            //Cancel Radiology Exam
     2212            CGDocumentManager.Current.DAL.CancelRadiologyExam(a.PatientID, a.RadiologyExamIEN.Value);
     2213
     2214            //Now, Cancel the appointment
     2215            this.Document.DeleteAppointment(a.AppointmentKey);
     2216
     2217            //redraw the grid to display new set of appointments after this appt was removed.
     2218            this.UpdateArrays();
     2219        }
     2220
     2221                /// <summary>
    19832222                /// Delete appointment ApptID
    19842223                /// </summary>
     
    20152254                return;
    20162255            }
     2256
     2257            //At this point, the appointment will be deleted...
     2258            //Remove the Selected Appointment from the grid because we don't anybody to think there's still
     2259            //an appointment selected while we are still updating the grid
     2260            this.calendarGrid1.SelectedAppointment = 0;
    20172261
    20182262            bool bClinic = dCancel.ClinicCancelled;
     
    23812625                }
    23822626
     2627        /// <summary>
     2628        /// Add a new Radiology Appointment to VISTA (ÒÝÊì as my mom calls it)
     2629        /// </summary>
     2630        private void AppointmentAddNewRadiology()
     2631        {
     2632            DateTime dStart, dEnd;  //return vales for below
     2633            string sResource;       //ditto
     2634            int nAccessTypeID = 0;  //ditto
     2635
     2636            this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
     2637            this.calendarGrid1.GetSelectedType(out nAccessTypeID);
     2638
     2639            Debug.Assert(sResource != null);
     2640            Debug.Assert(dStart > DateTime.MinValue);
     2641
     2642            //Display a dialog to collect Patient Name
     2643            DPatientLookup dPat = new DPatientLookup();
     2644            dPat.DocManager = m_DocManager;
     2645
     2646            if (dPat.ShowDialog(this) == DialogResult.Cancel)
     2647            {
     2648                return;
     2649            }
     2650
     2651            int DFN = Int32.Parse(dPat.PatientIEN);
     2652            // Hospital Location IEN
     2653            int hlIEN = (from resource in CGDocumentManager.Current.GlobalDataSet.Tables["Resources"].AsEnumerable()
     2654                         where resource.Field<string>("RESOURCE_NAME") == sResource
     2655                         select resource.Field<int>("HOSPITAL_LOCATION_ID")).FirstOrDefault();
     2656
     2657            //Get Radiology Exams from the DB
     2658            List<RadiologyExam> _radExams = CGDocumentManager.Current.DAL.GetRadiologyExamsForPatientinHL(DFN, hlIEN);
     2659
     2660            //If none found...
     2661            if (!_radExams.Any())
     2662            {
     2663                MessageBox.Show("Patient does not have any radiology exams to register.");
     2664                return;
     2665            }
     2666
     2667            //Display a form for the user to select radiology exams.
     2668            DRadExamsSelect _radform = new DRadExamsSelect(_radExams);
     2669
     2670            if (_radform.ShowDialog() == DialogResult.Cancel) return;
     2671
     2672            //Get some return values
     2673            int _examien = _radform.ExamIEN;
     2674            string _procedurename = _radform.ProcedureName;
     2675
     2676            //Save Radiology Exam Schedule Info to Radiology Package
     2677            CGDocumentManager.Current.DAL.ScheduleRadiologyExam(DFN, _examien, dStart);
     2678
     2679            //Now create and save the appointment
     2680            CGAppointment appt = new CGAppointment();
     2681            string _sNote = "Radiology Exam (" + _examien + "): " + _procedurename;
     2682            appt.CreateAppointment(dStart, dEnd, _sNote, 0, sResource);
     2683            appt.PatientID = Int32.Parse(dPat.PatientIEN);
     2684            appt.PatientName = dPat.PatientName;
     2685            appt.AccessTypeID = nAccessTypeID;
     2686            appt.RadiologyExamIEN = _examien;
     2687            appt.Patient = new Patient
     2688            {
     2689                DFN = Convert.ToInt32(dPat.PatientIEN),
     2690                ID = dPat.PatientPID,
     2691                Name = dPat.PatientName,
     2692                HRN = dPat.HealthRecordNumber,
     2693                DOB = dPat.PatientDOB
     2694            };
     2695
     2696            this.Document.CreateAppointment(appt);
     2697
     2698            //Print Appointment Slip if requested
     2699            if (_radform.PrintAppointmentSlip) this.PrintAppointmentSlip(appt);
     2700
     2701            //Now redraw the grid to display the new appointments
     2702            this.UpdateArrays();
     2703        }
     2704
     2705
    23832706        #region BMX Event Processing and Callbacks
    23842707        /// <summary>
     
    28923215                        try
    28933216                        {
     3217                // added April 13 2011
     3218                // Can't edit radiology appointments (Why? b/c it's intimately tied to Radiology Entry of the Hosp Loc)
     3219                if (e.Appointment.RadiologyExamIEN.HasValue && e.Appointment.RadiologyExamIEN.Value > 0)
     3220                {
     3221                    MessageBox.Show("You cannot move a radiology appointment.", "Clinical Scheduling");
     3222                    return;
     3223                }
     3224
     3225                // added May 5 2011
     3226                // Can't move an appointment to a radiology resource
     3227                if (IsThisARadiologyResource(e.Resource))
     3228                {
     3229                    MessageBox.Show("You cannot move an appointment to a radiology location.", "Clinical Scheduling");
     3230                    return;
     3231                }
     3232               
    28943233                                if (e.Appointment.CheckInTime.Ticks > 0)
    28953234                                {
    2896                                         MessageBox.Show("You cannot change the appointment time because the patient has already checked in.", "Clinical Scheduling",  MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
     3235                                        MessageBox.Show("You cannot change the appointment time because the patient has already checked in.", "Clinical Scheduling");
    28973236                                        return;
    28983237                                }
     
    35663905
    35673906
    3568 
    3569 
    3570 
    35713907    }//End class
    35723908}
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.resx

    r1110 r1174  
    121121    <value>17, 17</value>
    122122  </metadata>
    123   <metadata name="contextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     123  <metadata name="ctxResourceTree.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124124    <value>126, 17</value>
    125125  </metadata>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs

    r1143 r1174  
    480480                    {
    481481                        rect.Inflate(-10, 0);
    482                         num = (int) this.m_ApptOverlapTable[appointment.m_nKey];
     482                        num = (int) this.m_ApptOverlapTable[appointment.AppointmentKey];
    483483                        num2 = rect.Right - rect.Left;
    484484                        x = num2 / (num + 1);
     
    12671267                    x = (this.m_sResourcesArray.Count > 1) ? (((int) this.m_ColumnInfoTable[resource]) + 1) : appointment.StartTime.DayOfYear;
    12681268                    Rectangle rectangle = new Rectangle(x, y, 1, num2 - y);
    1269                     hashtable.Add(appointment.m_nKey, rectangle);
     1269                    hashtable.Add(appointment.AppointmentKey, rectangle);
    12701270                }
    12711271            }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj

    r1112 r1174  
    140140  </ItemGroup>
    141141  <ItemGroup>
     142    <Compile Include="DRadExamsSelect.cs">
     143      <SubType>Form</SubType>
     144    </Compile>
     145    <Compile Include="DRadExamsSelect.Designer.cs">
     146      <DependentUpon>DRadExamsSelect.cs</DependentUpon>
     147    </Compile>
    142148    <Compile Include="Provider.cs" />
     149    <Compile Include="RadiologyExam.cs" />
    143150    <Compile Include="strings.ar.Designer.cs">
    144151      <AutoGen>True</AutoGen>
     
    152159    </Compile>
    153160    <Compile Include="UserPreferences.cs" />
    154     <None Include="app.config" />
    155161    <None Include="dsPatientApptDisplay2.xsc">
    156162      <DependentUpon>dsPatientApptDisplay2.xsd</DependentUpon>
     
    391397      <DependentUpon>DPatientLookup.cs</DependentUpon>
    392398      <SubType>Designer</SubType>
     399    </EmbeddedResource>
     400    <EmbeddedResource Include="DRadExamsSelect.resx">
     401      <DependentUpon>DRadExamsSelect.cs</DependentUpon>
    393402    </EmbeddedResource>
    394403    <EmbeddedResource Include="DResource.resx">
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/DAL.cs

    r1117 r1174  
    1 using System;
     1/* Licensed under LGPL */
     2
     3using System;
    24using System.Collections.Generic;
    35using System.Linq;
     
    187189
    188190        /// <summary>
     191        /// Gets All radiology exams for a Patient in a specific hospital location
     192        /// </summary>
     193        /// <param name="DFN"></param>
     194        /// <param name="SCIEN">Hospital Location IEN</param>
     195        /// <returns>Generic List of type RadiologyExam</returns>
     196        public List<RadiologyExam> GetRadiologyExamsForPatientinHL(int DFN, int SCIEN)
     197        {
     198            string cmd = string.Format("BSDX GET RAD EXAM FOR PT^{0}^{1}", DFN, SCIEN);
     199            DataTable tbl = RPMSDataTable(cmd, "");
     200            return (from row in tbl.AsEnumerable()
     201                    select new RadiologyExam
     202                    {
     203                        IEN = row.Field<int>("BMXIEN"),
     204                        Status = row.Field<string>("STATUS"),
     205                        Procedure = row.Field<string>("PROCEDURE"),
     206                        RequestDate = row.Field<DateTime>("REQUEST_DATE")
     207                    }).ToList();
     208        }
     209
     210        /// <summary>
     211        /// Schedules a Single Radiology Exam for a patient
     212        /// </summary>
     213        /// <param name="DFN"></param>
     214        /// <param name="examIEN">IEN of exam in 75.1 (RAD/NUC MED ORDERS) file</param>
     215        /// <param name="dStart">Start DateTime of appointment</param>
     216        /// <returns>should always return true</returns>
     217        public bool ScheduleRadiologyExam(int DFN, int examIEN, DateTime dStart)
     218        {
     219            string fmStartDate = FMDateTime.Create(dStart).FMDateString;
     220            string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate));
     221            return result == "1" ? true : false;
     222        }
     223
     224        /// <summary>
     225        /// Put the radiology exam on Hold because the appointment has been cancelled for it
     226        /// </summary>
     227        /// <param name="DFN"></param>
     228        /// <param name="examIEN">IEN of exam in 75.1 (RAD/NUC MED ORDERS) file</param>
     229        /// <returns>should always return true</returns>
     230        public bool CancelRadiologyExam(int DFN, int examIEN)
     231        {
     232            string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN));
     233            return result == "1" ? true : false;
     234        }
     235
     236        /// <summary>
    189237        /// Save User Preference in DB For Printing Routing Slip
    190238        /// Uses Parameter BSDX AUTO PRINT RS
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/FMDateTime.cs

    r850 r1174  
    1717 *
    1818
    19  Mods by Sam Habiel to use in Scheduling GUI.
     19 Modified by Sam Habiel to use in Scheduling GUI. Modified class licensed under LGPL.
    2020 */
    2121
     
    250250                }
    251251
     252        /*public static string FMDate (this DateTime d)
     253        {
     254            return Create(d, FMDateTimePrecision.DateAndTime).FMDateString;
     255        }*/
     256
     257
    252258                public static FMDateTime Parse (string str)
    253259                {
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/Patient.cs

    r1112 r1174  
    1818    /// Puppet standing for a Real Patient
    1919    /// </summary>
     20    [Serializable]
    2021    public class Patient
    2122    {
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/Provider.cs

    r1111 r1174  
    99    /// Provider puppet
    1010    /// </summary>
     11    [Serializable]
    1112    public class Provider
    1213    {
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/UserPreferences.cs

    r1117 r1174  
    1 using System;
     1/*Licensed under LGPL*/
     2
     3using System;
    24using System.Collections.Generic;
    35using System.Linq;
Note: See TracChangeset for help on using the changeset viewer.