Sei sulla pagina 1di 67

INTRODUCTION

Our project Patient Care Management includes registration of patients, storing their details into the system and also computerized. Our software has the facility to give a unique id for every patient and stores the details of every patient and the staff automatically. It includes a search facility to know the current status of each room. Our software can be login by entering a username and password. It is accessible either by an administrator or user. Only they can add data into the database. The data can be retrieved easily. very user-friendly. The interface is

EXISTING SYSTEM
Existing system refers to the system that is being followed till now. Presently all the hospital functionalities are done manually. That is if a patient want to consult a doctor he can visit their till his chance called. This is make the person very difficult. Out_Patient and In_Patient tickets are distributed directly. The main disadvantage is time consuming.

LIMITATIONS OF EXISTING SYSTEM


Lack of security of data. Time consuming. Consumes large volume of paper work. Manual work No direct role for the higher officials.

To avoid all these limitations and make the system working more accurately it needs to be computerized.

OBJECTIVES OF PROPOSED SYSTEM

The Patient care management software is user-friendly software. The main objectives of the system is which shows and helps you to collect most of the information about Hospitality and Medical Services The system is very simple in design and to implement. The system requires very low system resources and the system will work in almost all configurations. The main objectives of the proposed system can be enumerated as follows: Patients are easily allocated to the doctors. Doctors Search is possible. Todays patient list help doctors to search their patients

TECHNOLOGIES TO BE USED
This project will be a desktop application to be developed in VB 6.0 having Ms Access as backend. Database Design (Ms Access) Form Design (VB 6.0) Coding (VB 6.0) Testing (VB 6.0) Reporting Tool (Data Report)

ADVANTAGES OF PROPOSED SYSTEM The system is very simple in design and to implement. The system requires very low system resources and the system will work in almost all configurations. Security of data. Ensure data accuracys. It can be used in any Hospital, Clinic, Dispensary for maintaining patient details and their test results. Administrator controls the entire system. Reduce the damages of the machines. Minimize manual data entry. Greater efficiency. User friendly and interactive. Minimum time required. The Software is for the automation of Hospital Management. It maintains two levels of users: Administrator Level User Level The Software includes: patient. Billing and Report generation. Maintaining Patient details. Providing Prescription, Precautions and Diet advice. Providing and maintaining all kinds of tests for a

PROJECT MODULES
Login Management: Under this module we can login into the software. Only valid and authenticated users have privileges to access the software. We have three valid attempts to login into the software. After the expiry of the valid attempts, the software automatically terminates. Only administrator has privileges to create nay number of users in our project. Our project is based on patient related activities and is divided in sub-modules. They are: Setup Management This module is sub-divided into three sub-modules. They are: Patient Registration: In this module we can register a new patient by autogenerating a unique patient no. The data fields used under this module are:- patient name, occupation, nationality, family doctor, civil status. Under this module we can also have a facility to display existing records in data grid format. Admit Management: In this module we can enter the unique patient no. All the fields like name, address, telephone no., family doctor, Date_of_birth, age, civil status, social cost will display automatically in the respective fields. We can enter date of admission, room no, room type, disease diagnosed, attending physician. After that we cal click on the admit button to admit patient. Searching process is also associated search the patient record. under this module to

Patient Discharge:

Under this module we can enter the unique patient no. The data fields patient name, attending physician, date admitted, room no, room type will display automatically. The doctor enter the final diagnosis remarks disposition i.e. treated and also write special instructions Maintenance Process and also specify the and also specify the & discharged, transferred, untreated

condition of discharge i.e. Good, Satisfactory, Serious, Critical This module is sub-divided into three sub-modules. They are: User Management: In this module only administrator has rights to create any number of users in our project. In this module we can assign the value of access level which ranges from 1 to 3. If value = 1, it means the user account is administrator and has privileges to add more users , otherwise all the user accounts are simple users and have no privileges to create more users. Disease Management: In this module we can new diseases and remove existing disease. Reset Database: Under this module we can remove all the enteries from the tables i.e. patient info, medical records, admit status, diagnosis, users, diseases etc. Update Medical Records Under this module we can update personal information as well as medical record information. Reports Reports are used to extract the record from database in an organized way. Reports can be generated with the help of data environment tool in visual basic. The various data reports generated in our project are:
5

Medical Survey: In this module we can generate medical survey report recovering patients, no. of untreated patients. display medical survey untreated patients. in tabular format and show no. of treated patients, no. of still We can also report which shows diseases wise

no. of treated patients, no. of still recovering patients, no. of Medical Record: In this module we can generate medical record of a patient by entering the unique patient no.

DATA FLOW DIAGRAM


Level 1: Login Management (Admin / User)
Admin (Full Access) (id, password) User (Restricted Access) (id, password) Verify 3 Trials

PC M

Main Menu Display

Condition Not Satisfy

DFD - ADMINISTRATOR

DFD-USER

Level2 : Login Process for PCM

User (in_patient) (id, password)

PC M

Verify 3 Trials

SETUP

PATIENT

Condition Not Satisfy


ADMIT

DISCHARGE

MAINTENANCE User Management Add/Remove Disease

REPORTS Medical Survey Medical Record Searching

Reset Database

Update Medical Records

FEASIBILITY STUDY
Depending on the results of the initial investigation the survey is now expanded to a more detailed feasibility study. FEASIBILITY STUDY is a test of system proposal according to its workability, impact of the organization, ability to meet needs and effective use of the resources. It focuses on these major questions: 1. What are the users demonstrable needs and how does a candidate system meet them? 2. What resources are available for given candidate system? 3. What are the likely impacts of the candidate system on the organization? 4. Whether it is worth to solve the problem? During feasibility analysis for this project, following primary areas of interest are to be considered. Investigation and generating ideas about a new system does this. Steps in feasibility analysis Eight steps involved in the feasibility analysis are: Form a project team and appoint a project leader. Prepare system flowcharts. Enumerate potential proposed system. Define and identify characteristics of proposed system. Determine and evaluate performance and cost effective of each proposed system. Weight system performance and cost data. Select the best-proposed system. Prepare and report final project directive to management.

Technical feasibility A study of resource availability that may affect the ability to achieve an acceptable system. This evaluation determines whether the technology needed for the proposed system is available or not.

Can the work for the project be done with current equipment existing software technology & available personal? Can the system be upgraded if developed? If new technology is needed then what can be developed?

This is concerned with specifying equipment and software that will successfully satisfy the user requirement. The technical needs of the system may include: Front-end and back-end selection An important issue for the development of a project is the selection of suitable front-end and back-end. When we decided to develop the project we went through an extensive study to determine the most suitable platform that suits the needs of the organization as well as helps in development of the project. The aspects of our study included the following factors. Front-end selection: 1. It must have a graphical user interface that assists employees that are not from IT background. 2. Scalability and extensibility. 3. Flexibility. 4. Robustness. 5. According to the organization requirement and the culture. 6. Must provide excellent reporting features with good printing support. 7. Platform independent. 8. Easy to debug and maintain. 9. Event driven programming facility. 10. Front end must support some popular back end like Ms Access. According to the above stated features we selected VB6.0 as the frontend for developing our project. Back-end Selection:
10

