91
NEAR EAST UNIVERSITY l FACULTY /F EC/N/MICSAND ADMINITRATIVE SCIENCE I DEPARTMENT /F C/MPUTER INF/RMATI/N SYSTEM 2002 SPRING TERM cıs 400 (Graduation Project) Hospital Management System Submitted To: Dr.Valcin Akcali Miss.Nadire Cavus Submitted By: Amar EI-Sadig (950876) Mahmoud Abdo-Rabo (980702) Lefkosa 2002 ~ı,~~!•!, NEU

~ı,~~!•!, - Near East University Docs

Embed Size (px)

Citation preview

NEAR EAST UNIVERSITY

lFACULTY OF ECONOMICS AND

ADMINITRATIVE SCIENCE

I DEPARTMENT OF COMPUTERINFORMATION SYSTEM

2002 SPRING TERMcıs 400

(Graduation Project)

Hospital Management System

Submitted To: Dr.Valcin AkcaliMiss. Nadire Cavus

Submitted By: Amar EI-Sadig (950876)Mahmoud Abdo-Rabo (980702)

Lefkosa2002

~ı,~~!•!,NEU

CONTENTS

I. ACKNOWLEDGEMENTS .I

II. ABSTRACT II

Ill. INTRODUCTION 1

IV. EXPLANATION OF THE SYSTEM 2-8

- Data Flow Diagram 2-5

- Database Design 6-8

V. USER MANUAL. ..•......•.•.........•.•.•....•..•..•.............•.•.....• 9-12

VI. LIST OF SUBPROGRAMS .•.....•........•.....•.............•.•..••.• 13-88

- User Flow Chart 13-45

- Source program 46-67

- Screen output 68-88

VII. References ..••.••..•.•......•......•.•.......•....•.•...•..•.........•...... Ill

ACKNOWLEDGMENT

We humbly thankful for Dr.Yalcin Ak:cali and our advisor Miss. Nadire cavusfor their valuable support they extended us throughout the project.

As much as we like to thank making this project and finish this project to Allah

at first. Then we would like to thank our teachers at computer information systemdepartment.

And thanks again to Prof Dr. Steven McDowell who supporting us by completeinformation and the necessary data that we have been looking for.

Eventually a lot of thanks for all the people and friends that we couldn'tassigned at this acknowledgment but they always near to our heart

IIIIIIIIIII

I

Abstract

• The aim of the project ''Hospital Management" is been observed in a view to

meet the requirements of generally Hospitals and clinics, to provide a better,

convenient and efficient Medical services to the people. The project has been

developed in such a way that the user interaction has been given the most priority

from us. It's easy to operate, as it's completely user friendly,with necessary help and

warning provided, operating by the visual basic program, we hope that our project

will reach the awaited expectations of our teachers.

•II

IIIil

II

I

II

I

INTRODUCTION

I

The software has been developed in Visual Basic, which is considered as one of

the most powerful programming tool. The project has been developed and designed in a

way to meet the user requirement. All necessary tools have been provided in the form of

User Manual, Data Flow Diagrams (DFD) and Flow-Charts. The program has a main

menu screen, which further guides to· the·other sub- menus, utmost care has been taken to

make-the-systemuser-interactive-.All reports and data entry screens have been designed

per user needs.Any feedback & enhancement will be welcomed from the user for consideration, as user

satisfaction is our main aim.The objective of the project is to dev€1op complGte software for catering the need of

Hospital Management. This program will serve the need of the hospital in accounting

department and patient treatment as well .

The database designwill be based to have the information on the following :

Doctor's Information: Covering the personnel details of the doctor, their branch of

Specialization, and the fee which will be charged for their consultation. The information

of other staff like nurses, receptionist and others will also be maintained .

Patient Information: Patient information will be recorded by having unique search key

for the patient identification, and accordingly a card will be issued to the patient for

future reference. The search ID may be patient name, telephone no, company of which

he/she employee .

Services Information: Information about types of services which the hospital offers

must be maintained, along with the charges for these services, like Ultrasound, X-Ray

and other services .

Medicines: Database must be maintainedfor Medicines along with the prices .

I

I

I

I

II

I

u..mcN•-~~--...-.. -.-----~~~~--,1

LL.I sııeıap ·,a, ııeısm "OJU! "JO/ JJBlSC: saıy ·,a, ııeıs I Io

>,-.o Cl)C Cl)

lı:: ~ ~«J :, o.., Cl) ı....Cl) C Q.

oo

~ ·aı ıuaııe; ·oJU! saAa!ı.ıoe ıuaııed

:.:;t-~---;;:nm'iiTT,;,m,...-,,;.,.,....~ı--ıcaı--------­a.ı-------- -C

~ Q)~(/) ca ca~ Q) oı:;::: "O o- -

.gC C C

(/) ji Q) o~ ~

E s:.!:

ca ca- Cl.. E2 ~ C

Q)o

:;:, ca ~ -C Q) ca

C

Q) (/) o.~ - "Oca C

Q) Q)

~~ cuQ) Cl.. Rz ::::>

- CCOQ) ~:.:- as~e.o~ ••...

C:

.•...CCl):.:;coa..

Q)e>cas:

o o~,_; Co ca-- :::

:ı:: ~ca (/)- C(J) o

Ü

g> (/)~ Q):J e>ııı caC .Co oÜ

C Co o:.:; :.:;co coE Eı.... ı....

.E .Es .SCl) s

Cl)oC C

C co co·u C C

"O s LL LL

Cl)~

ı...."O

a.Cl).•...m"Oa.

.1I::,

Co~caE.;::::CoO I I u..m

ClıC:Jo(.)(.)<(

Cl)encoo.•...CCl):.:;co

Cl)o·ca.~Cl)

..::.•...CCl):.:;coa.

UO!lBWJOJU! Jaıepdn

.•...eno(.)

sıı~ıap a~ueuy.

UO!llf WJOJU! paıepdn

uoueuııojuı ıuaqed

~-o N

