You are on page 1of 103

Hospital feedback System SDSC SHAR

HOSPITAL FEEDBACK SYSTEM SDSC SHAR


Project report Submitted by P.SATHISH M.CHANDRABABU Y.TARUN R.SRINIVAS (09F81A05A2) (09F81A0567) (09F81A05B1) (09F81A05A6)

Work Carried At

INDIAN SPACE RESEARCH ORGANISATION SDSC / SHAR / SRIHARIKOTA

Project submitted
In partial fulfillment of the requirements for the award of degree of

BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE ENGINEERING During the year 2009-2013 Under The Esteemed Guidance Of Mr. RAJKUMAR
SCI-ENG-SE, RTS&SDS, SDSC/SHAR Satish Dhawan Space Centre, SHAR Sriharikota.

SATISH DHAWAN SPACE CENTER/SHAR


SRIHARIKOTA, NELLORE (Dist)

Hospital feedback System SDSC SHAR

BONAFIDE CERTIFICATE
This is to certify that the project entitled HOSPITAL FEEDBACK SYSTEM SDSC SHAR is a bonafide record of the work done at SDS(SPECIALIZED DEVELOPED SYSTEMS)is a bonafide work carried by above students in partial fulfillment of the requirements for the award of the degree of B.TECH (COMPUTER SCIENCE ENGINEERING) and that is under our guidance during the period from Jan 2013 to Feb 2013. During their stay at SDSC- SHAR/ISRO, their conduct is very good.
(PROJECT GUIDE)

Mr. RAJKUMAR
SCI-ENG-SE, RTS & SDS, SDSC/SHAR.

Mr.P.SUNIL
Manager, RTS & SDS, SDSC/SHAR.

PLACE: SRIHARIKOTA

DATE:

Hospital feedback System SDSC SHAR

ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of our project work would be incomplete without the mention of the people whose constant guidance and encouragement crowned our efforts with success. We would like to thank HRDD, SDSC/SHAR for giving us an opportunity to carry out this project work. We express our sincere gratitude to Mr. RajKumar, SCI/ENG-SC, RTS & SDS, for providing us all the facilities to do the project and valuable ideas, helpful criticisms and constant encouragement in all the phases of this project work. We are greatly indebted to Mr. P.Sunil, Manager, SCI/ENG-SG, RTS & SDS, for his eminent guidance and support to complete the project work presented in this report.

Finally we consider it as our privilege to express our gratitude and respect to all those who guided, inspired and helped us directly and indirectly in the completion of our project work.

Hospital feedback System SDSC SHAR

ABSTRACT
OBJECTIVE :

This system is designed to receive feedback information from patient about various facilities provided in the hospital. Then to analyze those feedback using bar charts, pie charts, venn diagrams etc., This can helps in improving the weak delay. Hospitals currently use a manual system for the management and maintenance of critical information. The current system requires numerous paper forms, with data stores spread throughout the hospital management infrastructure. Often information (on forms) is incomplete, or does not follow management standards. Forms are often lost in transit between departments requiring a comprehensive auditing process to ensure that no vital information is lost. Multiple copies of the same information exist in the hospital and may lead to inconsistencies in data in various data stores. A significant part of the operation of any hospital involves the acquisition, management and timely retrieval of great volumes of information. All of this information must be managed in an efficient and cost wise fashion so that an institution's resources may be effectively utilized . It aims at standardizing data, consolidating data ensuring data integrity and reducing inconsistencies. PROJECT OVERVIEW : The Hospital feedback System (HFS) is designed for any Hospital to replace their existing manual, paper based system. The new system is to control the following information; A significant part of the operation of any hospital involves the acquisition, management and timely retrieval of great volumes of information. This information typically involves; staff respect and concern for comfort, cleanliness and ambience, seating arrangement and waiting area, how well were your question answered, How good are lab services, how good are pharmacy services, waiting time taken for consulting the doctor, overall satisfaction with patient experience . All of 4

Hospital feedback System SDSC SHAR this information must be managed in an efficient and cost wise fashion so that an institution's resources may be effectively utilized HFS will automate the management of the hospital making it more efficient. It aims at standardizing data, consolidating data ensuring data integrity and reducing inconsistencies.

SOFTWARE REQUIREMENTS :

Web Technologies : .NET 3.5 SP1 Language Database : C# : MS-ACCESS

Operating System : WINDOWS XP/VISTA/7

Hospital feedback System SDSC SHAR

INDEX
S. N CONTENTS

1.
2.

INTRODUCTION ANALYSIS

2.1 2.2
3.

SYSTEM ANALYSIS SYSTEM SPECIFICATIONS

DESIGN APPROACH

3.1 3.2 3.3 3.4 4.


5.

INTRODUCTION TO DESIGN UML DIAGRAMS DATA FLOW DIAGRAMS E-R DIAGRAMS


PROJECT MODULES

IMPLEMENTATION

4.1 4.2

CONCEPTS AND TECHNIQUES TESTING 4.2.1 TEST CASES

6. 7.

OUTPUT SCREENS CONCLUSION

Hospital feedback System SDSC SHAR

Introduction

Hospital feedback System SDSC SHAR

INTRODUCTION:
Feedback is a necessary part of any organization or person to improve the performance. It becomes compulsive in case of hospital where hundreds of patients give a visit every day. It is essential to know what problem they are facing while visiting the hospital and how they can be resolved. There are many services provided in the SHAR-Hospital y like pharmacy services, Lab services which includes X-Ray and blood testing, General staff in the hospital, Emergency services. Apart from this feedback on the part of doctor, how well a patients questions were answered by the doctor?. This all feedback is collected manually which includes lots of paperwork. Then this manual feedback is analyzed and worked up to improve the area of work. It is a time consuming and cumbersome task. There may be hundreds of records; Feedback given by patients may consist of many areas. So it becomes necessary to have an automated system which can help in storing, retrieving and analyzing the information. Proposed system will store the manual information entered by the operator and then this information can be analyzed using bar chart, pie chart and line graph. Which will give clear picture about area of improvement and the area which are working better than others.

Hospital feedback System SDSC SHAR

Analysis

Hospital feedback System SDSC SHAR

1. Existing System
In the existing manual system takes lot of time is spent on taking the forms and generating the reports. Hospitals currently use a manual system for the management and maintenance of critical information. The current system requires numerous paper forms, with data stores spread throughout the hospital management infrastructure. Often information (on forms) is incomplete, or does not follow management standards. Forms are often lost in transmit requiring a comprehensive auditing process to ensure that no vital information is lost. Multiple copies of the same information exist in the hospital and may lead to inconsistencies in data in various data stores.

2. Proposed System
The Hospital feedback System (HFS) is designed for Any Hospital to replace their existing manual, paper based system. The new system is to control the following information; staff respect and concern for comfort, cleanliness and ambience, seating arrangement and waiting area, how well were your question answered, how do you rate of lab services, how would you rate of pharmacy services, waiting time taken for consulting the doctor, overall satisfaction with patient experience, patient information. These services are to be provided in an efficient, cost effective manner, with the goal of reducing the time and resources currently required for such tasks.

3. Objective of the System


Hospitals currently use a manual system for the management and maintenance of critical information. The current system requires numerous paper forms, with data stores spread throughout the hospital management infrastructure. Often information (on forms) is incomplete, or does not follow management standards. Forms are often lost in transit requiring a comprehensive auditing process to ensure that no vital information is lost. Multiple copies of the

10

Hospital feedback System SDSC SHAR same information exist in the hospital and may lead to inconsistencies in data in various data stores. Analysis of data is cumbersome and time consuming task.

System Specifications
Hardware Requirements: Pentium-IV(Processor). 512 MB Ram 512 KB Cache Memory Hard disk 10 GB Microsoft Compatible 101 or more Key Board

Software Requirements: Operating System : Windows XP or above

Programming language: .NET Framework 3.5 SP1 Front-End: Back-End: C#.NET Ms-Access 2003 or above

11

Hospital feedback System SDSC SHAR

DESIGN

Design is the first step in the development phase for any techniques and principles for the purpose of defining a device, a process or system in sufficient detail to permit its physical realization. Once the software requirements have been analyzed and specified the software design involves three technical activities - design, coding, implementation and testing that are required to build and verify the software. 12

Hospital feedback System SDSC SHAR

The design activities are of main importance in this phase, because in this activity, decisions ultimately affecting the success of the software implementation and its easy of maintenance are made. These decisions have the final bearing upon reliability and maintainability of the system. Design is the only way to accurately translate the customers requirements into finished software or a system. Design is the place where quality is fostered in development. Software design is a process through which requirements are translated into a representation of software. Software design is conducted in two steps. Preliminary design is concerned with the transformation of requirements into data.