1. Multiple user support. 2. Efficient data handling. 3. Provide inherent features for security. 4. Efficient data retrieval and maintenance. 5. Stored procedures. 6. Popularity. 7. Operating System compatible. 8. Easy to install. 9. Various drivers must be available. 10. Easy to implant with the Front-end. According to above stated features we selected Ms-Access as the backend. The technical feasibility is frequently the most difficult area encountered at this stage. It is essential that the process of analysis and definition be conducted in parallel with an assessment to technical feasibility. It centers on the existing computer system (hardware, software etc.) and to what extent it can support the proposed system. Economical feasibility Economic justification is generally the Bottom Line consideration for most systems. Economic justification includes a broad range of concerns that includes cost benefit analysis. In this we weight the cost and the benefits associated with the candidate system and if it suits the basic purpose of the organization i.e. profit making, the project is making to the analysis and design phase. The financial and the economic questions during the preliminary investigation are verified to estimate the following: The cost to conduct a full system investigation. The cost of hardware and software for the class of application being considered. The benefits in the form of reduced cost.

11

The proposed system will give the minute information, as a result the performance is improved which in turn may be expected to provide increased profits. This feasibility checks whether the system can be developed with the available funds required.

Operational Feasibility It is mainly related to human organizations and political aspects. The points to be considered are: What changes will be brought with the system? What organization structures are disturbed? What new skills will be required? Do the existing staff members have these skills? If not, can they be trained in due course of time? The system is operationally feasible as it very easy for the End users to operate it. It only needs basic information about Windows platform. Schedule feasibility Time evaluation is the most important consideration in the development of project. The time schedule required for the developed of this project is very important since more development time effect machine time, cost and cause delay in the development of other systems. A reliable Patient Care Management can be developed in the considerable amount of time.

12

SYSTEM DESIGN
INTRODUCTION Design is the first step into the development phase for any engineered product or system. Design is a creative process. A good design is the key to effective system. The term design is defined as the process of applying various techniques and principles for the purpose of defining a process or a system in sufficient detail to permit its physical realization. It may be defined as a process of applying various techniques and principles for the purpose of defining a device, a process or a system in sufficient detail to permit its physical realization. Software design sits at the technical kernel of the software engineering process and is applied regardless of the development paradigm that is used. The system design develops the architectural detail required to build a system or product. As in the case of any systematic approach, this software too has undergone the best possible design phase fine tuning all efficiency, performance and accuracy levels. The design phase is a transition from a user oriented document to a document to the programmers or database personnel. System design goes through two phases of development: Logical and Physical Design. LOGICAL DESIGN: The logical flow of a system and define the boundaries of a system. It includes the following steps: Reviews the current physical system its data flows, file content, volumes , frequencies etc. Prepares output specifications that is, determines the format, content and frequency of reports. Prepares input specifications format, content and most of the input functions.

13

Prepares edit, security and control specifications. Specifies the implementation plan. Prepares a logical design walk through of the information flow, output, input, controls and implementation plan. Reviews benefits, costs, target dates and system constraints. Physical system produces the working systems by define the

PHYSICAL DESIGN: design specifications that tell the programmers exactly what the candidate system must do. It includes the following steps. Design the physical system. Specify input and output media. Design the database and specify backup procedures. Design physical information flow through the system and a physical design Walk through. Plan system implementation. Prepare a conversion schedule and target date. Determine training procedures, courses and timetable. Devise a test and implementation plan and specify any new hardware/software. Update benefits , costs , conversion date and system constraints

Design/Specification activities: Concept formulation. Problem understanding. High level requirements proposals. Feasibility study. Requirements engineering. Architectural design.

14

ABOUT OPERATING SYSTEM


Windows XP is a line of operating systems developed by Microsoft for use on general purpose computer systems, including home and business desktops, notebook computers and media centers. The letters XP stand for experience. Windows XP is the successor to both Windows 2000 and Windows Me and is first consumer oriented operating system produced by Microsoft to be built on the Windows NT kernel and architecture. The most common editions of operating systems are Windows XP home edition, which is targeted at home users, and Windows XP professional, which has additional features such as, support for Windows server domain and two physical processors and is targeted at power users and business clients. Windows XP Tablet PC edition is designed to run the ink-aware Tablet PC platform. Two separate 64 bit versions of Windows XP were also released, Windows XP 64 bit edition for IA-64(Itanium) processors and Windows XP Professional x64 edition for x86-64 processors.

15

SOFTWARE DESCRIPTION
Microsoft Visual Basic 6.0
Visual Basic 6.0 is Microsofts latest version of the Visual Basic Programming language. chore at time. Although writing programs can be a tedious

Visual Basic reduces the effort required on your part,

and makes programming enjoyable. Visual Basic makes many aspects of programming as simple as dragging graphics objects on to screen with your mouse. Visual Basic 6.0 is more than just a programming language; the secret to Visual Basic is in its name Visual. With to days Windows

Operating System, a program must be able to interact with the screen. Keyboard, mouse and printer graphically. The environment provided by Visual Basic is suitable for any type of application. Using this environment, the user can visually design the objects that your application uses. Visual Basic is not just a languages, its an integrated development environment in which you can develop, run, test and debug your applications. The impressive array of programming resources provided by Visual Basic enables to create the objects extemporaneously which can range from pop-up menu to a message box. A form is a major part of Visual Basic application, which allows the user to enter the data as well as view the result. A control is an object that we draw on a form to enable or enhance user interaction with an application. Hence a Visual Basic application is a combination of object like forms and controls, procedures that can respond to Events and other general-purpose procedures.

16

Starting Visual Basic


To start Visual Basic: Click on the Start button on the Windows task bar. Select Programs, then Microsoft Visual Basic # (where Click on Visual Basic # (where again # is your version).
Title Bar Main Menu Toolbar

# is your version of Visual Basic).

At the top of the screen is the Visual Basic Main Window. At the top of the main window is the Title Bar. The title bar gives us information about what program were using and what Visual Basic program we are working with. Under the main menu is the Toolbar. Here little buttons with pictures also allow us to control Visual Basic, much like the main menu. If you put the mouse cursor over one of these buttons for a second or so, a little tool tip will pop up and tell you what that particular button does.

TOOLBOX WINDOW
17

The Toolbox Window is the selection menu for controls used in your application.

VB6:

Pointer Label Frame Check Box Combo Box Horizontal Scroll Bar Timer Directory Shape Image OLE

Picture Box Text Box Command Button Option Button List Box Vertical Scroll Bar Drive Files Line Data Control

If the toolbox window is not present on the screen, click View on the main menu, then Toolbox. Features of Visual Basic: RAD - Rapid Application Development IDE Integrated Development Environment Good User Interface. OLE Features. Windows API Features. 32 bit Programming Languages. Data Management Online Help Data Access