print details /.,o en o (D(1) O>en aen ::r

I)> k I (")(").C •.m I a.~-.. CD:::,

I I .-+ Q)Q) :::,=oCIJ CD

I

-o -oQ)

Q) .-+.-+ m·m· :::,:::, .-+.-+ oo Q)Q) CIJ< CD3CD:::,.-+.-+CD-,3CIJ

I-oQ).-+m·:::,.-+:::::!lCD

Patient search

Patient files

Information of Patient

Updated Patient information

Patient details

C"Oa.Q)ara.5"ô-,3Q)..-+5·:::,

Patient ID.

'11 Q)•••-·CD::::J•••Cm-n

IIII

II s· .,

ö' sw1; I £(') ~,.ICm r s·c.,, --oo a...., w

3 ..­w (D!:!': a.o "T1::J -·::J

I

Consulting chargesz~

"'..-w~o;:o

I\.)-o N \ _ Staff Dr. files"""Io cı,(') ('I)

/ Staff Dr. search('I) Q)"' """I"' (')zr

Staff I Dr. information

Updated information

Staff I Dr. details

Staff Dr. ID

4

C..,.Cm.,,

II ıo

CDst==(,,) Patient archive info. It,.

I. ,~ N "O ~.,, m t:,a,· o ••••- -·:J - Patient ID CD.- o~

'::::,

(1) ••••C C

I I I \"O m

Patient info.,,

Patient case

I Ii I \ I ~ §.. LI_~ I "O :- \ I 3.! ıı- \ Staff I Dr ID•.. ' ._il)!:!:(1):J - ,._91:-' ' en .- ;.ı--il) ::··.. ' ·/ ---~- - Consultanc ••••

I I ,~ ' ':T mcharges :ı:

(1) ........- CI I I~ ..,.C

I I I ?:)~O- "' J l ~(9"' I~~g

II I <.ı>.

(,,)

oa )>) onsultanc (,,) oo . o

I \ -, paper ..ı. •"O •

D> N () Co••• (/) mar o .-il) .,,:::, öl :J

•.• Q. a.

-· I I@·:J a. ""O \ ,...I ô (1) il)

(/) .--, s3 ""O ()

il) ~- :Jil) .- "O .-.- a,· =- §.

Io· :J o:J .- :J .-zr 5

I

6

DATABASE DESIGN

1-Deot ClinkI Filed Name Data Tvne Field SizeI 1-deod Text 15I 2-dnam Text 15

2-DR Time:-Filed Name Data Type Field SizeI-date Date/time 102-DR.ID TEXT 103-Time Text 154-Remr Text 10

3-Inv Iss:-Filed Name Data Type Field SizeI-vied Text 102-pnum Number Long integer3-Tcod Text 104-Tdis Text 105-Cost Text 10ô-Invp Yes/no -7-Dset number double

4-Medie iss :-Filed Name Data Type Field SizeItm Number Long integerMeod Text 50Pnum Number Long integerIsqu Number Long integerUnpe Number 40Cher Text Long integer

5-Medic. md · -Filed Name Data Type Field Size

Mcod Text 50Mdes Text 50Mprc Number Double

6-Medic rec:-Filed Name Data Type I Field Size

Num Outo number Long integerDate Date/time Short integerMcod Text 50Requ Number 50

7-Patient :-Filed Name Data Type Field Size

Pnum Number Long integerPfnm Text 50Plnm Text 50Ptcl Text 50Ppay Text 50Pcom Text 50Pbdy Date/time -

8-Payment:-I Filed Name Field SizeData Typ_eText 10Pyds

9-Phtrans:-Filed Name Data Type Field Size

Phtnum Outonumber Long integerPrint 17ext 10

7

Filed Name Data Tvoe Field Size10-Setcounter :-

Cnst Number

11-Staf-Filed Name Data Type Field Size

Side Text 10Stnm Text 50Slnm Text 50Stel Text 50Sspc Text 50Ssal Number Long integerSoth Number Long integer

12-Test result:-Filed Name Data Type Field Size

Pnum Number Long integerTcod Text 6Date Date/time Short integerTeen Text 50Teci Text 50Trus Text 150

13-Treatment:-Filed Name Data Type Field Size

Tdis Text 50Tcod Text 6Tdep Text 2Test Number Double

14-visit rec:-Filed Name Data Type Field Size

Anum Auto number Long integerPnum Number Long integerSidn Text 6Date Dated time -Dept Text 6Tcod Text 50Qnum Number Long integerVtxp Text ILost Number DoubleVcod Text 50Invp Tes/no -

8

Hospital Management System (User Manual)HospitalPro is software designed for managing the job of hospital reception in easy way.

The structure ofHospitalPro:Master DatePatient Visits and InvoicingFast Search

Master DateMaster data is the main data of the software that you can not startworking without proper setup of this data.

The following lines are showing the usage of each session

Patient counter setThis session is ONE TIME setup (6 digits), it is used to set the start number of the patients counter. Basedon this number, HospitalPro will give an automatic number for the new patients

Staffmasterfile In this session you have to input the master date of the hospital staff Every person in the staff should havean ID code along with other basic information. The ID you enter will be used select the doctor (staffmember) at the time of recording the patients visits.

DepartmentsTo give a code (2 characters) for every department (e.g. CL for Clinics, EM for Emergency and so on)

TreatmentTo describe the different kind of treatment services the hospital is giving, every treatment should have acode (6 characters) and description, the other fields (Dept and cost) are extra information about this service.

In this session you will update always thetime table for the doctors. This will give afast access to the receptionist to know theavailability of doctors to give the patients fastand accurate answers-The receptionist can see this table bymaximizing the Start-up screen

11-15.18-22I

l1s..20!Saad

Mabrouk 11-15,18-22

Omar vacationI

!Ali 9-12,16-20

PaymentIt is a simple session to record the way of payment (e.g. Cash or Credit)