UML Diagrams:
Actor:
A coherent set of roles that users of use cases play when interacting with the use `cases.

Use case:
A description of sequence of actions, including variants, that a system performs that yields an observable result of value of an actor.

UML stands for Unified Modeling Language. UML is a language for specifying, visualizing and documenting the system. This is the step while developing any product after analysis. The goal from this is to produce a model of the entities involved in the project which

13

Hospital feedback System SDSC SHAR later need to be built. The representation of the entities that are to be used in the product being developed need to be designed. There are various kinds of methods in software design: They are as follows: Use case Diagram Sequence Diagram Collaboration Diagram Activity Diagram State chat Diagram

USECASE DIAGRAMS: Use case diagrams model behavior within a system and helps the developers understand of what the user require. The stick man represents whats called an actor. Use case diagram can be useful for getting an overall view of the system and clarifying who can do and more importantly what they cant do. Use case diagram consists of use cases and actors and shows the interaction between the use case and actors. The purpose is to show the interactions between the use case and actor. To represent the system requirements from users perspective. An actor could be the end-user of the system or an external system.

14

Hospital feedback System SDSC SHAR COLLABORATION DIAGRAM: A collaboration diagram is an introduction diagram that emphasizes the structural organization of the objects that send and receive messages. Graphically a collaboration diagram is a collection of vertices and arcs. CLASS DIAGRAM: Class is nothing but a structure that contains both variables and methods. The Class Diagram shows a set of classes, interfaces, and collaborations and their relating ships. There is most common diagram in modeling the object oriented systems and are used to give the static view of a system. It shows the dependency between the classes that can be used in our system. The interactions between the modules or classes of our projects are shown below. Each block contains Class Name, Variables and Methods.

15

Hospital feedback System SDSC SHAR

DATA FLOW DIAGRAMS:


The DFD takes an input-process-output view of a system i.e. data objects flow into the software, are transformed by processing elements, and resultant data objects flow out of the software. Data objects represented by labeled arrows and transformation are represented by circles also called as bubbles. DFD is presented in a hierarchical fashion i.e. the first data flow model represents the system as a whole. Subsequent DFD refine the context diagram (level 0 DFD), providing increasing details with each subsequent level. The DFD enables the software engineer to develop models of the information domain & functional domain at the same time. As the DFD is refined into greater levels of details, the analyst perform an implicit functional decomposition of the system. At the same time, the DFD refinement results in a corresponding refinement of the data as it moves through the process that embody the applications. A context-level DFD for the system the primary external entities produce information for use by the system and consume information generated by the system. The labeled arrow represents data objects or object hierarchy.

RULES FOR DFD:


Fix the scope of the system by means of context diagrams. Organize the DFD so that the main sequence of the actions Reads left to right and top to bottom. Identify all inputs and outputs.

16

Hospital feedback System SDSC SHAR Identify and label each process internal to the system with Rounded circles.

A process is required for all the data transformation and Transfers. Therefore, never connect a data store to a data Source or the destinations or another data store with just a Data flow arrow. Do not indicate hardware and ignore control information. Indicate external sources and destinations of the data, with Squares. Number each occurrence of repeated external entities. Identify all data flows for each process step, except simple Record retrievals. Label data flow on each arrow. Use details flow on each arrow.

Use the details flow arrow to indicate data movements. Operato r

Enter a Record

Generate Report/Gr aphs

Enter a Record

Database

17

Hospital feedback System SDSC SHAR

E-R Diagrams:
The Entity-Relationship (ER) model was originally proposed by Peter in 1976 [Chen76] as a way to unify the network and relational database views. Simply stated the ER model is a conceptual data model that views the real world as entities and relationships. A basic component of the model is the Entity-Relationship diagram which is used to visually represents data objects. Since Chen wrote his paper the model has been extended and today it is commonly used for database design For the database designer, the utility of the ER model is:

it maps well to the relational model. The constructs used in the ER model can easily be transformed into relational tables. it is simple and easy to understand with a minimum of training. Therefore, the model can be used by the database designer to communicate the design to the end user. In addition, the model can be used as a design plan by the database developer to implement a data model in a specific database management software.

Connectivity and Cardinality The basic types of connectivity for relations are: one-to-one, one-to-many, and many-to-many. A one-to-one (1:1) relationship is when at most one instance of a entity A is associated with one instance of entity B. For example, "employees in the company are each assigned their own office. For each employee there exists a unique office and for each office there exists a unique employee. A one-to-many (1:N) relationships is when for one instance of entity A, there are zero, one, or many instances of entity B, but for one instance of entity B, there is only one instance of entity A. An example of a 1:N relationships is a department has many employees each employee is assigned to one department A many-to-many (M:N) relationship, sometimes called non-specific, is when for one instance of entity A, there are zero, one, or many instances of entity B and for one instance of entity B there

18

Hospital feedback System SDSC SHAR are zero, one, or many instances of entity A. The connectivity of a relationship describes the mapping of associated

ER Notation

There is no standard for representing data objects in ER diagrams. Each modeling methodology uses its own notation. The original notation used by Chen is widely used in academics texts and journals but rarely seen in either CASE tools or publications by nonacademics. Today, there are a number of notations used, among the more common are Bachman, crow's foot, and IDEFIX. All notational styles represent entities as rectangular boxes and relationships as lines connecting boxes. Each style uses a special set of symbols to represent the cardinality of a connection. The notation used in this document is from Martin. The symbols used for the basic ER constructs are: entities are represented by labeled rectangles. The label is the name of the entity. Entity names should be singular nouns. relationships are represented by a solid line connecting two entities. The name of the relationship is written above the line. Relationship names should be verbs attributes, when included, are listed inside the entity rectangle. Attributes which are identifiers are underlined. Attribute names should be singular nouns. cardinality of many is represented by a line ending in a crow's foot. If the crow's foot is omitted, the cardinality is one.

19

Hospital feedback System SDSC SHAR

ER Diagram for hospital feedback system:

ID

EmpID

Feedback

1..N

1..N

PersonalDetails

20

Hospital feedback System SDSC SHAR

MODULES

21

Hospital feedback System SDSC SHAR

PROJECT MODULES
Login Enter a record/Feedback Form Draw Bar Graph Draw Pie charts Draw Venn diagram

MODULE DESCRIPTION

22

Hospital feedback System SDSC SHAR Name of the module-1: Login Description: This option provides the administrator to enter username and password, which on verifying with database gives permission to access. This provides security from unauthorized access to the application and database.

Once user enters correct username and password, A new window appears with multiple options Name of the module-2: Feedback Description: Whenever a patient visits the hospital a feedback form is given to him for filling. Operator collects that feedback form and enters into the database using this application. Same kind of form is given in the application. Operator enters feedback given by patient into the database. This form consist of multiple question which are answered by the user. A unique id as mentioned by patient is entered. Patients personal information like Name, contact number, date of births are entered.

23

Hospital feedback System SDSC SHAR

Name of the module-3: Bar diagram Description: A bargraph is a chart that uses either horizontal or vertical bars to show comparisons among the categories

24

Hospital feedback System SDSC SHAR

Name of the module-4: pie charts Description: pie chart is a circular chart divided into sectors. piecharts are useful to compare different parts of whole amount.piecharts are perhaps the most ubiquitous chart type they found in newspapers,business reports,and many other places.

25

Hospital feedback System SDSC SHAR

Name of the module-5: venn diagrams Description: A venn diagram or set diagram is a diagram that shows all possible relations between a finite collection of sets.

26

Hospital feedback System SDSC SHAR

27

Hospital feedback System SDSC SHAR

IMPLEMENTATION

28

Hospital feedback System SDSC SHAR

OVERVIEW OF TECHNOLOGIES USED 3.1 Front End Technology Microsoft .NET Framework
The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives:

To provide a consistent object-oriented programming environment whether object code is To provide a code-execution environment that minimizes software deployment and To provide a code-execution environment that guarantees safe execution of code, including To provide a code-execution environment that eliminates the performance problems of To make the developer experience consistent across widely varying types of applications, To build all communication on industry standards to ensure that code based on the .NET

stored and executed locally, executed locally but Internet-distributed, or executed remotely.

versioning conflicts.

code created by an unknown or semi-trusted third party.

scripted or interpreted environments.

such as Windows-based applications and Web-based applications.

Framework can integrate with any other code. The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting , while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the 29

Hospital feedback System SDSC SHAR runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services. The .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code, thereby creating a software environment that can exploit both managed and unmanaged features. The .NET Framework not only provides several runtime hosts, but also supports the development of thirdparty runtime hosts. The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system. The illustration also shows how managed code operates within a larger architecture. Features of the Common Language Runtime The common language runtime manages memory, thread execution, code execution, code safety verification, compilation, and other system services. These features are intrinsic to the managed code that runs on the common language runtime. With regards to security, managed components are awarded varying degrees of trust, depending on a number of factors that include their origin (such as the Internet, enterprise network, or local computer). This means that a managed component might or might not be able to perform fileaccess operations, registry-access operations, or other sensitive functions, even if it is being used in the same active application. The runtime enforces code access security. For example, users can trust that an executable embedded in a Web page can play an animation on screen or sing a song, but cannot access their personal data, file system, or network. The security features of the runtime thus enable legitimate Internet-deployed software to be exceptionally featuring rich.

30

Hospital feedback System SDSC SHAR The runtime also enforces code robustness by implementing a strict type- and code-verification infrastructure called the common type system (CTS). The CTS ensures that all managed code is self-describing. The various Microsoft and third-party language compilers generate managed code that conforms to the CTS. This means that managed code can consume other managed types and instances, while strictly enforcing type fidelity and type safety. In addition, the managed environment of the runtime eliminates many common software issues. For example, the runtime automatically handles object layout and manages references to objects, releasing them when they are no longer being used. This automatic memory management resolves the two most common application errors, memory leaks and invalid memory references. The runtime also accelerates developer productivity. For example, programmers can write applications in their development language of choice, yet take full advantage of the runtime, the class library, and components written in other languages by other developers. Any compiler vendor who chooses to target the runtime can do so. Language compilers that target the .NET Framework make the features of the .NET Framework available to existing code written in that language, greatly easing the migration process for existing applications. While the runtime is designed for the software of the future, it also supports software of today and yesterday. Interoperability between managed and unmanaged code enables developers to continue to use necessary COM components and DLLs. The runtime is designed to enhance performance. Although the common language runtime provides many standard runtime services, managed code is never interpreted. A feature called justin-time (JIT) compiling enables all managed code to run in the native machine language of the system on which it is executing. Meanwhile, the memory manager removes the possibilities of fragmented memory and increases memory locality-of-reference to further increase performance. Finally, the runtime can be hosted by high-performance, server-side applications, such as Microsoft SQL Server and Internet Information Services (IIS). This infrastructure enables you to use managed code to write your business logic, while still enjoying the superior performance of the industry's best enterprise servers that support runtime hosting.

31

Hospital feedback System SDSC SHAR .NET Framework Class Library The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented, providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use, but also reduces the time associated with learning new features of the .NET Framework. In addition, third-party components can integrate seamlessly with classes in the .NET Framework. For example, the .NET Framework collection classes implement a set of interfaces that you can use to develop your own collection classes. Your collection classes will blend seamlessly with the classes in the .NET Framework. As you would expect from an object-oriented class library, the .NET Framework types enable you to accomplish a range of common programming tasks, including tasks such as string management, data collection, database connectivity, and file access. In addition to these common tasks, the class library includes types that support a variety of specialized development scenarios. For example, you can use the .NET Framework to develop the following types of applications and services:

Console applications. Scripted or hosted applications. Windows GUI applications (Windows Forms). ASP.NET applications. XML Web services. Windows services.

For example, the Windows Forms classes are a comprehensive set of reusable types that vastly simplify Windows GUI development. If you write an ASP.NET Web Form application, you can use the Web Forms classes. Client Application Development Client applications are the closest to a traditional style of application in Windows-based programming. These are the types of applications that display windows or forms on the desktop,

32

Hospital feedback System SDSC SHAR enabling a user to perform a task. Client applications include applications such as word processors and spreadsheets, as well as custom business applications such as data-entry tools, reporting tools, and so on. Client applications usually employ windows, menus, buttons, and other GUI elements, and they likely access local resources such as the file system and peripherals such as printers. Another kind of client application is the traditional ActiveX control (now replaced by the managed Windows Forms control) deployed over the Internet as a Web page. This application is much like other client applications: it is executed natively, has access to local resources, and includes graphical elements. In the past, developers created such applications using C/C++ in conjunction with the Microsoft Foundation Classes (MFC) or with a rapid application development (RAD) environment such as Microsoft Visual Basic. The .NET Framework incorporates aspects of these existing products into a single, consistent development environment that drastically simplifies the development of client applications. The Windows Forms classes contained in the .NET Framework are designed to be used for GUI development. You can easily create command windows, buttons, menus, toolbars, and other screen elements with the flexibility necessary to accommodate shifting business needs. For example, the .NET Framework provides simple properties to adjust visual attributes associated with forms. In some cases the underlying operating system does not support changing these attributes directly, and in these cases the .NET Framework automatically recreates the forms. This is one of many ways in which the .NET Framework integrates the developer interface, making coding simpler and more consistent. Language Support

The Microsoft .NET Platform currently offers built-in support for three languages: C#, Visual Basic, and Jscript .

33

Hospital feedback System SDSC SHAR

3.2 BACK END TECHNOLOGY:

About Microsoft ACCESS 2007:


Microsoft Access, also known as Microsoft Office Access, is a database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. It is a member of the Microsoft Office suite of applications, included in the Professional and higher editions or sold separately. On May 12, 2010, the current version of Microsoft Access 2010 was released by Microsoft in Office 2010; Microsoft Office Access 2007 was the prior version. Microsoft Access stores data in its own format based on the Access Jet Database Engine. It can also import or link directly to data stored in other applications and databases. Software developers and data architects can use Microsoft Access to develop application software, and "power users" can use it to build software applications. Like other Office applications, Access is supported by Visual Basic for Applications, an object-oriented programming language that can reference a variety of objects including DAO (Data Access Objects), ActiveX Data Objects, and many other ActiveX components. Visual objects used in forms and reports expose their methods and properties in the VBA programming environment, and VBA code modules may declare and call Windows operating-system functions.

C# Language
C# (pronounced C Sharp) is a multi-paradigm programming language that encompasses functional, imperative, generic, object-oriented (class-based), and componentoriented programming disciplines. It was developed by Microsoft as part of the .NET initiative and later approved as a standard by ECMA (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the 44 programming languages supported by the .NET Framework's Common Language Runtime. C# is intended to be a simple, modern, general-purpose, object-oriented programming language. Anders Hejlsberg, the designer of Delphi, leads the team which is

34

Hospital feedback System SDSC SHAR developing C#. It has an object-oriented syntax based on C++ and is heavily influenced by other programming languages such as Delphi and Java. It was initially named Cool, which stood for "C like Object Oriented Language". However, in July 2000, when Microsoft made the project public, the name of the programming language was given as C#. The most recent version of the language is C# 3.0 which was released in conjunction with the .NET Framework 3.5 in 2007. The next proposed version, C# 4.0, is in development.

History:In 1996, Sun Microsystems released the Java programming language with Microsoft soon purchasing a license to implement it in their operating system. Java was originally meant to be a platform independent language, but Microsoft, in their implementation, broke their license agreement and made a few changes that would essentially inhibit Java's platform-independent capabilities. Sun filed a lawsuit and Microsoft settled, deciding to create their own version of a partially compiled, partially interpreted object-oriented programming language with syntax closely related to that of C++. During the development of .NET, the class libraries were originally written in a language/compiler called Simple Managed C (SMC). In January 1999, Anders Hejlsberg formed a team to build a new language at the time called Cool, which stood for "C like Object Oriented Language. Microsoft had considered keeping the name "Cool" as the final name of the language, but chose not to do so for trademark reasons. By the time the .NET project was publicly announced at the July 2000 Professional Developers Conference, the language had been renamed C#, and the class libraries and ASP.NET runtime had been ported to C#. C# 's principal designer and lead architect at Microsoft is Anders Hejlsberg, who was previously involved with the design of Visual J++, Borland Delphi, and Turbo Pascal. In interviews and technical papers he has stated that flaws in most major programming languages (e.g. C++, Java, Delphi, and Smalltalk) drove the fundamentals of the Common Language Runtime (CLR), which, in turn, drove the design of the C# programming language itself. Some argue that C# shares roots in other languages.

35

Hospital feedback System SDSC SHAR Features of C#:By design, C# is the programming language that most directly reflects the underlying Common Language Infrastructure (CLI). Most of C# 's intrinsic types correspond to value-types implemented by the CLI framework. However, the C# language specification does not state the code generation requirements of the compiler: that is, it does not state that a C# compiler must target a Common Language Runtime (CLR), or generate Common Intermediate Language (CIL), or generate any other specific format. Theoretically, a C# compiler could generate machine code like traditional compilers of C++ or FORTRAN; in practice, all existing C# implementations target CIL. Some notable C# distinguishing features are:

There are no global variables or functions. All methods and members must be declared within classes. It is possible, however, to use static methods/variables within public classes instead of global variables/functions.

Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable shadowing is often considered confusing by C++ texts. C# supports a strict Boolean data type, bool. Statements that take conditions, such as
while

and if, require an expression of a boolean type. While C++ also has a boolean

type, it can be freely converted to and from integers, and expressions such as if(a) require only that a is convertible to bool, allowing a to be an int, or a pointer. C# disallows this "integer meaning true or false" approach on the grounds that forcing programmers to use expressions that return exactly bool can prevent certain types of programming mistakes such as if (a = b) (use of = instead of ==).

In C#, memory address pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run. Most object access is done through safe object references, which are always either pointing to a valid, existing object, or have the well-defined null value; a reference to a garbage-collected object, or to random block of memory, is impossible to obtain. An unsafe pointer can point to an instance of a value-type, array, string, or a block of memory allocated on a

36

Hospital feedback System SDSC SHAR stack. Code that is not marked as unsafe can still store and manipulate pointers through the System.IntPtr type, but cannot dereference them.

Managed memory cannot be explicitly freed, but is automatically garbage collected. Garbage collection addresses memory leaks. C# also provides direct support for deterministic finalization with the using statement (supporting the Resource Acquisition Is Initialization idiom).

Multiple inheritance is not supported, although a class can implement any number of interfaces. This was a design decision by the language's lead architect to avoid complication, avoid dependency hell and simplify architectural requirements throughout CLI.

C# is more type safe than C++. The only implicit conversions by default are those which are considered safe, such as widening of integers and conversion from a derived type to a base type. This is enforced at compile-time, during JIT, and, in some cases, at runtime. There are no implicit conversions between booleans and integers, nor between enumeration members and integers (except for literal 0, which can be implicitly converted to any enumerated type). Any user-defined conversion must be explicitly marked as explicit or implicit, unlike C++ copy constructors (which are implicit by default) and conversion operators (which are always implicit).

Enumeration members are placed in their own scope. C# provides syntactic sugar for a common pattern of a pair of methods, accessor (getter) and mutator (setter) encapsulating operations on a single attribute of a class, in form of properties.

Full type reflection and discovery is available. C# currently (as of 3 June 2008) has 77 reserved words.

Common Type system (CTS)


C# has a unified type system. This unified type system is called Common Type System (CTS). A unified type system implies that all types, including primitives such as integers, are subclasses of the System.Object class. For example, every type inherits a ToString() method. For

37

Hospital feedback System SDSC SHAR performance reasons, primitive types (and value types in general) are internally allocated on the stack.

Categories of datatypes
CTS separates datatypes into two categories:

Value types Reference types

Value types are plain aggregations of data. Instances of value types do not have referential identity nor a referential comparison semantics - equality and inequality comparisons for value types compare the actual data values within the instances, unless the corresponding operators are overloaded. Value types are derived from System.ValueType, always have a default value, and can always be created and copied. Some other limitations on value types are that they cannot derive from each other (but can implement interfaces) and cannot have a default (parameterless) constructor. Examples of value types are some primitive types, such as int (a signed 32-bit integer), float (a 32-bit IEEE floating-point number), char (a 16-bit Unicode codepoint), and
System.DateTime

(identifies a specific point in time with millisecond precision).

In contrast, reference types have the notion of referential identity - each instance of reference type is inherently distinct from every other instance, even if the data within both instances is the same. This is reflected in default equality and inequality comparisons for reference types, which test for referential rather than structural equality, unless the corresponding operators are overloaded (such as the case for System.String). In general, it is not always possible to create an instance of a reference type, nor to copy an existing instance, or perform a value comparison on two existing instances, though specific reference types can provide such services by exposing a public constructor or implementing a corresponding interface (such as ICloneable or
IComparable).

Examples of reference types are object (the ultimate base class for all other C#

classes), System.String (a string of Unicode characters), and System.Array (a base class for all C# arrays). Both type categories are extensible with user-defined types.

38

Hospital feedback System SDSC SHAR

Boxing and Unboxing


Boxing is the operation of converting a value of a value type into a value of a corresponding reference type. Example:
int foo = 42; object bar = foo; // Value type... // foo is boxed to bar.

Unboxing is the operation of converting a value of a reference type (previously boxed) into a value of a value type. Example:
int foo = 42; object bar = foo; int foo2 = (int)bar; // Value type. // foo is boxed to bar. // Unboxed back to value type.

Features of C# 2.0
New features in C# for the .NET SDK 2.0 (corresponding to the 3rd edition of the ECMA-334 standard) are:

Partial class
Partial classes allow implementation of a class to be spread between several files, with each file containing one or more class members. It is primary useful when parts of a class are automatically generated. For example, the feature is heavily used by code-generating user interface designers in Visual Studio. file1.cs:
public partial class MyClass { public void MyMethod1() {

39

Hospital feedback System SDSC SHAR


// Manually written code } }

file2.cs:
public partial class MyClass { public void MyMethod2() { // Automatically generated code } }

Generics
Generics, or parameterized types, or parametric polymorphism is a .NET 2.0 feature supported by C#. Unlike C++ templates, .NET parameterized types are instantiated at runtime rather than by the compiler; hence they can be cross-language whereas C++ templates cannot. They support some features not supported directly by C++ templates such as type constraints on generic parameters by use of interfaces. On the other hand, C# does not support non-type generic parameters. Unlike generics in Java, .NET generics use reification to make parameterized types first-class objects in the CLI Virtual Machine, which allows for optimizations and preservation of the type information.

Static classes
Static classes are classes that cannot be instantiated or inherited from, and that only allow static members. Their purpose is similar to that of modules in many procedural languages.

A new form of iterator providing generator functionality


A new form of iterator that provides generator functionality, using a yield return construct similar to yield in Python.
// Method that takes an iterable input (possibly an array)

40

Hospital feedback System SDSC SHAR


// and returns all even numbers. public static IEnumerable<int> GetEven(IEnumerable<int> numbers) { foreach (int i in numbers) { if (i % 2 == 0) yield return i; } }

Anonymous delegates
Anonymous delegates provide closure functionality in C#. Code inside the body of an anonymous delegate has full read/write access to local variables, method parameters, and class members in scope of the delegate, excepting out and ref parameters. For example:int SumOfArrayElements(int[] array) { int sum = 0; Array.ForEach( array, delegate(int x) { sum += x; } ); return sum; }

Delegate covariance and contravariance


Conversions from method groups to delegate types are covariant and contravariant in return and parameter types, respectively.

The accessibility of property accessors can be set independently


Example:

41

Hospital feedback System SDSC SHAR


string status = string.Empty; public string Status { get { return status; } property, protected set { status = value; } it } // but only derived classes can change // anyone can get value of this

Nullable types
Nullable value types (denoted by a question mark, e.g. int? i = null;) which add null to the set of allowed values for any value type. This provides improved interaction with SQL databases, which can have nullable columns of types corresponding to C# primitive types: an SQL INTEGER
NULL

column type directly translates to the C# int?.

Nullable types received an eleventh-hour improvement at the end of August 2005, mere weeks before the official launch, to improve their boxing characteristics: a nullable variable which is assigned null is not actually a null reference, but rather an instance of struct Nullable<T> with property HasValue equal to false. When boxed, the Nullable instance itself is boxed, and not the value stored in it, so the resulting reference would always be non-null, even for null values. The following code illustrates the corrected flaw:
int? i = null; object o = i; if (o == null) Console.WriteLine("Correct behaviour - runtime version from September 2005 or later"); else Console.WriteLine("Incorrect behaviour - pre-release runtime (from before September 2005)");

When copied into objects, the official release boxes values from Nullable instances, so null values and null references are considered equal. The late nature of this fix caused some

42

Hospital feedback System SDSC SHAR controversy , since it required core-CLR changes affecting not only .NET2, but all dependent technologies (including C#, VB, SQL Server 2005 and Visual Studio 2005).

43

Hospital feedback System SDSC SHAR

Database Tables

DATABASE TABLES: Login:Table FieldName Username Password Accessrights DataType Text Text Text Remark Stores username Stores password Stores Type of userAdmin or operator

44

Hospital feedback System SDSC SHAR

Personal details: Table

FieldName EMPID EMPNAME EMPAGE EMPSEX ContactNumber Feedback details: Table FieldName ID EMPID Q1ReceptionServices Q2StaffRespect Q3Cleanliness Q4SeatingArrangement Q5QueryAnswering Q6LabServices Q7XRayServices Q8PharmacyServices Q9WaitingTime Q10OverallSatisfaction Suggestions DateOfEntry HospitalName

DataType Text Text Text Text Text

Remark Unique ID of Employee visiting hospital Name of Patient Age of Patient Male or Female Contact number

DataType AutoNumber Text Text Text Text Text Text Text Text Text Text Text Text Date/Time Text

Remark Unique ID generated by Access Foreign key from Personal detail table Question number 1 Question number 2 Question number 3 Question number 4 Question number 5 Question number 6 Question number 7 Question number 8 Question number 9 Question number 10 Question number 11 Date Of Entering the record Name of the hospital

45

Hospital feedback System SDSC SHAR

TESTING:
The testing phase is an important part of software development. It is the puterized system will help in automate process of finding errors and missing operations and also a complete verification to determine whether the objectives are met and the user requirements are satisfied.

46

Hospital feedback System SDSC SHAR Software testing is carried out in three steps: 1. The first includes unit testing, where in each module is tested to provide its

correctness, validity and also determine any missing operations and to verify whether the objectives have been met. Errors are noted down and corrected immediately. Unit testing is the important and major part of the project. So errors are rectified easily in particular module and program clarity is increased. In this project entire system is divided into several modules and is developed individually. So unit testing is conducted to individual modules. 2. The second step includes Integration testing. It need not be the case, the software

whose modules when run individually and showing perfect results, will also show perfect results when run as a whole. The individual modules are clipped under this major module and tested again and verified the results. This is due to poor interfacing, which may results in data being lost across an interface. A module can have inadvertent, adverse effect on any other or on the global data structures, causing serious problems. 3. The final step involves validation and testing which determines which the

software functions as the user expected. Here also some modifications were. In the completion of the project it is satisfied fully by the end user.

Maintenance and environment:


AS the number of computer based systems, grieve libraries of computer software began to expand. In house developed projects produced tones of thousand soft program source statements. Software products purchased from the outside added hundreds of thousands of new statements. A dark cloud appeared on the horizon. All of these programs, all of those source statements-had to be corrected when false were detected, modified as user requirements changed, or adapted to new hardware that was purchased. These activities were collectively called software Maintenance. The maintenance phase focuses on change that is associated with error correction, adaptations required as the software's environment evolves, and changes due to enhancements brought about by changing customer requirements. Four types of changes are encountered during the

47

Hospital feedback System SDSC SHAR maintenance phase. Correction Adaptation Enhancement Prevention

Correction:
Even with the best quality assurance activities is lightly that the customer will uncover defects in the software. Corrective maintenance changes the software to correct defects. Maintenance is a set of software Engineering activities that occur after software has been delivered to the customer and put into operation. Software configuration management is a set of tracking and control activities that began when a software project begins and terminates only when the software is taken out of the operation. We may define maintenance by describing four activities that are undertaken after a program is released for use: Corrective Maintenance Adaptive Maintenance Perfective Maintenance or Enhancement Preventive Maintenance or reengineering Only about 20 percent of all maintenance work are spent "fixing mistakes". The remaining 80 percent are spent adapting existing systems to changes in their external environment, making enhancements requested by users, and reengineering an application for use.

ADAPTATION:

48

Hospital feedback System SDSC SHAR Over time, the original environment (E>G., CPU, operating system, business rules, external product characteristics) for which the software was developed is likely to change. Adaptive maintenance results in modification to the software to accommodate change to its external environment.

ENHANCEMENT:
As software is used, the customer/user will recognize additional functions that will provide benefit. Perceptive maintenance extends the software beyond its original function requirements.

PREVENTION :
Computer software deteriorates due to change, and because of this, preventive maintenance, often called software re engineering, must be conducted to enable the software to serve the needs of its end users. In essence, preventive maintenance makes changes to computer programs so that they can be more easily corrected, adapted, and enhanced. Software configuration management (SCM) is an umbrella activity that is applied throughout the software process. SCM activities are developed to

SOURCE CODE: Login:


using System; using System.Collections.Generic; using System.ComponentModel;

49

Hospital feedback System SDSC SHAR


using using using using using using using System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Data.OleDb; SHARHospitalFeedbackSystem;

namespace SHARHospitalFeedbackSystem { public partial class Login : Form { public Login() { InitializeComponent(); } private void button3_Click(object sender, EventArgs e) { bool flag = LoginUser(); if (flag) { this.Hide(); Program.mainForm.ShowDialog(); } else return; this.Close(); } private void button1_Click(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { ChangePassword chg = new ChangePassword(); chg.ShowDialog(); } private void Password_KeyDown(object sender, KeyEventArgs e) { if (Keys.Enter == e.KeyCode) { bool flag = LoginUser(); if (flag) { this.Hide(); Program.mainForm.ShowDialog(); } else return; Program.conn.Close(); this.Close();

50

Hospital feedback System SDSC SHAR


} } private bool LoginUser() { string userName = UserName.Text.ToString().Trim(); string password = Password.Text.ToString().Trim(); string query = "SELECT * FROM Login WHERE username ='" + userName

+ "'";

Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); bool flag = false; try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); flag = selectResult.Read(); if (password == selectResult["password"].ToString()) { Program.accessRight = selectResult["AccessRights"].ToString(); Program.conn.Close(); } else { MessageBox.Show("Enter a valid username or password"); Program.conn.Close(); flag = false; } } catch (Exception ex) { MessageBox.Show("Enter a valid username or password"); //MessageBox.Show(ex.Message); Program.conn.Close(); flag = false; } finally { Program.conn.Close(); } return flag; } private void Login_Load(object sender, EventArgs e) { } } }

51

Hospital feedback System SDSC SHAR

option form:
using using using using System; System.Windows.Forms; System.IO; System.Data.OleDb;

namespace SHARHospitalFeedbackSystem { public partial class OptionForm : Form { public static int genReport =0; //for selecting which type of report to be printed. 1 or 2 there are two types of report public static int totalLines; //this variable is used for storing total number of record in database. which is used for calculating percentage public static OptionForm myForm ; public static DateTime beginDate = new DateTime(); // date on which first record was entered. this gives user to select from which date onward he wants to see the record public int[,] AllQuestionAnswerSet; //all data retrieved from database is stored in this variable //all questions are written in this variable to store it in listbox public string[] Questions = { "Service at the Reception :", "Staff respect and concern for your comfort :", "Cleanliness and ambience: ", "Seating arrangement and waiting area: ", "How well were your question answered?", "How do you rate the Lab Services?", "How would you rate the X-ray Services?", "How would you rate the Pharmacy Services?", "Waiting time to consult doctor", "Your overall satisfaction with your experience " }; public static float[,] PrintData; // this variable is used in print form. whatever data is to be printed in report is stored here. public OptionForm() { myForm = this; InitializeComponent(); AllQuestionAnswerSet = new int[10,5]; PrintData = new float[10,5]; } private void button11_Click(object sender, EventArgs e) { MainForm m1 = new MainForm(); m1.ShowDialog(); } public void GetBeginDate() { beginDate = System.DateTime.Now.Date; string query = "SELECT DateOfEntry FROM Feedback"; Program.oleDbCommand.CommandText = query;

52

Hospital feedback System SDSC SHAR


Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); selectResult.Read(); beginDate = DateTime.Parse(selectResult[0].ToString()); while (selectResult.Read()) { if (beginDate > DateTime.Parse(selectResult[0].ToString())) { beginDate = DateTime.Parse(selectResult[0].ToString()); } } } catch (Exception ex) { // MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } public void GetTotalLines() { string query = "SELECT Count(*) FROM Feedback"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); bool flag = selectResult.Read(); totalLines = int.Parse(selectResult[0].ToString()); Program.conn.Close(); } catch (Exception ex) { //MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } private void button12_Click(object sender, EventArgs e) // calling report dialogue box { ReportGeneration rep = new ReportGeneration(); rep.ShowDialog();

53

Hospital feedback System SDSC SHAR


}

base

private void button14_Click(object sender, EventArgs e) //backup data {

string databaseName = System.Environment.CurrentDirectory + "\\BackUp\\HospitalFeedback" + "-" + ((System.DateTime.Now.ToString().Replace('/', '-')).Replace(":", "-")).Replace(" ", "-") + ".mdb"; ; try { File.Copy("D:\\Project\\SHARHospitalFeedbackSystem\\SHARHospit alFeedbackSystem\\bin\\Debug\\App_Data\\HospitalFeedback.mdb", databaseName); MessageBox.Show("Database backup is completed"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Database backup Failed"); } return; } graph private void button1_Click(object sender, EventArgs e) //bar chart { FeedbackAnalysis feedback = new FeedbackAnalysis(); feedback.ShowDialog();

} chart private void button2_Click(object sender, EventArgs e) //generate pie { } PieChart p = new PieChart(); p.ShowDialog();

private void button3_Click(object sender, EventArgs e) // generate vienn diagram { VennDiagram V = new VennDiagram(); V.ShowDialog(); } graph private void button4_Click(object sender, EventArgs e) //generate line { } LineGraphXY L = new LineGraphXY(); L.ShowDialog();

private void OptionForm_Load(object sender, EventArgs e) { GetBeginDate(); GetTotalLines();

54

Hospital feedback System SDSC SHAR


}

} }

feedback:
using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text;

55

Hospital feedback System SDSC SHAR


using System.Windows.Forms; using System.Data.OleDb; namespace SHARHospitalFeedbackSystem { public partial class MainForm : Form { public static MainForm MyForm; public MainForm() { InitializeComponent(); MyForm = this; } public string empID { get { return MyForm.EmpIDText.Text; } set { MyForm.EmpIDText.Text = value; } } public DateTime DateOfEntering { get { return DateSelection.Value; } set { DateSelection.Value = value; } } public string EmpName { get { return MyForm.EmpNameText.Text; } set { MyForm.EmpNameText.Text = value; } } public string HospitalName { get { return MyForm.ComboBoxOptions.SelectedItem.ToString(); } set { if(value == "SHAR") MyForm.ComboBoxOptions.SelectedIndex = 0; else

56

Hospital feedback System SDSC SHAR


MyForm.ComboBoxOptions.SelectedIndex = 1;

} public string EmpContactNumber { get { return MyForm.ContactNumberText.Text; } set { MyForm.ContactNumberText.Text = value; } } public string EmpAge { get { return MyForm.EmpAgeTextBox.Text; } set { MyForm.EmpAgeTextBox.Text = value; } } public string Suggestions { get { return MyForm.RichTextSuggestions.Text; } set { MyForm.RichTextSuggestions.Text = value; } } public string EmpSex { get { string se = null; if (MyForm.RadioSexMale.Checked) se = "Male"; else se = "Female"; return se; } set { if (value == "Male") MyForm.RadioSexMale.Checked = true; else MyForm.RadioSexMale.Checked = true; } } public string Q1

57

Hospital feedback System SDSC SHAR


{

get {

string se = null; if (MyForm.RadioQ1E.Checked) se = "Excellent"; else if (MyForm.RadioQ1G.Checked) se = "Good"; else if (MyForm.RadioQ1F.Checked) se = "Fair"; else if (MyForm.RadioQ1P.Checked) se = "Poor"; else se = "No"; return se;

} set {

if (value == "Excellent") MyForm.RadioQ1E.Checked else if (value == "Good") MyForm.RadioQ1G.Checked else if (value == "Fair") MyForm.RadioQ1F.Checked else if (value == "Poor") MyForm.RadioQ1P.Checked else MyForm.RadioQ1N.Checked

= true; = true; = true; = true; = true;

} } public string Q2 { get { string se = null; if (MyForm.RadioQ2E.Checked) se = "Excellent"; else if (MyForm.RadioQ2G.Checked) se = "Good"; else if (MyForm.RadioQ2F.Checked) se = "Fair"; else if (MyForm.RadioQ2P.Checked) se = "Poor"; else se = "No"; return se; } set { if (value == "Excellent") MyForm.RadioQ2E.Checked = true; else if (value == "Good") MyForm.RadioQ2G.Checked = true; else if (value == "Fair")

58

Hospital feedback System SDSC SHAR


MyForm.RadioQ2F.Checked = true; else if (value == "Poor") MyForm.RadioQ2P.Checked = true; else MyForm.RadioQ2N.Checked = true; } } public string Q3 { get { string se = null; if (MyForm.RadioQ3E.Checked) se = "Excellent"; else if (MyForm.RadioQ3G.Checked) se = "Good"; else if (MyForm.RadioQ3F.Checked) se = "Fair"; else if (MyForm.RadioQ3P.Checked) se = "Poor"; else se = "No"; return se; } set { if (value == "Excellent") MyForm.RadioQ3E.Checked else if (value == "Good") MyForm.RadioQ3G.Checked else if (value == "Fair") MyForm.RadioQ3F.Checked else if (value == "Poor") MyForm.RadioQ3P.Checked else MyForm.RadioQ3N.Checked = true; = true; = true; = true; = true;

} } public string Q4 { get { string se = null; if (MyForm.RadioQ4E.Checked) se = "Excellent"; else if (MyForm.RadioQ4G.Checked) se = "Good"; else if (MyForm.RadioQ4F.Checked) se = "Fair"; else if (MyForm.RadioQ4P.Checked) se = "Poor"; else se = "No"; return se;

59

Hospital feedback System SDSC SHAR

} set { if (value == "Excellent") MyForm.RadioQ4E.Checked else if (value == "Good") MyForm.RadioQ4G.Checked else if (value == "Fair") MyForm.RadioQ4F.Checked else if (value == "Poor") MyForm.RadioQ4P.Checked else MyForm.RadioQ4N.Checked = true; = true; = true; = true; = true;

} } public string Q5 { get { string se = null; if (MyForm.RadioQ5E.Checked) se = "Excellent"; else if (MyForm.RadioQ5G.Checked) se = "Good"; else if (MyForm.RadioQ5F.Checked) se = "Fair"; else if (MyForm.RadioQ5P.Checked) se = "Poor"; else se = "No"; return se; } set {

if (value == "Excellent") MyForm.RadioQ5E.Checked else if (value == "Good") MyForm.RadioQ5G.Checked else if (value == "Fair") MyForm.RadioQ5F.Checked else if (value == "Poor") MyForm.RadioQ5P.Checked else MyForm.RadioQ5N.Checked

= true; = true; = true; = true; = true;

} } public string Q6 { get { string se = null; if (MyForm.RadioQ6E.Checked) se = "Excellent";

60

Hospital feedback System SDSC SHAR


else if (MyForm.RadioQ6G.Checked) se = "Good"; else if (MyForm.RadioQ6F.Checked) se = "Fair"; else if (MyForm.RadioQ6P.Checked) se = "Poor"; else se = "No"; return se; } set {

if (value == "Excellent") MyForm.RadioQ6E.Checked else if (value == "Good") MyForm.RadioQ6G.Checked else if (value == "Fair") MyForm.RadioQ6F.Checked else if (value == "Poor") MyForm.RadioQ6P.Checked else MyForm.RadioQ6N.Checked

= true; = true; = true; = true; = true;

} } public string Q7 { get { string se = null; if (MyForm.RadioQ7E.Checked) se = "Excellent"; else if (MyForm.RadioQ7G.Checked) se = "Good"; else if (MyForm.RadioQ7F.Checked) se = "Fair"; else if (MyForm.RadioQ7P.Checked) se = "Poor"; else se = "No"; return se; } set { if (value == "Excellent") MyForm.RadioQ7E.Checked else if (value == "Good") MyForm.RadioQ7G.Checked else if (value == "Fair") MyForm.RadioQ7F.Checked else if (value == "Poor") MyForm.RadioQ7P.Checked else MyForm.RadioQ7N.Checked = true; = true; = true; = true; = true;

61

Hospital feedback System SDSC SHAR


} } public string Q8 { get { string se = null; if (MyForm.RadioQ8E.Checked) se = "Excellent"; else if (MyForm.RadioQ8G.Checked) se = "Good"; else if (MyForm.RadioQ8F.Checked) se = "Fair"; else if (MyForm.RadioQ8P.Checked) se = "Poor"; else se = "No"; return se; } set { if (value == "Excellent") MyForm.RadioQ8E.Checked else if (value == "Good") MyForm.RadioQ8G.Checked else if (value == "Fair") MyForm.RadioQ8F.Checked else if (value == "Poor") MyForm.RadioQ8P.Checked else MyForm.RadioQ8N.Checked = true; = true; = true; = true; = true;

} } public string Q9 { get { string se = null; if (MyForm.RadioQ9E.Checked) se = "Excellent"; else if (MyForm.RadioQ9G.Checked) se = "Good"; else if (MyForm.RadioQ9F.Checked) se = "Fair"; else if (MyForm.RadioQ9P.Checked) se = "Poor"; else se = "No"; return se; } set {

if (value == "Excellent") MyForm.RadioQ9E.Checked = true;

62

Hospital feedback System SDSC SHAR


else if (value == "Good") MyForm.RadioQ9G.Checked else if (value == "Fair") MyForm.RadioQ9F.Checked else if (value == "Poor") MyForm.RadioQ9P.Checked else MyForm.RadioQ9N.Checked

= true; = true; = true; = true;

} } public string Q10 { get { string se = null; if (MyForm.RadioQ10E.Checked) se = "Excellent"; else if (MyForm.RadioQ10G.Checked) se = "Good"; else if (MyForm.RadioQ10F.Checked) se = "Fair"; else if (MyForm.RadioQ10P.Checked) se = "Poor"; else se = "No"; return se; } set {

} }

if (value == "Excellent") MyForm.RadioQ10E.Checked else if (value == "Good") MyForm.RadioQ10G.Checked else if (value == "Fair") MyForm.RadioQ10F.Checked else if (value == "Poor") MyForm.RadioQ10P.Checked else MyForm.RadioQ10N.Checked

= true; = true; = true; = true; = true;

private void ClearAll() { RichTextSuggestions.Clear(); EditButton.Enabled = false; SaveButton.Enabled = false; EmpIDText.Enabled = true; PersonalDetailsGroupBox.Enabled = false; panel1.Enabled = false; EmpAgeTextBox.Clear(); EmpNameText.Clear(); EmpIDText.Clear(); ContactNumberText.Clear(); DateSelection.Value = System.DateTime.Now.Date;

63

Hospital feedback System SDSC SHAR


RadioSexFemale.Checked = false; RadioSexMale.Checked = false; RadioQ1N.Checked = true; RadioQ2N.Checked = true; RadioQ3N.Checked = true; RadioQ4N.Checked = true; RadioQ5N.Checked = true; RadioQ6N.Checked = true; RadioQ7N.Checked = true; RadioQ8N.Checked = true; RadioQ9N.Checked = true; RadioQ10N.Checked = true; } private void button1_Click(object sender, EventArgs e) { if (EmpIDText.Text.Length == 0) { MessageBox.Show("Please enter Patient's ID"); return; } if (EmpNameText.Text.Length == 0) { MessageBox.Show("Please enter Patient's Name"); return; } if (EmpAgeTextBox.Text.Length == 0) { MessageBox.Show("Please enter Patient's age"); return; } if((!RadioSexFemale.Checked) && (!RadioSexMale.Checked)) { MessageBox.Show("Please Select Patient's Sex :Male or Female"); return; } saveIntoDatabase(); ClearAll(); //this.Close(); } private bool saveIntoDatabase() //Store Values into Database { string query = "SELECT * FROM PersonalDetails where EmpID = '" + this.empID + "'"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); if (selectResult.Read()) { Program.conn.Close();

64

Hospital feedback System SDSC SHAR


} else {

Program.conn.Close(); Program.oleDbCommand.CommandText = "INSERT INTO PersonalDetails (EmpID, EmpName, EmpAge, EmpSex, ContactNumber)VALUES ('" + this.empID + "', '" + this.EmpName + "', '" + this.EmpAge + "', '" + this.EmpSex + "', '"+ "')"; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); int row = Program.oleDbCommand.ExecuteNonQuery(); } } catch(Exception ex) { MessageBox.Show(ex.Message); Program.conn.Close(); } try {

Program.conn.Close(); Program.oleDbCommand.CommandText = "INSERT INTO Feedback (EmpID, Q1ReceptionServices, Q2StaffRespect, Q3Cleanliness,Q4SeatingArrangement, Q5QueryAnswering, Q6LabServices, Q7XRayServices, Q8PharmacyServices, Q9WaitingTime, Q10OverallSatisfaction, Suggestions, DateOfEntry, HospitalName)VALUES ('" + this.empID + "', '" + this.Q1 + "', '" + this.Q2 + "', '" + this.Q3 + "', '" + this.Q4 + "', '" + this.Q5 + "', '" + this.Q6 + "', '" + this.Q7 + "', '" + this.Q8 + "', '" + this.Q9 + "', '" + this.Q10 + "', '" + this.Suggestions + "', '" + this.DateOfEntering + "', '" + HospitalName+ "')"; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); int row = Program.oleDbCommand.ExecuteNonQuery(); MessageBox.Show(row.ToString() + " Record has been inserted"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } return true; } private void MainForm_Load(object sender, EventArgs e) { DateSelection.Value = System.DateTime.Now.Date; ComboBoxOptions.SelectedIndex = 0; } private void EmpAgeTextBox_KeyPress(object sender, KeyPressEventArgs e) { if ((!char.IsDigit(e.KeyChar)) && (!char.IsControl(e.KeyChar)))

65

Hospital feedback System SDSC SHAR


{ } }

e.Handled = true;

private void DateSelection_ValueChanged(object sender, EventArgs e) { if(DateSelection.Value > System.DateTime.Now.Date) { MessageBox.Show("Please select date Less than or equal to today's date"); DateSelection.Value = System.DateTime.Now.Date; return; } } private void SubmitButton_Click(object sender, EventArgs e) { EmpIDText.Enabled = false; string query = "SELECT * FROM PersonalDetails where EmpID = '" + this.empID + "'"; ; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); if (selectResult.Read()) { DialogResult result = MessageBox.Show("Patient Details already exist Do you want to Edit them?", "Patients' Feedback Details", MessageBoxButtons.YesNo); EmpName = selectResult[1].ToString(); EmpAge = selectResult[2].ToString(); EmpSex = selectResult[3].ToString(); EmpContactNumber = selectResult[4].ToString(); if (result == DialogResult.Yes) { PersonalDetailsGroupBox.Enabled = true; panel1.Enabled = true; EditButton.Enabled = true; } Program.conn.Close(); query = "SELECT * FROM Feedback where EmpID = '" + this.empID + "'"; ; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); selectResult = Program.oleDbCommand.ExecuteReader(); if (selectResult.Read()) { Q1 = selectResult[2].ToString(); Q2 = selectResult[3].ToString(); Q3 = selectResult[4].ToString(); Q4 = selectResult[5].ToString(); Q5 = selectResult[6].ToString();

66

Hospital feedback System SDSC SHAR


Q6 = selectResult[7].ToString(); Q7 = selectResult[8].ToString(); Q8 = selectResult[9].ToString(); Q9 = selectResult[10].ToString(); Q10 = selectResult[11].ToString(); Suggestions = selectResult[12].ToString(); DateOfEntering = DateTime.Parse(selectResult[13].ToString()); HospitalName = selectResult[14].ToString(); } Program.conn.Close(); } else { PersonalDetailsGroupBox.Enabled = true; panel1.Enabled = true; SaveButton.Enabled = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } private void EditButton_Click(object sender, EventArgs e) { int row = 0; try { Program.oleDbCommand.CommandText = "UPDATE PersonalDetails set EmpName ='" + this.EmpName + "' ," + " EmpAge ='" + this.EmpAge + "' ," + " EmpSex ='" + this.EmpSex + "' ," + " ContactNumber = '" + this.EmpContactNumber + "' " + " Where EMPID='" + EmpIDText.Text.Trim() + "'"; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); row = Program.oleDbCommand.ExecuteNonQuery(); Program.conn.Close(); Program.oleDbCommand.CommandText = "UPDATE Feedback set Q1ReceptionServices ='" + this.Q1 + "' ," + " Q2StaffRespect ='" + this.Q2 + "' ," + " Q3Cleanliness ='" + this.Q3 + "' ," + " Q4SeatingArrangement = '" + this.Q4 + "' ," + " Q5QueryAnswering = '" + this.Q5 + "' ," + " Q6LabServices = '" + this.Q6 + "' ," + " Q7XRayServices = '" + this.Q7 + "' ," + " Q8PharmacyServices = '" + this.Q8 + "' ," + " Q9WaitingTime = '" + this.Q9 + "' ," + " Q10OverallSatisfaction = '" + this.Q10 + "' ," + " Suggestions = '" + this.Suggestions + "' ," + " DateOfEntry = '" + this.DateOfEntering + "' ," + " HospitalName = '" + this.HospitalName + "' " + " Where EMPID='" + EmpIDText.Text.Trim() + "'"; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); row = Program.oleDbCommand.ExecuteNonQuery();

67

Hospital feedback System SDSC SHAR


Program.conn.Close(); ClearAll(); if (row != 0) { MessageBox.Show("Record has been Updated"); } else MessageBox.Show("Record could not be Updated"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } private void NewButton_Click(object sender, EventArgs e) { ClearAll(); }

} }

Generate form:
using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Data.OleDb;

namespace SHARHospitalFeedbackSystem { public partial class ReportGeneration : Form { public int[,] AllQuestionAnswerSet; public static string HospitalName; DateTime StartDate; DateTime EndDate; public static int TotalRecords; int totalLines; public ReportGeneration() { totalLines = 0; StartDate = new DateTime(); EndDate = new DateTime();

68

Hospital feedback System SDSC SHAR


InitializeComponent(); } public void GetTotalLines() { string query = "SELECT Count(*) FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "# and HospitalName = '" + ComboBoxOptions.SelectedItem.ToString() + "'"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); bool flag = selectResult.Read(); totalLines = int.Parse(selectResult[0].ToString()); Program.conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } private void button12_Click(object sender, EventArgs e) { ReportGeneration.HospitalName = ComboBoxOptions.SelectedItem.ToString(); StartDate = StartDatePicker.Value; EndDate = EnddateTime.Value; if (EndDate < StartDate) { MessageBox.Show("End date cannot be less than start date"); return; } GetTotalLines(); if (totalLines ==0) { MessageBox.Show("There are no records available for this period of time"); return; } OptionForm.genReport = 1; generateReport(); FormPrinter.Open(OptionForm.myForm); } private void button1_Click(object sender, EventArgs e) { StartDate = StartDatePicker.Value; EndDate = EnddateTime.Value; OptionForm.genReport = 2; generateReport1();

69

Hospital feedback System SDSC SHAR


FormPrinter.Open(OptionForm.myForm);

private void ReportGeneration_Load(object sender, EventArgs e) { StartDatePicker.Value = OptionForm.beginDate.Date; EnddateTime.Value = DateTime.Now; ComboBoxOptions.SelectedIndex = 0; AllQuestionAnswerSet = new int[10,5]; } public void generateReport() //First type of report { //GetTotalLines(); TotalRecords = totalLines; GetAllData(); OptionForm.PrintData = new float[10, 5]; for (int i = 0; i < 10; i++) for (int j = 0; j < 5; j++) { OptionForm.PrintData[i, j] = ((float) ((float)AllQuestionAnswerSet[i, j] / (float)totalLines) * 100); } }

public void generateReport1() //second type of report { GetTotalLines(); GetAllData(); OptionForm.PrintData = new float[10, 5]; int[] Q2; float[,] Q3; Q2 = new int[10]; Q3 = new float[10, 5]; try { for (int i = 0; i < 5; i++) { for (int j = 0; j < 10; j++) Q2[i] = Q2[i] + AllQuestionAnswerSet[j, i]; } for (int i = 0; i < 10; i++) { for (int j = 0; j < 5; j++) OptionForm.PrintData[i, j] = ((float)AllQuestionAnswerSet[i, j] / (float)Q2[j]) * 100; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } public void GetAllData() { AllQuestionAnswerSet = new int[10, 5]; try

70

Hospital feedback System SDSC SHAR


{

string query = "SELECT * FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "# and HospitalName = '" + ComboBoxOptions.SelectedItem.ToString() + "'"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); while (selectResult.Read()) { for (int i = 2; i < 12; i++) { switch (selectResult[i].ToString()) { case "Excellent": AllQuestionAnswerSet[i - 2, 0] = AllQuestionAnswerSet[i - 2, 0] + 1; break; case "Good": AllQuestionAnswerSet[i - 2, 1] = AllQuestionAnswerSet[i - 2, 1] + 1; break; case "Fair": AllQuestionAnswerSet[i - 2, 2] = AllQuestionAnswerSet[i - 2, 2] + 1; break; case "Poor": AllQuestionAnswerSet[i - 2, 3] = AllQuestionAnswerSet[i - 2, 3] + 1; break; case "No": AllQuestionAnswerSet[i - 2, 4] = AllQuestionAnswerSet[i - 2, 4] + 1; break; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } }

71

Hospital feedback System SDSC SHAR

Pie chart:
using using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Windows.Forms.DataVisualization.Charting; System.Data.OleDb;

namespace SHARHospitalFeedbackSystem

72

Hospital feedback System SDSC SHAR


{

public partial class PieChart : Form { bool flag = false; DateTime StartDate; DateTime EndDate; int totalLines; public int[,] AllQuestionAnswerSet; //all data retrieved from database is stored in this variable public PieChart() { totalLines = 0; AllQuestionAnswerSet = new int[10, 5]; StartDate = new DateTime(); EndDate = new DateTime(); InitializeComponent(); chart2 = new Chart(); } Chart chart2; public void GetTotalLines() { totalLines = 0; string query = "SELECT Count(*) FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "# and HospitalName = '" + ComboBoxOptions.SelectedItem.ToString() + "'"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); bool flag = selectResult.Read(); totalLines = int.Parse(selectResult[0].ToString()); Program.conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } public void GetAllData() { AllQuestionAnswerSet = new int[10, 5]; try { string query = "SELECT * FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "# and HospitalName = '" + ComboBoxOptions.SelectedItem.ToString() + "'"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open();

73

Hospital feedback System SDSC SHAR


OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); while (selectResult.Read()) { for (int i = 2; i < 12; i++) { switch (selectResult[i].ToString()) { case "Excellent": AllQuestionAnswerSet[i - 2, AllQuestionAnswerSet[i - 2, 0] + 1; break; case "Good": AllQuestionAnswerSet[i - 2, AllQuestionAnswerSet[i - 2, 1] + 1; break; case "Fair": AllQuestionAnswerSet[i - 2, AllQuestionAnswerSet[i - 2, 2] + 1; break; case "Poor": AllQuestionAnswerSet[i - 2, AllQuestionAnswerSet[i - 2, 3] + 1; break; case "No": AllQuestionAnswerSet[i - 2, AllQuestionAnswerSet[i - 2, 4] + 1; break; } } }

0] =

1] =

2] =

3] =

4] =

} private void button1_Click(object sender, EventArgs e) { StartDate = StartDatePicker.Value; EndDate = EnddateTime.Value; if (EndDate < StartDate) { MessageBox.Show("End date cannot be less than start date"); return; } GetTotalLines(); if (totalLines == 0) { MessageBox.Show("There are no records available for this period of time"); return;

} catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); }

74

Hospital feedback System SDSC SHAR


} GetAllData(); flag = true; PieChart1.Series[0].Points.Clear(); PieChart1.Series[0].ChartType = SeriesChartType.Pie; PieChart1.Series[0].IsVisibleInLegend = true; PieChart1.Series[0].IsValueShownAsLabel = true; string [] names = {"Excellent", "Good", "Fair", "Poor", "No"}; try { string parameter; // selectedQs = ListBoxQuestions.SelectedIndices; for (int j = 0; j <5; j++) { parameter = ((((float)AllQuestionAnswerSet[ComboBoxQuestions.SelectedIndex, j]) / (float)totalLines) * 100).ToString("f2"); PieChart1.Series[0].Points.Add(double.Parse(parameter)); PieChart1.Series[0].Points[j].LegendText = names[j]; } PieChart1.Series[0].AxisLabel = "Values are given in %"; PieChart1.Series[0].XValueType = ChartValueType.String; PieChart1.Series[0].YValueType = ChartValueType.Int32; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void PieChart_Load(object sender, EventArgs e) { for (int i = 0; i < 10; i++) { ComboBoxQuestions.Items.Add(OptionForm.myForm.Questions[i]); } // ComboBoxQuestions.Items.Add("Overall"); ComboBoxQuestions.SelectedIndex = 0; ComboBoxOptions.SelectedIndex = 0; //OptionForm.myForm.generateReport(); StartDatePicker.Value = OptionForm.beginDate.Date; } private void button2_Click(object sender, EventArgs e) { PieChart1.Printing.PrintPreview(); } private void PieChart1_PostPaint(object sender, ChartPaintEventArgs e) { if(flag) e.ChartGraphics.Graphics.DrawString(ComboBoxOptions.SelectedItem.T oString()+" - "+ComboBoxQuestions.SelectedItem.ToString(), new Font("Arial", 11.0f, FontStyle.Bold), new SolidBrush(Color.Black), new Point(10, 4000 + 100 * 0)); } } }

75

Hospital feedback System SDSC SHAR

Venn diagram:
using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Data.OleDb;

namespace SHARHospitalFeedbackSystem { public partial class VennDiagram : Form {

76

Hospital feedback System SDSC SHAR


public string[] Questions = { "Q1ReceptionServices", "Q2StaffRespect", "Q3Cleanliness", "Q4SeatingArrangement", "Q5QueryAnswering", "Q6LabServices", "Q7XRayServices", "Q8PharmacyServices", "Q9WaitingTime", "Q10OverallSatisfaction" }; public string[] Options = {"Excellent", "Good", "Fair", "Poor"}; public int[,] AllQuestionAnswerSet; //all data retrieved from database is stored in this variable int QA, QB, QC, QAB, QBC, QAC, QABC; DateTime StartDate; DateTime EndDate; int totalLines; public VennDiagram() { InitializeComponent(); AllQuestionAnswerSet = new int[10, 5]; totalLines = 0; StartDate = new DateTime(); EndDate = new DateTime(); } public void GetTotalLines() { totalLines = 0; string query = "SELECT Count(*) FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "#"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); bool flag = selectResult.Read(); totalLines = int.Parse(selectResult[0].ToString()); Program.conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } private void VennDiagram_Load(object sender, EventArgs e) { for (int i = 0; i < 10; i++) { ListBoxQuestions.Items.Add(OptionForm.myForm.Questions[i]); } // OptionForm.myForm.generateReport(); ComboBoxOptions.SelectedIndex = 0; StartDatePicker.Value = OptionForm.beginDate.Date; } ListBox.SelectedIndexCollection selectedQs; public void GetAllData()

77

Hospital feedback System SDSC SHAR


{

AllQuestionAnswerSet = new int[10, 5]; try { string query = "SELECT * FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "#"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); while (selectResult.Read()) { for (int i = 2; i < 13; i++) { switch (selectResult[i].ToString()) { case "Excellent": AllQuestionAnswerSet[i - 2, 0] = AllQuestionAnswerSet[i - 2, 0] + 1; break; case "Good": AllQuestionAnswerSet[i - 2, 1] = AllQuestionAnswerSet[i - 2, 1] + 1; break; case "Fair": AllQuestionAnswerSet[i - 2, 2] = AllQuestionAnswerSet[i - 2, 2] + 1; break; case "Poor": AllQuestionAnswerSet[i - 2, 3] = AllQuestionAnswerSet[i - 2, 3] + 1; break; case "No": AllQuestionAnswerSet[i - 2, 4] = AllQuestionAnswerSet[i - 2, 4] + 1; break; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } } private void button1_Click(object sender, EventArgs e) { QA = 0; QB = 0; QC = 0; QAB = 0; }

78

Hospital feedback System SDSC SHAR


QBC= 0; QAC = 0; QABC = 0; StartDate = StartDatePicker.Value; EndDate = EnddateTime.Value; GetTotalLines(); selectedQs = ListBoxQuestions.SelectedIndices; if (selectedQs.Count <2) { MessageBox.Show("Please select atleast two options to draw Venn Diagram"); return; } if (EndDate < StartDate) { MessageBox.Show("End date cannot be less than start date"); return; } if (totalLines == 0) { MessageBox.Show("There are no records available for this period of time"); return; } GetAllData(); string query = "SELECT * FROM Feedback WHERE DateOfEntry >= #" + StartDate + "#" + " and DateOfEntry <= #" + EndDate + "#"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); while (selectResult.Read()) { if (selectResult[Questions[selectedQs[0]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QA++; } if (selectResult[Questions[selectedQs[1]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QB++; } if (selectResult[Questions[selectedQs[2]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QC++; } if (selectResult[Questions[selectedQs[0]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim() && selectResult[Questions[selectedQs[1]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QAB++;

79

Hospital feedback System SDSC SHAR


}

if (selectResult[Questions[selectedQs[1]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim() && selectResult[Questions[selectedQs[2]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QBC++; } if (selectResult[Questions[selectedQs[0]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim() && selectResult[Questions[selectedQs[2]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QAC++; } if (selectResult[Questions[selectedQs[0]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim() && selectResult[Questions[selectedQs[1]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim() && selectResult[Questions[selectedQs[2]]].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) { QABC++; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); } pictureBox1.Invalidate(); } private void button2_Click(object sender, EventArgs e) { } private void pictureBox1_Paint(object sender, PaintEventArgs e) { string [] quesOptions = {"A", "B", "C"}; /* Brush oz=new SolidBrush(Color.White); Pen kal=new Pen(oz,10); PointF nokta=new PointF(20,50); Font ye=new Font("Times New Roman",12); e.Graphics.DrawString("P",ye,oz,nokta); PointF nokta2 = new PointF(90, 50); e.Graphics.DrawString("S", ye, oz, nokta2); PointF nokta3 = new PointF(160, 50); e.Graphics.DrawString("M", ye, oz, nokta3); e.Graphics.DrawEllipse(Pens.White,20,50,100,100); e.Graphics.DrawEllipse(Pens.Black, 90, 50, 100, 100);

80

Hospital feedback System SDSC SHAR


e.Graphics.DrawEllipse(Pens.Blue, 160, 50, 100, 100);*/ bool flag = false; try { if (selectedQs != null) { float widthE = 200; float heightE = 200; float a=0, b=0, c; float xa, xb, xc; float ya, yb, yc; xa= 20; xb=220; xc = 120; ya = 50; yb = 50; yc = 250; int fontSize = 14; //Draw Ellipse for A Brush oz = new SolidBrush(Color.White); Pen kal = new Pen(oz, 15); e.Graphics.DrawEllipse(Pens.White, xa, ya, widthE, heightE); PointF nokta = new PointF(xa+30, ya+30); Font ye = new Font("Times New Roman", fontSize); e.Graphics.DrawString((QA-QAB-QAC+QABC).ToString(), ye, //Draw A Intersection B String nokta = new PointF(xa + 170, ya + 80); ye = new Font("Times New Roman", fontSize); e.Graphics.DrawString((QAB-QABC).ToString(), ye, oz, nokta); //Draw Ellipse for B oz = new SolidBrush(Color.Black); kal = new Pen(oz, 15); e.Graphics.DrawEllipse(Pens.Black, xb-50, yb, widthE, heightE); oz, nokta3); PointF nokta3 = new PointF(xb+30 , yb+30); e.Graphics.DrawString((QB-QAB-QBC+QABC).ToString(), ye, //Draw B Intersection C String nokta3 = new PointF(xb + 25, yb + 140); e.Graphics.DrawString((QBC-QABC).ToString(), ye, oz, nokta3); //Draw Ellipse for C oz = new SolidBrush(Color.Blue); kal = new Pen(oz, 15); e.Graphics.DrawEllipse(Pens.Blue, xc-25, yc-90, widthE, heightE); ye, oz, nokta2); PointF nokta2 = new PointF(xc, yc+20); e.Graphics.DrawString((QC - QAC - QBC + QABC).ToString(),

oz, nokta);

81

Hospital feedback System SDSC SHAR


//Draw A Intersection C nokta2 = new PointF(xc , yc - 50); e.Graphics.DrawString((QAC-QABC).ToString(), ye, oz, //Draw A B and C Intersections nokta2 = new PointF(xc+70, yc -85); e.Graphics.DrawString(QABC.ToString(), ye, oz, nokta2); //Draw Details fontSize = 12; string temp = "n(A):" + QA.ToString()+ " \t" + " n(B):" + QB.ToString(); temp = temp + "\t" + " n(C):" + QC.ToString(); e.Graphics.DrawString(temp, new Font("Arial", fontSize, FontStyle.Regular), new SolidBrush(Color.Black), xa - 20, yc + 150); temp = "n(AIntB):" + QAB.ToString() + "\t" + "n(BIntC):" + QBC.ToString(); temp = temp + "\t" + "n(CIntA):" + QAC.ToString() + "\t" + "n(AIntBIntC):" + QABC.ToString(); e.Graphics.DrawString(temp, new Font("Arial", fontSize, FontStyle.Regular), new SolidBrush(Color.Black), xa - 20, yc + 170); for (int i = 0; i < selectedQs.Count; i++) e.Graphics.DrawString(quesOptions[i] + "- " + OptionForm.myForm.Questions[selectedQs[i]], new Font("Arial", fontSize, FontStyle.Regular), new SolidBrush(Color.Black), new PointF(xa, yc + 200 + 25 * i)); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }

nokta2);

Line graph:
using using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Collections; System.Data.OleDb;

82

Hospital feedback System SDSC SHAR

namespace SHARHospitalFeedbackSystem { public partial class LineGraphXY : Form { public string[] Questions = { "Q1ReceptionServices", "Q2StaffRespect", "Q3Cleanliness", "Q4SeatingArrangement", "Q5QueryAnswering", "Q6LabServices", "Q7XRayServices", "Q8PharmacyServices", "Q9WaitingTime", "Q10OverallSatisfaction" }; DateTime StartDate; DateTime EndDate; int totalLines; List<DateTime> XAxis; List<Double> YAxis; public int[,] AllQuestionAnswerSet; ListBox.SelectedIndexCollection selectedQs; // public string[] Options = { "Excellent", "Good", "Fair", "Poor" }; public LineGraphXY() { XAxis=new List<DateTime>(); YAxis=new List<double>(); InitializeComponent(); AllQuestionAnswerSet = new int[10, 5]; totalLines = 0; StartDate = new DateTime(); EndDate = new DateTime(); } private void LineGraph_Load(object sender, EventArgs e) { for (int i = 0; i < 10; i++) { ListBoxQuestions.Items.Add(OptionForm.myForm.Questions[i]); } StartDatePicker.Value = OptionForm.beginDate.Date; ComboBoxOptions.SelectedIndex = 0; } private void button1_Click(object sender, EventArgs e) { LineChart.ChartAreas.Clear(); LineChart.Legends.Clear(); LineChart.Series.Clear(); selectedQs = ListBoxQuestions.SelectedIndices; StartDate = StartDatePicker.Value; EndDate = EndDatePicker.Value; if (selectedQs.Count == 0) { MessageBox.Show("Please select atleast one question"); return; } if (EndDate < StartDate) { MessageBox.Show("End date cannot be less than start date"); return; }

83

Hospital feedback System SDSC SHAR


if (selectedQs.Count >5) { MessageBox.Show("You can select only upto five questions"); return; } GetTotalLines(StartDate); if(totalLines ==0) { MessageBox.Show("There are no records available for this period of time"); return; } Color[] col = { Color.Red, Color.Green, Color.Black, Color.Blue, Color.Brown }; LineChart.ChartAreas.Add("ChtArea"); //LineChart.ChartAreas[0].Position = System.Windows.Forms.DataVisualization.Charting.ElementPosition() LineChart.ChartAreas[0].BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; LineChart.ChartAreas[0].BorderWidth = 3; string query; try { for (int j = 0; j < selectedQs.Count; j++) { XAxis = new List<DateTime>(); YAxis = new List<double>(); query = Questions[selectedQs[j]].Trim(); GetAllData(query); LineChart.Legends.Add(OptionForm.myForm.Questions[selected Qs[j]]); LineChart.Series.Add(OptionForm.myForm.Questions[selectedQ s[j]]); LineChart.Series[j].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; LineChart.Series[j].IsVisibleInLegend = true; // LineChart.Series[j].IsValueShownAsLabel = true; LineChart.Series[j].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime; LineChart.Series[j].YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double; //line width LineChart.ChartAreas[0].AxisX.Title = "Date"; LineChart.ChartAreas[0].AxisY.Title = "Value in %"; LineChart.Series[j].BorderWidth = 3; LineChart.Series[j].Color = col[j]; IEnumerable<DateTime> X = XAxis; IEnumerable<double> Y = YAxis; LineChart.Series[j].Points.DataBindXY(X, "Date", Y, "Value"); } } catch (Exception ex) { MessageBox.Show(ex.Message); }

84

Hospital feedback System SDSC SHAR


} public void GetTotalLines(DateTime temp) { totalLines = 0; AllQuestionAnswerSet = new int[10, 5]; string query = "SELECT * FROM Feedback WHERE DateOfEntry <= #" + EndDate + "#"; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); try { OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); while (selectResult.Read()) { if (DateTime.Parse(selectResult[13].ToString()) >= temp) totalLines++; } Program.conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } public void GetAllData(string qname) { DateTime temp = StartDate; AllQuestionAnswerSet = new int[10, 5]; double NoOfRecords = 0;; while (temp < EndDate) { try { NoOfRecords = 0; //string query = "SELECT * FROM Feedback WHERE DateOfEntry >= #" + temp + "#" + " and DateOfEntry <= #" + EndDate + "# and " + qname + " = 'Excellent'"; string query = "SELECT * FROM Feedback WHERE DateOfEntry = #"+ temp.ToShortDateString() + "#";// and " + qname + " = '"+ComboBoxOptions.SelectedItem.ToString().Trim()+"' "; Program.oleDbCommand.CommandText = query; Program.oleDbCommand.Connection = Program.conn; Program.conn.Open(); OleDbDataReader selectResult = Program.oleDbCommand.ExecuteReader(); totalLines = 0; while (selectResult.Read()) { //MessageBox.Show(selectResult[13].ToString()); if (selectResult[qname].ToString() == ComboBoxOptions.SelectedItem.ToString().Trim()) NoOfRecords++; totalLines++;

85

Hospital feedback System SDSC SHAR


} XAxis.Add(temp); if(totalLines == 0) YAxis.Add(0); else YAxis.Add((NoOfRecords/(double)totalLines) * 100); temp = temp.AddDays(1); Program.conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Program.conn.Close(); }

} }

private void button2_Click(object sender, EventArgs e) { LineChart.Printing.PrintPreview(); }

public class LineGraph { public List<int> YAxis; public string Type; public List<DateTime> XAxis; public LineGraph() { YAxis = new List<Int32>(); XAxis = new List<DateTime>(); Type = null; } public void AddPoint(int yAxis, DateTime xAxis, string type) { this.YAxis.Add(yAxis); this.XAxis.Add(xAxis); this.Type = type; } }

86

Hospital feedback System SDSC SHAR

87

Hospital feedback System SDSC SHAR

TESTING

Testing:
Testing is a process of executing a program with the indent of finding an error. Testing is a crucial element of software quality assurance and presents ultimate review of specification, design and coding.

88

Hospital feedback System SDSC SHAR System Testing is an important phase. Testing represents an interesting anomaly for the software. Thus a series of testing are performed for the proposed system before the system is ready for user acceptance testing. A good test case is one that has a high probability of finding an as undiscovered error. A successful test is one that uncovers an as undiscovered error.

Testing Objectives:
1. Testing is a process of executing a program with the intent of finding an error 2. A good test case is one that has a probability of finding an as yet undiscovered error 3. A successful test is one that uncovers an undiscovered error

Testing Principles:
All tests should be traceable to end user requirements Tests should be planned long before testing begins Testing should begin on a small scale and progress towards testing in large Exhaustive testing is not possible To be most effective testing should be conducted by a independent third party

The primary objective for test case design is to derive a set of tests that has the highest livelihood for uncovering defects in software. To accomplish this objective two different categories of test case design techniques are used. They are White box testing. Black box testing.

White-box testing:
White box testing focus on the program control structure. Test cases are derived to ensure that all statements in the program have been executed at least once during testing and that all logical conditions have been executed. 89

Hospital feedback System SDSC SHAR

Black-box testing:
Black box testing is designed to validate functional requirements without regard to the internal workings of a program. Black box testing mainly focuses on the information domain of the software, deriving test cases by partitioning input and output in a manner that provides through test coverage. Incorrect and missing functions, interface errors, errors in data structures, error in functional logic are the errors falling in this category.

Testing strategies:
A strategy for software testing must accommodate low-level tests that are necessary to verify that all small source code segment has been correctly implemented as well as high-level tests that validate major system functions against customer requirements.

Testing fundamentals:
Testing is a process of executing program with the intent of finding error. A good test case is one that has high probability of finding an undiscovered error. If testing is conducted successfully it uncovers the errors in the software. Testing cannot show the absence of defects, it can only show that software defects present.

Testing Information flow:


Information flow for testing flows the pattern. Two class of input provided to test the process. The software configuration includes a software requirements specification, a design specification and source code.

90

Hospital feedback System SDSC SHAR Test configuration includes test plan and test cases and test tools. Tests are conducted and all the results are evaluated. That is test results are compared with expected results. When erroneous data are uncovered, an error is implied and debugging commences.

Unit testing:
Unit testing is essential for the verification of the code produced during the coding phase and hence the goal is to test the internal logic of the modules. Using the detailed design description as a guide, important paths are tested to uncover errors with in the boundary of the modules. These tests were carried out during the programming stage itself. All units of Vienna SQL were successfully tested.

Integration testing:
Integration testing focuses on unit tested modules and build the program structure that is dictated by the design phase.

System testing:
System testing tests the integration of each module in the system. It also tests to find discrepancies between the system and its original objective, current specification and system documentation. The primary concern is the compatibility of individual modules. Entire system is working properly or not will be tested here, and specified path ODBC connection will correct or not, and giving output or not are tested here these verifications and validations are done by giving input values to the system and by comparing with expected output. Top-down testing implementing here.

Acceptance Testing:
This testing is done to verify the readiness of the system for the implementation. Acceptance testing begins when the system is complete. Its purpose is to provide the end user with the confidence that the system is ready for use. It involves planning and execution of functional tests, performance tests and stress tests in order to demonstrate that the implemented system satisfies its requirements.

91

Hospital feedback System SDSC SHAR Tools to special importance during acceptance testing include: Test coverage Analyzer records the control paths followed for each test case. Timing Analyzer also called a profiler, reports the time spent in various regions of the code are areas to concentrate on to improve system performance. Coding standards static analyzers and standard checkers are used to inspect code for deviations from standards and guidelines.

Test Cases:
Test cases are derived to ensure that all statements in the program have been executed at least once during testing and that all logical conditions have been executed. Using White-Box testing methods, the software engineer can drive test cases that Guarantee that logical decisions on their true and false sides. Exercise all logical decisions on their true and false sides. Execute all loops at their boundaries and with in their operational bounds. Exercise internal data structure to assure their validity.

The test case specification for system testing has to be submitted for review before system testing commences.

92

Hospital feedback System SDSC SHAR

OUTPUT SCREENS

LOGIN:

93

Hospital feedback System SDSC SHAR

94

Hospital feedback System SDSC SHAR

feedback:

95

Hospital feedback System SDSC SHAR

REPORT GENERATION:

96

Hospital feedback System SDSC SHAR

Bar diagrams:

97

Hospital feedback System SDSC SHAR

Pie charts:

98

Hospital feedback System SDSC SHAR

Venn diagrams:

99

Hospital feedback System SDSC SHAR

CONCLUSION

100

Hospital feedback System SDSC SHAR

CONCLUSION:

The package was designed in such a way that future modifications can be done easily. The following conclusion can be deduced from the development of the project. Automation of the entire system improves the efficiency It provides a friendly graphical user interface which proves to be better when compared to the existing system. It gives appropriate access to the authorized users depending on their permissions. It effectively overcomes the delay in communications. Updating of information becomes so easier. System security, data security and reliability are the striking features. The System has adequate scope for modification in future if it is necessary.

101

Hospital feedback System SDSC SHAR

102

Hospital feedback System SDSC SHAR

103

You might also like