18

DATABASE DESIGN
A database is an organized mechanism that has the capability of storing information through which a user can retrieve stored information in an effective and efficient manner. The data is the purpose of any database and must be protected. The database design is a two level process. In the first step, user requirements are gathered together and a database is designed which will meet these requirements as clearly as possible. This step is called Information Level Design and it is taken independent of any individual DBMS. In the second step, this Information level design is transferred into a design for the specific DBMS that will be used to implement the system in question. This step is called Physical Level Design, concerned with the characteristics of the specific DBMS that will be used. A database design runs parallel with the system design. The organization of the data in the database is aimed to achieve the following two major objectives. Data Integrity Data independence Normalization is the process of decomposing the attributes in an application, which results in a set of tables with very simple structure. The purpose of normalization is to make tables as simple as possible. Normalization is carried out in this system for the following reasons. To structure the data so that there is no repetition of data , this helps in saving. To permit simple retrieval of data in response to query and report request. To simplify the maintenance of the data through updates, insertions, deletions. To reduce the need to restructure or reorganize data which new application requirements arise.

19

RELATIONAL DATABASE MANAGEMENT SYSTEM (RDBMS): A relational model represents the database as a collection of relations. Each relation resembles a table of values or file of records. In formal relational model terminology, a row is called a tuple, a column header is called an attribute and the table is called a relation. A relational database consists of a collection of tables, each of which is assigned a unique name. A row in a tale represents a set of related values. RELATIONS, DOMAINS & ATTRIBUTES: A table is a relation. The rows in a table are called tuples. A tuple is an ordered set of n elements. Columns are referred to as attributes. Relationships have been set between every table in the database. This ensures both Referential and Entity Relationship Integrity. A domain D is a set of atomic values. A common method of specifying a domain is to specify a data type from which the data values forming the domain are drawn. It is also useful to specify a name for the domain to help in interpreting its values. Every value in a relation is atomic, that is not decomposable.

TABLES STRUCTURE
1. Table: Admit Status Fieldname ID(PK) Date Hospno Roomno Roomtype Disease Patstatus Attendingphysician Datedischarge Disposition Conditionofdischarge Data type Autonumber Date/time Number Text Text Text Text Text Text Text text

20

2. Table: Diagnos Fieldname ID(PK) Date Disease Hospno PatStatus Disposition 3. Table: Disease Fieldname Disease(PK) 4. Table: Lastno Fieldname Hospno Tranno 5. Table: Temp Fieldname Disease Treated Admitted Transferred 6. Table: users Fieldname Userid Password Level Data type Text Text Number Data type Text Number Number Number Data type Number Number Data type text Data type Autonumber Date/time Text Number Text Text

7. Table: Medrec Fieldname ID(PK) Date Hospno Lastname firstname Middlename Data type Autonumber Date/time Number Text Text Text
21

Address Telno Birthdate Age Nationality Civilstatus Sex Familydoctor Dateofarrival Guardian Gaddress Relationship Finaldiagnosis Diagnosis Remarks Allergies Disposition Conditionofdischarge Orderdate Ordertime Docorders Nurseremakrs Discharges 8. Table: Patients Fieldname Hospno Lastname firstname Middlename Address1 Address2 Telno Birthdate Age Civilstatus Sex Occupation Nationality Height Weight Guardian Gaddress Relationship Familydoctor Socialclass

Text Text Date/time number Text Text Text Text Date/time Text Text Text Text Text Text Text Text Text Date/time Text Text Text Yes/no Data type Number Text Text Text Text Text Text Date/time number Text Text text text Text Number Text Text Text Text Text

22

Patientstatus Dateregistered Nurseremakrs Discharges

Text Text Text Yes/no

23

SOURCE CODE

24

Form: Admit Option Explicit Private Sub cmdClose_Click() Unload Me End Sub Private Sub cmdSave_Click() Dim lDiagnosDiseaseFound As Boolean If ValidateEntries Then If CheckHospNo Then ' Confirm Saving.. If MsgBox("Pls click Ok to confirm admittance of the patient.", vbInformation + vbOKCancel) = vbOK Then rstPatients.Edit rstPatients("PatientStatus") = "IN" rstPatients.Update 'AdmitStatus If CheckAdmitStatus Then rstAdmitStatus.Edit Else rstAdmitStatus.AddNew End If rstAdmitStatus("Date") = dDate rstAdmitStatus("HospNo") = nHospNo rstAdmitStatus("RoomNo") = UCase(cboRoomNo) rstAdmitStatus("RoomType") = UCase(cboRoomType) rstAdmitStatus("Disease") = UCase(cboDisease) rstAdmitStatus("PatStatus") = "IN" rstAdmitStatus("AttendingPhysician") UCase(txtAttendingPhysician) 'Remove previous discharge info rstAdmitStatus("DateDischarge") = "" rstAdmitStatus("Disposition") = "" rstAdmitStatus("ConditionOfDischarge") = "" rstAdmitStatus.Update 'Update Diagnos Disease List =

25

lDiagnosDiseaseFound = False If rstDiagnos.RecordCount > 0 Then Do Until rstDiagnos.EOF If Trim(rstDiagnos("HospNo")) = Trim(nHospNo) And _ rstDiagnos("Disease") = UCase(cboDisease) Then lDiagnosDiseaseFound = True Exit Do End If rstDiagnos.MoveNext Loop End If If Not lDiagnosDiseaseFound Then rstDiagnos.AddNew rstDiagnos("Date") = dDate rstDiagnos("Disease") = UCase(cboDisease) rstDiagnos("HospNo") = nHospNo rstDiagnos("PatStatus") = "IN" rstDiagnos.Update End If 'Clear all fields Init nHospNo = "" nHospNo.SetFocus End If Else MsgBox "Unable to admit unregistered patient. Pls create patient's info first.", vbCritical End If End If End If If Trim(txtAttendingPhysician) = "" Then ValidateEntries = False MsgBox "Attending physician required", vbCritical txtAttendingPhysician.SetFocus Exit Function

26

End If ValidateEntries = True End Function Function CheckHospNo() As Boolean CheckHospNo = False If Len(Trim(nHospNo)) > 0 Then rstPatients.Seek "=", Val(nHospNo) If Not rstPatients.NoMatch Then CheckHospNo = True Else MsgBox "Patient's personal record not found.. Pls register the patient first", vbInformation End If End If End Function Function CheckAdmitStatus() As Boolean CheckAdmitStatus = False rstAdmitStatus.Seek "=", Val(nHospNo) If Not rstAdmitStatus.NoMatch Then CheckAdmitStatus = True End If End Function Function GetDataFromAdmitStatus() If CheckAdmitStatus Then If Trim(rstAdmitStatus("DateDischarge")) = "" Then 'not yet discharge cmdSave.Caption = "Edit" cmdSave.Enabled = nLevel > 1 dDate = rstAdmitStatus("Date") cboRoomNo = rstAdmitStatus("RoomNo") cboRoomType = rstAdmitStatus("RoomType") cboDisease = rstAdmitStatus("Disease") txtAttendingPhysician = rstAdmitStatus("AttendingPhysician") Else