Patients master data This is the starting point for every patientcome to the hospital, you have to open a newfile for every patient. Once you open thissession and click "Add" button an automaticnumber will be given to the patient based onthe numbering system you defined in thePatient counter set and last patient IDYou can access this session from menu bar"Patient/Master file" and also directly fromthe Start-up screenNote: You have to click "Add" for every newpatient. And to change dataof an existingpatient you have to click "Update" aftermaking the changes.For easy data changes see Fast search.

HospitalPro is providing a fast way to view and to record the visits of every patient.The word "Visit" means every time the patient goes to a department to do any kind of treatment or test

You can view all the visit recordof a patient by entering the IDin "Enter patient ID" field thenclick "Visits records"In this session you can view, editand add a new visit

Adda new visitThis is the most used session in HospitalPro.In this session you will record all the visits of the patients and then print the invoice. This session isassessable from many places, you can add a visit by clicking "Add new visit" in the Start-up screen, andfrom "Add" button in view Patient Visit Records, also you can a new visit from Add new visit session itselfby clicking the "Add" button in the sessionThe following lines are showing how to use this session:

10

The form is designed to makethe data entry easy aspossible.The dropdown menus makethe selection fast and accuratebecause the selection isrestricted to the list.Patient ID will comeautomatically from "Enterpatient ID" field in Start-upscreen and the date is readingautomatically the current datefrom the system.

The fields Dr. ID, Dept. and Description are coming from the predefined master dataThe field "Visit code" is an automatic number, HospitalPro is generating a unique number for every visit ofa patient to any of the departments, based on this number the invoice will be generated, so if the patientwent to more than clinic in the same day the invoice will be printed for all clinics together or if the patientwent to the Lab to do some tests all the test will appear in one invoice, the same for Emergency also

InvoicingAfter you enter the data of the patient visit you can print the invoice directly by clicking the "Invoice"button. This button will take you to the invoice screen, in the screen you will find all the records that havegot the same Visit code, you can edit the numbers and also you add a discount, finally to print the invoiceclick "Print Invoice" button.

International Treatment Hospital Invoice

Visit Code 100009731432LB100009P.ıtienllO

Dlscription Discount Net

BL000.GRP 20 o 20ıI 1~¥::~mlA{··

BLOOO.HCG 11 o 11

Tol,ıl 31

I I

Fast search

HospitalPro is providing a fast way of finding the ID of a patient and then record his visit, you can find bytelephone number by entering the telephone number in the field next to the button "By Telephone" thenclick the button. The same thing for finding by first name, enter the first name in the field next to the button"By First name" then click the button.

In case that you want to view a certain master datafor a patient to check or to edit, you can reach therecord directly by entering the ID in the filed next tothe button "Patient record by ID" then click the

t button.This will allow you to edit ONLY the currentrecord, you will not be able to add a new record

11

USER FLOW CHART- -

--13

--- ~-·--- -- --

MAIN SCREENPATIENTMASTER DATAPHARMACYHELPEXIT

MAIN

/ ENTER CHOICE 7 l

YES -ôYES ôYES -ô

ADD PATIENTUPDATE PATIENTDELET PATIENT

15

PATIENT MASTER DATA

.-----------¥- ADD PATIENT PROCESS

ENTER PATIENT

WORNINGMASSAGE

WORN INGMASSAGE

ENTER DATA PATIENT

YES

• GiTl~T©J

16

.-----------¥ UPDATE PATINET PROCESS

ENTER PATIENT ID

WORN INGMASSAGE

WORNINGMASSAGE

DISPLAY PATIENTINFORMATION

UPDATING PROCESS

SORTING UPDATING INTOPATIENTDBF

YES

ı,

,--------~ DELET PATIENT PROCESS

ENTER PATIENT ID

WORN INGMASSAGE

WORN INGMASSAGE

DISPLAY PATIENT INFO

PATIENT DBF

DELEING FROMPATIENTDBF

,s

SEARCH PROCESS

SEARCH BY TEL. SEARCH BY NAME SEARCH BY ID

/ ENTER CHOICE /

ı..•.. ô ô ô .,,

NO + o

19

SEARCH BY TEL.

-----9-------, ENTER PATIENT TEL.

WORN ING MASSAGE

WORN ING MASSAGE

DISPLAY RECORD INFORMATION

YES

10

SEARCH BY NAME

ENTER PATIENT NAME

WORN ING MASSAGE

WORN ING MASSAGE

DISPLAY RECORD INFORMATION

YES

SEARCH BY PATIENT ID

ENTER PATIENT ID

WORN ING MASSAGE

WORNING MASSAGE

DISPLAY RECORD INFORMATION

YES

. ------~---·- -

ACCOUNT PAYMENT PROCESS

9 ADD

UPDATE

ô

NO

.:23

ADD ACOUNT PAYMENT

ENTER PATIENT PAYMENT

YES

WORN ING MASSAGE

WORN ING MASSAGE

PATIENT PAYMENTDBF

NO

UPDATE ACCOUNT PAYMENT

ENTER PATIENT PAYMENT

WORN ING MASSAGE

,YES WORN ING MASSAGE

DISPLAY INFORMATION ABOUT PATINET

PAYMENT

UPDATING PROCESS

SORTING UPDATING INTO PATIENT DBF

YES

DR TIME TABLE PROCESS

ADD UPDATE

ENTER CHOICE

ADD DR TIME TABLE

WORN ING MASSAGE

WORN ING MASSAGE

UPDATE DR TIME TABLE

WORN ING MASSAGE

WORN ING MASSAGE

sorting updating into DR DBF

YES

18

MASTER DATA PROCESS

STAFF MASTER FILE DEPARTMENT TREATMENT

DR/TIMETABLE PATMENT

L ENTER CHOICE 7 l

""'s:: YES c:) YES

Y!;_S

/- YES C) YES c:)

STAFF MASTER FILE PROCESS

ADD UPDATE

ENTER CHOICE

NO

C)

30

ENTER ALL DA TA

3l

ADD STAFF PROCESS

WORN ING MASSAGE

WORN ING MASSAGE

DISPLAY INFORMATION ABOUT DR/STAFF

UPDATING PROCESS

SORTING UPDATING INTO STAFF/DR DBF

