Changeset 1124 for Scheduling/trunk/cs/bsdx0200GUISourceCode
- Timestamp:
- Mar 30, 2011, 4:19:15 AM (14 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r1123 r1124 337 337 try 338 338 { 339 //Create new Document340 339 this.SelectedDate = dDate.Date; 341 340 … … 361 360 //If this document already has a view, the use it 362 361 //SAM: Why do this again??? 362 //SAM: I think it's not needed; b/c 363 363 Hashtable h = CGDocumentManager.Current.Views; 364 364 CGDocument d; … … 952 952 public int CreateAppointment(CGAppointment rApptInfo, bool bWalkin) 953 953 { 954 string sStart; 955 string sEnd; 956 string sPatID; 957 string sResource; 958 string sNote; 959 string sLen; 954 // i18n code -- Use culture neutral FMDates 955 string sStart = FMDateTime.Create(rApptInfo.StartTime).FMDateString; 956 string sEnd = FMDateTime.Create(rApptInfo.EndTime).FMDateString; 957 958 TimeSpan sp = rApptInfo.EndTime - rApptInfo.StartTime; 959 string sLen = sp.TotalMinutes.ToString(); 960 string sPatID = rApptInfo.PatientID.ToString(); 961 string sNote = rApptInfo.Note; 962 string sResource = rApptInfo.Resource; 963 960 964 string sApptID; 961 965 962 //sStart = rApptInfo.StartTime.ToString("M-d-yyyy@HH:mm");963 //sEnd = rApptInfo.EndTime.ToString("M-d-yyyy@HH:mm");964 965 // i18n code -- Use culture neutral FMDates966 sStart = FMDateTime.Create(rApptInfo.StartTime).FMDateString;967 sEnd = FMDateTime.Create(rApptInfo.EndTime).FMDateString;968 969 TimeSpan sp = rApptInfo.EndTime - rApptInfo.StartTime;970 sLen = sp.TotalMinutes.ToString();971 sPatID = rApptInfo.PatientID.ToString();972 sNote = rApptInfo.Note;973 sResource = rApptInfo.Resource;974 966 if (bWalkin == true) 975 967 { … … 980 972 sApptID = rApptInfo.AccessTypeID.ToString(); 981 973 } 982 983 CGAppointment aCopy = new CGAppointment();984 aCopy.CreateAppointment(rApptInfo.StartTime, rApptInfo.EndTime, sNote, 0, sResource);985 aCopy.PatientID = rApptInfo.PatientID;986 aCopy.PatientName = rApptInfo.PatientName;987 aCopy.HealthRecordNumber = rApptInfo.HealthRecordNumber;988 aCopy.AccessTypeID = rApptInfo.AccessTypeID;989 aCopy.WalkIn = bWalkin ? true : false;990 974 991 975 string sSql = "BSDX ADD NEW APPOINTMENT^" + sStart + "^" + sEnd + "^" + sPatID + "^" + sResource + "^" + sLen + "^" + sNote + "^" + sApptID; 992 976 System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "NewAppointment"); 993 int nApptID;994 977 995 978 Debug.Assert(dtAppt.Rows.Count == 1); 996 979 DataRow r = dtAppt.Rows[0]; 997 nApptID = Convert.ToInt32(r["APPOINTMENTID"]);980 int nApptID = Convert.ToInt32(r["APPOINTMENTID"]); 998 981 string sErrorID; 999 982 sErrorID = r["ERRORID"].ToString(); … … 1002 985 throw new Exception(sErrorID); 1003 986 } 1004 aCopy.AppointmentKey = nApptID; 1005 this.m_appointments.AddAppointment(aCopy); 1006 1007 //TODO: Improve 1008 //Yucky hack for now... haven't investigated why we need to create a new CGAppointment beyond 1009 //the one that we pass. 987 988 //next line is probably done elsewhere 989 rApptInfo.WalkIn = bWalkin ? true : false; 1010 990 rApptInfo.AppointmentKey = nApptID; 991 992 this.m_appointments.AddAppointment(rApptInfo); 1011 993 1012 994 //Have make appointment from CGView responsible for requesting an update for the avialability. -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
r1118 r1124 228 228 this.ctxPrintScheduleT0 = new System.Windows.Forms.MenuItem(); 229 229 this.ctxPrintScheduleT1 = new System.Windows.Forms.MenuItem(); 230 this.ctxPrintScheduleT3 = new System.Windows.Forms.MenuItem(); 230 231 this.panelRight = new System.Windows.Forms.Panel(); 231 232 this.panelClip = new System.Windows.Forms.Panel(); … … 239 240 this.lblResource = new System.Windows.Forms.Label(); 240 241 this.panelCenter = new System.Windows.Forms.Panel(); 241 this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();242 242 this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu(); 243 243 this.ctxCalGridAdd = new System.Windows.Forms.MenuItem(); … … 257 257 this.splitter1 = new System.Windows.Forms.Splitter(); 258 258 this.splitter2 = new System.Windows.Forms.Splitter(); 259 this.c txPrintScheduleT3 = new System.Windows.Forms.MenuItem();259 this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid(); 260 260 this.panelRight.SuspendLayout(); 261 261 this.panelClip.SuspendLayout(); … … 476 476 // 477 477 this.mnuFindAppt.Index = 9; 478 this.mnuFindAppt.Shortcut = System.Windows.Forms.Shortcut.CtrlF; 478 479 this.mnuFindAppt.Text = "&Find Available Appointment"; 479 480 this.mnuFindAppt.Click += new System.EventHandler(this.mnuFindAppt_Click); … … 550 551 // mnu10Minute 551 552 // 553 this.mnu10Minute.Enabled = false; 552 554 this.mnu10Minute.Index = 0; 553 555 this.mnu10Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl0; … … 557 559 // mnu15Minute 558 560 // 561 this.mnu15Minute.Enabled = false; 559 562 this.mnu15Minute.Index = 1; 560 563 this.mnu15Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl4; … … 564 567 // mnu20Minute 565 568 // 569 this.mnu20Minute.Enabled = false; 566 570 this.mnu20Minute.Index = 2; 567 571 this.mnu20Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl3; … … 571 575 // mnu30Minute 572 576 // 577 this.mnu30Minute.Enabled = false; 573 578 this.mnu30Minute.Index = 3; 574 579 this.mnu30Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl2; … … 624 629 this.tvSchedules.Location = new System.Drawing.Point(0, 0); 625 630 this.tvSchedules.Name = "tvSchedules"; 626 this.tvSchedules.Size = new System.Drawing.Size(128, 351);631 this.tvSchedules.Size = new System.Drawing.Size(128, 204); 627 632 this.tvSchedules.Sorted = true; 628 633 this.tvSchedules.TabIndex = 1; … … 681 686 this.ctxPrintScheduleT1.Click += new System.EventHandler(this.ctxPrintScheduleT1_Click); 682 687 // 688 // ctxPrintScheduleT3 689 // 690 this.ctxPrintScheduleT3.Index = 6; 691 this.ctxPrintScheduleT3.Text = "Print Clinic Schedule(s) (T+&3)"; 692 this.ctxPrintScheduleT3.Click += new System.EventHandler(this.ctxPrintScheduleT3_Click); 693 // 683 694 // panelRight 684 695 // … … 687 698 this.panelRight.Location = new System.Drawing.Point(996, 0); 688 699 this.panelRight.Name = "panelRight"; 689 this.panelRight.Size = new System.Drawing.Size(128, 351);700 this.panelRight.Size = new System.Drawing.Size(128, 204); 690 701 this.panelRight.TabIndex = 3; 691 702 this.panelRight.Visible = false; … … 783 794 this.panelCenter.Location = new System.Drawing.Point(136, 24); 784 795 this.panelCenter.Name = "panelCenter"; 785 this.panelCenter.Size = new System.Drawing.Size(857, 303);796 this.panelCenter.Size = new System.Drawing.Size(857, 156); 786 797 this.panelCenter.TabIndex = 7; 798 // 799 // ctxCalendarGrid 800 // 801 this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 802 this.ctxCalGridAdd, 803 this.ctxCalGridEdit, 804 this.ctxCalGridDelete, 805 this.ctxCalGridCheckIn, 806 this.ctxCalGridUndoCheckin, 807 this.menuItem2, 808 this.ctxCalGridNoShow, 809 this.ctxCalGridNoShowUndo, 810 this.menuItem9, 811 this.ctxCalGridWalkin, 812 this.menuItem10, 813 this.ctxCalGridReprintApptSlip}); 814 this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup); 815 // 816 // ctxCalGridAdd 817 // 818 this.ctxCalGridAdd.Index = 0; 819 this.ctxCalGridAdd.Text = "Add Appointment"; 820 this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click); 821 // 822 // ctxCalGridEdit 823 // 824 this.ctxCalGridEdit.Index = 1; 825 this.ctxCalGridEdit.Text = "Edit Appointment"; 826 this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click); 827 // 828 // ctxCalGridDelete 829 // 830 this.ctxCalGridDelete.Index = 2; 831 this.ctxCalGridDelete.Text = "Cancel Appointment"; 832 this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click); 833 // 834 // ctxCalGridCheckIn 835 // 836 this.ctxCalGridCheckIn.Index = 3; 837 this.ctxCalGridCheckIn.Text = "Check In Patient"; 838 this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click); 839 // 840 // ctxCalGridUndoCheckin 841 // 842 this.ctxCalGridUndoCheckin.Index = 4; 843 this.ctxCalGridUndoCheckin.Text = "&Undo Check In"; 844 this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click); 845 // 846 // menuItem2 847 // 848 this.menuItem2.Index = 5; 849 this.menuItem2.Text = "-"; 850 // 851 // ctxCalGridNoShow 852 // 853 this.ctxCalGridNoShow.Index = 6; 854 this.ctxCalGridNoShow.Text = "Mark as No Show"; 855 this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click); 856 // 857 // ctxCalGridNoShowUndo 858 // 859 this.ctxCalGridNoShowUndo.Index = 7; 860 this.ctxCalGridNoShowUndo.Text = "Undo NoShow"; 861 this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click); 862 // 863 // menuItem9 864 // 865 this.menuItem9.Index = 8; 866 this.menuItem9.Text = "-"; 867 // 868 // ctxCalGridWalkin 869 // 870 this.ctxCalGridWalkin.Index = 9; 871 this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment"; 872 this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click); 873 // 874 // menuItem10 875 // 876 this.menuItem10.Index = 10; 877 this.menuItem10.Text = "-"; 878 // 879 // ctxCalGridReprintApptSlip 880 // 881 this.ctxCalGridReprintApptSlip.Index = 11; 882 this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip"; 883 this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click); 884 // 885 // panelBottom 886 // 887 this.panelBottom.Controls.Add(this.statusBar1); 888 this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom; 889 this.panelBottom.Location = new System.Drawing.Point(136, 180); 890 this.panelBottom.Name = "panelBottom"; 891 this.panelBottom.Size = new System.Drawing.Size(857, 24); 892 this.panelBottom.TabIndex = 8; 893 // 894 // statusBar1 895 // 896 this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill; 897 this.statusBar1.Location = new System.Drawing.Point(0, 0); 898 this.statusBar1.Name = "statusBar1"; 899 this.statusBar1.Size = new System.Drawing.Size(857, 24); 900 this.statusBar1.SizingGrip = false; 901 this.statusBar1.TabIndex = 0; 902 // 903 // splitter1 904 // 905 this.splitter1.Location = new System.Drawing.Point(128, 24); 906 this.splitter1.Name = "splitter1"; 907 this.splitter1.Size = new System.Drawing.Size(8, 180); 908 this.splitter1.TabIndex = 9; 909 this.splitter1.TabStop = false; 910 // 911 // splitter2 912 // 913 this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; 914 this.splitter2.Location = new System.Drawing.Point(993, 24); 915 this.splitter2.Name = "splitter2"; 916 this.splitter2.Size = new System.Drawing.Size(3, 180); 917 this.splitter2.TabIndex = 10; 918 this.splitter2.TabStop = false; 787 919 // 788 920 // calendarGrid1 … … 805 937 this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources"))); 806 938 this.calendarGrid1.SelectedAppointment = 0; 807 this.calendarGrid1.Size = new System.Drawing.Size(857, 303);939 this.calendarGrid1.Size = new System.Drawing.Size(857, 156); 808 940 this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0); 809 941 this.calendarGrid1.TabIndex = 0; … … 815 947 this.calendarGrid1.MouseEnter += new System.EventHandler(this.calendarGrid1_MouseEnter); 816 948 // 817 // ctxCalendarGrid818 //819 this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {820 this.ctxCalGridAdd,821 this.ctxCalGridEdit,822 this.ctxCalGridDelete,823 this.ctxCalGridCheckIn,824 this.ctxCalGridUndoCheckin,825 this.menuItem2,826 this.ctxCalGridNoShow,827 this.ctxCalGridNoShowUndo,828 this.menuItem9,829 this.ctxCalGridWalkin,830 this.menuItem10,831 this.ctxCalGridReprintApptSlip});832 this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);833 //834 // ctxCalGridAdd835 //836 this.ctxCalGridAdd.Index = 0;837 this.ctxCalGridAdd.Text = "Add Appointment";838 this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);839 //840 // ctxCalGridEdit841 //842 this.ctxCalGridEdit.Index = 1;843 this.ctxCalGridEdit.Text = "Edit Appointment";844 this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);845 //846 // ctxCalGridDelete847 //848 this.ctxCalGridDelete.Index = 2;849 this.ctxCalGridDelete.Text = "Cancel Appointment";850 this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);851 //852 // ctxCalGridCheckIn853 //854 this.ctxCalGridCheckIn.Index = 3;855 this.ctxCalGridCheckIn.Text = "Check In Patient";856 this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);857 //858 // ctxCalGridUndoCheckin859 //860 this.ctxCalGridUndoCheckin.Index = 4;861 this.ctxCalGridUndoCheckin.Text = "&Undo Check In";862 this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);863 //864 // menuItem2865 //866 this.menuItem2.Index = 5;867 this.menuItem2.Text = "-";868 //869 // ctxCalGridNoShow870 //871 this.ctxCalGridNoShow.Index = 6;872 this.ctxCalGridNoShow.Text = "Mark as No Show";873 this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);874 //875 // ctxCalGridNoShowUndo876 //877 this.ctxCalGridNoShowUndo.Index = 7;878 this.ctxCalGridNoShowUndo.Text = "Undo NoShow";879 this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);880 //881 // menuItem9882 //883 this.menuItem9.Index = 8;884 this.menuItem9.Text = "-";885 //886 // ctxCalGridWalkin887 //888 this.ctxCalGridWalkin.Index = 9;889 this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";890 this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);891 //892 // menuItem10893 //894 this.menuItem10.Index = 10;895 this.menuItem10.Text = "-";896 //897 // ctxCalGridReprintApptSlip898 //899 this.ctxCalGridReprintApptSlip.Index = 11;900 this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";901 this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);902 //903 // panelBottom904 //905 this.panelBottom.Controls.Add(this.statusBar1);906 this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;907 this.panelBottom.Location = new System.Drawing.Point(136, 327);908 this.panelBottom.Name = "panelBottom";909 this.panelBottom.Size = new System.Drawing.Size(857, 24);910 this.panelBottom.TabIndex = 8;911 //912 // statusBar1913 //914 this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;915 this.statusBar1.Location = new System.Drawing.Point(0, 0);916 this.statusBar1.Name = "statusBar1";917 this.statusBar1.Size = new System.Drawing.Size(857, 24);918 this.statusBar1.SizingGrip = false;919 this.statusBar1.TabIndex = 0;920 //921 // splitter1922 //923 this.splitter1.Location = new System.Drawing.Point(128, 24);924 this.splitter1.Name = "splitter1";925 this.splitter1.Size = new System.Drawing.Size(8, 327);926 this.splitter1.TabIndex = 9;927 this.splitter1.TabStop = false;928 //929 // splitter2930 //931 this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;932 this.splitter2.Location = new System.Drawing.Point(993, 24);933 this.splitter2.Name = "splitter2";934 this.splitter2.Size = new System.Drawing.Size(3, 327);935 this.splitter2.TabIndex = 10;936 this.splitter2.TabStop = false;937 //938 // ctxPrintScheduleT3939 //940 this.ctxPrintScheduleT3.Index = 6;941 this.ctxPrintScheduleT3.Text = "Print Clinic Schedule(s) (T+&3)";942 this.ctxPrintScheduleT3.Click += new System.EventHandler(this.ctxPrintScheduleT3_Click);943 //944 949 // CGView 945 950 // 946 951 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 947 this.ClientSize = new System.Drawing.Size(1124, 351);952 this.ClientSize = new System.Drawing.Size(1124, 204); 948 953 this.Controls.Add(this.panelCenter); 949 954 this.Controls.Add(this.panelBottom); … … 1547 1552 { 1548 1553 //If resource already open, then navigate to its window 1549 CGView v = this.DocManager.GetViewByResource(sSelectedTreeResourceArray);1554 CGView v = this.DocManager.GetViewByResource(sSelectedTreeResourceArray); 1550 1555 if (v != null) 1551 1556 { … … 1585 1590 try 1586 1591 { 1587 doc.OnOpenDocument(dDate); 1592 doc.OnOpenDocument(dDate); //this typically creates a new view 1588 1593 } 1589 1594 … … 1595 1600 } 1596 1601 1597 //We are doing this--Again? 1602 //We are doing this--again--to fetch the view we just opened in OnOpenDocument 1603 //XXX: Yes, I know, this totally sucks. But I don't fully grasp the whole thing yet to refactor it. 1598 1604 v =this.DocManager.GetViewByResource(sSelectedTreeResourceArray); 1599 1605 … … 1633 1639 1634 1640 cg.PositionGrid(7); 1641 1642 //new code for v 1.5 //smh 1643 //Disable entries that would make time scale smaller b/c users should not be able to 1644 //make appointments for smaller time scales 1645 if (nScale >= 10) 1646 { 1647 v.mnu10Minute.Enabled = true; 1648 v.mnu15Minute.Enabled = true; 1649 v.mnu20Minute.Enabled = true; 1650 v.mnu30Minute.Enabled = true; 1651 } 1652 if (nScale >= 15) 1653 { 1654 v.mnu10Minute.Enabled = false; 1655 v.mnu15Minute.Enabled = true; 1656 v.mnu20Minute.Enabled = true; 1657 v.mnu30Minute.Enabled = true; 1658 } 1659 if (nScale >= 20) 1660 { 1661 v.mnu10Minute.Enabled = false; 1662 v.mnu15Minute.Enabled = false; 1663 v.mnu20Minute.Enabled = true; 1664 v.mnu30Minute.Enabled = true; 1665 } 1666 if (nScale >= 30) 1667 { 1668 v.mnu10Minute.Enabled = false; 1669 v.mnu15Minute.Enabled = false; 1670 v.mnu20Minute.Enabled = false; 1671 v.mnu30Minute.Enabled = true; 1672 } 1673 if (nScale >= 60) 1674 { 1675 v.mnu10Minute.Enabled = false; 1676 v.mnu15Minute.Enabled = false; 1677 v.mnu20Minute.Enabled = false; 1678 v.mnu30Minute.Enabled = false; 1679 } 1680 //end new code 1635 1681 1636 1682 //Get the OverBook and ModifySchedule permissions from ResourceUser table -
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user
r1123 r1124 37 37 </RemoteDebugMachine> 38 38 <StartAction>Project</StartAction> 39 <StartArguments>/s=172.16.16.108 /p=9250 /a= BASMA.ALDWAIRI /v=SELEN.123/culture=ar-JO</StartArguments>39 <StartArguments>/s=172.16.16.108 /p=9250 /a=s.habiel /v=catdog.66 /culture=ar-JO</StartArguments> 40 40 <StartPage> 41 41 </StartPage> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DCheckIn.cs
r1117 r1124 48 48 private string m_sPatientName; 49 49 private DateTime m_dCheckIn; 50 private string m_sProvider;51 50 private string m_sProviderIEN; 52 51 private CGDocumentManager m_DocManager; 53 52 private DataSet m_dsGlobal; 54 53 private DataTable m_dtProvider; 55 private DataView m_dvCS;56 private bool m_bProviderRequired;57 private DataTable m_dtClinic;58 private DataTable m_dtForm;59 private DataView m_dvClinic;60 private DataView m_dvForm;61 54 public bool m_bPrintRouteSlip; 62 55 private List<Provider> _providers; -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DResource.cs
r899 r1124 532 532 private CGResource m_pResource; 533 533 private DataView m_dvHospLoc; 534 private DataView m_dvClinicParams;535 534 536 535 #endregion Fields
Note:
See TracChangeset
for help on using the changeset viewer.