27

If

MsgBox("Patient's

was

discharged

last

"

&

Trim(rstAdmitStatus("DateDischarge")) & ". Would you like to reconfine this patient?", vbInformation + vbOKCancel) = vbOK Then dDate = Date dDate.SetFocus Else 'Get another patient Init nHospNo.SetFocus End If End If End If End Function Private Sub nHospNo_LostFocus() cmdSave.Caption = "Admit" If CheckHospNo Then txtName = Trim(rstPatients("Lastname")) & ", " & Trim(rstPatients("Firstname")) & " " & Trim(rstPatients("Middlename")) txtAddress1 = rstPatients("Address1") nTelNo = rstPatients("TelNo") cboCivilStatus = rstPatients("CivilStatus") cboSocialClass = rstPatients("SocialClass") dBirthDate = rstPatients("Birthdate") nAge = GetAge(dBirthDate) txtFamilyDoctor = rstPatients("FamilyDoctor") 'GetDataFromAdmitStatus GetDataFromAdmitStatus Else Init End If End Sub Function GetDisease() rstDisease.Index = "Disease" If rstDisease.RecordCount > 0 Then cboDisease = rstDisease("Disease")

28

Do Until rstDisease.EOF cboDisease.AddItem UCase(rstDisease("Disease")) rstDisease.MoveNext Loop End If End Function Private Sub mnuSearchPatient_Click() frmSearchPatient.Show 1 'nHospNo.Mask = "" nHospNo = Str(nPatNo) 'nHospNo.Mask = "#######" 'MsgBox "Auto-retrieve record of patient number " & Trim(Str(nPatNo)), vbInformation nHospNo_LostFocus dDate.SetFocus End Sub '- UDF Private Sub nHospNo_GotFocus() Init Call FocusMe(nHospNo) End Sub Private Sub txtAttendingPhysician_Gotfocus() Call FocusMe(txtAttendingPhysician) End Sub Private Sub nHospNo_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtAttendingPhysician_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub cboRoomNo_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub cboRoomType_KeyPress(KeyAscii As Integer)

29

If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub cboDisease_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub '- eo: UDF Form: Discharge Option Explicit Private Sub cmdClose_Click() Unload Me End Sub Private Sub cmdSave_Click() Dim strDisposition, strConditionOfDischarge As String Dim lMedRecNew As Boolean If ValidateEntries Then If CheckHospNo Then ' Confirm Saving.. If MsgBox("Pls click Ok to confirm Discharge of the patient.", vbInformation + vbOKCancel) = vbOK Then rstPatients.Edit rstPatients("PatientStatus") = "OUT" rstPatients.Update 'AdmitStatus If CheckAdmitStatus Then rstAdmitStatus.Edit 'discharge info strDisposition = "T" 'Treated If optTransferred = True Then strDisposition = "S" 'Transferred ElseIf optDead = True Then strDisposition = "U" 'Untreated/Dead/Discharged End If strConditionOfDischarge = "G" If optSatisfactory Then strConditionOfDischarge = "F"

30

ElseIf optSerious Then strConditionOfDischarge = "U" ElseIf optCritical Then strConditionOfDischarge = "C" End If rstAdmitStatus("DateDischarge") = Date rstAdmitStatus("Disposition") = strDisposition rstAdmitStatus("ConditionOfDischarge") strConditionOfDischarge rstAdmitStatus("PatStatus") = "OUT" rstAdmitStatus.Update End If 'Update Diagnos Disease List If rstDiagnos.RecordCount > 0 Then Do Until rstDiagnos.EOF If Trim(rstDiagnos("HospNo")) = Trim(nHospNo) And _ rstDiagnos("Disease") = UCase(cboDisease) Then rstDiagnos.Edit rstDiagnos("Disposition") = strDisposition rstDiagnos("PatStatus") = "OUT" rstDiagnos.Update Exit Do End If rstDiagnos.MoveNext Loop End If 'Medical Record lMedRecNew = True If rstMedRec.RecordCount > 0 Then rstMedRec.MoveFirst Do Until rstMedRec.EOF If Trim(rstMedRec("HospNo")) = Trim(nHospNo) And _ rstMedRec("Date") = Date And _ rstMedRec("Discharge") = True Then 'edit lMedRecNew = False =

31

Exit Do End If rstMedRec.MoveNext Loop End If If lMedRecNew Then 'New medical record rstMedRec.AddNew Else rstMedRec.Edit End If rstMedRec("HospNo") = nHospNo rstMedRec("Date") = Date rstMedRec("Firstname") = txtFirstname rstMedRec("Middlename") = txtMiddlename rstMedRec("Lastname") = txtLastname rstMedRec("Address") = txtAddress1 rstMedRec("Age") = nAge rstMedRec("Sex") = cboSex rstMedRec("Nationality") = txtNationality rstMedRec("TelNo") = nTelNo rstMedRec("CivilStatus") = cboCivilStatus rstMedRec("DateOfArrival") = dDateAdmitted rstMedRec("FinalDiagnosis") = UCase(rtbFinalDiagnosis.Text) rstMedRec("Remarks") = UCase(rtbRemarks.Text) rstMedRec("Disposition") = strDisposition rstMedRec("ConditionOfDischarge") = strConditionOfDischarge rstMedRec("Discharge") = True rstMedRec.Update 'Clear all fields Init nHospNo = "" nHospNo.SetFocus End If Else

32

MsgBox "Unable to discharge unregistered patient. Pls create patient's info first.", vbCritical End If End If End Sub Private Sub Form_Load() Set dbsInfoSys = OpenDatabase(App.Path & "\InfoSys.mdb") Set rstPatients = dbsInfoSys.OpenRecordset("Patients") Set rstAdmitStatus = dbsInfoSys.OpenRecordset("AdmitStatus") Set rstDiagnos = dbsInfoSys.OpenRecordset("Diagnos") Set rstMedRec = dbsInfoSys.OpenRecordset("MedRec") rstMedRec.Index = "HospNo" rstPatients.Index = "HospNo" rstAdmitStatus.Index = "HospNo" rstDiagnos.Index = "HospNo" Init 'Clear all entry fields End Sub Private Sub Form_Unload(Cancel As Integer) rstMedRec.Close rstDiagnos.Close rstAdmitStatus.Close rstPatients.Close dbsInfoSys.Close End Sub '- clear all entry fields Function Init() cmdSave.Caption = "Discharge" cmdSave.Enabled = True txtName = "" txtAttendingPhysician = "" cboDisease = "" cboRoomNo = "" cboRoomType = "" dDateAdmitted = Date '"" rtbFinalDiagnosis = ""

33