3.2.

WORN ING MASSAGE

WORNING MASSAGE

DEPARTMENT PROCESS

ADD UPDATE

ENTER CHOICE

NO

ADD DEPARTMENT PROCESS

ENTER DEPARTMENT NAME

s WORN ING MASSAGE

WORN ING MASSAGE

YES

UPDATE DEPARTMENT PROCESS

ENTER DEPARTMENT

WORN ING MASSAGE

WORN ING MASSAGE

DISPLAY INFORMATION ABOUT DEPARTMENT

UPDATING PROCESS

SORTING UPDATING INTO DEP DBF

YES

35

TERATMENTPROCESS

ADD UPDATE

ENTER CHOICE

NO

ADD TREATMENT PROCESS

WORN ING MASSAGE

WORN ING MASSAGE

UPDATE TREATMENT PROCESS

ENTER TREATMENT

WORN ING MASSAGE

WORN ING MASSAGE

DISPLAY INFORMATION ABOUT TREATMENT

UPDATING PROCESS

SORTING UPDATING INTO DEP DBF

YES

PHARMACY PROCESS

MEDICINE DATA RECIVE MEDICINE ISSUED MEDICINE

ENTER CHOICE

RECIVE MEDICINE PROCESS

ADD UPDATE

ENTER CHOICE

NO

ô ENTER

MEDICINE CODE

o

o

ENTER ALL CODES 7

Y_l;_S

ADD RECIVE MEDICINE PROCESS

WORN ING MASSAGE

WORN ING MASSAGE

MEDICINE CODE DBF

-~-

- --- -

WORN ING MASSAGE

UPDATE RECIVE MEDICINE

ENTER MEDICINE

WORN ING MASSAGE

DISPLAY INFORMATION ABOUT MEDICINE

UPDATING PROCESS

SORTING UPDATING INTO MEDICINE DBF

41

ISSUE MEDICINE PROCESS

ADD UPDATE

ENTER CHOICE

NO

o

43

~-----¥ ADD MEDICINE PROCESS

ENTER MEDICINENAME

sWORN INGMASSAGE

WORN INGMASSAGE

ENTER MEDICINEPATIENT

'(ES

MEDICINE DBF

UPDATE ISSUE MEDICINE PROCESS

ENTER MEDICINE

WORN INGMASSAGE

WORN INGMASSAGE

DISPLAY INFORMATIONABOUT MEDICINE

PATIENT

UPDATING PROCESS

SORTING UPDATING INTOMEDICINE DBF

YES

SOURCE PROGRAM

I-fr main:-

Private Sub MDIForm_Load()

End Sub

Private Sub mnuFileExit_Click()Unload Me

End Sub

Private Sub mnuHelp_Click()Dim apI As Stringapl = "C:\Hospital\UserMan.htm"StartMeUp (apl)

End Sub

Private Sub mnuMainScreen_Click()Load fr_startupEnd Sub

Private Sub mnuMasterDataPatientCounterSet_Click()Load frcountsetEnd Sub

Private Sub mnuMasterDataStaflMasterFile_Click()Load frstaff

End Sub

Private Sub mnuMasterDepartments_Click()Load frDept

End Sub

Private Sub mnuMasterDoctorsTimeTable_Click()Load frDtm

End Sub

Private Sub mnuMasterPayment_Click()Load frPay

End Sub

Pri~ Sub mnuMasterTreatment_ Click()Load frtreat

End Sub

Private Sub mnuPatientMasterFile _Click()Load frpatmdEnd Sub

Private Sub mnuPatient VisitRecord _Click()

End Sub

Private Sub mnuPharmacylssue _Click()Load frmediss

End Sub

Private Sub mnuPharmacyMedicineData _Click()Load frmeddat

End Sub

Private Sub mnuPharmacyReceive _Click()Load frmedrec

End Sub

Private Sub mnuWindow Arrangelcon _Click()Me.Arrange vbArrangelcons

End Sub

Private Sub mnuWindowCascade _Click()Me.Arrange vbCascade

End Sub

Private Sub mnuWindowTileHorizontal _Click()Me.Arrange vbTileHorizontal

End Sub

Private Sub mnuWindowTileVertical Click()Me.Arrange vbTileVertical

End Sub

2-fr_startup:-

Private Sub cmdFPID _Click()On Error GoTo pid_err

IfLen(Me.Text4.Text) <> O ThenScreen.MousePointer = vbHourglassLoad frpatmdfrpatmd.Commandl.Enabled = FalseDim sql3 As Stringsql3 = "SELECT * FROM Patient WHERE pnum = "sql3 = sql3 & fr_startup.Text4.Textfrpatmd. Adodc I .Record Source = sql3frpatmd.Adodc I .RefreshScreen.MousePointer = vbDefaultElseMsgBox "You have to enter the patient ID.", vbCritical, "Missing data"cısEnd IfExit Sub

pid_err:Screen.MousePointer = vbDefaultcısEnd Sub

Private Sub cmdFPname _Clickt)On Error GoTo pnam_errIfLen(Me.Text3.Text) <> O ThenScreen.MousePointer = vbHourglassLoad frfınPnamDim sql2 As Stringsql2 = "SELECT ptel, pnum, pfnm, plnm, ppay, pcom FROM Pbynam WHERE pfnm =

"'sql2 = sql2 & fr_startup.Text3.Text & ""'frfınPnam.Adodc2.RecordSource = sql2frfınPnam.Adodc2.Reftesh-frfınPnam.Label2. Caption= "Number of records found: " &frfınPnam.Adodc2.Recordset.RecordCountScreen.MousePointer = vbDefaultElseMsgBox "You have to enter a name.", vbCritical, "Missing data"cısEnd IfExit Sub

pnam_err:Screen.MousePointer = vbDefaultcısEnd Sub

Private Sub cmdFPtel_ Clickt)On Error GoTo ptel errIfLen(Me.Tuxt2.Text}<> O 1'h€nScreen.MousePointer = vbHourglass

