1. 1| P a g e
Cairo Higher Institute for
Engineering, Computer
Science and Management
Computer Science Department
العالى القاهرة هعهد
واإلدارة الحاسب وعلىم للهندسة
الحاسب علىم قسن
Concept of Programming Project
Medical Store System (Java, C , Prolog)
PREPARED BY:
Mahmoud Abdullah Farghally 2013030084
Supervisor:
DR.Osama Fathi
Instructor:
Eng.Mohamed Khalid
CAIRO 2017
2. 2| P a g e
Chapter1 (introduction):-
- 1.1 Introduction
- 1.2 Description of the problem
- 1.3 Motivation in the problem
- 1.4 Objectives
- 1.5 Conclusion
Chapter2 (System Analysis):-
- 2.1 Basic Definitions
- 2.2 System Analysis Diagrams
- 2.3 Database Diagrams
- 2.4 Production Rules
Chapter3 (Source Code):-
- 3.1 Source code of Java Desktop
- 3.2 Source code of C++
- 3.3 Source code of Prolog
Chapter4 (Implementation):-
- 4.1 C++
- 4.2 Java Desktop
- 4.3 Prolog
3. 3| P a g e
Chapter1
1.1 Introduction:-
In this chapter we will clear for you the motivation of the
problem and the describe of this problem and objectives.
1.2 Description of the problem
The pharmacy management system is design based on computer
science students in order to illuminate the problem of the current
system which provided by the system involved all the pharmaceutical
employees of the pharmacy. This accessibility of the information will
be great advantage as it reduced further medical errors associated with
physicians and nurses.
The system handles all aspects of the inventory control function. It
allows the pharmacist to receive new batches of drugs, delete obsolete
drugs and modify the current dosage and identification of drug in the
database. Furthermore, the system eases the process of stock
replenishment.
On the other hand, PMS enables dispensation process. It stores all the
physicians’ prescription of the patients. A summarized list of drugs
dispensed to the patient can be viewed for monitoring purposes.
1.3 Motivation in the problem
The pharmacy management system is built in order to replace manual
based system to computerize. Here system is expected to be efficient,
useful and affordable on implementing tasks that is order by the
pharmacy manager.
1.4 Objectives
The pharmacy management system provides functions on identify
medication usages instruction, minimize human errors in medication
safety, facilitate accessibility of drugs’ information and information
management among employees, providing optimal drugs movement in
pharmacy unit, enable reports with in significantly short period of
4. 4| P a g e
time, despite simultaneous usage of database for the purpose stated
above.
The system will solve the problem of the current system by
minimizing time wastage and reduce resources which simply change
manual based system to computerized system.
1.5 Conclusion
We know in this chapter the all about project will be useful for a lot of
people whose own pharmacies.
8. 8| P a g e
2.2 System Analysis Diagrams
Context Diagram
Function Diagram
9. 9| P a g e
DFD-0 Diagram
DFD-1 Diagram
2.3 Database Diagrams
1-Corporate Customer
ID
Name
Address
Order ID
Email
Product ID
Product Quantity
Product Price
Expired Date
Product Name
wareHouse ID
3-WareHouse
10. 11| P a g e
2-StockDB
Product ID
Product
Quantity
Product Price
Expired Date
Product Name
Stock ID
Product ID
Product Quantity
Product Price
Expired Date
Product Name
4-Orders
3-WareHouse
2-StockDB
13. 13| P a g e
Chapter3
( Source Code )
In this chapter we will clear the source code for Project in many software
(Java Desktop And Prolog)
3.1 Source code of Java Desktop
Login Code
Register Button
14. 14| P a g e
Update Button
Search Button
Delete Code
15. 15| P a g e
Search Code
Delete Code
Save Button
16. 16| P a g e
3.2 Source code of C++
Part of code:-
Introduction of the System
void intro()
{
cout<<"ttttnt ----------------------------------- ";
cout<<"ttttnt ----------------------------------- ";
cout<<"ttttnt ----------------------------------- ";
cout<<"ttttnnntt MSSystem";
cout<<"ttttnnt Medical Store System ";
cout<<"ttttnntt [ PROJECT ]";
cout<<"ttttnnnt eng Name : [ Mahmoud Farghally ] ";
cout<<"ttttnnnt eng ID : [ 2013030084 ] ";
cout<<"ttttnnnt Cairo Higher Institute ";
cout<<"ttttnt ----------------------------------- ";
cout<<"ttttnt ----------------------------------- ";
cout<<"ttttnt ----------------------------------- ";
cout<<"ttttnt ----------------------------------- ";
cin.get();
}
Choosing action.
void entry_menu()
{
char ch;
int num;
system("cls");
cout<<"nnntENTRY MENU";
cout<<"nnt1.CREATE Medicen RECORD";
cout<<"nnt2.DISPLAY ALL Medciens RECORDS";
cout<<"nnt3.SEARCH Medicen RECORD ";
cout<<"nnt4.MODIFY Medicen RECORD";
cout<<"nnt5.DELETE Medicen RECORD";
cout<<"nnt6.BACK TO MAIN MENU";
cout<<"nntPlease Enter Your Choice (1-6) ";
cin>>ch;
system("cls");
switch(ch)
{
case '1': write_medicen(); break;
case '2': display_all(); break;
case '3': cout<<"nntPlease Enter The roll number "; cin>>num;
display_sp(num); break;
case '4': cout<<"nntPlease Enter The roll number "; cin>>num;
modify_medicen(num);break;
case '5': cout<<"nntPlease Enter The roll number "; cin>>num;
delete_medicen(num);break;
case '6': break;
default: cout<<"a"; entry_menu();
}
}
17. 17| P a g e
Display Reports about Medicen
void class_result()
{
medicen st;
ifstream inFile;
inFile.open("medicen.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
cin.ignore();
cin.get();
return;
}
cout<<"nnttALL Medicen Result nn";
cout<<"==========================================================n";
cout<<"R.No Name Price Quantity Expire Year "<<endl;
cout<<"==========================================================n";
while(inFile.read(reinterpret_cast<char *> (&st), sizeof(medicen)))
{
st.show_tabular();
}
cin.ignore();
cin.get();
inFile.close();
}
3.3 Source code of Prolog
Part of code:-
go :-
intro,
write('> '),
read(X),
do(X),
X == quit.
% INTRODUCTION OF THE EXPERT SYSTEM
intro :-
write('THIS IS A SYSTEM HELP YOU FIND INFORMATION ABOUT MEDICEN'), nl,
write('Enter start to begin.'), nl.
% START ASKING QUESTIONS
do(start) :-
solve,
!.
do(quit).
do(X) :-
write(X),
write('is not a legal command.'), nl,
fail.
% starting
solve:-
18. 18| P a g e
write('THIS IS A SYSTEM HELP YOU FIND INFORMATION ABOUT MEDICEN'), nl,
write('PLEASE SEARCH BY A SPECIFIC QUIRY LIKE THIS
,"medicen(id,name,type,price,quantity)"'), nl.
% KNOWLEDG BASE
medicen(1,panadol,tablets,45.00,2000).
medicen(2,claudicat50,tablets,69.75,1000).
medicen(3,claudicat100 ,tablets,54.00,1000).
medicen(4,normesar20,tablets,63.00,1000).
medicen(5,normesar40,tablets,85.00,2000).
medicen(6,symbian5,tablets,67.50,2000).
medicen(7,soft_gelatin,capsules,42.50,3000).
medicen(8,duspatalin135,tablets,56.00,2000).
medicen(9,brufen_syrup ,bottle_of_150ml ,12.00,3000).
medicen(10,brufen_syrup,bottle_of_110ml ,9.00,3000).
medicen(11,norocarmena3,carton_box_containing_1_strip_of_21,45.00,2000).
medicen(12,bivatracin_topical_aerosol_powder,spray,36.00,2000).
medicen(13,colosalzine,tablets,28.50,3000).
medicen(14,cona_adione,plastic_bottle_10_tablet,9.0,3000).
medicen(15,cyclogest_200,strip_each_of_5_pessaries ,126.00,2000).
medicen(16,neotigason,capsules,336.00,3000).
medicen(17,hebitaxime,box_of_one_vial ,20.75,2000).
medicen(18,nitazode,bottle_of_60_ml,21.75,3000).
medicen(19,baclofen,tablets,21.60,3000).
medicen(20,cetal_suspension, bottle_of_60_ml ,6.38,2000).
medicen(21,epifenac_eye_drops,self_dropping_container_of_5_ml ,9.00,2000).
medicen(22,flumox,capsules,14.25,2000).
medicen(23,congestal,tablets,9.25,3000).
medicen(24,neo_bronchophane, bottle,9.00,2000).
medicen(25,tantum,tube,7.50,3000).
medicen(26,tantum_gel,tube,7.50,3000).
medicen(27,tantum_verde,tube,7.50,2000).
medicen(28,treflucan_150_mg,capsules,12.50,3000).
medicen(29,cipromax,tablets,60.00,2000).
medicen(30,peptazol,tablets,67.50,2000).
19. 19| P a g e
Chapter 4
Implementation
In this chapter we will display all systems of this project we made it by
C++, Java Desktop, Prolog .
4.1 C++