rtbRemarks = "" txtFirstname = "" txtMiddlename = "" txtLastname = "" txtAddress1 = "" nAge = 0 Function GetDataFromAdmitStatus() If CheckAdmitStatus Then If Trim(rstAdmitStatus("DateDischarge")) <> "" Then 'not yet discharge cmdSave.Caption = "Edit" End If dDateAdmitted = rstAdmitStatus("Date") cboDisease = rstAdmitStatus("Disease") cboRoomNo = rstAdmitStatus("RoomNo") cboRoomType = rstAdmitStatus("RoomType") txtAttendingPhysician = rstAdmitStatus("AttendingPhysician") End If End Function Function GetDataFromMedRec() If rstMedRec.RecordCount > 0 Then rstMedRec.MoveFirst Do Until rstMedRec.EOF If Trim(rstMedRec("HospNo")) = Trim(nHospNo) And _ rstMedRec("Date") = Date And _ rstMedRec("Discharge") = True Then 'edit cmdSave.Caption = "Edit" cmdSave.Enabled = nLevel > 1 'cboDisease = rstMedRec("Disease") rtbFinalDiagnosis = rstMedRec("FinalDiagnosis") rtbRemarks = rstMedRec("Remarks") txtAttendingPhysician = rstMedRec("AttendingPhysician") 'Disposition optTreated = (rstMedRec("Disposition") = "T")

34

optTransferred = (rstMedRec("Disposition") = "S") optDead = (rstMedRec("Disposition") = "U") 'Condition of Discharged optGood = (rstMedRec("ConditionOfDischarge") = "G") optSatisfactory = (rstMedRec("ConditionOfDischarge") = "F") optSerious = (rstMedRec("ConditionOfDischarge") = "U") optCritical = (rstMedRec("ConditionOfDischarge") = "C") Exit Do End If rstMedRec.MoveNext Loop End If End Function Private Sub nHospNo_LostFocus() cmdSave.Caption = "Discharge" If CheckHospNo Then txtName = Trim(rstPatients("Lastname")) & ", " & Trim(rstPatients("Firstname")) & " " & Trim(rstPatients("Middlename")) 'GetDataFromAdmitStatus GetDataFromAdmitStatus GetDataFromMedRec Else Init End If End Sub Private Sub mnuSearchPatient_Click() frmSearchPatient.Show 1 nHospNo = Str(nPatNo) nHospNo_LostFocus rtbFinalDiagnosis.SetFocus End Sub '- UDF Private Sub nHospNo_GotFocus() Init Call FocusMe(nHospNo)

35

End Sub Private Sub nHospNo_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub '- eo: UDF Form: disease Function CheckDisease(strDisease As String) As Boolean CheckDisease = False rstDisease.Seek "=", txtDisease If Not rstDisease.NoMatch Then CheckDisease = True cmdSave.Caption = "Edit" End If End Function Private Sub cmdRemove_Click() If Not IsEmpty(txtDisease) Then If CheckDisease(txtDisease) Then If MsgBox("Click Ok to Remove this record.", vbExclamation + vbOKCancel) = vbOK Then rstDisease.Edit rstDisease.Delete adoDisease.Refresh cmdSave.Caption = "Save" txtDisease = "" txtDisease.SetFocus End If Else MsgBox txtDisease & " not found ", vbCritical End If Else MsgBox "Nothing to remove.", vbInformation End If End Sub Private Sub cmdSave_Click() If Not IsEmpty(txtDisease) Then

36

' Confirm Saving.. If MsgBox("Click Ok to Save", vbInformation + vbOKCancel) = vbOK Then If Not CheckDisease(txtDisease) Then rstDisease.AddNew 'New record Else rstDisease.Edit 'Existing End If rstDisease("Disease") = UCase(txtDisease) rstDisease.Update adoDisease.Refresh cmdSave.Caption = "Save" txtDisease = "" txtDisease.SetFocus End If Else MsgBox "Nothing to save", vbInformation End If End Sub Private Sub cmdClose_Click() Unload Me End Sub Private Sub Form_Load() Set dbsInfoSys = OpenDatabase(App.Path & "\InfoSys.mdb") Set rstDisease = dbsInfoSys.OpenRecordset("Disease") rstDisease.Index = "Disease" cmdRemove.Visible = nLevel > 2 End Sub Private Sub Form_Unload(Cancel As Integer) rstDisease.Close dbsInfoSys.Close End Sub '- UDF Private Sub txtDisease_GotFocus() Call FocusMe(txtDisease)

37

End Sub Private Sub txtDisease_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub '- eo: UDF Form: login Option Explicit Private Sub cmdExit_Click() Unload Me End End Sub Private Sub cmdOK_Click() Static nTries As Byte rstUsers.Seek "=", txtUserId If Not rstUsers.NoMatch Then If nTries < 2 Then If rstUsers("Password") = txtPassword Then nLevel = Val(CStr(rstUsers("Level"))) '' nLevel = 7 'for testing only/temporary Unload Me frmMain.Show 1 Else nTries = nTries + 1 MsgBox "Invalid Password: " & CStr(nTries), vbCritical txtPassword.SetFocus End If Else MsgBox "Access Denied!", vbCritical Unload Me End End If Else MsgBox "Unauthorized Access!", vbCritical txtUserId.SetFocus End If

38

End Sub Private Sub Form_Load() 'Go to Application Path ChDir (App.Path) Set dbsInfoSys = OpenDatabase(App.Path & "\infosys.mdb") Set rstUsers = dbsInfoSys.OpenRecordset("Users") rstUsers.Index = "UserId" End Sub Private Sub Form_Unload(Cancel As Integer) rstUsers.Close dbsInfoSys.Close End Sub '- UDF Private Sub txtPassword_GotFocus() Call FocusMe(txtPassword) End Sub Private Sub txtPassword_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then Unload Me End End If If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtUserId_GotFocus() Call FocusMe(txtUserId) End Sub Private Sub txtUserID_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then Unload Me End End If If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub '- eo: UDF

39

Form: Main Private Sub cmdExit_Click() End End Sub Function GetMedSurvey() Dim nTreated, nAdmitted, nTransferred As Long Dim strPrevDisease As String Set dbsInfoSys = OpenDatabase(App.Path & "\InfoSys.mdb") Set rstDiagnos = dbsInfoSys.OpenRecordset("Diagnos") Set rstTemp = dbsInfoSys.OpenRecordset("Temp") rstDiagnos.Index = "Disease" rstTemp.Index = "Disease" If rstTemp.RecordCount > 0 Then rstTemp.MoveFirst Do Until rstTemp.EOF rstTemp.Delete rstTemp.MoveNext Loop End If nTreated = 0 nTransferred = 0 nAdmitted = 0 If rstDiagnos.RecordCount > 0 Then rstDiagnos.MoveFirst strPrevDisease = Trim(rstDiagnos("Disease")) Do Until rstDiagnos.EOF If Trim(UCase(rstDiagnos("Disease"))) = Trim(UCase(strPrevDisease)) Then If rstDiagnos("Disposition") = "T" Then nTreated = nTreated + 1 ElseIf rstDiagnos("Disposition") = "S" Then nTransferred = nTransferred + 1 Else 'A-Still Recovering nAdmitted = nAdmitted + 1 End If