Load :frfınPtelDim sqll As Stringsqll = "SELECT ptel, pnum, pfnm, plnm, ppay, pcom FROM PbyTel WHERE ptel = "'sqll = sqll & fr_startup.Text2.Text & 11111

frfınPtel.Adodc I.Record Source = sqlIfrfınPtel.Adodc I.RefreshfrfınPtel.Label I.Caption = "Number of records found : " &

· frfınPtel. Adodc I .Recordset.RecordCountScreen.MousePointer = vbDefaultElseMsgBox "You have to enter a telephone number.", vbCritical, "Missing data"ClsEnd If

Exit Sub

ptel_err:Screen.MousePointer = vbDefaultCls

End Sub

Private Sub cmdPMF _Click()Load frpatmd

End Sub

Private Sub cmdPVR _Click()On Error GoTo pvst_errIfLen(Me.Text5.Text) <> O ThenScreen.MousePointer = vbHourglassLoad frPvisitDim sql4 As Stringsql4 ="SELECT* FROM visit_rec WHERE pnum = 11

sql4 = sql4 & fr_startup.Text5.Text & "order by date"frPvisit.AdodcPV.RecordSource = sql4frPvisit.AdodcPV.RefreshfrPvisit.LabelPV.Caption = "Number of visits: " &frPvisit.AdodcPV.Recordset.RecordCountScreen.MousePointer = vbDefaultElseMsgBox "You have to enter patient ID. 11, vbCritical, "Missing data"ClsEnd If

Exit Sub

pvst_err:Screen.MousePointer = vbDefaultCls

End Sub

Private Sub cmdPVReg_ Click()Load frPvsregfrPvsreg. SetFocusfrPvsreg.Adodc VR.Recordset.AddNewfrPvsreg.Text3vr.Text = Date'frPvsreg.Text4vr.Text = "CL"frPvsreg.DComPID. SetFocusfrPvsreg.DComPID.Text = fr_startup.Text5.TextfrPvsreg.Textlvr.Text = fr_startup.Text5.TextfrPvsreg.DComDID.Text = '"'frPvsreg.DComDIS.Text = ""frPvsreg.DComDCL.Text = ""

End Sub

Private Sub Command1_Click()Load frmediss

End Sub

Private Sub Form_Load()Me.Height = 7380Me.Width= 5800TextI.Text= Date

End Sub

Private Sub Timerl_Timer()Me.TextI.Text= Date

End Sub

3-frcountset:-

Private Sub Commandl_Click()On Error GoTo set errAdodc1.Recordset.SaveExit Subset err:MsgBox "Entry is not allowed", vbCritical, "Enrty error"cısEnd Sub so

Private Sub Form_ Load()Me.Height = 2800Me.Width= 4770Adodcl.Visible = FalseIfLen(Me.Textl.Text) <> O Then

Me.Textl.Enabled = TrueMe.CommandI.Enabled= True

End If

End Sub

4-frDep:-

Private Sub cmAdd_Click()Me.AdodcDp.Recordset.AddNew

End Sub

Private Sub cmUpd_Click()Me.AdodcDp.Recordset.Update

End Sub

Private Sub Form_Load()Me.Height = 3600Me.Width = 4800

End Sub

5-frDtm:-

Private Sub cmAdd_Click()Me.Adodcdt.Recordset.AddNew

End Sub

Private Sub cmUpd_Click()Me.Adodcdt.Recordset.Update

End Sub

Private Sub Form_Load()Me.Height = 4000Me.Width = 5300

End Sub

