WINDOWS MOBILE APPLICATION FOR INTERNET INTERPRETER SCHEDULING SYSTEM Vinod Swargam B.Tech., Acharya Nagarjuna University, India, 2005 PROJECT Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in COMPUTER SCIENCE at CALIFORNIA STATE UNIVERSITY, SACRAMENTO FALL 2011 WINDOWS MOBILE APPLICATION FOR INTERNET INTERPRETER SCHEDULING SYSTEM A Project by Vinod Swargam Approved by: __________________________________, Committee Chair Dr. Jinsong Ouyang __________________________________, Second Reader Dr. Ying Jin ____________________________ Date ii Student: Vinod Swargam I certify that this student has met the requirements for format contained in the University format manual, and that this project is suitable for shelving in the Library and credit is to be awarded for the Project. __________________________, Graduate Coordinator Dr. Nik Faroughi Department of Computer Science Engineering iii ________________ Date Abstract of WINDOWS MOBILE APPLICATION FOR INTERNET INTERPRETER SCHEDULING SYSTEM by Vinod Swargam The purpose of this Project is to develop and implement the enhanced features of Internet Interpreter Scheduling System as mobile application in healthcare domain and made it synchronize with the existing web application as well. This project includes the development of mobile application in Asp.Net and maintaining a global database for both web and mobile application by accessing through the I2S2 web services. I2S2 mobile application is proposed to run efficiently on HTC windows mobile phone. Existing Internet Interpreter Scheduling System has three types of users. They are Agency Platform, Requester/Provider Platform and Interpreter Platform Users. Interpreters are going to get appointments scheduled by agency and requesters into the schedule folder of the mobile application by connecting to web services based on day, week and month calendar format. Uncovered appointments can be placed into public folder of Interpreters. Therefore, even interpreters can view the appointments in “View Available Appointments” folder and accept the appointments based on their availability. Agency will keep some of the interpreter appointments into the Interpreter folder of the iv Interpreter.Intended Interpreter can accept or reject appointments in interpreter folder based on their availability. After Time Finish Appointments authorized with signature and get synchronize with database. Appointments rejected by the interpreter will be scheduled by the agency to another interpreter. Modules like Schedule, My Folder, Available Appointments, View Details, Time Finish and Sync were implemented in the Internet Interpreter Scheduling System as per the customer requirements. Internet Interpreter Scheduling System application can be entered using Application Name, User Name, and Password as login credentials. System provides Password facility to ensure validity of user. Scheduling System mobile application can be login in both online or offline modes. If the interpreter is not having the proper internet connectivity or not in the network coverage area, he can login into the system in offline mode. Mobile application transfers data and appointment status to the SQL Server Enterprise database using web service after mobile gets internet connectivity. This project was developed using the technologies like Asp.Net, C#, Microsoft Windows Mobile API, Microsoft SQL Server 2008 as Database, XML and Web Services. _______________________, Committee Chair Dr. Jinsong Ouyang _______________________ Date v ACKNOWLEDGEMENTS I would like to thank Dr. Jinsong Ouyang, my project advisor for providing me a wonderful opportunity to work on this project, which provided a great exposure to the field of Mobile Application Development. I thank him for providing all the help, support and necessary resources to complete the project successfully. Dr. Ouyang helped me in understanding the project in detail and provided knowledge and expertise in the field to understand the project and completing it successfully. In addition, I would like to thank Dr. Ying Jin for her willingness to serve on the committee. I benefited very much from the professor’s course offerings and advice. I would like to thank my client for providing me all the requirements and support while working on this project and helped me to pass this critical phase of my graduation. Lastly, I would like to thank the entire faculty and staff of the Department of Computer Science Engineering at California State University, Sacramento. vi TABLE OF CONTENTS Page Acknowledgements ............................................................................................................ vi List of Figures .................................................................................................................... ix Chapter 1. INTRODUCTION ........................................................................................................ 1 Background ............................................................................................................. 1 Project Objectives ................................................................................................... 3 2. REQUIREMENTS ANALYSIS ................................................................................... 5 Product Perspective................................................................................................. 5 Product Features ..................................................................................................... 5 Operating Environment........................................................................................... 9 Assumptions and Dependencies ........................................................................... 10 Use Cases .............................................................................................................. 10 External Interfaces Requirements ......................................................................... 22 Non-functional Requirements ............................................................................... 22 Software Quality Attributes .................................................................................. 23 Developer Environment ........................................................................................ 23 3. SYSTEM DESIGN ..................................................................................................... 25 Building a Mobile Applications ............................................................................ 25 Mobile Application Architecture .......................................................................... 27 .NET Application Architecture ............................................................................. 30 vii High Level Design ................................................................................................ 32 4. DATABASE DESIGN................................................................................................ 34 About SQL Server 2008 ....................................................................................... 34 Database Tables and Database Diagram ............................................................... 34 Sample of Database Scripts .................................................................................. 38 5. IMPLEMENTATION DETAILS ............................................................................... 48 Development of Mobile Interface using ASP.NET .............................................. 48 Implementation of Web service using Map Quest................................................ 54 Implementation of Business Logic using C#.NET ............................................... 57 Implementation Details of Time Finish ................................................................ 67 6. RESULTS OF INTERNET INTERPRETER SCHEDULING SYSTEM ................. 79 7. CONCLUSION ......................................................................................................... 105 Appendix Hardware and Software Specifications ......................................................... 108 Bibliography ................................................................................................................... 109 viii LIST OF FIGURES Figure 1 Interpreter Authentication Screen shot ............................................................... 12 Figure 2 Schedule Use Case Diagram .............................................................................. 13 Figure 3 My Folder Use Case Diagram ............................................................................ 15 Figure 4 View Available Appointments Use Case Diagram ............................................ 16 Figure 5 Time Finish Use Case Diagram .......................................................................... 18 Figure 6 Distance and Time Calculation Use Case Diagram .......................................... 20 Figure 7 Sync Use Case Diagram ..................................................................................... 21 Figure 8 Development Environment Diagram .................................................................. 23 Figure 9 Internet Scheduling System Application Architecture ....................................... 30 Figure 10 Design of the Mobile Application ................................................................... 32 Figure 11 Design for User and Phone Related Tables ...................................................... 38 Figure 12 Cradle the POCKET PC Emulator in Device Manager Screenshot ................. 79 Figure 13 Initializing the Active Sync Screenshot ........................................................... 80 Figure 14 After Synchronization Screenshot .................................................................... 81 Figure 15 Folders of the Application Screenshot ............................................................. 82 Figure 16 Schedule with Appointments search ................................................................ 83 Figure 17 Schedule with Cannot Cover option selected ................................................... 83 Figure 18 Schedule with options Screen Shot .................................................................. 84 Figure 19 View Available Appointments with options Screenshot .................................. 85 Figure 20 View Details of the View Appointment details Screenshot ............................. 86 Figure 21 View Details of the View Appointments with Search Results Selected .......... 87 ix Figure 22 View Available Appointments Screen shot ...................................................... 88 Figure 23 View Available Appointments with “I will Take It” selection Screen shot ..... 89 Figure 24 View My Folder with Appointments Search Results ....................................... 90 Figure 25 View Details in the View My Folder ............................................................... 90 Figure 26 Time Finish Module with Appointment Screen shot ....................................... 91 Figure 27 Time Finish of Appointment with functions Screen shot ................................. 92 Figure 28 Time Finish Module with Requester tab Screen shot ....................................... 93 Figure 29 Time Finish Module with Time Finish tab Screen shot ................................... 94 Figure 30 Time Finish Module with Patient tab Screen shot............................................ 94 Figure 31 Time Finish Module with Time Finish Tab Screen shot .................................. 95 Figure 32 Time Finish Screen with save option Screen shot ............................................ 96 Figure 33 Time Finish Folder authorization tab Screen shot ............................................ 97 Figure 34 Time Finish Module Authorization Tab Screen shot ....................................... 97 Figure 35 Completing the Time Finish for Appointment Screenshot............................... 98 Figure 36 Sync Module Screen shot ................................................................................. 99 Figure 37 Sync Module with functions screen shot .......................................................... 99 Figure 38 Sync Appointments with remove option activated Screen shot ..................... 100 Figure 39 Synchronize the appointment with Sync option selected Screen Shot ........... 101 Figure 40 Distance Calculation Web Service using Map Quest Screen shot ................. 102 Figure 41 Calculation of Mileage by using Map Quest in Time Finish Screen shot ...... 104 x 1 Chapter 1 1. INTRODUCTION This chapter introduces the project outlines the background to the problem, identifies the problem owner, and gives an outline of the project objectives. Background Internet Interpreter Scheduling System provides a single point of online entry for requesters of interpreting services, freelance professional interpreters and agencies. The Web system is currently in use in major medical systems. Internet Interpreter Scheduling System called as I2S2 in short form. Internet Interpreter Scheduling System has three platform Users: Agency Platform Requester/Provider Platform Interpreter Platform Agency Platform: Individual agencies of Interpreters will be the users for this platform. Agency has the pool of interpreters associated with it. These Agencies will have contract with different clinics or agencies to provide the Interpreters. Hospital management requests an Interpreter for the appointment through the requester platform or by calling the Agency. Agency staff will take the appointment through Appointment Intake Screen and schedule an Interpreter to the appointment depending on the availability of the Interpreter. 2 Requester/Provider Platform: Requesters or Providers are the users from the Hospitals. Requesters or Providers could be the head of the Interpreting department in the hospital or specific department head or supervisor of the Hospital. Requester or Provider will have the individual login credentials to login into the Internet Interpreter Scheduling System from the Requester Platform. Requesters can request for an Appointment through entering the details in Appointment Intake Screen from the Requester platform. Depending on the role, privileges will differ for the users of requester platform. Requester will have the choice to pick an interpreter of patient preference or specify gender depends on type of the appointment. There are two types of requesters present in the existing system. Interpreter Admin User Clerk User Interpreter Admin User will have more privileges than Clerk User. Interpreter Platform: Interpreters can login into the I2S2 interpreter platform on Web. Interpreter will do time finish of the appointments on daily or weekly basis and upload the signed paper vouchers into the system as part Invoicing. In addition, Interpreters will submit the Approximate Mileage and Travel Time for each appointment in reimbursement form to the Agency. 3 Windows Mobile application is aimed towards these interpreters to deliver the work more efficiently and fast processing. Through this application time will be reduced for processing invoice of the customer and interpreter from the Agency Side. There is different type of interpreters. - Staff - Volunteer - Independent Contractor - Intern Interpreters Staff Interpreters are the In-house interpreters. These people are the full time employees of the Agency. Volunteer interpreters are the people who will work as part of learning. Independent contractor can be a single person or group of the interpreters from another agency. Intern Interpreters are students work as part of internship program. Project Objectives Mobile version of the Internet Interpreter Scheduling System with the primary goals as follows: Fast Processing: Interpreters can get authorization from the hospital faculty by time finishing the appointment immediately after completing the appointment. Mileage and Travel time could be calculated immediately with the submission of the appointment in Time finish module. 4 Improve client communications and work product delivery: The firm requires the capability to better communicate with customers, provide immediate information on appointment and Interpreter status with quicker turn around on work product. Hence, this project aims at providing an efficient mobile-based solution that ensures better communication and quick access to appointment related information for Interpreter. Ease of use: The system should be easy to use and flow with the information and existing procedures of the organization. Flexible System: The organization should be able to use the system effectively because it works on the same kind of interface as web based system. Structure of the folders and functionality looks similar to the Web application. Training: Training is essential to any new implementation. The users with limited training can understand the functionality of mobile version of Internet Interpreter Scheduling System. Organization need not spend much time for training the resources. 5 Chapter 2 2. REQUIREMENTS ANALYSIS Product Perspective This project is targeted towards Interpreters who will use this product for their daily activities, so need software assistance for efficient scheduling and time finishing appointments. This project is intended to be a stand-alone product and should not depend on the availability of other software. It should run on Windows based Mobile OS. Product Features This project provides various functionalities including Scheduling, My Folder, View Available Appointments, Time Finish and Sync modules. Schedule: Appointments scheduled for interpreter by Agency or Requesters will be displayed in this Schedule folder. Interpreter will have the option to accept the appointment by “I will take it” or reject the appointment by “Cannot cover” option. If the Interpreter clicks on “Cannot Cover” option then appointment will go to the Agency unassigned appointments (Public Pool). If any appointment rejected by any of the interpreter, agency will reschedule it to a different interpreter depending on the availability of Interpreter. If the Interpreter wants to cancel the appointment in the last minute, they need to call the agency to get confirmation before requesting “Cannot Cover”. 6 My Folder: My Folder will have the appointments assigned to the Interpreter. Appointments in this folder are not accepted by the interpreter. This is called as the private pool or interpreter Folder. If the agency is not aware whether the interpreter will be available for the appointment then they will place the appointment in this folder. Interpreter will be able to view the details of the appointment and accept or reject it based on the availability and willingness. The process of transferring the appointments to interpreter folder will be mostly by the agency from the I2S2 Web application. If the Interpreter accepts the Appointment, it will disappear from the My Folder and shown in the Schedule folder of the Mobile Application. If the Interpreter rejects the appointment then it will go back to the Agency pool or Public Pool. View Available Appointments: Appointments moved to this pool by the agency. Interpreters can see the unassigned appointments in this folder. This folder contains only those appointments pertaining to the language that interpreter speaks. Interpreter can view the details of the appointment by using option “View Details”. View Details will include Requester, Appointment and Patient Information. In addition, it will show the Appointment start and end times. 7 If the interpreter is available for the appointment, he can assign himself as the assignee to that particular appointment. Notification sent to the Agency, Requester and Interpreter. Interpreter will have the option to reject the appointment in the schedule folder after accepting from View Scheduled Appointments folder. Time Finish: Time Finish is the important module of the application. This includes the time finishing the appointment by the interpreter immediately after completing the appointment. Time Finish includes four tabs namely Requester, Patient, Time Finish details and Authorization in the last tab. Requester details include Clinic/Venue, Provider Name and Department. Patient Details include Patient Medical Reference Number, Last Name and First Name. Time Finish will contain Appointment Number, Start Date / Time, End Date / Time, Confirmer Name and Confirmer Phone. Interpreter can enter appointment end time and supervisor/faculty from the hospital need to enter their name and phone number for reference to time finish of scheduled appointment. The authorization tab of the Time Finish will contain Authorization Code and Signature for Authorization. Interpreter save the appointment and Time finish then it will move to the Sync Folder. Interpreter can change the start of the appointment in case of any change in the appointment start time due to doctor no show, patient no show or any other reason. 8 Sync: This is the main operation where it will synchronize the appointments from the mobile application to the global database through web services. Interpreter has to remove the Cancelled appointments from the Sync folder by using the Remove function. Only checked appointments get synchronize with database. Removed appointments will not be get synchronize with database. When we synchronize the Appointments time finish details get updated in the I2S2 system. Voucher is automated with the Appointment details and uploaded as voucher into the system. Integration to the Map Quest: The integration of Interpreter Scheduling System with the Map Quest Services is implemented using Map Quest SDK in web service. It calculates the mileage for the interpreter from the Source to the destination. Address of the Source and destination points taken into consideration from the configuration settings of customer and Interpreter. Two types of mileage calculation settings available for I2S2. Customers can configure the settings from their side. Mileage calculates the distance from the source to the destination and travel time calculates time to travel the same distance. Mileage calculation options are: 1. Round Trip 9 2. Point to Point Round Trip mileage includes the distance from the Source to the destination and again destination to the source point. Point-to-point mileage includes only mileage from the Source to the destination. If the interpreter having more than one appointment, it will calculates the mileage between the venues but not the round trip. Agency will generate invoice for the Customer and interpreter based on the Mileage and Travel Time calculated by this web service. View Details: View Details is the feature available in all the folders in the application. View Details will show all the requester, appointment and patient details. It will help the Interpreter to choose the appointment from the available appointments and Interpreter Folder. Interpreter will choose appointment depending on the availability and willingness. Operating Environment Since Application implemented in Microsoft ASP.NET technology, the software will hosted on ASP.NET-compatible Platform. The system also requires SQL database and web services configured on Web and Database production servers. The system must be completely compatible with any browser that fully supports Microsoft ASP.NET technology. 10 The users of the software will be expected to have a fast internet connection, 3G or good Wi-Fi connection to work efficiently. Mobile Application works only on Windows Smart Phone. Assumptions and Dependencies 1. It is assumed that the system will be developed using the ASP.NET technology. 2. It is assumed that the system will be able to interact with web services and Map QUEST SDK to calculate the Mileage and Travel Time. 3. It is assumed that the system will interface with a SQL Server 2008 database. 4. Mobiles used by the users should support Windows Platform OS. Functional Requirements The functional requirements of this project are described using use cases. Use Cases Use case is a graphical overview of the functionality provided by a system in terms of actors, their goals and any dependencies between those use cases. Use case modeling is a technique used to describe what the new software being developed should do or what the already available software does. It is used in the Analysis phase of software development to express clearly the high-level requirements of the software. Actor: An actor is user of the system. An actor is someone or something, which interacts with the system. 11 Use Case: The functionality provided by the system is represented as a use case. It is typically described in verb form. UC: Authentication of the Interpreter Preconditions: The following preconditions must be true before the initiation of the use case. 1. User has logged into the Internet. 2. System has validated user credentials entered in the Login Page. Basic Flow: The following steps represent the basic flow of events occurring from the Main Menu also shown in Figure 1 below. 1. Interpreter should download the mobile application on windows mobile phone. 2. System determines User's role from login. 3. System displays the Modules after successful authentication of the Interpreter. 4. System loads the appointments related to the folders based on the login. 12 Figure 1 Interpreter Authentication Screen shot Post Conditions The following post conditions must be true after the completion of the use case. 1. User has logged into the application. 2. User is able to view/select various folders of the application. UC: Schedule Preconditions The following preconditions must be true before the initiation of the use case. 1. User has logged into the Internet Scheduling System. 13 2. System has validated user credentials entered in the Login Page. Basic Flow The following steps represent the basic flow of events in Schedule Folder also shown in Figure 2 below. 1. User will navigate the Main Menu 2. User selects the Schedule from the Main Menu 3. User selects the required date by clicking on the calendar drop down or can directly view the appointments in day, week and monthly format. 4. User will select the “I will Take it” to accept the appointment 5. User will select the “Cannot Cover” to reject the appointment. 6. Similarly, user can select “View Details” to view the requester, patient and appointment details. Figure 2 Schedule Use Case Diagram 14 Post Conditions The following post conditions must be true after the completion of the use case. 1. User can also see the appointment in the Time Finish Folder after accepting the appointment on day of the appointment. 2. User can choose to go back to the main menu by clicking on “Main Menu” link. UC: My Folder Preconditions The following preconditions must be true before the initiation of the use case. 1. User has logged into the Internet. 2. System has validated user credentials entered in the Login Page. Basic Flow The following steps represent the basic flow of events in My Folder Screen also shown in Figure 3 below. 1. User will navigate the Main Menu 2. User selects the My Folder from the Main Menu 3. User selects the required date by clicking on date drop down or user can view the appointments in day, week and monthly format. 4. User will select the “I will Take it” to accept the appointment 5. User will select the “Cannot Cover” to reject the appointment. 6. Similarly, user can select “View Details” to view the requester, patient and 15 Appointment details. Figure 3 My Folder Use Case Diagram Post Conditions The following post conditions must be true after the completion of the use case. 1. User can see the appointments in Schedule Folder after accepting the appointments. 2. User can see the appointments in Public Folder after rejecting the appointments. 3. User can choose to go back to the Main Menu by clicking on “Main Menu” link UC: View Available Appointments Preconditions The following preconditions must be true before the initiation of the use case. 16 1. User has logged into the Internet Interpreter Scheduling System. 2. System has validated user credentials entered in the Login Page. Basic Flow The following steps represent the basic flow of events in View Available Appointments screen also shown in Figure 4 below. 1. User will navigate the Main Menu 2. User selects the View Available Appointments from the Main Menu 3. User selects the required date by clicking on the date drop down or user can view the appointments in day, week and monthly format. 4. User will select the “I will Take it” to accept the appointment 5. User will select the “Cannot Cover” to reject the appointment. 6. Similarly, user can select “View Details” to view the requester, patient and Appointment details. Figure 4 View Available Appointments Use Case Diagram 17 Post Conditions: The following post conditions must be true after the completion of the use case. 1. User can see the appointments in Schedule folder after accepting the appointments. 2. User can choose to go back to the home page by clicking on “Main Menu” link. UC: Time Finish Preconditions The following preconditions must be true before the initiation of the use case. 1. User has logged into the Internet Interpreter Scheduling System. 2. System has validated user credentials entered in the Login Page. Basic Flow The following steps represent the basic flow of events in Time Finish module also shown in Figure 5 below. 1. User will navigate the Main Menu 2. User selects the Time Finish from the Main Menu 3. User can see the appointments for today in Time Finish. 4. User can select the Patient, Requester and Time Finish tab to view the details of the Appointment. 18 5. User can select the “Authorization” tab and enter authorization code and signature of the authorized person. 6. User clicks on save option. Figure 5 Time Finish Use Case Diagram Post Conditions: The following post conditions must be true after the completion of the use case. 1. User can see the appointments in Sync Folder after time finishing. 2. User can choose to go back to the home page by clicking on “Main Menu” link UC: Distance and Time Calculation Preconditions The following preconditions must be true before the initiation of the use case. 19 1. User has logged into the Internet Interpreter Scheduling System. 2. System has validated user credentials entered in the Login Page. Basic Flow The following steps represent the basic flow of events in Calculating the distance and Travel Time module also shown in Figure 6 below. 1. User will navigate the Main Menu 2. User selects the Time Finish from the Main Menu 3. User can see the appointments for today. 4. User will select the Time Finish tab and enter the finish Time details of the appointment. 5. Clicks on save option. 5. After Time finish the mileage and travel time were calculated automatically with the appointment details and authorization. 20 Figure 6 Distance and Time Calculation Use Case Diagram Post Conditions: The following post conditions must be true after the completion of the use case. 1. User can see the time finished appointments with distance and travel time calculated automatically. 2. User can choose to go back to the home page by clicking on “Main Menu” link. UC: Sync Preconditions The following preconditions must be true before the initiation of the use case. 1. User has logged into the Internet Interpreter Scheduling System. 2. System has validated user credentials entered in the Login Page. 21 Basic Flow The following steps represent the basic flow of events in Sync module also shown in Figure 7 below. 1. User will navigate the Main Menu 2. User selects the Sync from the Main Menu 3. User can see the appointments time finished in the sync folder. 4. User will remove the appointments before synchronizing to the database. 4. User will select the “Sync” to synchronize the details of the appointment. Figure 7 Sync Use Case Diagram Post Conditions: The following post conditions must be true after the completion of the use case. 1. User can see the appointments as submitted with mileage and travel time. 2. User can choose to go back to the home page by clicking on “Main Menu” link. 22 External Interfaces Requirements Software Interfaces 1. Operating System: The software is being designed to run on windows Mobile OS. 2. Web Server: The software is being designed to run on Internet Information Server 3. Database: The software will access the SQL Server 2008 Enterprise Edition database for CRUD operations. 4. Libraries: The software is created using the .NET version 3.5 framework. 5. Map Quest: Accuracy of calculating the Distance and Travel time will be depend on the API changes by the MAP Quest. Non-functional Requirements Security Requirements 1. Passwords and authorization code should be displayed as “*” in the Login and Time finish pages as required. 2. Proper authentication is required for users to access any of the screens in the Application. 3. Every user of the Application is assigned with a unique login and password. 4. Microsoft .NET framework ensures security of data, for example passwords that are being transmitted over the internet. 23 Software Quality Attributes Reliability: Data entered must be correctly stored in the database. In addition, database should commit transactions so that partial entries are not stored in the database. Usability: Individuals of varying skill level and technical competence will use the system. Maintainability: The code and design is documented well enough such that a new project member with the same amount of academic or work experience can easily work on the project. Developer Environment This project is developed using Microsoft Visual Studio .NET Framework along with Microsoft SQL Server 2008 relational database system. Figure 8 Development Environment Diagram 24 The Microsoft .NET Framework, is a prefabricated infrastructure to develop Mobile and Web applications. Mobile Applications developed on Visual Studio 2008 IDE and Mobile Application interacts with the Web and Database server through HTTP Request over the internet. 25 Chapter 3 3. SYSTEM DESIGN Mobile application works same as the web applications hosted on the server. Client interacts with the server through web services and servers provide content to the client. Clients obtain that content from internet and view them using a browser. Design of user interface for mobile application is different from the web application. Mobile application works by maintaining a global database and interacting with server with the help of the web services. Building a Mobile Applications Today, Cell phones (mobile phones) have become part of our life style. Mobile devices can connect to the Internet, and execute applications. Mobile applications are applications that can be run or accessed on mobile devices. There are two categories. One category is mobile web application. In these applications, web pages can be viewed from mobile devices. Typically they use WAP protocol. The web applications themselves may reside on desktop or servers. The development environment can be simply text editor or Microsoft Mobile Internet Toolkit[2]. The other category is executable applications that reside on the mobile devices. Games run on pocket pc, or calendar on PDA. These applications need to be downloaded and installed and executed onto the mobile device. There are several development environments for this kind of programming. We can use .NET Compact Framework to program on Microsoft PocketPC, or use Java 2 Platform Micro Edition (J2ME) to 26 program with Nokia SDK. There are many different types of mobile devices, such as PocketPC, Palm, and Cell Phone[5]. Since cell phones have much more popularity and can let me learn more technology, in my project, I used cell phone as the platform. This project runs on MS IIS (Microsoft Internet Information Services) Web Server. IIS is a web server application and set of feature extension modules created by Microsoft for use with Microsoft Windows. It is one of the world’s most popular web servers in terms of overall websites behind the industry leader Apache HTTP Server[6]. Connected application put the application layers on different physical computers. For example moving the data layer to a separate server or pushing out the presentation layer to the user computer. This first version was called client/server since the application was broken into two parts a client and server. A classic example is the Web it is composed of a browser which is the client and a web server. Mobile application must be tested in uncontrolled real-world test conditions. This is also called as Field testing. It is must for multi-tier applications. Appropriate automation test tool should be selected to test these applications[3]. Even, if it is possible to have performance testing, GUI testing, and compatibility should be tested on actual devices. 27 Mobile Application Architecture Web version of the Interpreter Scheduling System interacts with few I2S2 web services. Web services for mobile application also added to the same I2S2 web services. Maintaining a global database for the application will fetch all the scheduled appointments through interacting with web services and displayed on basis of login interpreter privileges. Both agency and requester users can schedule appointments. Interpreters are going to get those appointments into the schedule tab of the mobile application by connecting based on day, week and month calendar format. Interpreter system interacts with web server and database server through DAO Layer and some of the method calls will be through the I2S2 Web services. I2S2 Web Services act as interface between the server and mobile application. Reading the data from the server and writing data to the server will be through the xml. Business layer consists of business logic to call the required methods. Web services will expose the methods needed for the Mobile application and provides security in calling the global database. Mobile application login authorization is completed through the SSL certificate. Login credentials are encrypted and send to the server through third party certificate agency , 28 which provides the SSL certificate. If the entered login credentials are successful then the user will get the access to use the mobile application. In this way authorization to the system is secure. A Web service is a method of communication between two electronic devices over a network. The W3C defines a "Web service" as "a software system designed to support interoperable machine-to-machine interaction over a network". It has an interface described in a machine - process able format(WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards[4]. In this project, I2S2 web services used for the mobile application will expose limited functionality to mobile application users. So the users of the mobile application cannot manipulate the core I2S2 database. Mobile Application is provided with methods to access and update the information related to appointment, requester and patients details through a secure web services. Mobile application can connect to the Internet Interpreter Scheduling System only through these web services. Web services will be hosted on the same server as the web application. IIS is used as the web server for this application. 29 Mobile Application after the launch of simulator checks the Program.cs , which is the main thread for mobile application. This file invoke the FrmMain class. This acts as the router to all the forms in the application. This will invoke appropriate handlers based on selection of the folder on the mobile application Main Menu. This acts as the controller for whole application. User wants to do any operation will be go through this FrmMain class in Mobile Application. .CAB file is created for the installer. Need to finish developing driver or application, after completing the Development of the application. CAB Wizard used to create cabinet (.cab) files to facilitate installation of mobile application on devices. This file acts as a container, holding all necessary device driver or application files in one location, which ensures that these files are present at installation. This process to be followed using a text editor first to create an .inf file and then using the CAB Wizard command-line tool (Cabwiz.exe) at the command prompt. Online / Offline Mode: I2S2 Mobile able to work in offline mode because some of the departments or hospitals might not have the Internet connectivity. Interpreter might not be able to synchronize the appointments. In that case, Interpreter will get authorization from doctor and save the appointment in the mobile application. Interpreter will be Synchronize the appointments when the connectivity is good. 30 Figure 9 Internet Scheduling System Application Architecture .NET Application Architecture In the classic three-tier design of a .NET application, the architecture breaks down into three major areas of functionality: 1. The data layer manages the physical storage and retrieval of data 2. The business layer maintains business rules and logic. 3. The presentation layer houses the user interface and related presentation code. 31 Data layer: This layer consists of operations to get and set the data to the database back and forth. This layer only interacts with the database. Database queries or use stored procedures to access the data from the database or to perform any operation to the database. Business layer: This layer consists of operations which work as a mediator to transfer the data from Application or presentation layer data layer. Business layer is the class where we write the functions which get the data from the application layer and passes through the data access layer. Presentation layer: Presentation layer is the form which provides the user interface to either programmer of end user. Programmer uses this layer for designing purpose and to get or set the data back and forth. Presentation layer is the form where we design using the controls like textbox, labels, command buttons etc. The following is a block diagram of all the modules in the application and the relationships between them. The following view includes arrows to indicate flow of data and/or control. 32 Figure 10 Design of the Mobile Application High Level Design The High-Level Design (HLD) provides an overview of the design components of the Mobile application. The design is represented through elaborations on class diagrams for each of the core sub-systems. The purpose of the high-level design is to define key classes, as well as the interactions among instances of these classes (objects). Inputs to the HLD consist of the functional requirements defined in the above sections. The HLD 33 represents a decomposition of all the sub-systems down to the class level. It is envisioned that the HLD will form the basis for the detailed design efforts. Following are the key goals and constraints governing the design decisions in the HLD: • High-level design should decompose complex business logic; identify dependencies Among components, and arrive at a holistic view of the application. • High-level design should address core functionality by identifying and defining the key classes, responsibilities, behavior and attributes. • High-level design should clearly define application boundaries and their interfaces. • High-level design should form the basis for planning and scoping subsequent phases. • High-level design should adopt object-oriented design principles such as encapsulation, Information hiding, loose coupling, and high cohesion. In this Project, Mobile Application User Interface involves all the script and designer files. Designer.cs files allow users to customize the Mobile interface. This interface allows the users to include options and customize the table and options. Script files contain the logic to call the process.xml files or web services. Process.xml files mainly used to sync the data, read and write data from the XML. This Project includes the Web Services as the reference. Web services hosted on the same server as the Mobile Application. 34 Chapter 4 4. DATABASE DESIGN Database Design is one of the most important parts of designing an application. Database design encompasses the entire process from the creation of requirements, business processes, logical analysis and physical database constructs to the deployment of the database. A good database design will contribute to software development and improve performance. It facilitates data retrieval, storage and modification. About SQL Server 2008 Microsoft SQL Server is a relational model database server produced by Microsoft. SQL Server 2008 includes native support for managing XML data, in addition to relational data. For relational data, T-SQL has been augmented with error handling features (including the try and catch) and support for recursive queries (Common Table Expressions). SQL CLR was introduced with the SQL Server to let it integrate with the .NET Framework. Database Tables and Database Diagram An entity-relationship (ER) diagram is a specialized graphic that illustrates the relationships between entities in a database. ER diagrams often use symbols to represent three different types of information. Boxes are commonly used to represent entities. Diamonds are normally used to represent relationships and ovals are used to represent attributes. 35 An ER model is a diagram containing entities or "items", relationships among them, and attributes of the entities and the relationships. An entity is a real-world item or concept that exists on its own. The set of all possible values for an entity is the entity type. A relationship type is a set of associations among entity types. A relationship or relationship instance is an ordered pair consisting of particular related entities. Appointment table is the main table in this Internet Interpreter Scheduling System database, which connects to rest of the tables like Employee, Person, Requester, Customer, Department and Language. Interpreter Scheduling System will take appointments with multiple patients. The Internet Interpreter scheduling system maintains global database for both web and mobile application, most of the tables are common for both applications. Additional Columns added as per the need of web service calls for the Mobile application. Person table will have all the service recipient information of the Appointment. If the Appointment is linked with more than one patient then Person table will have multiple records for the same Appointment. Patient table will have the Last Name, First Name, ReferenceNumber , CellPhone, WorkPhone, AppointmentID, CustomerID. Person table is always linked with the Appointment and Requester table. Customer Table linked with Appointment and 36 Requester tables. Customer will have different departments. Each department will have several requesters or providers. Customer mapped with CustoemrID, Name and Customer category with rest of the tables. Requester table will have all the details for the requester. It contains the Name, Email, Location Type Of Medical, Client ID, Customer Category ID, Department ID, Agency Name ID, Hospital ID, Appointment declined EmailFlag. These requesters are directly linked with the Hospital or department in the Hospital. Interpreter will get a notification to registered mobile phone based on the settings of the interpreter. If the interpreter registers phone number then every appointment scheduled or cancelled then server will send a notification to the mobile phone of the interpreter. Tables PhoneCompanyEmailServer and Employee TextMessagePhone are connected. PhoneCompanyEmailServer has all the registered servers for different carriers. TextMessagePhone have all the registered phone numbers of the Interpreters. Another important table username is connected with UserGroupType. Interpreters only have the permission to access the Mobile application. User login to Mobile application, it verifies the login credentials matching the User Group Type as Interpreter .Interpreter can be able to login and if the login credentials are not matching the interpreter then it will give an error message. During the Time Finish of the appointment the doctor has to enter the Authorization Code. Authorization Code can be saved in Appointment, Department and Customer 37 Level. Customer can assign different authorization codes for different users or have same code for particular department. This authorization code work as per the level of security hierarchy defined. Mostly authorization code is specific to department. Through the authorization code, legitimate signature gets validated. Doctor or supervisor will see the details of the appointment and time finish the appointment with valid Signature after entering the Authorization Code. Following diagram shows the relation between the username and UserGroupType and PhoneCompanyEmail Server and Employee Text Phone. 38 . Figure 11 Design for User and Phone Related Tables Sample of Database Scripts Following is the script used to create table in the Internet Interpreter Scheduling System. This includes all the details needed for the scheduling and time finishing for an employee. It includes ID, Language, Interpreter name, Address, Employee ID, Gender, Working City, Pay Rate, Available Times, Phone Number and Text Phone Number to get the notification from the System. Employee table having constraints on different columns based on the requirements with the system. 39 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Employee]( [EmployeeID] [int] IDENTITY(1,1) NOT NULL, [InterpreterType] [varchar](50) NOT NULL, [Title] [varchar](50) NULL, [LastName] [varchar](50) NULL, [FirstName] [varchar](50) NULL, [MiddleName] [varchar](50) NULL, [Prefix] [varchar](50) NULL, [Suffix] [varchar](50) NULL, [AddressLine1] [varchar](50) NULL, [AddressLine2] [varchar](50) NULL, [AddressLine3] [varchar](50) NULL, [City] [varchar](50) NULL, [State] [varchar](50) NULL, [ZipCode] [varchar](50) NULL, [MAddressLine1] [varchar](50) NULL, [MAddressLine2] [varchar](50) NULL, [MAddressLine3] [varchar](50) NULL, [MCity] [varchar](50) NULL, [MState] [varchar](50) NULL, [MZipCode] [varchar](50) NULL, [Email] [varchar](50) NULL, [SSN] [char](11) NULL, [DOB] [datetime] NULL, [SID] [varchar](50) NULL, [StartDate] [datetime] NULL, [ContractStartDate] [datetime] NULL, [ContractExpiredDate] [datetime] NULL, [IsActive] [bit] NOT NULL, [IsInterpreter] [bit] NOT NULL, [Gender] [varchar](50) NULL, [PayRate] [money] NOT NULL, [AgencyNameID] [int] NOT NULL, [Score] [int] NOT NULL, [WorkingCity] [varchar](1024) NULL, [RowDeleted] [bit] NOT NULL, [UpdateDate] [datetime] NOT NULL, [UpdateUser] [varchar](50) NULL, [InterpreterRateEnabled] [bit] NOT NULL, [InterpreterHourCalculationEnabled] [bit] NOT NULL, [MinimumHour] [int] NULL, [StepInMinute] [int] NULL, [IncrementInMinute] [int] NULL, [MinimumHourTel] [int] NULL, [StepInMinuteTel] [int] NULL, [IncrementInMinuteTel] [int] NULL, 40 [MinimumHourCancelledAppt] [int] NULL, [MinimumHourCancelledApptTel] [int] NULL, [StepInMinuteWithinMinimumHour] [int] NULL, [StepInMinuteTelWithinMinimumHour] [int] NULL, [WeekendRateEnabled] [bit] NOT NULL, [DiscountRateEnabled] [bit] NOT NULL, [DiscountRateTriggerInMinute] [int] NULL, [DiscountRateTelTriggerInMinute] [int] NULL, [MinimumHourCancelledApptLevel2] [int] NULL, [MinimumHourCancelledApptTelLevel2] [int] NULL, [NeverConsolidateMileage] [bit] NOT NULL, [AlwaysConsolidateMileage] [bit] NOT NULL, [NeverConsolidateAppointment] [bit] NOT NULL, [AlwaysConsolidateAppointment] [bit] NOT NULL, [AppointmentCancelledEmailFlag] [bit] NOT NULL, [AppointmentSentToInterpreterInboxEmailFlag] [bit] NOT NULL, [AppointmentSentToInterpreterScheduleEmailFlag] [bit] NOT NULL, [Notes] [text] NULL, [BusinessName] [varchar](255) NULL, [AppointmentCancelledSMSFlag] [bit] NOT NULL, [AppointmentSentToInterpreterInboxSMSFlag] [bit] NOT NULL, [AppointmentSentToInterpreterScheduleSMSFlag] [bit] NOT NULL, [PhoneCompanyEmailServerID] [int] NULL, [TextMessagePhoneNumber] [varchar](50) NULL, [AppointmentInfoEditedEmailFlag] [bit] NOT NULL, [AppointmentInfoEditedSMSFlag] [bit] NOT NULL, [CollisionID] [timestamp] NOT NULL, CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED ( [EmployeeID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[Employee] WITH NOCHECK ADD CONSTRAINT [FK_AgencyName_Employee] FOREIGN KEY([AgencyNameID]) REFERENCES [dbo].[AgencyName] ([AgencyNameID]) GO ALTER TABLE [dbo].[Employee] CHECK CONSTRAINT [FK_AgencyName_Employee] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_InterpreterType] DEFAULT ('I') FOR [InterpreterType] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_IsActive] DEFAULT (0) FOR [IsActive] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_IsInterpreter] DEFAULT (0) FOR [IsInterpreter] 41 GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_PayRate] DEFAULT (0) FOR [PayRate] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_RowDeleted] DEFAULT (0) FOR [RowDeleted] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_UpdateDate] DEFAULT (getdate()) FOR [UpdateDate] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_InterpreterRateEnabled] DEFAULT (0) FOR [InterpreterRateEnabled] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_InterpreterHourCalculationEnabled] DEFAULT (0) FOR [InterpreterHourCalculationEnabled] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_WeekendRateEnabled] DEFAULT (0) FOR [WeekendRateEnabled] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_DiscountRateEnabled] DEFAULT (0) FOR [DiscountRateEnabled] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_NeverConsolidateMileage] DEFAULT (0) FOR [NeverConsolidateMileage] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AlwaysConsolidateMileage] DEFAULT (0) FOR [AlwaysConsolidateMileage] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_NeverConsolidateAppointment] DEFAULT (0) FOR [NeverConsolidateAppointment] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AlwaysConsolidateAppointment] DEFAULT (0) FOR [AlwaysConsolidateAppointment] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentCancelledEmailFlag] DEFAULT (0) FOR [AppointmentCancelledEmailFlag] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentSentToInboxEmailFlag] DEFAULT (0) FOR [AppointmentSentToInterpreterInboxEmailFlag] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentSentToInterpreterScheduleEmailFlag] DEFAULT (0) FOR [AppointmentSentToInterpreterScheduleEmailFlag] 42 GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentCancelledEmailFlag1] DEFAULT ((0)) FOR [AppointmentCancelledSMSFlag] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentSentToInterpreterInboxEmailFlag1] DEFAULT ((0)) FOR [AppointmentSentToInterpreterInboxSMSFlag] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentSentToInterpreterScheduleEmailFlag1] DEFAULT ((0)) FOR [AppointmentSentToInterpreterScheduleSMSFlag] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentInfoEditedEmailFlag] DEFAULT ((0)) FOR [AppointmentInfoEditedEmailFlag] GO ALTER TABLE [dbo].[Employee] ADD CONSTRAINT [DF_Employee_AppointmentInfoEditedSMSFlag] DEFAULT ((0)) FOR [AppointmentInfoEditedSMSFlag] GO CodeTable_r_all is a stored procedure used throughout the application and it will be loaded only at the start of the application. This procedure will return all the information needed throughout the Scheduling System. This script involves all the tables like RateType, UserGroupType, PhoneType, Language, Agency Name, Customer Category, Employee Phone, Billing Note and so on. As it is used throughout the application if the anything is needed across the layers then need to alter stored procedure and add the query according to the need of the functionality. ALTER PROCEDURE [dbo].[CodeTable_r_all] @AgencyNameID int = null AS begin if @AgencyNameID is null begin select * from State select * from UserGroupType 43 select * from TelephoneType select * from PhoneType select * from RateType select * from [Language] select * from InvoiceStyle select * from v_CodeTable_Department select * from CustomerCategory order by SortOrder, DisplayValue select * from AgencyName where RowDeleted = 0 select * from AgencyPhone where RowDeleted = 0 select * from ZipCode where RowDeleted = 0 select e.*, FirstName + ' ' + LastName + ' - ' + it.Code + dbo.GetInActiveString(IsActive) as DisplayName, u.UserNameID, u.UserName, u.Password,it.DisplayValue as InterpreterTypeDisplayValue, it.SortOrder from Employee e inner join InterpreterType it on e.InterpreterType = it.Code left outer join UserName u on e.EmployeeID = u.EID and (u.UserGroupTypeCode = 'Interpreter' or u.UserGroupTypeCode = 'Agency')and u.RowDeleted = 0 where e.RowDeleted = 0 select el.*, l.LanguageName from EmployeeLanguage el inner join [Language] l on el.LanguageID = l.LanguageID where el.RowDeleted = 0 select *, dbo.GetWeekDay(DayCode) as DayOfWeek from EmployeeAvailableTime e where e.RowDeleted = 0 select *, ZipCode from EmployeeNotWorkingArea ewa inner join ZipCode zc on ewa.ZipCodeID = zc.ZipCodeID where ewa.RowDeleted = 0 select * from EmployeePhone e where e.RowDeleted = 0 select [EmployeeTimeOffID] ,[EmployeeID] ,convert(datetime, convert(date,[DayOff],111), 111) as [DayOff] ,[Reason],[FromTime],[ToTime],[RowDeleted],[UpdateDate] from EmployeeTimeOff where RowDeleted = 0 and DateDiff(day, getDate(), DayOff ) >= 0 select * from EmployeeNote e where e.RowDeleted = 0 select * from BillingCode where RowDeleted = 0 select * from Customer c where c.RowDeleted = 0 44 select * from CustomerPhone where RowDeleted = 0 select * from v_CodeTable_Hospital where RowDeleted = 0 select * from HospitalPhone where RowDeleted = 0 select * from Gender select * from ExactLocation select * from PhoneCompanyEmailServer where RowDeleted = 0 select * from EmployeePayDifferential epd where epd.RowDeleted = 0 select * from InterpreterType order by DisplayValue select * from QuestionFormatType select * from InterpreterCheckListType select * from InterpreterCheckList select * from SpecialityType select interSpe.*, speType.DisplayValue from InterpreterSpeciality interSpe inner join SpecialityType speType on interSpe.SpecialityTypeID = speType.SpecialityTypeID where interSpe.RowDeleted = 0 order by speType.DisplayValue select * from TrainingType select interTrain.*, trainType.DisplayValue from InterpreterTraining interTrain inner join TrainingType trainType on interTrain.TrainingTypeID = trainType.TrainingTypeID where interTrain.RowDeleted = 0 order by trainType.DisplayValue select * from AppointmentCancelledReason order by DisplayValue select * from InterpreterLockedOutType order by DisplayValue select * from AppointmentStatusType select * from ProjectCode select * from SourceCode select * from InterpreterAddOn select * from AppointmentTypeCode order by SortOrder 45 select *, FirstName + LastName as DisplayName from Dispatcher RowDeleted = 0 select *, dbo.GetWeekDay(DayCode) as DayOfWeek where RowDeleted = 0 where from DispatcherSchedule select * from ReportUrl end end Following is the Stored procedure to retrieve all the information need for the application related to the appointment. It retrieves the data from Appointment, v_Appointment, AppointmentNote, AppointmentHistory, PayrollPeriod, InvoicePeriod, BillingAddress, PayrollPeriodInterpreterAppointment, v_Appointment_PayBillItemAuto, PayBillItemManual, EmployeeReminder, v_Appointment_Person, AppointmentAttachment, EmployeeReminder, PayrollPeriodInterpreter, InvoiceDetail , InvoicePeriodCustomer, InvoiceDetailAppointment tables. This will retrieve the information of the interpreter mapped to this appointments. CREATE PROCEDURE [dbo].[Appointment_r_all] @AgencyNameID int, @SQL nvarchar(4000) AS begin create table #FoundAppointment(AppointmentID int not null) declare @SQLPrefix nvarchar(4000) select @SQLPrefix = 'insert into #FoundAppointment ' + @SQL exec(@SQLPrefix) select distinct a.AppointmentID into #AppointmentWithAgency from Appointment a inner join #FoundAppointment fa on a.AppointmentID = fa.AppointmentID where a.AgencyNameID = @AgencyNameID and a.RowDeleted = 0 --select table back out to the caller --select Appointment 46 select a.* from v_Appointment a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID order by a.StartTime --select AppointmentNote select a.* from AppointmentNote a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID where a.RowDeleted = 0 --select AppointmentHistory select a.* from AppointmentHistory a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID where a.RowDeleted = 0 order by UpdateDate --select BillingAddress select a.* from BillingAddress a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID where a.RowDeleted = 0 --select PayBillItemAuto select a.* from v_Appointment_PayBillItemAuto a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID --select PayBillItemManual select a.* from PayBillItemManual a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID where a.RowDeleted = 0 --select PendingEmployee select a.*, e.FirstName + ' ' + e.LastName + dbo.GetInActiveString(e.IsActive) as DisplayName from PendingEmployee a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID inner join Employee e on a.EmployeeID = e.EmployeeID where a.RowDeleted = 0 --select Person select a.* from v_Appointment_Person a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID where a.RowDeleted = 0 select * from AppointmentAttachment where 1 = 0 --select employee reminder 47 select a.* from EmployeeReminder a inner join #AppointmentWithAgency awa on a.AppointmentID = awa.AppointmentID select * from PayrollPeriod where 1 = 0 select * from PayrollPeriodInterpreter where 1 = 0 select * from PayrollPeriodInterpreterAppointment where 1 = 0 select * from InvoicePeriod where 1 = 0 select * from InvoicePeriodCustomer where 1 = 0 select * from InvoiceDetail where 1 = 0 select * from InvoiceDetailAppointment where 1 = 0 --drop temp tables drop table #FoundAppointment drop table #AppointmentWithAgency return 0 end If the appointment is moved to the interpreter folder of a particular interpreter then Appointment will show IsInterpreterFolder flag as ‘1’ and else with ‘0’. If the Interpreter was assigned to the appointment then the appointment will display with assigned EmployeeID. If the appointment was kept in public folder then the appointment with IsPublicFolder flag as ‘1’. Moving of the appointments to the interpreter folder and public folder will be confirmed from the Agency side through web application. 48 Chapter 5 5. IMPLEMENTATION DETAILS This chapter describes in detail the .NET technologies used in this project and shows some sample code to explain in detail, the main features of the application. Development of Mobile Interface using ASP.NET ASP.NET framework developed to allow programmers to build Web, Mobile applications and web services. Mobile Framework uses the forms on the front end and scripts files used to write code behind the forms. Script files will use the Web services calls to execute the logic. The Scheduling System provides the following major features: 1. Maintaining a global database and through the web services sync the data into the database. The agency or requester users will create appointments. Interpreters are going to get those appointments into the schedule folder of the mobile application in day, week and monthly format. 2. Interpreter can accept or reject the appointment based on the available schedule. 3. Signature of the authorized person is automated and uploaded as the voucher into the System. 4. Appointments should be Synchronize to the database after the time finish. 5. MAP Quest functionality implemented in the Scheduling System by implementing the Map Quest SDK and using MQ API. This functionality is 49 implemented as a separate web service to calculate the mileage and travel distance between the source and destination. 6. Canceled appointments need to be removed from the Sync Folder before synchronizing the database. 7. Appointments will be saved in two folders. It will consist of the appointments scheduled for interpreter and agency is not sure about that interpreter’s availability. Agency Folder consists of the unassigned appointments. This is the common pool for all the interpreters and agency. 8. Important part of the mobile application is, it detects the web browser and will produce the output according to the browser. 9. After the appointment is finished, employee submits the appointment and sync to the database through I2S2 web services. 10. Interpreter can login to the Scheduling System in both online/offline modes. Interpreter can save the appointment after the time finish and submit the appointment when the internet connectivity is good. 11. A device emulator is software that simulates a mobile device. Visual Studio IDE includes built-in emulator SDKs for Pocket PC and Smartphone. Development of Web Service in ASP.Net Web Service is programmable application logic accessible via standard Web protocols. One of these Web protocols is the Simple Object Access Protocol (SOAP). SOAP uses XML for data description and HTTP for transport to encode and transmit application 50 data. A SOAP message consists of several elements, most notably an envelope. The envelope encapsulates the data transmitted within the SOAP message. Consumers of a Web Service do not need to know anything about the platform, object model, or programming language used to implement the service. They only need to understand how to send and receive SOAP messages through HTTP and XML. Soap Message for DoScheduleAppointmentByLoginUser: Sample Soap Message for the method DoScheduleAppointmentByLoginUser method implemented through web service. This method is implemented to do scheduling of the appointment and return Appointment DataSet(XmlDocument). In this example below, explains the HTTP headers for the request, including the HTTP SOAPAction header, which is optionally used by the server for routing the SOAP message. In the below code snippet, following the HTTP headers we find the body of the HTTP message. The body of the HTTP message is the SOAP request for a DoScheduleAppointmentByLoginUser Web Service that going to build. SOAPAction: "http://tempuri.org/DoScheduleAppointmentByLoginUser" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <AuthHeader xmlns="http://tempuri.org/"> <ProductKey>string</ProductKey> 51 <ApplicationName>string</ApplicationName> <UserGroupTypeCode>string</UserGroupTypeCode> <Username>string</Username> <Password>string</Password> </AuthHeader> </soap:Header> <soap:Body> <DoScheduleAppointmentByLoginUser xmlns="http://tempuri.org/"> <strAppointmentTypeYearNumber>string</strAppointmentTypeYearNumber> </DoScheduleAppointmentByLoginUser> </soap:Body> </soap:Envelope> The code snippet in the following sections depicts the functionality of the I2S2web services, which is an integral module in the entire application. MapQuest SDK implementation in Scheduling system using the Map Quest API to calculate the mileage and travel time. Map Services web.config has to be configured with <App Settings > related to the Map Quest. App Settings includes geocode Server Name, Port, Path, Client ID and Password as geocode settings and route Server Name, Port, Client Id and password. <appSettings> <add key="geoCodeServerName" value="geocode.access.mapquest.com"></add> <add key="geoCodeServerPort" value="80"></add> <add key="geoCodeServerPath" value="mq"></add> <add key="geoCodeClientId" value="1233524"></add> <add key="geoCodePassword" value="wkfhei"></add> 52 <add key="routeServerName" value="route.access.mapquest.com"></add> <add key="routeServerPort" value="80"></add> <add key="routeServerPath" value="mq"></add> <add key="routeClientId" value="21734"></add> <add key="routePassword" value="dwkkjkj"></add> </appSettings> http://localhost/MapServices/DistanceCalculator.asmx is the URL used to access the MapQuest web services and test the working of it. ASMX file extension is used for ASP.NET Web services Source file. WSDL file for Calculating the distance with Map Quest SDK <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:element name="CalculateDrivingDistanceTime"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="sFromAddressLine1" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sFromCity" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sFromState" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sFromZipCode" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sToAddressLine1" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sToCity" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sToState" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="sToZipCode" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="CalculateDrivingDistanceTimeResponse"> <s:complexType> 53 <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="CalculateDrivingDistanceTimeResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> <wsdl:message name="CalculateDrivingDistanceTimeSoapIn"> <wsdl:part name="parameters" element="tns:CalculateDrivingDistanceTime" /> </wsdl:message> <wsdl:message name="CalculateDrivingDistanceTimeSoapOut"> <wsdl:part name="parameters" element="tns:CalculateDrivingDistanceTimeResponse" /> </wsdl:message> <wsdl:portType name="DistanceCalculatorSoap"> <wsdl:operation name="CalculateDrivingDistanceTime"> <wsdl:input message="tns:CalculateDrivingDistanceTimeSoapIn" /> <wsdl:output message="tns:CalculateDrivingDistanceTimeSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="DistanceCalculatorSoap" type="tns:DistanceCalculatorSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="CalculateDrivingDistanceTime"> <soap:operation soapAction="http://tempuri.org/CalculateDrivingDistanceTime" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="DistanceCalculatorSoap12" type="tns:DistanceCalculatorSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="CalculateDrivingDistanceTime"> <soap12:operation soapAction="http://tempuri.org/CalculateDrivingDistanceTime" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> 54 <wsdl:service name="DistanceCalculator"> <wsdl:port name="DistanceCalculatorSoap" binding="tns:DistanceCalculatorSoap"> <soap:address location="http://localhost/MapServices/DistanceCalculator.asmx" /> </wsdl:port> <wsdl:port name="DistanceCalculatorSoap12" binding="tns:DistanceCalculatorSoap12"> <soap12:address location="http://localhost/MapServices/DistanceCalculator.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions> Implementation of Web service using Map Quest Below is the code snippet for calculating the driving distance time between the Source and destination points for time finish module of the Scheduling System. This code has been implemented using MAP Quest SDK and learning through the MAP Quest API provided for the Asp.Net Framework[7]. In this DistanceCalculator.asmx file is used to write the business logic and calling of the Map Quest provided method calls. Existing Scheduling system is using the directions from freeware version software www.randmcnally.com, which was unreliable and inaccurate. System used to get the output of Mileage and time. This is not used to calculate the mileage and travel time accurately. Implementation in CalculateDrivingDistanceTime() method is used to provide enhancement to the existing system that would allow I2S2 to integrate MapQuest map services via a paid subscription. 55 In this implementation sub method DoRoute will calculate the distance between the source and the destination points. DoRoute will take geoLocs, routeOptions, routeResult, sessionId has to be passed as parameters. Finally the return values routeResult.Distance and routeResult.Time will return the distance and travel time between the source and destination. CalculateDrivingDistanceTime will take the source and destination address as the parameters. Both address should be separated as address line, city, state and zip code. public string CalculateDrivingDistanceTime(string sFromAddressLine1, string sFromCity, string sFromState, string sFromZipCode, string sToAddressLine1, string sToCity, string sToState, string sToZipCode) { Exec exRoute = new Exec(routeServerName, routeServerPath, routeServerPort); exRoute.ClientId = routeClientId; exRoute.Password = routePassword; string sessionId = exRoute.CreateSessionEx(mqSession); exRoute.DoRoute(geoLocs, routeOptions, routeResult, sessionId); if (routeResult.ResultCode.ToString().Equals("0")) { return routeResult.Distance.ToString() + "," + (Math.Round((double)(routeResult.Time / 60) * 10) / 10).ToString(); } else { return "0,0"; } } } CalculateDrivingDistanceTime is a web method present in the MapQuest web service. DistanceCalculator.asmx.cs file consists of the logic behind the web method. This method will invoke the MapQuestServerAPI_CalculateDrivingDistanceTime method by passing the from and to Address in AddressLine1,City,State and Zip code format. 56 public string CalculateDrivingDistanceTime( string sFromAddressLine1, string sFromCity, string sFromState, string sFromZipCode, string sToAddressLine1, string sToCity, string sToState, string sToZipCode) { string rv = string.Empty; rv = MapQuestServerAPI_CalculateDrivingDistanceTime( sFromAddressLine1, sFromCity, sFromState, sFromZipCode, sToAddressLine1, sToCity, sToState, sToZipCode); return rv; } Following code snippet shows how CalculateDrivingDistanceTime will be called by the script file and passing the source address and destination address as the Parameters. Both address need to pass as separate parameters in address line, city, state and zip format. private string MapQuestServerAPI_CalculateDrivingDistanceTime( string sFromAddressLine1, string sFromCity, string sFromState, string sFromZipCode, string sToAddressLine1, string sToCity, string sToState, string sToZipCode) { double dblMileage = 0; double dblTravelTime = 0; string rv = string.Format("{0},{1}", dblMileage, dblTravelTime); if (sFromAddressLine1 == string.Empty || sFromCity == string.Empty || sFromState == string.Empty || sFromZipCode == string.Empty || sToAddressLine1 == string.Empty || sToCity == string.Empty || sToState == string.Empty || sToZipCode == string.Empty) return rv; try { MapQuestDistanceCalculator oMapQuestDistanceCalculator = new MapQuestDistanceCalculator(); rv = oMapQuestDistanceCalculator.CalculateDrivingDistanceTime( sFromAddressLine1, sFromCity, sFromState, sFromZipCode, sToAddressLine1, sToCity, sToState, sToZipCode); } catch { } return rv; } 57 Implementation of Business Logic using C#.NET C# is a multi-paradigm programming language encompassing imperative, functional, generic, object oriented and component oriented programming disciplines. C# is intended to be a simple, modern, general-purpose, object-oriented programming language[1]. Following Code snippet will check the internet connectivity to the mobile application and shows the error if the internet is not connected. public bool ValidateUserName(A_UserInfo.clsUserinfo user) { if (!Config.A_ConnectInternet.CheckInternetConnection()) { MessageBox.Show("Network Error: There is no internet connection. Please connect to the internet and try again.", "Require", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return false; } Following Code snippet will validate the username used to login into Mobile application is legitimate or not. If the Login credentials having previleges to login, sytem will allow to login. I2S2Services.I2S2Services theService = new I2S2Services.I2S2Services(); I2S2Services.AuthHeader theAuthentication = new I2S2Services.AuthHeader(); theAuthentication.ProductKey = m_strProductKey; theAuthentication.ApplicationName = user.Appointment; theAuthentication.UserGroupTypeCode = user.Usergroup; theAuthentication.Username = user.Username; theAuthentication.Password = user.Password; theService.AuthHeaderValue = theAuthentication; try { if (theService.ValidateUserName()) { return true; } 58 } catch (Exception ex) { throw ex; } return false; } Following Code snippet is loading the DataTable for the Mobile application from the AppointmentDS dataset. Loading the values for the fields from the appointment and person tables. This method loads the Appointment details needed for the application by retrieving the Appointment Row and from there getting the Appointment Number, StartDate, AppointmentDuration, CustomerName, IsAppointmentVoucherRequired, CAuthorizationCode, DAuthorizationCode from the dataset. CAuthorization code is specific to the customer and DAuthorizationCode is assigned to a particualr department. Supervisor will do a signature on the time finish with entering the authorizationcode for the appoinment. Appointments without authorization code will not get submitted. public DataTable LoadAppointmentDataTable(string strXML) { DataTable dtAppointments = CreateTable(); XmlDocument theXmlDocument = new XmlDocument(); theXmlDocument.LoadXml(strXML); XmlNodeList xmlNodes = theXmlDocument.GetElementsByTagName("AppointmentDS"); XmlDocument xmlDocList = xmlNodes[0].OwnerDocument; XmlNodeList xmlListAppoint = xmlDocList.GetElementsByTagName("Appointment"); XmlNodeList xmlListPerson = xmlDocList.GetElementsByTagName("Person"); int nNodeCount = xmlListAppoint.Count; 59 for (int i = 0; i < nNodeCount; i++) { XmlNode ndAppointment = xmlListAppoint[i]; DataRow drAppointment = dtAppointments.NewRow(); #region Appointment Row drAppointment["AppointmentTypeYearNumber"] = ndAppointment["AppointmentTypeYearNumber"].ChildNodes[0].Value.ToString (); drAppointment["StartDateString"] = ndAppointment["StartDateString"].ChildNodes[0].Value.ToString(); drAppointment["StartTimeString"] = ndAppointment["StartTimeString"].ChildNodes[0].Value.ToString(); drAppointment["AppointmentDuration"] = ndAppointment["AppointmentDuration"].ChildNodes[0].Value.ToString(); drAppointment["CustomerName"] = ndAppointment["CustomerName"].ChildNodes[0].Value.ToString(); if (ndAppointment["HospitalName"] != null) drAppointment["HospitalName"] = ndAppointment["HospitalName"].ChildNodes[0].Value.ToString(); if (ndAppointment["DepartmentName"] != null) drAppointment["DepartmentName"] = ndAppointment["DepartmentName"].ChildNodes[0].Value.ToString(); if (ndAppointment["IsAppointmentVoucherRequired"] != null) drAppointment["IsAppointmentVoucherRequired"] = ndAppointment["IsAppointmentVoucherRequired"].ChildNodes[0].Value.ToStr ing(); if (ndAppointment["CAuthorizationCode"] != null) drAppointment["CAuthorizationCode"] = ndAppointment["CAuthorizationCode"].ChildNodes[0].Value.ToString(); if (ndAppointment["DAuthorizationCode"] != null) drAppointment["DAuthorizationCode"] = ndAppointment["DAuthorizationCode"].ChildNodes[0].Value.ToString(); #endregion Following code snippet will explain how the Time Finish details of the appointment will be loaded into the Time Finish Folder using the WriteFileTimeFinishedXML Method , which will take the From and To dates as parameters to retrieve the appointments scheduled. private void WriteFileTimeFinishedXML(string sDateFrom, string sDateTo, DataTable dtContent) { string strPathFile = Config.A_Config.I2S2PathTimeFinish + user.Appointment + "_" + user.Username + ".xml"; DataTable dtTemp = bWebservice.CreateTable(); dtTemp = processXML.ReadTimeFinishXML(strPathFile, dtTemp); 60 DataTable dtSync = processXML.CreateTableSync(); dtSync = processXML.ReadSyncXML(Config.A_Config.I2S2PathSync + user.Appointment + "_" + user.Username + ".xml"); dtTemp = MergeDatatable(dtTemp, dtContent,dtSync); processXML.WriteTimeFinishXML(dtTemp, strPathFile); } ReadSyncXML is a method which reads the details of the appointment need to be retrieved through sync in the xml format. Following code snippet will show the reading of the data Appointment number,start and end time, Hosiptal, Department, Provider, Customer, Confirmer Phone, Confirmer Name and Authorization code. #region File XML Sync public DataTable ReadSyncXML(string PathFileXML) { #region Load File XML XmlDocument doc = new XmlDocument(); DataTable dtAppointments = CreateTableSync(); if (File.Exists(PathFileXML)) { //XmlTextReader reader = new XmlTextReader(PathFileXML); doc = Config.A_Encryption_Decryption_XML.DescryptionFile(PathFileXML); #region Load Datatable XmlNodeList xmlNodes = doc.GetElementsByTagName("Appointments"); XmlDocument xmlDocList = xmlNodes[0].OwnerDocument; XmlNodeList xmlListAppoint = xmlDocList.GetElementsByTagName("AppointmentTypeYearNumber"); int nNodeCount = xmlListAppoint.Count; for (int i = 0; i < nNodeCount; i++) { DataRow drAppointment = dtAppointments.NewRow(); #region Appointment Row XmlNode ndAppointment = xmlListAppoint[i]; drAppointment["AppointmentTypeYearNumber"] = ndAppointment.Attributes[0].Value.ToString(); if (ndAppointment["HospitalName"] != null) { if (ndAppointment["HospitalName"].ChildNodes[0] != null) drAppointment["HospitalName"] = ndAppointment["HospitalName"].ChildNodes[0].Value.ToString(); } if (ndAppointment["DepartmentName"] != null) 61 { if (ndAppointment["DepartmentName"].ChildNodes[0] != null) drAppointment["DepartmentName"] = ndAppointment["DepartmentName"].ChildNodes[0].Value.ToString(); if (ndAppointment["ProviderFullName"] != null) { if (ndAppointment["ProviderFullName"].ChildNodes[0] != null) drAppointment["ProviderFullName"] = ndAppointment["ProviderFullName"].ChildNodes[0].Value.ToString(); } if (ndAppointment["StartDateString"] != null) drAppointment["StartDateString"] = ndAppointment["StartDateString"].ChildNodes[0].Value.ToString(); if (ndAppointment["StartTimeString"] != null) drAppointment["StartTimeString"] = ndAppointment["StartTimeString"].ChildNodes[0].Value.ToString(); if (ndAppointment["EndDateString"] != null) drAppointment["EndDateString"] = ndAppointment["EndDateString"].ChildNodes[0].Value.ToString(); if (ndAppointment["EndTimeString"] != null) drAppointment["EndTimeString"] = ndAppointment["EndTimeString"].ChildNodes[0].Value.ToString(); if (ndAppointment["ConfirmerName"] != null) { if (ndAppointment["ConfirmerName"].ChildNodes[0] != null) drAppointment["ConfirmerName"] = ndAppointment["ConfirmerName"].ChildNodes[0].Value.ToString(); } if (ndAppointment["ConfirmerPhone"] != null) { if (ndAppointment["ConfirmerPhone"].ChildNodes[0] != null) drAppointment["ConfirmerPhone"] = ndAppointment["ConfirmerPhone"].ChildNodes[0].Value.ToString(); } if (ndAppointment["AuthirozedCode"] != null) { if (ndAppointment["AuthirozedCode"].ChildNodes[0] != null) drAppointment["AuthirozedCode"] = ndAppointment["AuthirozedCode"].ChildNodes[0].Value.ToString(); } if (ndAppointment["Signature"] != null) { if (ndAppointment["Signature"].ChildNodes[0] != null) drAppointment["Signature"] = ndAppointment["Signature"].ChildNodes[0].Value.ToString(); } 62 #endregion Appointment Row #region Person Rows ArrayList arrPersons = new ArrayList(); XmlNodeList xmlListPerson = ndAppointment["Person"].ChildNodes; for (int j = 0; j < xmlListPerson.Count; j++) { XmlNode ndPerson = xmlListPerson[j]; ArrayList thePerson = new ArrayList(); thePerson.Add(ndPerson["LastName"].ChildNodes[0].Value.ToString()); thePerson.Add(ndPerson["FirstName"].ChildNodes[0].Value.ToString()); thePerson.Add(ndPerson["ReferenceNumber"].ChildNodes[0].Value.ToString( )); arrPersons.Add(thePerson); } drAppointment["Person"] = arrPersons; #endregion dtAppointments.Rows.Add(drAppointment); } #endregion } #endregion return dtAppointments; } WriteSyncXML is a method which writes the details of the appointment to the session through sync in the xml format. Following code snippet will show the saving of the data Appointment number,start and end time, Hosiptal,Department, Provider, Customer, Confirmer Phone, Confirmer Name and Authorization code related the appointment. public void WriteSyncXML(string pathFile, DataTable dt) { #region Write File XML 63 XmlDocument xmldoc = new XmlDocument(); ArrayList arr = new ArrayList(); string strXML = "<Appointments>"; int countRows = dt.Rows.Count; if (countRows > 0) { for (int i = 0; i < countRows; i++) { strXML += "<AppointmentTypeYearNumber name='" + ReplaceSpecialChars(dt.Rows[i].ItemArray[0].ToString()) + "'>" strXML += "<HospitalName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[1].ToString()) + "</HospitalName>"; strXML += "<DepartmentName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[2].ToString()) + "</DepartmentName>"; strXML += "<ProviderFullName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[3].ToString()) + "</ProviderFullName>"; strXML += "<StartDateString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[5].ToString()) + "</StartDateString>"; strXML += "<StartTimeString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[6].ToString()) + "</StartTimeString>"; strXML += "<EndDateString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[7].ToString()) + "</EndDateString>"; strXML += "<EndTimeString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[8].ToString()) + "</EndTimeString>"; strXML += "<ConfirmerName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[9].ToString()) + "</ConfirmerName>"; strXML += "<ConfirmerPhone>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[10].ToString()) + "</ConfirmerPhone>"; strXML += "<AuthirozedCode>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[11].ToString()) + "</AuthirozedCode>"; strXML += "<Signature>" + dt.Rows[i].ItemArray[12].ToString() + "</Signature>"; strXML += "<Person>"; arr = (ArrayList)dt.Rows[i].ItemArray[4]; for (int j = 0; j < arr.Count; j++) { strXML += "<Information>"; 64 strXML += "<LastName>" + ReplaceSpecialChars(Convert.ToString(((ArrayList)arr[j])[0])) + "</LastName>"; strXML += "<FirstName>" + ReplaceSpecialChars(Convert.ToString(((ArrayList)arr[j])[1])) + "</FirstName>"; strXML += "<ReferenceNumber>" + ReplaceSpecialChars(Convert.ToString(((ArrayList)arr[j])[2])) + "</ReferenceNumber>"; strXML += "</Information>"; } strXML += "</Person>"; strXML += "</AppointmentTypeYearNumber>"; } } strXML += "</Appointments>"; xmldoc.LoadXml(strXML); if (File.Exists(pathFile)) { File.Delete(pathFile); } //xmldoc.Save(Config.A_Config.I2S2PathSync + "temp.xml"); Config.A_Encryption_Decryption_XML.EncryptionFile(pathFile,xmldoc.Outer Xml); #endregion Write File XML } #endregion File XML Sync Some of the appointments from different customers will have multiple patients. Following Code snippet will retrieve all the patients for the appointment. It will get the LastName, First Name and Reference Numebr of the Patient. Patient Information is saved in the Person table of the I2S2. AppointmentDS will get the data from Appointment, AppointmentNote, AppointmentHistory, PayBillItemManual , Person tables. #region Person Rows BillingAddress, PayBillItemAuto, 65 ArrayList arrPersons = new ArrayList(); for (int j = 0; j < xmlListPerson.Count; j++) { if (ndAppointment.Attributes[0].Value.Trim() == (xmlListPerson[j])["AppointmentID"].ChildNodes[0].Value.Trim()) { XmlNode ndPerson = xmlListPerson[j]; ArrayList thePerson = new ArrayList(); thePerson.Add(ndPerson["LastName"].ChildNodes[0].Value.ToString()); thePerson.Add(ndPerson["FirstName"].ChildNodes[0].Value.ToString()); thePerson.Add(ndPerson["ReferenceNumber"].ChildNodes[0].Value.ToString( )); arrPersons.Add(thePerson); } } drAppointment["Person"] = arrPersons; #endregion dtAppointments.Rows.Add(drAppointment); } return dtAppointments; } Following is the Code snippet depicts calling onViewMyFolder method when Interpreter clicks on My Folder in the mobile application. OnViewMyFolder method intern calls the webservice GetInterpreterFolderAppointment method by passing the from and to date. public DataTable onViewMyFolder(A_UserInfo.clsUserinfo user,string strFromDate, string strToDate) { if (!Config.A_ConnectInternet.CheckInternetConnection()) { MessageBox.Show("Network Error: There is no internet connection. Please connect to the internet and try again.", "Require", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return new DataTable(); } I2S2Services.I2S2Services theService = new I2S2Services.I2S2Services(); I2S2Services.AuthHeader theAuthentication = new I2S2Services.AuthHeader(); theAuthentication.ProductKey = m_strProductKey; theAuthentication.ApplicationName = user.Appointment; theAuthentication.UserGroupTypeCode = user.Usergroup; theAuthentication.Username = user.Username; theAuthentication.Password = user.Password; theService.AuthHeaderValue = theAuthentication; 66 string strXML = theService.GetInterpreterFolderAppointment(strFromDate, strToDate).OuterXml; DataTable dtAppointments = LoadAppointmentDataTable(strXML); return dtAppointments; } Below code snippet will get the appointments for View Available Appointmetnts folder in the Internet Interpreter Scheduling System. It will intern call GetInterpreterAvailable Appointment method of the I2S2 Webservice. public DataTable onViewAvailableAppointments(A_UserInfo.clsUserinfo user, string strFromDate, string strToDate) { if (!Config.A_ConnectInternet.CheckInternetConnection()) { MessageBox.Show("Network Error: There is no internet connection. Please connect to the internet and try again.", "Require", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return new DataTable(); } I2S2Services.I2S2Services theService = new I2S2Services.I2S2Services(); I2S2Services.AuthHeader theAuthentication = new I2S2Services.AuthHeader(); theAuthentication.ProductKey = m_strProductKey; theAuthentication.ApplicationName = user.Appointment; theAuthentication.UserGroupTypeCode = user.Usergroup; theAuthentication.Username = user.Username; theAuthentication.Password = user.Password; theService.AuthHeaderValue = theAuthentication; string strXML = theService.GetInterpreterAvailableAppointment(strFromDate, strToDate).OuterXml; DataTable dtAppointments = LoadAppointmentDataTable(strXML); return dtAppointments; } Following Method demonstrates the loading of the appointment array list . It will check for the Collision Id. Collision id is to determine if the same appointment is getting modified by more than one user at a time. 67 If the agency and Interpreter are trying to save or modify any details of the appointment it will check for the collision id. Collision id calculate the time stamp of the appointment and ask the later update to refresh before doing the update to the same appointment. private ArrayList LoadAppointmentArrayList(string strXML) { ArrayList arrResult = new ArrayList(); XmlDocument theXmlDocument = new XmlDocument(); theXmlDocument.LoadXml(strXML); XmlNodeList xmlNodes = theXmlDocument.GetElementsByTagName("AppointmentDS"); XmlDocument xmlDocList = xmlNodes[0].OwnerDocument; XmlNodeList xmlListAppoint = xmlDocList.GetElementsByTagName("Appointment"); int nCount = xmlListAppoint.Count; for (int i = 0; i < nCount; i++) { XmlNode ndAppointment = xmlListAppoint.Item(i); ArrayList theAppointment = new ArrayList(); theAppointment.Add(ndAppointment["AppointmentTypeYearNumber"].ChildNode s[0].Value.ToString()); theAppointment.Add(ndAppointment["CollisionID"].ChildNodes[0].Value.ToS tring()); theAppointment.Add(ndAppointment["StartDateString"].ChildNodes[0].Value .ToString()); arrResult.Add(theAppointment); } return arrResult; } Implementation Details of Time Finish Code snippets in this section depict the functionality of the Time Finish Module, which is another major module in the entire application. #region LoadData private void LoadDataListView(DataTable tbList) { this.listView1.Items.Clear(); for (int i = 0; i < tbList.Rows.Count; i++) { #region Appointment Details DateTime dt = Convert.ToDateTime(tbList.Rows[i].ItemArray[1]); if (DateTime.Compare(dt, Convert.ToDateTime(DateTime.Now.ToShortDateString())) > 0) continue; ListViewItem lvitem = new ListViewItem(); 68 ListViewItem.ListViewSubItem lvsItem; lvitem.Text = Convert.ToString(tbList.Rows[i].ItemArray[0]); lvitem.Tag = Convert.ToString(tbList.Rows[i].ItemArray[11]); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[1]); lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[2]); lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[3]); lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[7]); lvitem.SubItems.Add(lvsItem); /**/ System.Collections.ArrayList arrTemp = new System.Collections.ArrayList(); arrTemp = (System.Collections.ArrayList)tbList.Rows[i].ItemArray[10]; System.Collections.ArrayList arr = new System.Collections.ArrayList(); string strFullName = string.Empty; string strRef = string.Empty; int k = 0; foreach (object o in arrTemp) { arr = (System.Collections.ArrayList)o; if (k == 0) { strFullName = strFullName + arr[0].ToString() + ", " + arr[1].ToString(); strRef = strRef + arr[2].ToString(); k = 1; } else { strFullName = strFullName + " / " + arr[0].ToString() + ", " + arr[1].ToString(); strRef = strRef + " / " + arr[2].ToString(); } } lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = strRef; lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = strFullName; lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[5]); lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[6]); lvitem.SubItems.Add(lvsItem); 69 lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[8]); lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[9]); lvitem.SubItems.Add(lvsItem); lvsItem = new ListViewItem.ListViewSubItem(); lvsItem.Text = Convert.ToString(tbList.Rows[i].ItemArray[4]); lvitem.SubItems.Add(lvsItem); this.listView1.Items.Add(lvitem); #endregion } } Following Code snippet is to create the Userinterface for the Time finish folder in scheduling System. CreateListView will create the display of the columns present in the time finish folder. Order of the columns to be displayed also mentioned here. Appt. Nbr, Date Of Service, Time Start, Duration, Language, Patient Name, Requester name, provider and customer name. Width of the column has to be specified before adding the elements ot the Interface. #region CreateControl private void CreateListView() { this.listView1 = new A_UserControl.ListViewEx(); this.col2 = new System.Windows.Forms.ColumnHeader(); this.ccol3 = new System.Windows.Forms.ColumnHeader(); this.col4 = new System.Windows.Forms.ColumnHeader(); this.col5 = new System.Windows.Forms.ColumnHeader(); this.col6 = new System.Windows.Forms.ColumnHeader(); this.col7 = new System.Windows.Forms.ColumnHeader(); this.col8 = new System.Windows.Forms.ColumnHeader(); this.col9 = new System.Windows.Forms.ColumnHeader(); this.col10 = new System.Windows.Forms.ColumnHeader(); this.col11 = new System.Windows.Forms.ColumnHeader(); this.col12 = new System.Windows.Forms.ColumnHeader(); this.col13 = new System.Windows.Forms.ColumnHeader(); this.listView1.Columns.Add(this.col2); this.listView1.Columns.Add(this.ccol3); this.listView1.Columns.Add(this.col4); this.listView1.Columns.Add(this.col5); this.listView1.Columns.Add(this.col9); 70 this.listView1.Columns.Add(this.col11); this.listView1.Columns.Add(this.col10); this.listView1.Columns.Add(this.col7); this.listView1.Columns.Add(this.col8); this.listView1.Columns.Add(this.col12); this.listView1.Columns.Add(this.col13); this.listView1.Columns.Add(this.col6); this.listView1.FullRowSelect = true; this.listView1.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Regular); this.listView1.Location = new System.Drawing.Point(0, 2); this.listView1.Name = "listView1"; this.listView1.TabIndex = 1; this.listView1.View = System.Windows.Forms.View.Details; this.listView1.ItemActivate += new System.EventHandler(this.listView1_ItemActivate); this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); this.listView1.ContextMenu = conMenuMain; this.listView1.GridLines = true; this.col2.Text = "Appt. Nbr."; this.col2.Width = 80; this.ccol3.Text = "Date Of Service"; this.ccol3.Width = 110; // // col4 // this.col4.Text = "Time Start"; this.col4.Width = 80; // // col5 // this.col5.Text = "Duration"; this.col5.Width = 70; this.col9.Text = "Language"; this.col9.Width = 120; this.col11.Text = "MR #"; this.col11.Width = 110; this.col10.Text = "Patient Name"; this.col10.Width = 150; this.col7.Text = "Clinic/Venue"; this.col7.Width = 180; this.col8.Text = "Department"; this.col8.Width = 180; this.col12.Text = "Requester Name"; this.col12.Width = 120; this.col13.Text = "Provider Name"; this.col13.Width = 150; this.col6.Text = "Customer Name"; this.col6.Width = 180; // // frmView 71 // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(240, 268); this.Controls.Add(this.listView1); this.Menu = mainMenuList; } Following three methods are used to call the web services for the folders corresponding to the Mobile Application. getMySchedule calls the onViewMySchedule web method by passing the from,to dates and username of the interpreter. getMyFolder method will call onViewMyFolder webmethod in the webservice. #region Get DataTable private DataTable getMySchedule() { return bWebservice.onViewMySchedule(this.user,m_sDateFrom,m_sDateTo); } private DataTable getMyFolder() { return bWebservice.onViewMyFolder(this.user, m_sDateFrom, m_sDateTo); } private DataTable getAvairableAppointment() { return bWebservice.onViewAvailableAppointments(this.user, m_sDateFrom, m_sDateTo); } #endregion Following code snippet of method OnSave will execute the Saving functionality of the Time Finish Folder. This method has the validations for the Confirmer Phone number, Confirmer Name and Authorization Code. Signature field will be validated with authorization code. User need to enter the authorization code before saving it. 72 Authorization code for the appointment will be verified with server side validation. MessageBox is a class used to display the error message in the framework. #region Save File XML private void OnSave() { #region Check input data if (ucTimeFinish1.getStartDate() == string.Empty) { return; } if (ucTimeFinish1.getStartHour() == string.Empty) { return; } if (ucTimeFinish1.getStartMinute() == string.Empty) { return; } if (ucTimeFinish1.getEndDate() == string.Empty) { return; } if (ucTimeFinish1.getEndHour() == string.Empty) { return; } if (ucTimeFinish1.getEndMinute() == string.Empty) { return; } if (ucTimeFinish1.getConfirmerName() == string.Empty) { MessageBox.Show("Confirmer's Name is required", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } if (ucTimeFinish1.getConfirmerPhone() == string.Empty) { return; } #endregion Check input data 73 Following Code snipppet depicts the saving details in the time finish module. In this implementation need to create a data table from reading the xml from path and load the details of the appointment into the data row. //Save File string strPath = Config.A_Config.I2S2PathSync + user.Appointment + "_" + user.Username + ".xml"; //Read file xml DataTable tbList = processXML.ReadSyncXML(strPath); //Merge table DataRow drList = tbList.NewRow(); drList["AppointmentTypeYearNumber"] = m_sAppointmentNumber; drList["HospitalName"] = ucTimeFinish1.getClinicVenue(); drList["DepartmentName"] = ucTimeFinish1.getDepartment(); drList["ProviderFullName"] = ucTimeFinish1.getProvider(); drList["Person"] = ucTimeFinish1.getReceptionServicee(); drList["StartDateString"] = ucTimeFinish1.getStartDate(); drList["StartTimeString"] = ucTimeFinish1.getStartHour() + ":" + ucTimeFinish1.getStartMinute() + " " + ucTimeFinish1.getStartPartDate(); drList["EndDateString"] = ucTimeFinish1.getEndDate(); drList["EndTimeString"] = ucTimeFinish1.getEndHour() + ":" + ucTimeFinish1.getEndMinute() + " " + ucTimeFinish1.getEndPartDate(); drList["ConfirmerName"] = ucTimeFinish1.getConfirmerName(); drList["ConfirmerPhone"] = ucTimeFinish1.getConfirmerPhone(); Following snippet is implemented to create the flag to validate the Authorization text box whether the authorization code exist or not. #region Check Picture int flag = 0; if (table.Rows.Count > 0) { for (int l = 0; l < table.Rows.Count; l++) { if (table.Rows[l].ItemArray[0].ToString() == m_sAppointmentNumber.Trim()) { if ((table.Rows[l].ItemArray[16].ToString() == "") && table.Rows[l].ItemArray[17].ToString() == "") { } else { if (table.Rows[l].ItemArray[16].ToString() != "") { 74 if (ucTimeFinish1.getAuthirozedCode().ToLower() != table.Rows[l].ItemArray[16].ToString().ToLower()) flag = 1; else flag = 2; } if (flag == 1) { if (table.Rows[l].ItemArray[17].ToString() != "") { if (ucTimeFinish1.getAuthirozedCode().ToLower() != table.Rows[l].ItemArray[17].ToString().ToLower()) flag = 1; else flag = 2; } } } Based on the value of the flag, if it is ‘1’ then displays an error message stating Invalid AuthorizationCode. If the authorization code is correct then saves the Authorization code into the data table. This Code validates the signature entered in the picture box . If the signature is not entered by the doctor , it will throw an error. After validating the mandatory fields the data will be saved into the xml. if (flag == 1) { MessageBox.Show("Authorization Code is required", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } if (flag == 2) { drList["AuthirozedCode"] = ucTimeFinish1.getAuthirozedCode(); } if (table.Rows[l].ItemArray[15].ToString().ToLower() == "true".ToLower()) { if (!ucTimeFinish1.PictureBoxHaveImage()) 75 { MessageBox.Show("Signature is required", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } else { drList["Signature"] = Convert.ToBase64String(ucTimeFinish1.getImageByte()); } } if (ucTimeFinish1.PictureBoxHaveImage()) drList["Signature"] = Convert.ToBase64String(ucTimeFinish1.getImageByte()); flag = l; } } } #endregion Check Picture tbList.Rows.Add(drList); //Write file table.Rows.RemoveAt(flag); processXML.WriteSyncXML(strPath, tbList); processXML.WriteTimeFinishXML(table, pathFileTimeFinish); RemoveViewDetail(); CreateListView(); LoadDataListView(table); } #endregion Save File XML This is the code written in the A_Process.xml, which is used to sync the data after submission of the appointment and sync to the database. WriteSyncXML will sync the data related to the appointment into the Appointment and Person tabels coorespondingly and encrypt the data before sending to the server. public void WriteSyncXML(string pathFile, DataTable dt) { #region Write File XML XmlDocument xmldoc = new XmlDocument(); ArrayList arr = new ArrayList(); string strXML = "<Appointments>"; int countRows = dt.Rows.Count; if (countRows > 0) { for (int i = 0; i < countRows; i++) 76 { strXML += "<AppointmentTypeYearNumber name='" + ReplaceSpecialChars(dt.Rows[i].ItemArray[0].ToString()) + "'>"; strXML += "<HospitalName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[1].ToString()) + "</HospitalName>"; strXML += "<DepartmentName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[2].ToString()) + "</DepartmentName>"; strXML += "<ProviderFullName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[3].ToString()) + "</ProviderFullName>"; strXML += "<StartDateString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[5].ToString()) + "</StartDateString>"; strXML += "<StartTimeString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[6].ToString()) + "</StartTimeString>"; strXML += "<EndDateString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[7].ToString()) + "</EndDateString>"; strXML += "<EndTimeString>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[8].ToString()) + "</EndTimeString>"; strXML += "<ConfirmerName>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[9].ToString()) + "</ConfirmerName>"; strXML += "<ConfirmerPhone>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[10].ToString()) + "</ConfirmerPhone>"; strXML += "<AuthirozedCode>" + ReplaceSpecialChars(dt.Rows[i].ItemArray[11].ToString()) + "</AuthirozedCode>"; strXML += "<Signature>" + dt.Rows[i].ItemArray[12].ToString() + "</Signature>"; strXML += "<Person>"; arr = (ArrayList)dt.Rows[i].ItemArray[4]; for (int j = 0; j < arr.Count; j++) { strXML += "<Information>"; strXML += "<LastName>" + ReplaceSpecialChars(Convert.ToString(((ArrayList)arr[j])[0])) + "</LastName>"; strXML += "<FirstName>" + ReplaceSpecialChars(Convert.ToString(((ArrayList)arr[j])[1])) + "</FirstName>"; strXML += "<ReferenceNumber>" + ReplaceSpecialChars(Convert.ToString(((ArrayList)arr[j])[2])) + "</ReferenceNumber>"; strXML += "</Information>"; } strXML += "</Person>"; 77 strXML += "</AppointmentTypeYearNumber>"; } } strXML += "</Appointments>"; xmldoc.LoadXml(strXML); if (File.Exists(pathFile)) { File.Delete(pathFile); } Config.A_Encryption_Decryption_XML.EncryptionFile(pathFile,xmldoc.Outer Xml); } Following code snippet depict the Event Listeners for the Time finish folder. This is to execute the functionality of the various options like Main Menu, Save, Search Results present in the time finish folder #region Main Menu List private void mnuItemListMainMenu_Click(object sender, EventArgs e) { this.Close(); } private void mnuItemListTimeFinishDetails_Click(object sender, EventArgs e) { if (this.listView1.SelectedIndices.Count > 0) { onSelectItemRow(); RemoveListView(); CreateViewDetail(); LoadViewDetail(this.m_sAppointmentNumber); } } #endregion #region Main Menu Details private void mnuItemDetailsSave_Click(object sender, EventArgs e) { OnSave(); } 78 GetAppointmentAuthorizationCode method will retrieve the appointment row and then get the authorization code for the appointment and if any case appointment is not having any authorization code then it will validate the authorization code of the customer. So Authorization Code should be given while doing the authorization for the Time Finishing appointment. This provides the security to the Scheduling System. public static string GetAppointmentAuthorizationCode(AppointmentDS.AppointmentRow oAppointment) { string rv = string.Empty; if (oAppointment != null) { if (!oAppointment.IsAuthorizationCodeNull()) { rv = oAppointment.AuthorizationCode; } else if (!oAppointment.IsDAuthorizationCodeNull()) { rv = oAppointment.DAuthorizationCode; } else if (!oAppointment.IsCAuthorizationCodeNull()) { rv = oAppointment.CAuthorizationCode; } } return rv; } 79 Chapter 6 6. RESULTS OF INTERNET INTERPRETER SCHEDULING SYSTEM The following screenshots capture the main functionalities of the Windows Mobile Application Internet Interpreter Scheduling System (I2S2) User Authentication: I2S2 Logic Screen User will enter the Application Name, User Name, and Password to enter into I2S2 Mobile application. If the User login is successful, then user will get access to functions of application. Here User will have option for selecting online or offline mode. Appointments can be time finish in offline mode. These appointments can be sync to the database after getting the internet connectivity. Following is the screenshot cradle the mobile device with I2S2 application and authenticating it. Figure 12 Cradle the POCKET PC Emulator in Device Manager Screenshot 80 After successful deployment of the application, device emulator uses to connect the mobile device simulator to the application and cradles the device. This process will take place after building and deploying the application. Following is the screen shot of the Microsoft Active Sync initialization process before user connect to the device. It will first look for the changes and then the process of synchronization starts. Figure 13 Initializing the Active Sync Screenshot This is the state the Microsoft Active sync after being connected. Then the device is ready to login and use. 81 Figure 14 After Synchronization Screenshot Following is the screen shot of the home screen of Mobile application. This includes all the modules Schedule, Time finish, My Folder, Sync and View Available Appointments. After selecting the folder name the application loads the appointments by calling the global web services, which intern make calls to the database and retrieves data. 82 Figure 15 Folders of the Application Screenshot Screen Flow for Schedule: User clicks on Schedule Folder of the scheduling system. It will show all the appointments scheduled for the interpreter. Interpreter can view the appointments in day, weekly and monthly view depends on user convenience. In the following screen, date selection dropdown will show the calendar picker when the interpreter click on the drop down. 83 Figure 16 Schedule with Appointments search Figure 17 Schedule with Cannot Cover option selected 84 Schedule folder has the options like I will Take it, Cannot cover and View details. Interpreter can choose one of the options to perform the actions depends on their availability for the appointment. Interpreter can view the details of the appointment by selecting the View details option provided in the Schedule folder. It will show the Requester, Patient and Appointment details with the time details of the appointment. It will help the interpreter to decide to accept or reject the appointment. Following Screen shot is used to show the options provided by the application for interpreter in the Schedule folder. Figure 18 Schedule with options Screen Shot 85 If the interpreter selects cannot cover option, appointment will go to the agency pool without any assignee. Agency will reschedule the appointment to another interpreter. Interpreter can go back to the main home screen by clicking on Main Menu option provided in the Action. Screen Flow for View Available Appointments: View available appointments folder will show all appointments for the interpreter that are not assigned to any other interpreter and related to the interpreter speaking language. Interpreter can view the details of the appointment by clicking the View Details option provided in the View Available Appointments folder. Figure 19 View Available Appointments with options Screenshot 86 Following is the screen shot after selecting View Details option in the View Available Appointments Folder. It shows all the requester, clinic and patient details related to the Appointment. Figure 20 View Details of the View Appointment details Screenshot Interpreter can select the option “I will Take it”, then the appointment will display in the Schedule Folder of the Interpreter. View Details will show the Requester, Patient and Appointment details. 87 Following is the Screen shot of the Available appointments folder with the Search results option activated. “Cannot Cover” option is available for the appointments in this folder. Interpreter will be able to select the appointments by selecting the choice “I will Take it” Figure 21 View Details of the View Appointments with Search Results Selected 88 Figure 22 View Available Appointments Screen shot Interpreter can view the appointments day, week and monthly format depending on choice. Interpreter can pick any date by clicking on the dropdown; it will pop up a calendar picker. Interpreter can select any date and view the appointments correspondingly. Below screenshot shows the View available appointments folder with “I will Take it” option active. Interpreter selects that option, appointment will transfer to the schedule folder of the mobile application. 89 Figure 23 View Available Appointments with “I will Take It” selection Screen shot Screen flow for My Folder My Folder will show the appointments scheduled for the interpreter by the agency or Requester. Interpreter can view the appointments in day, weekly or monthly format. Interpreter can reject the appointments by clicking on the “Cannot Cover”, then appointments will go to the public folder. Interpreter can pick the appointment again by going to the View Available appointments or Agency will reschedule it to someone else. 90 Figure 24 View My Folder with Appointments Search Results Figure 25 View Details in the View My Folder 91 View Details will show the Requester, appointment details when the view details option selected by the interpreter in the View My Folder. Depending on the details, the Interpreter can select the appointment or reject the appointment. Screen flow for Time Finish: Time Finish Folder will show the appointments for that day. Below screenshot shows the view results of the time finish folder. Figure 26 Time Finish Module with Appointment Screen shot 92 User will have only two options Time Finish Details and Main Menu. Following is the screen shot of the Time finished folder with options selected. Figure 27 Time Finish of Appointment with functions Screen shot Following is the screenshot of the time-finished folder with requester tab selected. User can use the keyboard with stylus to modify the details of the appointment. 93 Time Finish tab of the Time Finish Folder will have the appointment start and end time. Supervisor or doctor at venue will authorize the appointment by entering the Confirmer name and Phone number before saving the appointment. Figure 28 Time Finish Module with Requester tab Screen shot 94 Below is the screen shot of the time finish tab of the time finish folder. Figure 29 Time Finish Module with Time Finish tab Screen shot Figure 30 Time Finish Module with Patient tab Screen shot 95 Figure 31 Time Finish Module with Time Finish Tab Screen shot In Time Finish module the interpreter or supervisor provided with option to change the starting time of the appointment in case of any delays due to late coming of patient or doctor. Interpreter will enter the end time and get authorization from the supervisor. Action provided with three option. Save option is use to save the details and sync the appointment. Search Results will show the today’s Appointments for the interpreter in the Time finish Module. Main Menu option will display the all the folders for the interpreter. 96 Figure 32 Time Finish Screen with save option Screen shot Below Screen shots depicts the Authorization tab of the time finish folder. Interpreter can enter the authorization code and signature of the interpreter. Doctor or Corresponding person will do the signature on Authorization tab with Stylus. User will have the option of clearing the signature if any case of any mistake. Doctor or supervisor can do signature on the Authorization Tab of the Time finish folder by stylus. 97 Figure 33 Time Finish Folder authorization tab Screen shot Figure 34 Time Finish Module Authorization Tab Screen shot 98 After saving the appointment completed, It will disappear from the Time Finish folder and move to Sync Folder. Following screenshot is used to Time finish screen after successful submission of the appointment and went to the sync folder. Figure 35 Completing the Time Finish for Appointment Screenshot Screen flow for Sync Appointments time finished by the interpreter will display in the Sync Folder of the Application. When the User clicks on “Sync” it will synchronize the appointments to the database. All the appointments will update in the global database by web service calls. 99 Figure 36 Sync Module Screen shot Figure 37 Sync Module with functions screen shot 100 Above Screen shot is used to Sync Folder with Sync option selected. Appointment need to be checked before sync to the database. Unchecked appointments will not be get sync with the database. Following screen shot depicts the Remove option selected in the Sync Folder. Figure 38 Sync Appointments with remove option activated Screen shot Appointments will be removed before performing the Sync option. Sync operation synchronizes the application with database. 101 Sync operation provides the functionality with multiple appointments. Interpreter can synchronize any number of appointments at once to the database. Interpreter will select the appointments supposed to get sync and click on Sync option, which enables the sync with the database through web services. Figure 39 Synchronize the appointment with Sync option selected Screen Shot Testing of the MapQuest functionality through web service Calculation of driving distance and time will be calculated by the Map Services Web service, which is implemented using the Map Quest API. From and To address for 102 source and destinations should be entered into the fields. User click on invoke, it will get the distance and travel time in xml format. Method will parse the values and display for the time finish module. Below screen shot is used to show the calculation of driving distance interface to calculate the distance and time for the interpreter to travel from source to destination. Figure 40 Distance Calculation Web Service using Map Quest Screen shot 103 Following Screen shot is used to show the mileage for the appointment after calculating the distance between the source and destination points. Here source address taken by the scheduling system from the configuration settings entered by the customer and interpreter address settings will take from the interpreter configuration settings from the interpreter platform. Customer can opt for two types of mileages. One for round trip and another option for point to point mileage. Round Trip mileage calculates the round trip distance from the source to destination and again from destination to source. Point to point mileage will be configured when the interpreter had sequence appointments. Travel distance will be calculated from the source to destination and destination to another destination and so on. Finally back to the Source. 104 Figure 41 Calculation of Mileage by using Map Quest in Time Finish Screen shot 105 Chapter 7 7. CONCLUSION In Recent Years Mobile Applications deliver complex functionalities on platforms that have limited resource for computing. Mobile Application testing is one of the most important part of development life cycle. Testing involves both the software and hardware equipment. It is important to have good equipment to support the software build. The application is first tested within the development environment using emulators. Later it is subjected to field testing. Emulators provide inexpensive way to test the applications on mobile phones to which we may not have physical access. Testing developer has to understand the network landscape and device landscape for mobile application. After that need to find out bottlenecks. Conditions like wireless traffic and user load, which arise on actual device, should be taken into consideration while measuring performance. Some of the advantages of using the Mobile application are Highly Automated. High Interoperability Flexibility Fast Processing 106 This project is developed as a real-time project for client. It aims at providing an efficient Mobile-based solution that ensures quick and fast processing of the scheduling System. It contributes to improve productivity of the interpreter and more efficient scheduling system that handles a greater load of appointments without increasing staff. It provides the capability to better communicate with customers, provide immediate information on appointment status to Agency and Requesters. This project is efficient in realizing the goals of the Staff of the Agency by efficiently calculating the Mileage and Travel Time using the Map Quest. This reduces the work of staff for manual calculation and adjusting the mileages for the interpreters while generating the invoice for both customer and interpreters. In addition, It provides the flexibility of automation of the voucher and reduced the time for processing the payroll of the employees. The scope of the project defined in such a way that, it can submitted as a Master’s project. 107 Functionality Extensions The following functionalities can be possible additions onto the existing system: 1. Integrate the time tracking system with the existing scheduling application. Time tracking system track the time spent by the interpreters at venue and traveling more efficiently. Agency will know the availability of the interpreter and delay in the appointment rapidly. Billing to the customer and payments to the interpreter will be more efficient based on the work completed. 2. Make this software compatible to different mobile operating systems like Android and IOS, so that huge percentage of users will be able to get benefited from this application. 108 APPENDIX Hardware and Software Specifications Hardware Requirements WINDOWS Mobile Phone with Touch Screen Development Environment: Pentium-IV Processor or above 250MB of Free Hard disk space 1GB of RAM Network interface card or Modem (For Remote Access) Software Requirements Windows Mobile OS WI-FI / 3G / Internet Connection Development Environment: Microsoft Visual Studio .Net 2008 Enterprise Edition Microsoft .Net Framework 3.5 Internet Information Services (IIS) Microsoft SQL Server 2005 Programming Languages – C# MAP QUEST SDK XML 109 BIBLIOGRAPHY 1. A.Russell Jones ( 2002 ) : Mastering Asp.Net with C#; SYBEX 2. Building Microsoft ASP.NET Applications for Mobile Devices, Second Edition (Pro-Developer) by Andy Wigley 3. Creating ASP.NET Mobile Web Pages: Retrieved from the Microsoft Corporation MSDN Library. Website: http://msdn.microsoft.com/enus/library/8htez1ds(v=VS.80).aspx 4. W3C Working Group Note 11 February 2004 http://www.w3.org/TR/2004/NOTE-ws-gloss-20040211/ 5. Windows Phone Development, from MSDN Website: http://msdn.microsoft.com/en-us/library/ff402535%28v=VS.92%29.aspx 6. Creating Web Services : Retrieved from Microsoft Corporation MSDN Library. Website:http://msdn.microsoft.com/en-us/library/9xe4bs0s(v=VS.90).aspx 7. MapQuest Platform Web Services from MapQuest developer Network http://www.mapquestapi.com/