40

rstTemp.Seek "=", strPrevDisease If Not rstTemp.NoMatch Then rstTemp.Edit Else rstTemp.AddNew End If rstTemp("Disease") = strPrevDisease rstTemp("Treated") = nTreated rstTemp("Admitted") = nAdmitted rstTemp("Transferred") = nTransferred rstTemp.Update rstDiagnos.MoveNext Else 'New disease nTreated = 0 nTransferred = 0 nAdmitted = 0 strPrevDisease = rstDiagnos("Disease") End If Loop End If End Function Private Sub Command1_Click() Select Case Command1.Caption Case "&Patient" frmPatients.Show 1 Case "&Medical Survey" GetMedSurvey rptMedSurvey.DataMember = "cmdMedSurvey" rptMedSurvey.Show 1 Unload rptMedSurvey Unload denvMedSurvey Case Else '&Users frmUsers.Show 1 End Select End Sub

41

Private Sub Command2_Click() Select Case Command2.Caption Case "&Admit" frmAdmit.Show 1 Case "&Medical Record" frmMedRecRep.Show 1 Case Else '&Diseases frmDisease.Show 1 End Select End Sub Private Sub Command3_Click() Select Case Command3.Caption Case "&Discharge" frmDischarge.Show 1 Case "&Clear Tables" If nLevel > 2 Then frmInitialize.Show 1 Else MsgBox "Only the administrator can access this menu.", vbCritical End If Case Else 'Screen Survey frmScreenSurvey.Show 1 End Select End Sub Private Sub Form_Load() ShockwaveFlash1.Movie = App.Path & "\region1.swf" Set dbsInfoSys = OpenDatabase(App.Path & "\InfoSys.mdb") Set rstDiagnos = dbsInfoSys.OpenRecordset("Diagnos") Set rstTemp = dbsInfoSys.OpenRecordset("Temp") rstDiagnos.Index = "Disease" End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) lblMenuTips.Caption = " Chr(13) & Chr(13) & " Medical Center" & Patient's Information System"

42

picSetup.Picture = LoadPicture(App.Path & "\SetFlat.jpg") picReport.Picture = LoadPicture(App.Path & "\RepFlat.jpg") picMaintenance.Picture = LoadPicture(App.Path & "\MaintFlat.jpg") '- Lower buttons imgSearch.Picture = LoadPicture(App.Path & "\SearchFlat.jpg") imgMedRec.Picture = LoadPicture(App.Path & "\MedRecFlat.jpg") imgAuthors.Picture = LoadPicture(App.Path & "\AuthorsFlat.jpg") End Sub Private Sub picSetup_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) picSetup.Picture = LoadPicture(App.Path & "\SetDown.jpg") lblMenuTips.Caption = "Maintenance: Click this button if you want to create users, update table of diseases or clear all tables for initial system installation." picMaintenance.Picture = LoadPicture(App.Path & "\MaintUp.jpg") End Sub Private Sub picReport_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) lblMenuTips.Caption = "Reports: Click this button if you want to generate or print a medical survey report or patient's medical records." picReport.Picture = LoadPicture(App.Path & "\RepUp.jpg") End Sub Private Sub picSetup_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) lblMenuTips.Caption = "Setup: Click this button if you want to register patient, confine or discharge previously admitted patient." picSetup.Picture = LoadPicture(App.Path & "\SetUp.jpg") End Sub '- eo: Main Menu Buttons '- Lower Buttons Private Sub imgSearch_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) imgSearch.Picture = LoadPicture(App.Path & "\SearchDown.jpg") frmSearchPatient.Show 1 End Sub

43

Private

Sub

imgMedRec_MouseDown(Button

As

Integer,

Shift As

Integer, X As Single, Y As Single) imgMedRec.Picture = LoadPicture(App.Path & "\MedRecDown.jpg") frmMedRec.Show 1 End Sub Private Sub imgAuthors_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) imgAuthors.Picture = LoadPicture(App.Path & "\AuthorsDown.jpg") frmAuthors.Show 1 End Sub Private Sub imgSearch_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) imgSearch.Picture = LoadPicture(App.Path & "\SearchUp.jpg") End Sub Private Sub imgMedRec_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) imgMedRec.Picture = LoadPicture(App.Path & "\MedRecUp.jpg") End Sub Private Sub imgAuthors_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) imgAuthors.Picture = LoadPicture(App.Path & "\AuthorsUp.jpg") End Sub '- eo: Lower Buttons Private Long) End Sub Form: Medicalrec Option Explicit Private Sub cmdClose_Click() Unload Me End Sub Private Sub cmdRemove_Click() If ValidateEntries Then If CheckHospNo Then Sub ShockwaveFlash1_OnReadyStateChange(newState As

44

' Confirm Saving.. If MsgBox("Pls click Ok to confirm Medical Record DELETION.", vbExclamation + vbOKCancel) = vbOK Then 'Medical Record If rstMedRec.RecordCount > 0 Then If rstMedRec.RecordCount > 0 Then rstMedRec.MoveFirst Do Until rstMedRec.EOF If Trim(rstMedRec("HospNo")) = Trim(nHospNo) And _ rstMedRec("Date") = Date Then 'edit lMedRecNew = False Exit Do End If rstMedRec.MoveNext Loop End If If lMedRecNew Then 'New medical record rstMedRec.AddNew Else rstMedRec.Edit End If rstMedRec("HospNo") = nHospNo rstMedRec("Lastname") = txtLastname rstMedRec("Firstname") = txtFirstname rstMedRec("Middlename") = txtMiddlename rstMedRec("Address") = txtAddress1 rstMedRec("TelNo") = nTelNo rstMedRec("Birthdate") = dBirthDate rstMedRec("Age") = nAge rstMedRec("Nationality") = txtNationality rstMedRec("CivilStatus") = cboCivilStatus rstMedRec("Sex") = cboSex rstMedRec("FamilyDoctor") = txtFamilyDoctor rstMedRec("Diagnosis") = cboDisease

45

rstMedRec("DateOfArrival") = dDateOfArrival rstMedRec("Date") = Date rstMedRec("Guardian") = UCase(txtGuardian) rstMedRec("GAddress") = UCase(txtGAddress) rstMedRec("Relationship") = UCase(txtRelationship) rstMedRec("Allergies") = UCase(txtAllergies) rstMedRec("FinalDiagnosis") = UCase(rtbFinalDiagnosis.Text) rstMedRec("Remarks") = UCase(rtbRemarks.Text) rstMedRec("AttendingPhysician") = txtAttendingPhysician rstMedRec("OrderDate") = dOrderDate rstMedRec("OrderTime") = txtOrderTime rstMedRec("DocOrders") = UCase(txtDocOrders) rstMedRec("NurseRemarks") = UCase(txtNurseRemarks) 'discharge info strDisposition = "T" If optTransferred = True Then strDisposition = "S" End If strConditionOfDischarge = "G" If optSatisfactory Then strConditionOfDischarge = "F" ElseIf optSerious Then strConditionOfDischarge = "U" ElseIf optCritical Then strConditionOfDischarge = "C" End If rstMedRec("Disposition") = strDisposition rstMedRec("ConditionOfDischarge") = strConditionOfDischarge rstMedRec.Update 'Clear all fields Init nHospNo = "" nHospNo.SetFocus End If Else