[ıflL1R

SI

6-frfınPname:-

Private Sub cmdClofpnam _Click()Unload MeEnd Sub

7-frfınPtel:-

Private Sub cmAdd _Click()Me.Adodcdt.Recordset.AddNew

End Sub

Private Sub cmUpd_Click()Me.Adodcdt.Recordset.Update

End Sub

Private Sub Form_Load()Me.Height = 4000Me. Width = 5300

End Sub

8-frinvpr:-

Private Sub Command2 _Click()Dim Message As StringIfCommand2.Value = True ThenMessage =Message+ "THERE IS NO PRINTER CONECTED " + vbCrMsgBox Message, vbOKOnly + vblnformation, "Printer Problem"End If

End Sub

Private Sub Form_Load()

Dim sq3 As Stringsq3 = "SELECT * FROM inv_pr WHERE vied =

111

sq3 = sq3 & frPvsreg.Text8vr.Text & 111 AND (invp=O)"frlnvPr.Adodcinp.RecordSource = sq3frInvPr.Adodcinp.Refresh

End Sub

Private Sub TimerPI _Timer()DataEnvironment 1.Printlnv 1 frPvsreg. Text8vr

Rep Inv 1. ShowTimerPI.Enabled = FalseScreen.MousePointer = vbDefault

End Sub

9-frmdstock:-

Private Sub Commandl_ClickOUnload Me

End Sub

Private Sub Form_Load()Me.Height = 1940Me.Width= 4800

End Sub

10-frmeddat: -Private Sub cmclose _Click()Unload Me

End Sub

Private Sub cmmdadd _Click()Me.Adodcmd.Recordset.AddNew

End Sub

Private Sub cmmdupd _Click()Me.Adodcmd.Recordset. Update

End Sub

Private Sub Form_ Load()Me.Height= 6300Me. Width = 7150

End Sub

11-frmediss:-

Option ExplicitDim RSMID As New ADODB.Recordset

s~

"Private Sub Adodcmdiss _MoveComplete(ByVal adReason AsADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus AsADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

On Error Resume NextDComMID.BoundText = Adodcmdiss.Recordset("mcod")ShowGroupmid

End Sub

Private Sub cmExit _Click()Unload Me

End Sub

Private Sub cmmdissadd , Click()On Error GoTo add err

Me.Adodcmdiss.Recordset.AddNewText2.Text = Textl.Text + IMe.DComMID. Text= ""Exit Subadd err:MsgBox Err.Description

End Sub

Private Sub cmmdissupd _Click()On Error GoTo upd_err

update3Exit Sub

upd_err:MsgBox Err.Description

End Sub

Private Sub Command I_Click()frmdstock. Show

If DataEnvironment I .rsmdstock.State And adStateOpen ThenDataEnvironment I .rsmdstock. Close

End IfScreen.MousePointer = vbHourglass

Me. Timer2.Enabled = True

End Sub

Private Sub Command2 _Click()Dim Message As StringIfCommand2.Value = True ThenMessage= Message + "THERE IS NO PRINTER CONECTED " + vbCrMsgBox Message, vbOKOnly + vblnformation, "Printer Problem"

·End If

End Sub

Private Sub DComMID_Change()IfDComMID.MatchedWithList = False ThenExit SubElseText4.Text = DComMID.BoundTextEnd If

End Sub

Private Sub Form_Load()Me.Height= 5730Me.Width= 6250Me.Adodcmdiss.Recordset.AddNewText2.Text = Textl.Text + 1Me.DComMID.Text = ""

RSMID.Open "medic_md", Adodcmdiss.Recordset.ActiveConnectionSet DComMID.RowSource = RSMIDShowGroupmid

End Sub

Private Sub ShowGroupmid()On Error Resume NextRSMID.Bookmark = DComMID.Selectedltem

End Sub

Private Sub Form_Unload(Cancel As Integer)RSMID.Close

End Sub

Private Sub update3()'updateOn Error GoTo update_errlIf Adodcmdiss.Recordset.EOF ThenAdodcmdiss.Recordset.MovePreviousAdodcmdiss.Recordset.MoveLastElse 55

Adodcmdiss.Recordset.MoveNextAöodcmdiss.Recordset.MovePrevious'Me.Adodc 1.Refresh'Text 1.Refresh

End IfExit Sub

· update_errl:MsgBox Err.Description & "Changes will not be saved", vbCritical, "Error ! "

End Sub

Private Sub Timer1_Timer()'Me.Adodcmdiss.Refreshupdate3

Screen.MousePointer = vbDefaultTimerl .Enabled = False

End Sub

Private Sub Timer2_Timer()

Load frmdstock

Timer2.Enabled = FalseScreen.MousePointer = vbDefault

End Sub

12-fredrec

Option ExplicitDim RSMRC As New ADODB.Recordset

Private Sub Adodcmrec_MoveComplete(ByVal adReason AsADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus AsADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

On Error Resume NextDComMRC.BoundText = Adodcmrec.Recordset("mcod")ShowGroupmrc

End Sub

Private Sub cmAdd_Click()On Error GoTo add err

Me.Adodcmrec...Recordset.AddNewDComMRC. Text = ""Textl.SetFocus

Exit Subadd err:

. MsgBox Error.Description

End Sub

Private Sub cmExit_ Clickt)Unload Me

End Sub

Private Sub cmUpd_ Clickf)On Error GoTo upd err

Me.Adodcmrec.Recordset.UpdateExit Sub

upd_err:MsgBox Err.Description

End Sub

Private Sub DComMRC _ChangeQIf DComMRC.MatchedWithList = False ThenExit SubElseText2.Text = DComMRC.BoundTextEnd If

End Sub

Private Sub Form_ Loadt)Me.Height = 3 720Me. Width = 6250

RSMRC. Open "medic _md", Adodcmrec.Recordset.ActiveConnectionSet DComMRC.RowSource = RSMRCShowGroupmrc

End SubPrivate Sub ShowGroupmrcO

On Error Resume NextRSMRC.Bookmark = DComMRC.Selectedltem

End Sub

sr

Private Sub Form_Unload(Cancel As Integer).RSMRC.Close

End SubPrivate Sub update20'updateOn Error GoTo update_errlIf Adodcmrec.Recordset.EOF ThenAdodcmrec.Recordset.MovePreviousAdodcmrec.Recordset.MoveLastElseAdodcmrec.Recordset.MoveNextAdodcmrec.Recordset.MovePrevious'Me.Adodc I .Refresh'Text5 .Refresh

End IfExit Subupdate_ err I:MsgBox Err.Description & "Changes will not be saved", vbCritical, "Error!"

End Sub

13-frlogin:-

Option Explicit

Public LoginSucceeded As Boolean

Private Sub crndCancel_Clickı)'set the global var to false'to denote a failed loginLoginSucceeded = FalseMe.Hide

End Sub

Private Sub crndOK_Clickı)'check for correct passwordlftxtPassword = "hota" Then

'place code to here to pass the'success to the calling sub'setting a global var is the easiestLoginSucceeded = TrueMe.Hidefr_startup.Show

ElseMsgBox "Invalid Password, try again!",, "Login"txtPassword.SetFocusSendKeys "{Horne}+{End}"

58

End IfEnd Sub

Private Sub Form_ Load()

End Sub

Private Sub txtUserName_Change()txtUserName. Text= "mahmoud&amar"End Sub

14-frPatmd:-

Option ExplicitDim RSpay As New ADODB.Recordset

Private Sub Adodc 1 _MoveComplete(ByVal adReason As ADODB.EventReasonEnum,ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByValpRecordset As ADODB.Recordset)

On Error Resume NextDataCombopay.BoundText = Adodcl.Recordset("ppay")ShowGroupl

End Sub

Private Sub Command 1 _Click()'AddOn Error Resume NextupdatelMe.Adodc2.RefreshText5 .Refresh

Adodc 1.Recordset.AddNewTextl.Text = Text5.Text + 1Text6.Text = "Credit"Text2. SetFocus

End Sub

Private Sub update 1 ()'updateOn Error GoTo update_errlIf Adode 1.Recordset.EOF ThenAdodc 1.Recordset.MovePreviousAdodc 1.Recordset.MoveLastElseAdodc l .Recordset.MoveNext

Adodc I .Recordset.MovePreviousMe.Adodc2.RefreshTexts .Refresh

End IfExit Subupdate_ err I:MsgBox Err.Description & "Changes will not be saved", vbCritical, "Error!"

End Sub

Private Sub Command2 _Clickt)update I

End Sub

Private Sub Command3 _Clickt)Me.Adodc 1.Recordset.Deleteupdate I

End Sub

Private Sub Command4 _Click()Unload Me

End Sub

Private Sub DataCombopay _Changeı)If DataCombopay.MatchedWithList = False Then'MsgBox "Wrong entry"'DataCombo I. SetFocusExit SubElseText6.Text = DataCombopay.BoundTextEnd If

End Sub

Private Sub Form_Load()Me.Height = SO 1 OMe.Width= 6930

RSpay.Open "payment", Adodc 1.Recordset.ActiveConnectionSet DataCombopay.RowSource = RSpayShowGroupl

End Sub

Private Sub ShowGroup 1 OOn Error Resume NextRSpay.Bookmark = DataCombopay.Selecteditem

End Sub

Private Sub Form_Unload(Cancel As Integer)'On Error GoTo start errl

RSpay.Close'If Adodc1.Recordset.EOFThen'Adode1.Recordset.MovePrevious'Else

'Adodcl .Recordset.MoveLast'End IfExit Substart errl:MsgBox Err.Description & "Changes will not be saved", vbCritical, "Error!"

End Sub

15-frpay:-

Private Sub cmAdd_Clickı)Me.AdodcPy.Recordset.AddNew

End Sub

Private Sub cmUpdate_ClickOMe.AdodcPy.Recordset.Update

End Sub

Private Sub Form_LoadOMe.Height = 3600Me.Width = 4800

End Sub

16-frPvisit:-

Private Sub cmdAddPV_Clickı)On Error GoTo AddErr

Load frPvsregLoad frPvsreg

61

frPvsreg. SetF ocusfrPvsreg.Adodc VR.Recordset.AddNewfrPvsreg.Text3vr.Text = DatefrPvsreg.DComPID. SetFocusfrPvsreg.DComPID.Text = fr_startup.Text5.TextfrPvsreg. Text I vr.Text = fr_startup. Text5. TextfrPvsreg.DComDID. Text = ""frPvsreg.DComDIS. Text = ""frPvsreg.DComDCL. Text= ""

Exit SubAddErr:

ClsMsgBox Err.Description

End Sub

Private Sub cmdClosePV _Click()Unload Me

End Sub

Private Sub DataGridPV _Click()

End Sub

Private Sub Form_Load()Me.Height= 4700Me.Width= 10815

End Sub

17-frPvsreg:-

Option ExplicitDim RSDCL As New ADODB.RecordsetDim RSDIS As New ADODB.RecordsetDim RSDID As New ADODB.RecordsetDim RSPID As New ADODB.Recordset

Private Sub AdodcVR_MoveComplete(ByVal adReason AsADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus AsADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

On Error Resume NextDComPID.BoundText = AdodcVR.Recordset("pnum")ShowGrouppidDComDID.BoundText = AdodcVR.Recordset("sidn")ShowGroupdid

6.2.

DComDIS.BoundText = AdodcVR.Recordset("tcod")ShowGroupdisDComDCL.BoundText = Adodcvk.Recordseu'tdept'')ShowGroupdcl

End Sub

Private Sub cmdvradd _Clickt)On Error GoTo vradd errUnload MeLoad frPvsregfrPvsreg. SetFocusfrPvsreg.Adodc VR.Recordset.AddNewfrPvsreg. Text3vr. Text = DatefrPvsreg.DComPID. SetFocusfrPvsreg.DComPID.Text = fr_startup.Text5.TextfrPvsreg. Text 1 vr.Text= fr_startup. Text5. TextfrPvsreg.DComDID.Text = 1111

frPvsreg.DComDIS.Text = 1111

frPvsreg.DComDCL. Text = 1111

Exit Subvradd err:MsgBox Err.DescriptionResume Next

End Sub

Private Sub cmdvrclos _Clickt)Unload Me

End Sub

Private Sub cmdvrref ClickO'Dim dv As Integer'dv = (Day(Text3vr.Text) * 1) + (Month(Text3vr.Text) * 30) + (Year(Text3vr.Text) *365.25)'Text8vr.Text = Textlvr.Text & Text3vr.Text & Text4vr.Text

'updateOn Error GoTo update_errlText8vr.Text = Textlvr.Text & Round((Day(Text3vr.Text) * 1) +(Month(Text3vr.Text) * 30) + (Year(Text3vr.Text) * 365.25)) & Text4vr.TextIf AdodeVR.Recordset.EOF ThenAdodc VR.Recordset.MovePreviousAdodc VR.Recordset.MoveLastElseAdodc VR.Recordset.MoveNextAdodc VR.Recordset.MovePreviousEnd If'DataEnvironment 1. Command3Dim addinv As New ADODB.Command

Dim sq As-Stringaddiİıv.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.3.5 I;" & "DataSource=c: \hospital\hospital I.mdb"sq= "INSERT INTO "invpr' (pnum, vied, invp, cost, tdis, tcod) SELECTvisit_rec. pnum, visit_rec. vcod, visit_rec.invp, visit _rec. cost, Treatment. tdis,visit_rec.tcod FROM Treatment, visit_rec WHERE Treatment.tcod = visit_rec.tcod~ (visit_rec.invp = O) AND (visit_rec.vcod="'sq= sq & frPvsreg.Text8vr.Text & "')"addinv.CommandText = sqaddinv.ExecuteMe. Timerl .Enabled = TrueScreen.MousePointer = vbHourglass

Exit Subupdate_ err I:MsgBox Err.Description & "Changes will not be saved", vbCritical, "Error!"Resume NextEnd Sub

Private Sub Command I_ClickOLoad frlnvPr

End Sub

Private Sub DComDCL _Changer)IfDComDCL.MatchedWithList = False Then'MsgBox "Wrong entry"'DataCombo I.SetFocusExit SubElseText4vr.Text = DComDCL.BoundTextEnd If

End Sub

Private Sub DComDID _Change()If DComDID.MatchedWithList = False Then'MsgBox "Wrong entry"'DataCombo I. SetFocusExit SubElseText2vr. Text = DComDID.BoundTextEnd If