46

MsgBox "Unable to update medical record of unregistered patient. Pls create patient's info first.", vbCritical End If End If End Sub Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) 'nHospNo.Mask = "" nHospNo = Str(adoPatients.Recordset("HospNo")) nHospNo_LostFocus End Sub Private Sub Form_Activate() nHospNo.SetFocus End Sub Private Sub Form_Load() Set dbsInfoSys = OpenDatabase(App.Path & "\InfoSys.mdb") Set rstPatients = dbsInfoSys.OpenRecordset("Patients") Set rstMedRec = dbsInfoSys.OpenRecordset("MedRec") Set rstDisease = dbsInfoSys.OpenRecordset("Disease") Set rstAdmitStatus = dbsInfoSys.OpenRecordset("AdmitStatus") rstPatients.Index = "HospNo" rstMedRec.Index = "HospNo" rstAdmitStatus.Index = "HospNo" Init 'Clear all entry fields GetDisease SStab1.Tab = 0 cmdRemove.Visible = nLevel > 2 End Sub Private Sub Form_Unload(Cancel As Integer) rstAdmitStatus.Close rstDisease.Close rstMedRec.Close rstPatients.Close dbsInfoSys.Close End Sub

47

'- clear all entry fields Function Init() SStab1.Tab = 0 cmdSave.Caption = "Save" cmdSave.Enabled = True txtLastname = "" txtFirstname = "" txtMiddlename = "" txtAddress1 = "" txtAddress2 = "" nTelNo.Mask = "" nTelNo = "" nTelNo.Mask = "(###) ###-####" txtOccupation = "" txtNationality = "" nAge = "" txtHeight = "" nWeight = "" cboSex = "" cboCivilStatus = "" cboSocialClass = "" txtGuardian = "" txtGAddress = "" txtRelationship = "" txtFamilyDoctor = "" cboPatientStatus = "" dDateOfArrival = "" cboRoomNo = "" cboRoomType = "" cboCivilStatus = rstPatients("CivilStatus") cboSocialClass = rstPatients("SocialClass") cboPatientStatus = rstPatients("PatientStatus") dBirthDate = rstPatients("Birthdate") End Function

48

Private Sub SSTab1_Click(PreviousTab As Integer) If PreviousTab = 1 Then 'nHospNo.SetFocus End If End Sub '-- UDF Private Sub nHospNo_GotFocus() Call FocusMe(nHospNo) End Sub Private Sub txtAllergies_GotFocus() Call FocusMe(txtAllergies) End Sub Private Sub txtAttendingPhysician_Gotfocus() Call FocusMe(txtAttendingPhysician) End Sub Private Sub txtDocOrders_GotFocus() Call FocusMe(txtDocOrders) End Sub Private Sub txtFamilyDoctor_GotFocus() Call FocusMe(txtFamilyDoctor) End Sub Private Sub txtGAddress_GotFocus() Call FocusMe(txtGAddress) End Sub Private Sub txtGuardian_GotFocus() Call FocusMe(txtGuardian) End Sub Private Sub txtNurseRemarks_GotFocus() Call FocusMe(txtNurseRemarks) End Sub Private Sub txtOrderTime_GotFocus() Call FocusMe(txtOrderTime) End Sub Private Sub txtOrderTime_LostFocus()

49

txtOrderTime = ValidTime(txtOrderTime) End Sub Private Sub txtRelationship_GotFocus() Call FocusMe(txtRelationship) End Sub Private Sub cboDisease_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtAllergies_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtAttendingPhysician_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtDocOrders_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtOrderTime_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtNurseRemarks_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub cboPatientStatus_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub nHospNo_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtFamilyDoctor_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtFirstname_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub

50

Private Sub txtGuardian_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtGAddress_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtRelationship_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub '-- eo: UDF Form: Patients Option Explicit Function CheckHospNo() As Boolean CheckHospNo = False rstPatients.Seek "=", Val(nHospNo) If Not rstPatients.NoMatch Then CheckHospNo = True cmdSave.Enabled = nLevel > 1 End If End Function Private Sub cmdSave_Click() If ValidateEntries Then ' Confirm Saving.. If MsgBox("Click Ok to Save", vbInformation + vbOKCancel) = vbOK Then End If If IsEmpty(txtLastname) Then ValidateEntries = False MsgBox "Lastname required", vbCritical txtLastname.SetFocus Exit Function End If If IsEmpty(txtFirstname) Then ValidateEntries = False MsgBox "Firstname required", vbCritical

51

txtFirstname.SetFocus Exit Function End If If IsEmpty(txtAddress1) And _ IsEmpty(txtAddress2) Then ValidateEntries = False MsgBox "Address required", vbCritical txtAddress1.SetFocus Exit Function End If If dBirthDate > Date Then ValidateEntries = False MsgBox "Invalid birthdate", vbCritical dBirthDate.SetFocus Exit Function End If If IsEmpty(cboSex) Then ValidateEntries = False MsgBox "Sex required", vbCritical cboSex.SetFocus Exit Function End If If Val(nWeight) < 1 Then ValidateEntries = False MsgBox "Invalid weight", vbCritical nWeight.SetFocus Exit Function End If ValidateEntries = True End Function Private Sub mnuSearchPatient_Click() frmSearchPatient.Show 1 '-Actual App '- Runtime Error: Invalid Procedure Call 'nHospNo.Mask = ""

52

nHospNo = Str(nPatNo) 'invalid property value 'nHospNo.Mask = "#######" 'MsgBox "Auto-retrieve record of patient number " & Trim(Str(nPatNo)), vbInformation nHospNo_LostFocus 'Invalid procedure call '- eo: Runtime Error: End Sub Private Sub nHospNo_LostFocus() cmdSave.Caption = "Save" If CheckHospNo Then cmdSave.Caption = "Edit" txtLastname = rstPatients("Lastname") txtFirstname = rstPatients("Firstname") txtMiddlename = rstPatients("Middlename") txtAddress1 = rstPatients("Address1") txtAddress2 = rstPatients("Address2") nTelNo.Mask = "" nTelNo = rstPatients("TelNo") nTelNo.Mask = "(###) ###-####" txtOccupation = rstPatients("Occupation") txtNationality = rstPatients("Nationality") cboSex = rstPatients("Sex") cboCivilStatus = rstPatients("CivilStatus") cboSocialClass = rstPatients("SocialClass") cboPatientStatus = rstPatients("PatientStatus") dBirthDate = rstPatients("Birthdate") nAge = GetAge(dBirthDate) txtHeight = rstPatients("Height") nWeight = rstPatients("Weight") txtGuardian = rstPatients("Guardian") txtGAddress = rstPatients("GAddress") txtRelationship = rstPatients("Relationship") txtFamilyDoctor = rstPatients("FamilyDoctor") Else Init