End Sub

Private Sub DComDIS _Change()If DComDIS.MatchedWithList = False Then'MsgBox "Wrong entry"'DataCombo I . SetFocus

Exit SubElseText9vr.Text = DComDIS.BoundTextEnd If

End Sub

Private Sub DComPID _Change()IfDComPID.MatchedWithList = False Then'MsgBox "Wrong entry"'DataCombo 1. SetFocusExit SubElseTextlvr.Text = DComPID.BoundTextEnd If

End Sub

Private Sub Form_J,oad()Me.Height = 50 IOMe.Width= 7650

RSPID. Open "patient", Adodc VR.Recordset.ActiveConnectionSet DComPID.RowSource = RSPIDShowGrouppidRSDID. Open "staffq", AdodcVR.Recordset.ActiveConnectionSet DComDID.RowSource = RSDIDShowGroupdidRSDIS. Open "Treatmentq", Adodc VR.Recordset.ActiveConnectionSet DComDIS.RowSource = RSDISShowGroupdisRSDCL. Open "DepClinq", Adodc VR.Recordset.ActiveConnectionSet DComDCL.RowSource = RSDCLShowGroupdcl

End Sub

Private Sub ShowGrouppid()On Error Resume NextRSPID.Bookmark = DComPID. Selectedltem

End Sub

Private Sub Form_Unload(Cancel As Integer)RSPID.CloseRSDID.CloseRSDIS.CloseRSDCL. Close

End SubPrivate Sub ShowGroupdid()

On Error Resume Next&S

RSDID.Bookmark = DComDID. Selectedltem

End Sub

Private Sub ShowGroupdis()On Error Resume NextRSDIS.Bookmark = DComDIS.Selectedltem

End SubPrivate Sub ShowGroupdcl()

On Error Resume NextRSDCL.Bookmark = DComDCL. Selectedltem

End Sub

Private Sub Timer I_Timer()Dim upinv As New ADODB.CommandDim sq2 As Stringupinv.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.3.51;" & "DataSource=c: \hospital\hospital 1. mdb ••sq2 = "UPDATE visit_rec SET invp = 1 WHERE (vcod="'sq2 = sq2 & frPvsreg.Text8vr.Text & "')"upinv.CommandText = sq2upinv .ExecuteScreen.MousePointer = vbDefaultTimerl .Enabled = False

End Sub

l S-frstaff -

Private Sub cmAdd _Click()Me.Adodcst.Recordset.AddNewEnd Sub

Private Sub cmUpd _Click()Me.Adodcst.Recordset. Update

End Sub

Private Sub Form_Load()Me.Height = ŞOOOMe. Width = 7000

End Sub

19-frtreat: -66

Private Sub cmAdd _Click()Me.Adodctr.Recordset.AddNew

End Sub

Private Sub cmUpd_Click()Me.Adodctr.Recordset. Update

End Sub

Private Sub Form_Load()Me.Height = 5000Me.Width= 7000

End Sub

61-

SCREEN OUTPUT

l-1

»:-OD-RR-YYUU-£E-SS-FF 10DD-SS-»: 20RR-TT-EE-LL 15

Issue ~eciic:ıı,eTI~ l'IUl'liler

PatienllD

Receive MedicimJ

Date fgııoı~ _=. . ...~_,,~ ·'-· rs -~

Code I ı;ı1 R'i,U; 3 .

Exit

Patient Moster Odta

P.lD jK~

P. laıtntırne

;ı~~ . (eıeci ;,,,~Conparıy ~j sa~ =

· Birth date f 01 /re/1!>5-si-. ..,....·>,

LaıtlDI 100022ıı~ı. I~ fHj

oPııtientYisit Records.- I ~ .~-- lı... -~ ·t_. '"'---- _,, L{ fi ı •• __ L_ın --- "\r~r •••••• ,,,qı

BL0-01 O n lı100001 OR-199 19/06/2002 LB BLD-02 O n100001 OR-199 19/06/2002 EM XRY-03 O n l100001 OR-199 20IOS/2002 a. OEN-01 6 N ~100001 OR-132 20I06l2002 a. ENT-01 O n £100001 OR-112 20/06/2002 OP SRG-01 O n l100001 DA-199 22/06/2002 LB BLD-01 O N f100001 OR-132 22/06/2002 a. DEN-01 O N

OR-154 22/06/2002 a. INT-Ol O nDR-132 22/06/2002 a. ENT-01 O n

22/06/2002 LB BLD-02 O N 1;23/06/2002 ı:-ı.t XRY.fl1 0 N 1£

I 1000027314~.ŞE'w~····· -

3 Vısit~ r,;B Coıt f !00

18

Staff Mnster Dala

ID JJ)R-112

rl(SI name fAmıed

Laıtrnıne f Omar

_ Ottıôr herifi f o

lelephore f - --·Jctı Desç. [.

Code

Dept.I~ code. - ~ı

Ali

Mostaf

Saad

Mabroı

OmarAli

Mostaf

SaadMabroı.:

Omar,

1234567 100016 tes116 test1616 Credit223569 100022 ashraf ibrahim Credit2345233 100()(6 tona lkjıp Credit2349023 100)()( oınar ahmed Cash3344551 100010 !Jhf dsh Cash35346 100018 dgerg wgHq Credit lgsg3582233 100ll2 ornar hassan Credit .. lsadal 3586040 100003 ahmed bilal Cash3586040 100019 ZAFAR SIDDIQUI Credit jFIBER

SAME ER RAWAL

,, [!00(!!27~42Ş.:.5E~~,,,,, ,·,-, =· cF '!fr'

Oı.10

linw,

· Remaıb

REFERENCES

1- The book of How to ProgramVisual Basic 5.0, Control Creation EditionJeffrey P .McManus

2-Visual Basic (version 6.0)Microsoft Access 2002

2- Internet: A-www.yahoo.comB-www.altavista.comC-www .Infoseek.comD-www.msn.com

VI