53

End If End Sub Private Sub dBirthDate_LostFocus() nAge = GetAge(dBirthDate) End Sub '-- UDF Private Sub nHospNo_GotFocus() 'nHospNo.Mask = "#######" Call FocusMe(nHospNo) End Sub Private Sub nTelNo_GotFocus() Call FocusMe(nTelNo) End Sub End Sub Private Sub nHospNo_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub nWeight_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtAddress1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtFamilyDoctor_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtFirstname_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtGuardian_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtHeight_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub

54

Private Sub txtGAddress_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtLastname_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtMiddlename_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtOccupation_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtNationality_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub Private Sub txtRelationship_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation End Sub '-- eo: UDF Form: search patient Option Explicit Dim Conn As New ADODB.Connection Dim adoPatients As New ADODB.Recordset Private Sub cmdClose_Click() nPatNo = Val(Trim(nHospNo)) Unload Me End Sub Private Sub Form_Unload(Cancel As Integer) Set adoPatients = Nothing Set Conn = Nothing End Sub Private Sub Form_Load()

55

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\InfoSys.mdb" & ";Persist Security Info=False;Jet OLEDB:Database Password=" adoPatients.CursorLocation = adUseClient txtLastname_LostFocus End Sub Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) If Not adoPatients.BOF And Not adoPatients.EOF Then nAge = GetAge(dBirthDate) End If End Sub If Trim(txtLastname) <> "" And _ Trim(txtFirstname) <> "" Then strSQL = strSQL & " and " End If If Trim(txtLastname) = "" And _ Trim(txtFirstname) <> "" Then strSQL = strSQL & " Where " End If If Trim(txtFirstname) <> "" Then 'strSQL strSQL End If strSQL = strSQL & " Order by [LastName], [Firstname]" End If adoPatients.CursorLocation = adUseClient adoPatients.Open strSQL, Conn, adOpenKeyset, adLockOptimistic 'adOpenDynamic, adLockPessimistic" Set DataGrid1.DataSource = adoPatients Set txtMiddlename.DataSource = adoPatients Set txtAddress1.DataSource = adoPatients Set txtAddress2.DataSource = adoPatients = = strSQL strSQL & & " " [FirstName] [FirstName] Like Like '%" '" & & Trim(UCase(txtFirstname)) & "%'" 'remove as per panelist 2.21.5 Trim(UCase(txtFirstname)) & "%'"

56

Set nTelNo.DataSource = adoPatients Set txtOccupation.DataSource = adoPatients Set txtNationality.DataSource = adoPatients Set cboSex.DataSource = adoPatients Set cboCivilStatus.DataSource = adoPatients Set dBirthDate.DataSource = adoPatients Set txtHeight.DataSource = adoPatients Set nWeight.DataSource = adoPatients Set cboSocialClass.DataSource = adoPatients Set cboPatientStatus.DataSource = adoPatients Set txtGuardian.DataSource = adoPatients Set txtGAddress.DataSource = adoPatients Set txtRelationship.DataSource = adoPatients Set txtFamilyDoctor.DataSource = adoPatients If Not lHospNo Then nHospNo.DataField = "HospNo" Set nHospNo.DataSource = adoPatients Sub Private Sub txtLastname_LostFocus() Search (False) End Sub Private Sub txtFirstname_LostFocus() Search (False) DataGrid1.SetFocus End Sub '- UDF Private Sub txtFirstname_Gotfocus() Call FocusMe(txtFirstname) End Sub Private Sub txtLastname_Gotfocus() Call FocusMe(txtLastname) End Sub Private Sub txtLastname_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys Chr(9) 'Tab emulation

57

SCREENSHOTS

58

FORM: LOGIN

FORM: USERS MAINTENANCE

59

FORM: MAIN

60

FORM: PATIENT REGISTRATION

61

FORM: ADMIT PATIENT

FORM: DISCHARGE PATIENT

FORM: DISEASES MAINTENANCE


62

FORM: MEDICAL SCREEN SURVEY

63

SYSTEM IMPLEMENTATION AND MAINTENANCE


Implementation is the stage of the project where the theoretical design is turned into a working system. It can be considered to be the most crucial stage in achieving a successful new system gaining the users confidence that the new system will work and will be effective and accurate. It is primarily concerned with user training and documentation. Conversion usually takes place about the same time the user is being trained or later. Implementation simply means convening a new system design into operation, which is the process of converting a new revised system design into an operational one. IMPLEMENTATION AND MAINTENANCE IMPLEMENTATION In this process we will put new system into use, train users. Commonly the old system if any may run in parallel with new one and the results will be compared.

MAINTENANCE It is necessary to eliminate the residual errors in the system which appears in the system with the passage of time. The importance of maintenance lies in continuously bringing the new system to standards.

VALIDATION TO BE PERFORMED Front-end validation will be like user cannot enter wrong values or incorrect data, message boxes are displayed while performing wrong operation. Data base validation is also applied to the tables where the user cannot enter duplicate values. Primary keys are applied to the possible fields of tables.

64

SYSTEM TESTING
OVERVIEW System testing is generally done to ensure that the system is error free or not. In other words it is done to check whether the system is meeting the desired set objectives. Here in our system we performed two main tests.

CODE TESTING: In this testing code is checked whether it is working properly or not it is checked for errors to ensure that all the errors are rectified before system installation. SPECIFIC TESTING We started our development of the system by keeping in mind certain desired specifications like the amount of data need for implementing the system. UNIT TESTING In this testing phase we checked each form individually to see whether it is working properly or not. INTEGRATION TESTING In this testing all the form are collectively checked. It monitors whether the output of one form which will be input to another form is working properly or not. It is done to see the performance of system as a whole.

65

FUTURE SCOPE OF THE PROJECT


The future expansion scope of the project is that it can be shifted to the client server technology for use in networking environment thus making it a full fledged multi-user system... Intelligent Hospital Management System software can be upgraded to expand its utility to every one by connecting it to World Wide Web and also result could be found online. In such case the database could be shifted from MS ACCESS to oracle or MS SQL Server and the front end could be shifted from VB 6 to VB .NET - a new distributed computing platform.

PROJECT UTILITY: In nut shell the system can be used in most effective for Large as well as small Hospitals.

66

BIBLIOGRAPHY
BOOKS: Teach your-self Visual Basic in 21 days www.google.co.in Mastering Visual Basic 6 Visual Basic, A-Level (DOEACC) Rajeev mall Software engineering Elmasri Navathe Fundamentals of database systems

ONLINE REFERENCE: www.w3schools.com www.visual.com

67

Potrebbero piacerti anche