0% found this document useful (0 votes)
8 views99 pages

Chapters

The document outlines the development of an Android application called 'Medico - Pain and Palliative Care System' aimed at improving data management for a small clinic by computerizing patient and staff information. It addresses the challenges of manual record-keeping in palliative care and aims to enhance service delivery, accessibility, and communication within the healthcare system. The document also discusses the system's objectives, analysis, design, and feasibility, emphasizing the need for a more efficient and error-free approach to managing patient care.

Uploaded by

alfiyaashraf1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views99 pages

Chapters

The document outlines the development of an Android application called 'Medico - Pain and Palliative Care System' aimed at improving data management for a small clinic by computerizing patient and staff information. It addresses the challenges of manual record-keeping in palliative care and aims to enhance service delivery, accessibility, and communication within the healthcare system. The document also discusses the system's objectives, analysis, design, and feasibility, emphasizing the need for a more efficient and error-free approach to managing patient care.

Uploaded by

alfiyaashraf1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

MEDICO

CHAPTER 1
INTRODUCTION

DEPARTMENT OF COMPUTER APPLICATIONS 1 MES AIMAT


MEDICO

1.1 INTRODUCTION
Medico - Pain and palliative care system is an android application developed for a small
clinic to manage staff data and patient data effectively. The main aim of developing “Pain
and palliative care system” is to computerize the services. This project includes registration
of patients, storing their details into the system, and provide the prescription according to
their disease and provide different palliative care services. Healthcare is a field in which
accurate record keeping and communication are critical. The software has the facility to
give a unique id for every patient and stores the details of every patient and the staff
automatically. With the increase of demand in hospitals, we need effective data
management system for handling patient’s data, staff data and treatment details in an
effective way. It deals with the collection of patient’s information, diagnosis details, etc. It
includes a search facility to know the current status of each patient. User can view the
details like home care routine schedule date from their login session. Home care schedule
is created by the nurse.

1.2 PROBLEM STATEMENT


Palliative Care as an approach that improves the quality of life of patients and their
families facing the problems associated with life-threatening illness, through the
prevention and relief of suffering by means of early identification and impeccable
assessment and treatment of pain and other problems, physical, psychosocial and spiritual.
The clinic works without computerization so there can be manual errors and problems. All
the matters Taken care of by the nurse so there can be error too. The patients’ details,
reports, medicine description are not available patients until they directly reach the clinic.
Home care scheduling is not ordered.

1.3 SCOPE AND RELEVANCE OF THE PROJECT


The system is developed and designed such a way that further expansion or modification
can be made to permit the evaluation. The focus of the system is to inherit the requirements
and update the system as per the needs. This project is so perfectly designed that it satisfies
the requirements. Nothing can be ended in a single step. It is the fact that nothing is
permanent in this world. So, this project also has some future enhancements in the
evergreen and booming IT industry. Change is inevitable. The system and the architecture
are a compatible one, so addition of new modules can be done without much difficulty.

DEPARTMENT OF COMPUTER APPLICATIONS 2 MES AIMAT


MEDICO

Since this module has its unique properties, it can extend further to make this system a
complete one.

1.4 OBJECTIVE
The main objective of the system is to computerize the functions of the palliative care
services. The effort given here is to convert the current system of managing data of the
physicians and patients into a computerized system, so that a faster, secure, error free and
efficient computer system involves. In the very first stage, we have to identify the problem
and collect details of problem. It involves gathering of information about the problem of
existing system how the problem must be solved and finding the cost estimates and
implementation specification of the new system.

The objective of this application is:

• Develop an online pain and palliative care system to provide palliative care services to
the patients without any payment.
• Improve the quality and access to palliative care service skill development for service
providers.
• Improve the quality of palliative care service delivery in community and acute care
settings.
• Build and enhance research and data collection capacity within the palliative care sector.
• Strengthen understanding and increase uptake of advance care planning.
• Improve knowledge within the palliative care sector and community awareness of
palliative care.
• Provide palliative care services to the desired persons.
• Improve the collation and dissemination of palliative care information across the sector.

DEPARTMENT OF COMPUTER APPLICATIONS 3 MES AIMAT


MEDICO

CHAPTER 2
SYSTEM ANALYSIS

DEPARTMENT OF COMPUTER APPLICATIONS 4 MES AIMAT


MEDICO

2.1 INTRODUCTION
System analysis of study is an important phase of any system development process. The
system is studied to the minutest details and analysed. The system analyst plays the role of
an interrogator and dwells deep into the working of the present system. The system is
viewed as a whole and the inputs to the system are identified. The outputs from the
organization are traced to through the various processing that the input phases through in
the organization. A detailed study of this process must be made by various techniques like
interviews, questionnaires, etc. The data collected by these sources must be scrutinized to
arrives to a conclusion. The conclusion is an understanding of the system function. This
system is called existing system. Now the existing system is close study and problem
solver tries to sort out difficulties that the enterprise faces.

2.2 EXISTING SYSTEM


In current healthcare, information is conveyed from one healthcare professional to another
through paper notes or personal communication. It is very difficult to analyse. The effort
given here is to convert the current system of managing data of the physicians and patients
into a computerized system, so that a faster, secure, error free and efficient computer
system involves. In the very first stage, we have to identify the problem and collect details
of problem. It involves gathering of information about the problem of existing system how
the problem must be solved and finding the cost estimates and implementation
specification of the new system.

2.2.1 LIMITATIONS OF EXISTING SYSTEM


• There can be manual errors and problems.
• All the matters Taken care of by the nurse so there can be error too.
• The patients’ details, reports, medicine description are not available to patients until
they directly reach the clinic.
• Home care scheduling is not ordered.

2.3 PROPOSED SYSTEM


The project goal was to support the development of a comprehensive public and primary
health approach to Pain and palliative care that includes service provision, support systems.
The purpose of this project is to provide the palliative care services and the medical
equipment to the desired persons at their homes. In this project patients can register to the

DEPARTMENT OF COMPUTER APPLICATIONS 5 MES AIMAT


MEDICO

site and can add the previous case history with their disease description. Doctors can view
this detail and can add a prescription. Nurses can view this prescription and the nurses
schedule a home care routine plan to visit the patient homes and provide the services. And
the nurses update the current status of the patient.

2.3.1 ADVANTAGES OF PROPOSED SYSTEM


The human intervention can be reduced by this system. At any emergency situation the
details of the patients can be viewed by respective login id of patient. Details of patients
include their current medicine in use and condition of the patient by the treating
doctor(palliative). By this system more people would be able know about the palliative and
can register from their home.

2.4 FEASIBILITY STUDY


Feasibility is the determination of whether or not a project is worth doing. The process
followed in making this determination is called a feasibility study. It is the procedure for
identifying the candidate system, evaluating and electing the most feasible system. This is
done by investigating the existing system in the area under investigation or generally ideas
about a new system. It is a test of a system proposal according to its workability, impact on
the organization, ability to meet user needs, and effective use of resources. The objective of
feasibility study is not to solve the problem but to acquire a sense of its scope.

Some of the steps involved in the feasibility analysis are:

• Prepare system flow charts.


• Describe and identify characteristics of candidate systems.
• Determine and evaluate performance and cost effectiveness of the candidate system.
• Weigh system performance and cost data.
• Repair and report final project directive to management.

In the conduct of the feasibility study, I had to consider three distinct types of feasibility.
These included:

• Technical feasibility
• Operational feasibility
• Economic feasibility

DEPARTMENT OF COMPUTER APPLICATIONS 6 MES AIMAT


MEDICO

2.4.1 TECHNICAL FEASIBILITY


This is concerned with specifying equipment and software that will successfully satisfy the
user requirement. Definitely the equipment and software would satisfy users.

• The technical needs of the system include:


• The facility to produce outputs in the given time.
• Response time under certain conditions.
• Ability to produce a certain volume of transaction at a particular speed.
• Facility to communicate data to distant location.

2.4.2 OPERATIONAL FEASIBILITY


It is mainly related to human organizational and political aspects. The points to be
considered were:

• What changes would be brought with the system?


• What organizational structures would be disturbed?
• What new skills would be required? Do the existing staff members have these skills? If
not, could they be trained in due course of time?

2.4.3 ECONOMIC FEASIBILITY


Economic analysis is the most frequently used technique for evaluating the effectiveness of
a proposed system. More commonly known as cost/benefit analysis; the procedure is to
determine the benefits and savings that are expected from a proposed system and compare
them with costs. If benefits outweigh costs, a decision is taken to design and implement the
system.

2.5 SOFTWARE ENGINEERING PARADIGM APPLIED


In a Pain and Palliative Care System using the Waterfall model, the development process is
sequential and consists of distinct phases. Here’s how it typically works:

• Requirement Gathering and analysis: All possible requirements of the system to be


developed like processing speed, data security, acquiring more functions etc, are
captured in this phase and then documented in a requirement specification document.

DEPARTMENT OF COMPUTER APPLICATIONS 7 MES AIMAT


MEDICO

• System Design: The requirement specifications from first phase are studied in this phase
and system design is prepared. System Design helps in specifying hardware and system
requirements and also helps in defining overall system architecture.
• Implementation: With inputs from system design, the system is divides as units. which
are integrated in the next phase. Each unit is developed and tested for its functionality
which is referred to as Unit Testing.
• Integration and Testing: All the units developed in the implementation phase are
integrated into a system after testing of each unit. Post integration the entire system is
tested for any faults and failures.
• Deployment of system: Once the functional and non-functional testing is done, the
software is deployed in the customer environment or released it.
• Maintenance: There are some issues which come up in the client environment. To fix
those issues patches are released. Also, to enhance the product some better versions are
released. Maintenance is done to deliver these changes in the customer environment.

2.6 USE CASE DIAGRAM


A use case diagram is a visual representation used in software engineering to illustrate how
different types of users (actors) interact with a system. It helps in identifying the system's
functional requirements by showing various use cases (actions or services) that the system
performs. Each use case represents a specific goal or task that an actor wants to achieve
using the system. This diagram is especially useful during the early stages of development
to ensure that all user interactions are well understood and properly designed. Here are the
common notations in a use case diagram:
1. Actor: Represents a user or another system that interacts with the system.
2. Use Case: Describes a specific function or action the system performs in response to an
actor.
3. System Boundary: Defines the scope of the system; all use cases inside belong to the
system.
4. Association: Shows interaction or communication between the actor and a use case.

DEPARTMENT OF COMPUTER APPLICATIONS 8 MES AIMAT


MEDICO

DEPARTMENT OF COMPUTER APPLICATIONS 9 MES AIMAT


MEDICO

CHAPTER 3
SYSTEM DESIGN

DEPARTMENT OF COMPUTER APPLICATIONS 10 MES AIMAT


MEDICO

3.1 INTRODUCTION
The pain and palliative care system help patients or their bystanders to register into the
system. It helps them to get their reports up to dates and medicine details also. They can
also book equipment. The doctor can also get the home care reports and case history of the
patients. The nurse would schedule the home care details. That could be viewed by doctor
and he can make appropriate decisions. This project aims to reduce the manual efforts in
pain and palliative clinic.

3.2 DATABASE DESIGN

1. Login
Column Name Data Type Constraints Description
login_id varchar primary key, Login ID
auto increment
username varchar not null Username
password varchar not null Password
usertype varchar not null Usertype

2. Assign_nurse
Column Name Data Type Constraints Description
assign_id varchar primary key, Assign ID
auto increment
nurse_id varchar foreign key Nurse ID
patient_id varchar foreign key Patient ID
date date not null Date

3. Patient
Column Name Data Type Constraints Description
patient_id varchar primary key, Patient ID
auto increment
login_id varchar foreign key Login ID
firstname varchar not null First name
lastname varchar not null Last name
dob date not null Date of birth
phone int not null Phone
email varchar not null Email
place varchar not null Place
district varchar not null District

DEPARTMENT OF COMPUTER APPLICATIONS 11 MES AIMAT


MEDICO

4. Type
Column Name Data Type Constraints Description
type_id varchar primary key, Type ID
auto increment
type varchar not null Type of medicine

5. Medicines
Column Name Data Type Constraints Description
medicine_id varchar primary key, Medicine ID
auto increment
nurse_id varchar foreign key Nurse ID
type_id varchar foreign key Type of medicine
medicine varchar not null Medicine
details varchar not null Medicine details
rate int not null Rate
quantity int not null Quantity

6. Medicine_details

Column Name Data Type Constraints Description


detail_id varchar primary key, Detail ID
auto increment
medicine_id varchar foreign key Medicine ID
patient_id varchar foreign key Patient ID
quantity int not null Quantity
rate int not null Rate
total int not null Total amount

7. Feedback
Column Name Data Type Constraints Description
feedback_id varchar primary key, Feedback ID
auto increment
patient_id varchar foreign key Patient ID
feedback varchar not null Feedback
date date not null Date

DEPARTMENT OF COMPUTER APPLICATIONS 12 MES AIMAT


MEDICO

8. Doctors
Column Name Data Type Constraints Description
doctor_id varchar primary key, Doctor ID
auto increment
login_id varchar foreign key Login ID
Fname varchar not null First name
Lname varchar not null Last name
place varchar not null Place
phone int not null Phone
email varchar not null Email

9. Nurses
Column Name Data Type Constraints Description
nurse_id varchar primary key, Nurse ID
auto increment
login_id varchar foreign key Login ID
Fname varchar not null First name
Lname varchar not null Last name
place varchar not null Place
phone int not null Phone
email varchar not null Email

10. Appointments

Column Name Data Type Constraints Description


appointment_id varchar primary key, Appointment ID
auto increment
doctor_id varchar foreign key Doctor ID
patient_id varchar foreign key Patient ID
date date not null Date
status varchar not null Status

11. Equipment

Column Name Data Type Constraints Description


equipment_id varchar primary key, Equipment ID
auto increment
nurse_id varchar foreign key Nurse ID
equipment varchar not null Equipment name
image image not null Equipment image

DEPARTMENT OF COMPUTER APPLICATIONS 13 MES AIMAT


MEDICO

12. Equipment_request

Column Name Data Type Constraints Description


equipmentrequest_id varchar primary key, Equipment request ID
auto increment
equipment_id varchar foreign key Equipment ID
patient_id varchar foreign key Patient ID
date date not null Date
status varchar not null Status

13. Medicine_request

Column Name Data Type Constraints Description


medicinetrequest_id varchar primary key, Medicine request ID
auto increment
medicine_id varchar foreign key Medicine ID
patient_id varchar foreign key Patient ID
date date not null Date
status varchar not null Status

14. Medical_history

Column Name Data Type Constraints Description


history_id varchar primary key, Medicine history ID
auto increment
patient_id varchar foreign key Patient ID
desc varchar not null Description
file_upload longblob not null File upload

DEPARTMENT OF COMPUTER APPLICATIONS 14 MES AIMAT


MEDICO

3.2.1 ENTITY-RELATONSHIP MODEL


An ER (Entity-Relationship) Diagram is a visual tool used in database design to represent
the structure of data and the relationships between different entities in a system. Entities
represent real-world objects like users, products, or orders, while relationships show how
these entities interact with each other. Attributes describe the properties of each entity. ER
diagrams are especially useful during the planning phase of a database as they provide a
clear and simple way to visualize the data flow of database schema. Notations in ER
Diagram:

1. Entity:
Represents a real-world object or concept.

2. Attribute:
Describes properties of an entity.

3. Relationship:
Shows how two or more entities are related.

4. Lines:
Links attributes to entity sets or entity sets to relationships.

5. Cardinality:
Defines the number of instances in a relationship.
Types of cardinalities are:
• One-to-One
• One-to-Many
• Many-to-Many

DEPARTMENT OF COMPUTER APPLICATIONS 15 MES AIMAT


MEDICO

DEPARTMENT OF COMPUTER APPLICATIONS 16 MES AIMAT


MEDICO

3.3 OBJECT-ORIENTED DESIGN – UML DIAGRAMS


UML (Unified Modelling Language) diagrams are standardized visual representations used
to design and document the structure and behaviour of a software system. They help
developers and stakeholders understand system functionality, data flow, and relationships
between components. In the Anganwadi Automation System, UML diagrams like use case,
class, sequence, and activity diagrams provide a clear blueprint of how users interact with
the system and how different modules communicate, ensuring efficient planning and
development.

The UML diagrams included in this system are:

• Activity Diagram: An activity diagram visually represents the workflow of various


operations in the system. It shows the sequence of activities, decision points, and
parallel processes. This helps in understanding the dynamic behaviour of the
system and identifying the flow of control between actions.
• Class Diagram: A class diagram models the static structure of the system by
showing its classes, attributes, methods, and relationships. It helps in understanding
how different entities in the system are connected and how they interact. This is
especially useful during object-oriented design.
• Component Diagram: The component diagram illustrates the high-level structure of
the system in terms of software components and their dependencies. It shows how
components like modules or services interact and how they are organized, helping
in system architecture planning.
• Deployment Diagram: A deployment diagram represents the physical deployment
of software on hardware nodes. It maps software components to servers or devices,
showing the runtime environment. This helps visualize how the system will operate
in the real world.
• Sequence Diagram: A sequence diagram details the interaction between objects in a
particular scenario in a time-sequenced order. It shows the flow of messages and
the order in which operations occur, helping to understand use case execution and
communication between system elements.

DEPARTMENT OF COMPUTER APPLICATIONS 17 MES AIMAT


MEDICO

3.3.1 ACTIVITY DIAGRAM

ADMIN

DEPARTMENT OF COMPUTER APPLICATIONS 18 MES AIMAT


MEDICO

NURSE

DEPARTMENT OF COMPUTER APPLICATIONS 19 MES AIMAT


MEDICO

DOCTOR

DEPARTMENT OF COMPUTER APPLICATIONS 20 MES AIMAT


MEDICO

PATIENT

DEPARTMENT OF COMPUTER APPLICATIONS 21 MES AIMAT


MEDICO

3.3.2 CLASS DIAGRAM

DEPARTMENT OF COMPUTER APPLICATIONS 22 MES AIMAT


MEDICO

3.3.3 COMPONENT DIAGRAM

3.3.4 DEPLOYMENT DIAGRAM

DEPARTMENT OF COMPUTER APPLICATIONS 23 MES AIMAT


MEDICO

3.3.5 SEQUENCE DIAGRAM

DEPARTMENT OF COMPUTER APPLICATIONS 24 MES AIMAT


MEDICO

3.4 MODULAR DESIGN


3.4.1 MODULE DESCRIPTION

ADMIN MODULE
• Manage nurses: Allows the admin to add, update, or remove nurse profiles in the
system.
• Manage doctors: Allows the admin to add, update, or remove doctor profiles in the
system.
• View homecare request: Enables the admin to review patient homecare requests and
assign nurses accordingly.
• View enquiry: Lets the admin read and respond to enquiries submitted by patients to
improve service quality.

NURSE MODULE

• Add equipment: Allows nurses to update the inventory by adding new medical
equipment.
• View homecare appointments: Enables nurses to review homecare service assigned
by the admin.
• View equipment request: Allows nurses to review equipment requests and accept
and provide them.
• View medicine request: Enables nurses to process patient requests for medicines by
approving and fulfilling them.

DOCTOR MODULE
• View appointment: Lets doctors see patient appointments and either approve or
decline them based on availability.
• View patient details with medical history: Provides doctors access to patient
profiles and their medical history for better diagnosis.
• Upload prescription: Allows doctors to upload treatment prescriptions for patient
access after consultations.

PATIENT MODULE
• Register and login: Enables new patients to create an account and existing users to
log into the system.

DEPARTMENT OF COMPUTER APPLICATIONS 25 MES AIMAT


MEDICO

• Add medical history: Lets patients input and maintain records of their past and
current health conditions. They can also upload their diagnostic or lab reports.
• Make appointment: Allows patients to book appointments with doctors either for
in-clinic or homecare visits.
• View appointment: Enables patients to see the details and status of their scheduled
appointments.
• View reports (lab/scanning reports): Allows patients to access their uploaded
diagnostic or lab reports.
• View homecare request and status: Displays the homecare service requests along
with their current status.
• Request equipment and get status: Lets patients view available medical equipment
and send a request for use and track the status.
• Request medicine and get status: Allows patients to browse available medicines
and place requests for required items and track the status.
• Send enquiry: Lets patients submit their enquiries related to the services for
administrative review.

DEPARTMENT OF COMPUTER APPLICATIONS 26 MES AIMAT


MEDICO

3.5 INPUT DESIGN

DEPARTMENT OF COMPUTER APPLICATIONS 27 MES AIMAT


MEDICO

DEPARTMENT OF COMPUTER APPLICATIONS 28 MES AIMAT


MEDICO

3.6 OUTPUT DESIGN

DEPARTMENT OF COMPUTER APPLICATIONS 29 MES AIMAT


MEDICO

DEPARTMENT OF COMPUTER APPLICATIONS 30 MES AIMAT


MEDICO

DEPARTMENT OF COMPUTER APPLICATIONS 31 MES AIMAT


MEDICO

CHAPTER 4
SYSTEM ENVIRONMENT

DEPARTMENT OF COMPUTER APPLICATIONS 32 MES AIMAT


MEDICO

4.1 INTRODUCTION
The software requirements specification (SRS) is a means of translating the ideas in the
minds of clients into formal documentation. This document forms the development and
software validation. The basic reason for the difficulty in software requirement
specification comes from the fact that there are three interested parties - clients, the end
users and the software developer.

The requirements document has to be such that the client and the user can understand it
easily, and the developers can use it as a basis for software development. Due to the
diverse parties involved in the software requirement specification, a communication gap
exists.

This gap arises when the client does not understand the software or the software
development processor when the developer does not understand the client’s problem and
the application area of SRS bridges this communication gap. Problem analysis is done to
obtain a clear understanding of the needs of the clients and the users, and what exactly is
desired from the software.

The analysis leads to the actual specification. People performing the analysis called
analysts, are also responsible for specifying the requirements. The software project is
initiated by the client’s needs. In the beginning, these needs are in the minds of various
people in the client organization.

The requirement analyst must identify their requirements by talking to these people and
understanding their needs. These people and the existing documents about the current
mode of operation are the basic source of information for the analyst

4.2 SOFTWARE REQUIREMENTS SPECIFICATION


One of the most difficult tasks is selecting software for the system, once the system
requirements is found out then we have to determine whether a particular software package
fits for those system requirements. The application requirement:

Operating System : Microsoft windows 8 or Above


Front End : HTML, CSS, JavaScript
Back End : Python (Django Framework), SQLite Server

DEPARTMENT OF COMPUTER APPLICATIONS 33 MES AIMAT


MEDICO

IDE : JetBrains PyCharm / VS Code / Android Studio (for mobile


app module if any)

4.3 HARDWARE REQUIREMENTS SPECIFICATION


The selection of hardware is very important in the existence and proper working of any
software. Then selection hardware, the size and capacity requirements are also important.

Processor : Intel Pentium 4 or higher


RAM (Main Memory) : 4GB or more
Hard Disk : 40GB or more
Mouse : Any compatible
Keyboard : Any compatible

4.4 TOOLS AND PLATFORMS


4.4.1 FRONT-END TOOL

• HTML: HyperText Markup Language (HTML) is used to structure the content on


web pages.
• CSS: Cascading Style Sheets (CSS) is used to design and style HTML elements,
including layout, colours, and fonts.
• Android: In front-end Android development, XML is used to design the app's user
interface that users interact with on their devices.

4.4.2 BACK-END TOOL

• Python Flask: Flask is a lightweight Python web framework used to build backend
server logic, APIs, and handle database interactions.
• Java Android: In backend Android development, Java is used to implement the
logic behind app features, manage data, and connect to databases or servers.
• MySQL: MySQL is a popular open-source relational database management system
used to store, manage, and retrieve data for web and mobile applications. It works
with backend languages like Python and Java to handle data operations securely and
efficiently.

DEPARTMENT OF COMPUTER APPLICATIONS 34 MES AIMAT


MEDICO

4.4.3 OPERATING SYSTEM

The system can be developed on the following operating systems:

• Development Environment: Windows 8 or above

DEPARTMENT OF COMPUTER APPLICATIONS 35 MES AIMAT


MEDICO

CHAPTER 5
SYSTEM IMPLEMENTATION

DEPARTMENT OF COMPUTER APPLICATIONS 36 MES AIMAT


MEDICO

5.1 INTRODUCTION
Implementation is the stage in the project where theoretical design is turned into a working
system and is giving confidence on the new system for the users which will work
efficiently and effectively. It involves careful planning, investigation of the current system
and its constraints on implementations, design of methods to achieve the changeover, an
evaluation, of changeover methods. Apart from planning major tasks for preparing the
implementation are education and training of users. The major complex system being
implemented the more evolved will be the system analysis and the design effort required
just for implementation. An implementation coordination committee based on policies of
individual organization has been appointed. The implementation process begins with
preparing plan for implementation of the system. According to this plan the activities are to
be carried out discussions made regarding the equipment and resources and the additional
equipment has to be acquired to implement the new system. Implementation is the final
and important phase. The most critical stage in achieving a successful new system and in
giving the users confidence that the new system and in giving the users confidence that the
new system will work and be effective. The system can be implemented only after
thorough testing is done and if found to working according to the specification.

5.2 CODING
Coding, at the heart of system implementation, is the process of translating intricate design
concepts and algorithms into a structured and executable format. It involves the creation of
source code using programming languages that define the system's functionalities and
behaviour. Skilled developers meticulously craft code, applying coding standards and best
practices to ensure readability, maintainability, and scalability. Effective coding demands a
balance between creativity and precision, as developers sculpt the digital framework upon
which the entire system relies, ultimately shaping the user experience and fulfilling the
project's objectives.

5.2.1 CODING STANDARDS


Coding standards are a set of guidelines, conventions, and best practices that define the
style and structure of source code during software development. These standards serve as a
framework to ensure consistency, readability, maintainability, and quality across a project's
codebase. Adhering to coding standards offers several benefits, including improved

DEPARTMENT OF COMPUTER APPLICATIONS 37 MES AIMAT


MEDICO

collaboration among developers, easier code reviews, reduced bugs, and enhanced overall
software quality. Coding standards cover various aspects of coding, including naming
conventions for variables, functions, classes, and other entities; formatting rules for
indentation, spacing, and line breaks; documentation practices such as comments and code
documentation; usage of programming constructs and patterns; error handling guidelines;
and security considerations.

5.2.2 SAMPLE CODES


//doctor_view_uploads.html
{% include 'doctor_header.html' %}

<div class="top-sec-view"></div>

<center>
<div class="div-view">
<h3 style="margin-top: 30px;padding: 10px;">View Uploads </h3>

<table class="table" style="width: 1200px;">


<tr>
<th>#</th>
<th>File</th>
<th>First Name</th>
<th>Last Name</th>
<th>Place<th>
<th>Phone<th>
<th>Email<th>

<th> upload date</th>

</tr>
{% for row in data['view'] %}

DEPARTMENT OF COMPUTER APPLICATIONS 38 MES AIMAT


MEDICO

<tr>
<td style="padding-top: 10%;">{{loop.index}}</td>
<td ><img src="/{{row['file']}}" width="200px" height="200px"
alt=""></td>
<td style="padding-top: 10%;">{{row['ufname']}}</td>
<td style="padding-top: 10%;">{{row['ulname']}}</td>
<td style="padding-top: 10%;">{{row['uplace']}}</td>
<td style="padding-top: 10%;"></td>
<td style="padding-top: 10%;">{{row['uphone']}}</td>
<td></td>
<td style="padding-top: 10%;">{{row['uemail']}}</td>
<td></td>

<td style="padding-top: 10%;">{{row['date']}}</td>


<!-- <td style="padding-top: 10%;"><a href="?id={{row['']}}" class="btn btn-
info btn-sm">View Uploads</a></td> -->
<!-- <td><a href="?action=delete&id={{row['doctor_id']}}" class="btn btn-
danger btn-sm">Danger</a></td> -->
</tr>
{% endfor %}
</table>

</div>
</center>

{% include 'footer.html' %}

//doctor.py
from flask import *
from database import *

DEPARTMENT OF COMPUTER APPLICATIONS 39 MES AIMAT


MEDICO

doctor=Blueprint('doctor',__name__)

@doctor.route('/dochome')
def dochome():
if not session.get("log_id") is None:

return render_template('doctor_home.html')
else:
return redirect(url_for('public.login'))

@doctor.route('/viewappointment',methods=['get','post'])
def viewappointment():
if not session.get("log_id") is None:
data={}
q="SELECT * FROM USER INNER JOIN appointment USING(user_id) where
doctor_id='%s'"%(session['doc_id'])
data['view']=select(q)

if 'id' in request.args:
id=request.args['id']
q="select * from precautions where appointment_id='%s'"%(id)
res=select(q)
if res:
flash("Precuations are already added...")
return redirect(url_for('doctor.viewappointment'))
else:
id=request.args['id']
data['id']=id

if 'add' in request.form:

DEPARTMENT OF COMPUTER APPLICATIONS 40 MES AIMAT


MEDICO

apid=request.form['apid']
pre=request.form['pre']
med=request.form['med']
q="insert into precautions values(null,'%s','%s','%s')"%(apid,pre,med)
insert(q)
flash("Precautions are added....")
return redirect(url_for('doctor.viewappointment'))

if 'idd' in request.args:
id=request.args['idd']
q="select * from prescription where appointment_id='%s'"%(id)
res=select(q)
if res:
flash("Prescription are already added...")
return redirect(url_for('doctor.viewappointment'))
else:
idd=request.args['idd']
data['idd']=idd

if 'adds' in request.form:
apid=request.form['apid']
pre=request.form['med']
med=request.form['dose']
q="insert into prescription values(null,'%s','%s','%s')"%(id,pre,med)
insert(q)
flash("prescription are added....")
return redirect(url_for('doctor.viewappointment'))

if 'action' in request.args:
action=request.args['action']

DEPARTMENT OF COMPUTER APPLICATIONS 41 MES AIMAT


MEDICO

idr=request.args['idr']

else:
action=None

if action=='accept':
q="update appointment set status='accept' where appointment_id='%s'"%(idr)
update(q)
flash("appointment Updated Successfully....")
return redirect(url_for("doctor.viewappointment"))
if action=='reject':
q="update appointment set status='reject' where appointment_id='%s'"%(idr)
update(q)
flash("appointment Updated Successfully....")
return redirect(url_for("doctor.viewappointment"))

return render_template('doctor_view_appointment.html',data=data)
else:
return redirect(url_for('public.login'))

@doctor.route('/viewuploads')
def viewuploads():
if not session.get("log_id") is None:
data={}
q="SELECT * FROM USER INNER JOIN files USING(user_id) "
data['view']=select(q)
return render_template('doctor_view_uploads.html',data=data)
else:
return redirect(url_for('public.login'))

DEPARTMENT OF COMPUTER APPLICATIONS 42 MES AIMAT


MEDICO

//nurse_view_hrequest.html
{% include 'nurse_header.html' %}

<div class="top-sec-view"></div>

<center>
<div class="div-view">
<h3 style="margin-top: 30px;padding: 10px;">Assigned Home care Requests</h3>

<table class="table" style="width: 900px;">


<tr>
<th>#</th>
<!-- <th>First Name</th> -->
<th>Request User Name</th>
<th>Nurse Name<th>
<th>Date of Request<th>
<th>Request Status<th>

</tr>
{% for row in data['view'] %}
<tr>
<td>{{loop.index}}</td>
<!-- <td>{{row['ufname']}}</td> -->
<td>{{row['ufname']}}{{row['ulname']}}</td>
<td>{{row['nfname']}}{{row['nlname']}}</td>

<td></td>
<td>{{row['date']}}</td>
<td></td>

DEPARTMENT OF COMPUTER APPLICATIONS 43 MES AIMAT


MEDICO

{% if row['request_status'] == 'accept' %}

<td>Assigned by Admin</td>

{% elif row['request_status'] == 'reject' %}


<td>Rejected by Admin</td>
{% elif row['request_status'] == 'pending' %}
<td>Pending</td>

{% endif %}
</tr>
{% endfor %}
</table>

</div>
</center>

{% include 'footer.html' %}

5.2.3 CODE VALIDATION AND OPTIMIZATION

VALIDATION
Validation is conducted after the completion of the entire software development process. It
checks if the client gets the product they are expecting. Validation focuses only on the
output; it does not concern itself with the internal processes and technical intricacies of the
development process. Validation helps to determine if the software team has built the right
product. Validation is a One-time process that starts only after the verification is
completed. Software teams often use a wide range of validation methods, including White
Box Testing (non-functional testing or structural/design testing) and Black Box Testing
(functional testing). White Box Testing is a method that helps validate the software
application using a predefined series of inputs and data. Here, testers just compare the
output values against the input values to verify if the application is producing output as

DEPARTMENT OF COMPUTER APPLICATIONS 44 MES AIMAT


MEDICO

specified by the requirements. There are three vital variables in the Black Box Testing
method (input values, output values, and expected output values). This method is used to
verify if the actual output of the software meets the anticipated or expected output. The
main advantages of validation processes are:  It ensures that the expectations of all
stakeholders are fulfilled.  It enables software teams to take corrective action if there is a
mismatch between the actual product and the anticipated product.  It improves the
reliability of the end-product.

OPTIMIZATION
Code optimization is any method of code modification to improve code quality and
efficiency. A program may be optimized so that it becomes a smaller size, consumes less
memory, executes more rapidly, or performs fewer input/output operations. The basic
requirements optimization methods should comply with, is that an optimized program must
have the same output and side effects as its non-optimized version. This requirement,
however, may be ignored in the case that the benefit from optimization, is estimated to be
more important than probable consequences of a change in the program behaviour.
Optimization can be performed by automatic optimizers, or programmers. An optimizer is
either a specialized software tool or a built-in unit of a compiler (the so-called optimizing
compiler). Modern processors can also optimize the execution order of code instructions.
Optimizations are classified into high-level and low-level optimizations. High-level
optimizations are usually performed by the programmer, who handles abstract entities and
keeps in mind the general framework of the task to optimize the design of a system.
Optimizations performed at the level of elementary structural blocks of source code -
loops, branches, etc. - are usually referred to as high-level Pain and Palliative Care
optimizations too. Low-level optimizations are performed at the stage when source code is
compiled into a set of machine instructions, and it is at this stage that automated
optimization is usually employed. Assembler programmers believe, however, that no
machine, however perfect, can do this better than a skilled programmer

5.3 DEBUGGING
Debugging is a critical process in software development, aimed at identifying, analysing,
and resolving bugs or errors within a program. The first step in effective debugging is
understanding the problem. This involves reproducing the issue consistently and gathering

DEPARTMENT OF COMPUTER APPLICATIONS 45 MES AIMAT


MEDICO

all relevant information, such as error messages, logs, and user reports. By thoroughly
understanding the problem, developers can formulate hypotheses about the underlying
causes. Without a clear understanding, attempts to fix the issue may be misguided,
potentially introducing new bugs or failing to resolve the original problem.

Once a solution is developed, it must be implemented and thoroughly tested.


Comprehensive testing ensures that the fix resolves the issue without causing regressions
or new problems. This Once the problem is understood, the next step is to isolate the cause.
This involves examining the codebase to identify where the error occurs. Techniques such
as logging, breakpoints, and stepping through code in a debugger can help pinpoint the
exact location and conditions under which the bug manifests. By isolating the specific lines
of code or components responsible, developers can focus their efforts more efficiently. This
stage may also involve checking dependencies and interactions between different parts of
the system to ensure that the root cause is accurately identified.

After isolating the cause, the developer needs to devise a solution. This may involve
writing new code, modifying existing code, or even redesigning parts of the system to
address the issue more effectively. It is crucial to consider the impact of any changes on the
overall system to avoid introducing new bugs. During this phase, developers often write
additional tests to verify that the solution works as intended and that no other parts of the
system are adversely affected. Peer reviews and code analysis tools can provide additional
assurance that the solution is robust and maintainable.

Once a solution is developed, it must be implemented and thoroughly tested.


Comprehensive testing ensures that the fix resolves the issue without causing regressions
or new problems. This involves running both automated tests and manual tests, particularly
in areas affected by the change. Developers should test the fix in different environments
and scenarios to ensure its reliability. Proper documentation of the changes made, along
with the test results, is important for future maintenance and understanding the context of
the fix.

The final step in debugging is reflecting on the process and learning from it. Analysing
how the bug occurred, why it was not caught earlier, and how the debugging process was
handled can provide valuable insights for improving future development practices. Teams
can update their coding standards, testing protocols, and debugging techniques based on
lessons learned. This continuous improvement cycle helps in building more robust and

DEPARTMENT OF COMPUTER APPLICATIONS 46 MES AIMAT


MEDICO

resilient software systems. Additionally, sharing knowledge gained during the debugging
process can enhance team skills and prevent similar issues in the future.

Debugging is a methodical and iterative process that not only resolves current issues but
also strengthens the overall quality of the software and the skills of the development team.
By following a structured approach to understanding, isolating, solving, implementing, and
reflecting on bugs, developers can improve both the immediate and long-term health of
their projects.

5.4 UNIT TESTING


Unit testing is a software testing method where individual units or components of a system
are tested independently to ensure they perform as expected. These units are typically the
smallest testable parts of an application, such as functions, modules, or classes. Unit testing
helps developers identify bugs early in the development process, improve code reliability,
and ensure that future changes do not break existing functionality. Effective unit testing
promotes modular programming and enables easier code maintenance and refactoring.

DEPARTMENT OF COMPUTER APPLICATIONS 47 MES AIMAT


MEDICO

5.4.1 TEST PLANS AND TEST CASES

User Authentication
Test Scenario Test Steps Expected Result
User Registration Enter valid patient details and User account created
submit successfully
Login with valid Enter correct email & Redirected to dashboard;
credentials password, Click Login session token generated
Login with invalid Enter wrong details, Click Error: "Invalid credentials"
credentials Login
Profile Update Change user details Profile updated
successfully
Logout functionality Click Logout Redirected to login;
session cleared

Manage Nurses (Admin)


Test Scenario Test Steps Expected Result
Add a new nurse Fill nurse details (name, place, Nurse is created and listed
phone, email), Submit
Edit nurse Select nurse, Edit details, Nurse details updated
Save
Delete nurse Click delete button on nurse Nurse is removed from
list system

Manage Doctors (Admin)


Test Scenario Test Steps Expected Result
Add a new doctor Fill doctor details (name, Doctor is created and listed
place, phone, email), Submit
Edit doctor Select doctor from list, Edit Doctor details updated
details, Save
Delete doctor Click delete icon next to Doctor is removed from
doctor's name system
View doctors (Patient) Login as patient, Go to “View List of available doctors is
Doctors” section displayed

DEPARTMENT OF COMPUTER APPLICATIONS 48 MES AIMAT


MEDICO

Manage Medicines (Nurse)


Test Scenario Test Steps Expected Result
View medicine Navigate to medicine requests All requests displayed
requests list
Accept and provide Select request, update status Request updated, stock
medicine to "Accepted", Provide adjusted
medicine

Manage Equipment (Nurse + Patient)


Test Scenario Test Steps Expected Result
Add equipment Login as nurse, Navigate to Equipment is added and
(Nurse) “Add Equipment”, Enter listed
details, Upload image, Submit
View equipment Go to equipment request All patient requests are
requests (Nurse) section displayed
Accept and provide Click on request, Mark as Status updated; equipment
equipment (Nurse) accepted/provided marked as provided
Send equipment Login as patient, Select Request submitted
request (Patient) equipment, Submit request successfully
View equipment Go to "My Equipment Status of each request is
request status (Patient) Requests" section shown

Appointments (Doctor)
Test Scenario Test Steps Expected Result
View appointment Login as doctor, Go to Appointments listed
requests appointments
Accept/Reject Select an appointment, update Status updated accordingly
appointment status
Upload prescription Open patient appointment, Prescription uploaded
Upload prescription file successfully

DEPARTMENT OF COMPUTER APPLICATIONS 49 MES AIMAT


MEDICO

Homecare Requests (Patient + Nurse)


Test Scenario Test Steps Expected Result
Request homecare Login as patient, Go to Request submitted
homecare section, Submit
request
Assign nurse (Admin) Admin selects nurse and Nurse assigned and notified
assigns to request
View assigned requests Login as nurse, View assigned Assigned requests displayed
(Nurse) appointments

DEPARTMENT OF COMPUTER APPLICATIONS 50 MES AIMAT


MEDICO

CHAPTER 6
SYSTEM TESTING

DEPARTMENT OF COMPUTER APPLICATIONS 51 MES AIMAT


MEDICO

6.1 INTRODUCTION
System testing is a crucial phase in the development lifecycle of the Palliative Care project.
It involves evaluating the entire system as a whole to ensure that it meets the specified
requirements, functions correctly, and performs reliably under various conditions. This
chapter outlines the different types of system testing conducted for SCP, including
integration testing and system testing, along with the corresponding test plans and test
cases.

6.2 INTEGRATION TESTING


Integration testing focuses on testing the interactions and interfaces between individual
components or modules of Palliative Care to ensure that they work together seamlessly as a
cohesive system. This testing phase verifies that the integrated components communicate
and exchange data correctly, handle errors and exceptions gracefully, and maintain data
integrity throughout the system. Integration testing identifies and resolves integration
issues, such as communication failures, data mismatches, and functionality gaps, before
deploying the system for user acceptance testing.

6.3 SYSTEM TESTING


System testing evaluates the overall functionality, performance, and reliability of Palliative
Care as a complete and integrated system. This testing phase validates that the system
meets the specified requirements and performs as expected under normal and stress
conditions. System testing includes functional testing, performance testing, security
testing, usability testing, and compatibility testing to assess different aspects of the system
comprehensively. Test scenarios and test cases are executed to simulate user interactions,
data processing, and system behaviour across various use cases and scenarios.

6.3.1 TEST PLANS

• Objective: The objective of testing this system is to ensure that all major
functionalities—like managing users, handling appointments, medicine/equipment
requests, and feedback—work as intended. It aims to validate that each user type
(Admin, Nurse, Doctor, Patient) can perform their respective actions without issues.

DEPARTMENT OF COMPUTER APPLICATIONS 52 MES AIMAT


MEDICO

The goal is also to identify any bugs or logical errors before deployment to ensure
smooth user experience and system reliability.
• Strategy: The testing strategy involves a combination of unit testing, integration
testing, system testing, and user acceptance testing. Unit testing checks individual
features like login or adding medicine, while integration testing ensures that modules
like patient → doctor → nurse interactions work correctly. System testing focuses on
the complete workflow, and user acceptance testing checks if the system meets real-
world expectations. Manual testing will be mainly used for this project with all results
tracked using spreadsheets or logs.
• Test Plan: The test plan defines which features will be tested, such as appointment
booking, medical history upload, prescription upload, and request handling. Each
module - Admin, Nurse, Doctor, and Patient—has key functionalities that will be
validated through different test cases. The plan excludes non-functional aspects like
performance and security at this stage. The focus is on functional correctness, user role
coordination, and error-free data flow.
• Test Schedule: The testing will be carried out in phases over approximately two
weeks. It starts with understanding the requirements, followed by writing test cases
and executing tests in stages—unit, integration, and full system. After that, users
simulate real scenarios for UAT (User Acceptance Testing), and any bugs found will
be fixed and re-tested. The schedule ends with a final review and approval for system
release.

6.3.2 TEST CASES

TEST CASE 1: USER AUTHENTICATION & ACCESS CONTROL

• Test Scenario: Verify login/logout and role-based page access.

• Test Steps:

1. Open login page.

2. Enter valid and invalid credentials.

3. Try accessing pages without login.

• Expected Result:

1. Valid users are logged in with correct access.

DEPARTMENT OF COMPUTER APPLICATIONS 53 MES AIMAT


MEDICO

2. Invalid users get an error.

3. Unauthorized access is blocked.

TEST CASE 2: MANAGE NURSES

• Test Scenario: Admin manages nurses (create, edit, delete).

• Test Steps:

1. Admin logs in.

2. Adds a new nurse.

3. Edits a nurse’s details.

4. Deletes a nurse.

• Expected Result:

1. Nurse is added and visible in list.

2. Updated nurse info is shown.

3. Deleted nurse is removed.

TEST CASE 3: MANAGE DOCTORS

• Test Scenario: Admin manages doctors (create, edit, delete); patients view doctor list.

• Test Steps:

1. Admin logs in.

2. Adds a new doctor.

3. Edits a doctor’s details.

4. Deletes a doctor.

5. Patient logs in and views doctors.

• Expected Result:

1. Doctor is added and listed.

2. Edited data is updated.

3. Deleted doctor is removed.

4. Patient sees current doctors

DEPARTMENT OF COMPUTER APPLICATIONS 54 MES AIMAT


MEDICO

TEST CASE 4: MANAGE MEDICINES

• Test Scenario: Nurse adds medicines, views requests; patients request and view
medicine status.

• Test Steps:

1. Patient logs in and requests medicine.

2. Nurse views and accepts request.

3. Patient checks status.

• Expected Result:

1. Requests are shown to nurse.

2. Request status is updated.

3. Patient can track request status.

TEST CASE 5: MANAGE EQUIPMENT

• Test Scenario: Nurse adds equipment and handles patient requests; patient views and
requests equipment.

• Test Steps:

1. Nurse logs in and adds equipment.

2. Patient logs in and sends equipment request.

3. Nurse views and accepts the request.

4. Patient checks request status.

• Expected Result:

1. Equipment added successfully.

2. Requests are shown to nurse.

3. Status updates after action.

4. Patient sees current request status.

TEST CASE 6: APPOINTMENTS AND PRESCRIPTIONS

• Test Scenario: Patient makes appointment; doctor views and uploads prescription.

DEPARTMENT OF COMPUTER APPLICATIONS 55 MES AIMAT


MEDICO

• Test Steps:

1. Patient logs in and books appointment.

2. Doctor logs in and views appointments.

3. Doctor uploads prescription.

4. Patient views prescription.

• Expected Result:

1. Appointment is scheduled.

2. Doctor sees list of patients.

3. Prescription is uploaded successfully.

4. Patient can access prescription report.

TEST CASE 7: HOMECARE & FEEDBACK

• Test Scenario: Patients request homecare and provide feedback; nurses/admin view
and act.

• Test Steps:

1. Patient logs in and sends homecare request.

2. Admin/nurse views request and updates status.

3. Patient checks status.

4. Patient submits feedback.

5. Admin views feedback.

• Expected Result:

1. Request is recorded and tracked.

2. Status is updated accordingly.

3. Feedback is stored and displayed

DEPARTMENT OF COMPUTER APPLICATIONS 56 MES AIMAT


MEDICO

CHAPTER 7
SYSTEM MAINTENANCE

DEPARTMENT OF COMPUTER APPLICATIONS 57 MES AIMAT


MEDICO

7.1 INTRODUCTION
System maintenance is a critical phase of the software development lifecycle that begins
after the deployment of the system and continues throughout its operational life. It ensures
that the software remains functional, secure, and efficient in real-world conditions.
Maintenance involves a range of activities such as identifying and fixing bugs, improving
performance, adapting to new technologies, and enhancing existing features based on user
feedback.

A well-maintained system not only delivers a smooth user experience but also extends the
software’s life, reduces the risk of failures, and minimizes downtime. Regular maintenance
helps organizations keep up with changing user requirements, evolving hardware and
software environments, and new security threats. By continuously monitoring and updating
the application, system maintenance plays a vital role in maintaining the overall health,
stability, and scalability of the software.

7.2 MAINTENANCE TYPES


System maintenance for the Pain and Palliative Care System involves periodic monitoring,
upgrading, and enhancing the application after deployment to keep it secure, efficient, and
relevant to user needs. It ensures that the system continues to meet functional expectations
while evolving with technological and user trends.

• Corrective Maintenance: Corrective maintenance involves identifying and fixing


bugs, defects, or unexpected errors that occur after the system's deployment. This
ensures that the Pain and Palliative Care System remains stable, functional, and
reliable for all users.
• Adaptive Maintenance: Adaptive maintenance ensures that the system stays
compatible with evolving hardware, software, and operating environments. This
includes updating frameworks, libraries, and APIs to maintain smooth performance
across various platforms.
• Perfective Maintenance: Perfective maintenance focuses on improving the system’s
functionality, user interface, and efficiency. Based on user feedback and system
usage, enhancements are made to optimize workflows and introduce useful new
features.

DEPARTMENT OF COMPUTER APPLICATIONS 58 MES AIMAT


MEDICO

• Preventive Maintenance: Preventive maintenance aims to identify and resolve


potential issues before they impact the system. Regular monitoring, security audits,
and performance checks help maintain long-term stability and reduce downtime
risks.
• Backup and Disaster Recovery: A structured backup and disaster recovery plan
protects critical data such as user records, daily logs, and stock details. Regular
backups and quick recovery mechanisms ensure data safety in case of system
failures.
• Change Management and Scalability Planning: Change management involves
handling updates, feature additions, and system expansions in a structured way. As
user demand grows, scalability planning ensures that the system adapts without
affecting existing functionality.

DEPARTMENT OF COMPUTER APPLICATIONS 59 MES AIMAT


MEDICO

CHAPTER 8
SYSTEM SECURITY MEASURES

DEPARTMENT OF COMPUTER APPLICATIONS 60 MES AIMAT


MEDICO

8.1 INTRODUCTION
System security measures protect the Pain and Palliative Care System from unauthorized
access, data breaches, and cyber threats. With sensitive data such as user credentials, daily
records, vaccine schedules, and stock orders being managed digitally, implementing strong
security mechanisms is essential to ensure data integrity, confidentiality, and system
reliability.

8.2 OPERATING SYSTEM LEVEL SECURITY


Operating System (OS)-level security is the foundation for protecting the Pain and
Palliative Care System from low-level threats and vulnerabilities. Since the application is
hosted on a server environment, it is crucial to secure the OS to ensure that unauthorized
users cannot gain access, execute malicious code, or exploit unpatched vulnerabilities. This
layer of security helps in establishing a trusted environment for the application, database,
and network interactions.

• Regular Security Patches and Updates: The operating system and related
dependencies are frequently updated with the latest security patches. This prevents
the exploitation of known vulnerabilities. Regular updates also include performance
improvements and system optimizations, which contribute to a more secure and
stable environment for hosting the application.
• User Access Control Mechanisms: At the OS level, strict user privilege separation
is maintained. System administrators follow the principle of least privilege, ensuring
users only have the permissions necessary to perform their job functions. For
example, only the system admin has access to configuration files and deployment
tools, while the application users and services run under non-root, limited-access
accounts to minimize the risk of accidental damage or malicious misuse.

8.3 DATABASE LEVEL SECURITY


• Role-based access control (RBAC): Access to database resources is restricted based
on user roles such as Admin, Nurse, Doctor and Patient. This ensures that users only
access the data they are authorized to view or modify.

DEPARTMENT OF COMPUTER APPLICATIONS 61 MES AIMAT


MEDICO

• Regular database backups: Daily or scheduled backups are taken to ensure data can
be recovered in case of system failure, accidental deletion, or cyberattack.
• Data encryption (AES for sensitive data): Sensitive information like user passwords
and personal data are encrypted using algorithms like AES, ensuring that even if the
database is compromised, the data remains unreadable.

8.4 SYSTEM LEVEL SECURITY


• Secure API authentication (JWT, OAuth): The system uses JSON Web Tokens (JWT)
to authenticate and authorize users across frontend and backend. This prevents
session hijacking and ensures secure communication.
• HTTPS implementation: All data exchanged between the user and server is
encrypted using HTTPS, protecting against man-in-the-middle attacks and
eavesdropping.
• Audit logs to track user activities: The system maintains logs of critical user actions
such as login, data updates, etc. These logs help in tracking suspicious behaviour and
conducting post-incident analysis.

DEPARTMENT OF COMPUTER APPLICATIONS 62 MES AIMAT


MEDICO

CHAPTER 9
SYSTEM PLANNING AND SCHEDULING

DEPARTMENT OF COMPUTER APPLICATIONS 63 MES AIMAT


MEDICO

9.1 INTRODUCTION
System planning and scheduling is a critical phase in the software development life cycle
that outlines the roadmap for project execution. It involves defining project goals,
identifying required resources, estimating timeframes, and creating a structured timeline
for development activities. In the context of the Pain and Palliative Care System, planning
and scheduling ensured that all modules were developed systematically, within scope, and
on time. Proper planning helped in resource allocation, task prioritization, risk mitigation,
and achieving milestones efficiently. It laid the foundation for seamless development,
testing, and deployment by ensuring that every phase of the project was well-coordinated
and aligned with the system’s objectives.

9.2 PLANNING A SOFTWARE PROJECT


Planning a software project is the initial step that defines the roadmap for successful
development and delivery. It involves identifying requirements, setting clear goals, and
organizing tasks with proper timelines. Resource allocation, risk assessment, and tool
selection are also part of the planning phase. Effective planning ensures smooth
coordination among different modules and team members. For the Pain and Palliative Care
System, planning helped manage complex features and ensured timely completion.

9.2.1 STEPS INVOLVED IN PLANNING A SYSTEM

• Understanding Requirements: Gather and analyse the project requirements,


including functional and non-functional aspects, stakeholder expectations, and
constraints.
• Defining Objectives: Clearly define the project's goals and objectives, keeping in
mind the desired outcomes and benefits for end-users.
• Scope Definition: Set the boundaries of the project, outlining what will be included
and excluded from the deliverables.
• Resource Allocation: Identify and allocate necessary resources, such as human
resources, hardware, software, and tools, required for the project.
• Risk Assessment: Identify potential risks and uncertainties that may impact the
project's success. Develop strategies to mitigate or handle these risks.
• Project Timeline: Create a detailed project timeline, including milestones,
deliverable deadlines, and key project events.
DEPARTMENT OF COMPUTER APPLICATIONS 64 MES AIMAT
MEDICO

• Task Breakdown: Divide the project into smaller tasks and subtasks, making it
easier to manage and assign responsibilities.
• Task Dependencies: Determine task dependencies to understand which tasks are
prerequisites for others and plan their order of execution.
• Quality Assurance: Define quality standards and procedures to ensure that
deliverables meet the required quality levels.
• Communication Plan: Establish a communication plan to ensure effective
collaboration among team members and stakeholders.
• Cost Estimation: Estimate the project's budget, taking into account all necessary
expenses, including development, testing, and deployment.
• Change Management: Develop a process to manage and document any changes to
the project scope or requirements.

9.3 GANTT CHART

DEPARTMENT OF COMPUTER APPLICATIONS 65 MES AIMAT


MEDICO

9.4 PERT CHART

DEPARTMENT OF COMPUTER APPLICATIONS 66 MES AIMAT


MEDICO

CHAPTER 10
SYSTEM COST ESTIMATION

DEPARTMENT OF COMPUTER APPLICATIONS 67 MES AIMAT


MEDICO

10.1 INTRODUCTION
System cost estimation is a crucial aspect of project planning and management in the
development of the Pain and Palliative Care System. This chapter outlines the methods and
techniques used to estimate the costs associated with designing, developing, testing, and
deploying the Palliative Care project. By accurately estimating project costs, stakeholders
can make informed decisions, allocate resources effectively, and ensure that the project
remains within budgetary constraints while delivering the desired outcomes.

10.2 LOC-BASED ESTIMATION


For the Palliative Care project, two primary methods were considered for cost estimation:
Lines of Code (LOC)-based estimation and Function Point-based estimation.

LINES OF CODE (LOC)-BASED ESTIMATION:


This method estimates project costs based on the number of lines of code required to
develop the software system. It involves breaking down the project requirements into
smaller modules, determining the average lines of code per module, and estimating the
total lines of code for the entire system. The cost is then calculated based on factors such as
developer productivity, labour rates, and overhead costs.

Advantages of LOC Based Estimation


• LOC based estimation is easy to understand and implement, making it a popular
choice for cost estimation.
• Developers are familiar with LOC, making it easier for them to estimate their efforts
accurately.

Disadvantages of LOC Based Estimation


• LOC does not account for the complexity of different components, leading to
potential inaccuracies in the estimation.
• Different programming languages have varying LOC requirements for the same
functionality, leading to inconsistencies in estimation.

DEPARTMENT OF COMPUTER APPLICATIONS 68 MES AIMAT


MEDICO

CHAPTER 11
FUTURE ENHANCEMENT AND SCOPE OF FURTHER
DEVELOPMENT

DEPARTMENT OF COMPUTER APPLICATIONS 69 MES AIMAT


MEDICO

11.1 INTRODUCTION
Future enhancements play a crucial role in the sustainability and scalability of the Pain and
Palliative Care System. As user expectations, technology continue to evolve and the system
must adapt by introducing new features and improving existing ones. These enhancements
help in increasing the system’s effectiveness, ease of use, and relevance in day-to-day
operations across Palliative Cares. With proper planning and implementation, future
updates can significantly improve efficiency, transparency, and data-driven decision-
making within the system.

11.2 MERITS OF THE SYSTEM


• Automated Processes: Streamlines routine administrative tasks like daily tracking,
stock updates, and record maintenance.
• User-Friendly Interface: The application is designed with a simple and intuitive
interface, making it accessible for users of all skill levels. A clean layout and easy
navigation ensure a smooth user experience.
• Real-Time Data Access: Enables administrator to monitor daily activities instantly
through dashboards and reports.
• Data Accuracy: Reduces manual errors by replacing paper-based entries with digital
records.
• Secure Access: Uses role-based permissions and authentication to ensure that only
authorized users can access specific modules.
• Efficient Communication: Sends real-time notifications for key events.

11.3 LIMITATIONS OF THE SYSTEM


• User Adaptability: Staff with limited technical knowledge may need continuous
training and support to use the system effectively.
• Data Migration Challenges: Transitioning from manual registers to the new digital
system may require time and effort.
• No Multi-Language Support: The platform is available in a single language, which
may limit access for non-English-speaking users. Providing language options can
expand its reach.

DEPARTMENT OF COMPUTER APPLICATIONS 70 MES AIMAT


MEDICO

11.4 FUTURE ENHANCEMENT OF THE SYSTEM


• AI-Based Data Analytics: Implement artificial intelligence for disease prediction.
• Biometric Authentication: Use fingerprint or face recognition for secure login.
• Multi-Language Support: Add regional language options for better usability among
diverse user groups.

DEPARTMENT OF COMPUTER APPLICATIONS 71 MES AIMAT


MEDICO

ANNEXURE

DEPARTMENT OF COMPUTER APPLICATIONS 72 MES AIMAT


MEDICO

12.1 ORGANIZATION PROFILE


Riss Technologies is a rapidly growing company that provides professional IT services. We
are one of the largest and best software development companies in Kerala with focus on
Python .Net, PHP, Java, Software testing, SEO and Web Design. As a leader in providing
Offshore Software Development and related services, Riss Technologies functions from an
offshore set-up, based in Kerala, India. Our reputation enables us to serve in terms of
Outsourced Software Development, Web Development, designing of website and their
corresponding development. Particularly high-end developments using Microsoft NET,
Java JEE platforms, ASP, ASP.NET, PHP, Python, Flutter development as well as VB.6.0
Development adjoins us to a particularly niche sector of the global servicing. Riss
Technologies aim to provide our clients with comprehensive, end-to end technology
solutions that give them an advantage over the competition. From building applications
that increase productivity, to internet-enabling business for maximum profits.

DEPARTMENT OF COMPUTER APPLICATIONS 73 MES AIMAT


MEDICO

12.2 DOCUMENT GLOSSARY

12.2.1 LIST OF ABBREVIATIONS

SL NO ABBREVIATIONS EXPANSIONS

1 ER Diagram Entity Relationship Diagram

2 OS Operating System

3 LOC Lines of Code

4 IDE Integrated Development Environment

5 VS Code Visual Studio Code

6 UML Unified Modelling Language

7 HTML Hypertext Markup Language

8 CSS Cascading Style Sheets

9 API Application Programming Interface

DEPARTMENT OF COMPUTER APPLICATIONS 74 MES AIMAT


MEDICO

12.2.2 LIST OF FIGURES

SL NO NAME OF THE DIAGRAMS PAGE NO

1 Use Case Diagram 9

2 ER Diagram 16

3 Activity Diagram (Admin) 18

4 Activity Diagram (Nurse) 19

5 Activity Diagram (Doctor) 20

6 Activity Diagram (Patient) 21

7 Class Diagram 22

8 Component Diagram 23

9 Deployment Diagram 23

10 Sequence Diagram 24

11 Input Design 27

12 Output Design 29

13 Gantt Chart 65

14 Pert Chart 66

DEPARTMENT OF COMPUTER APPLICATIONS 75 MES AIMAT


MEDICO

12.2.3 LIST OF DATABASE DESIGN

SL NO TABLE NAME PAGE NO

1 Login 11

2 Assign_nurse 11

3 Patient 11

4 Type 12

5 Medicine 12

6 Medicine_details 12

7 Feedback 12

8 Doctors 13

9 Nurses 13

10 Appointments 13

11 Equipment 13

12 Equipment_request 14

13 Medicine_request 14

14 Medical_history 14

DEPARTMENT OF COMPUTER APPLICATIONS 76 MES AIMAT


MEDICO

12.2.4 LIST OF TEST CASE TABLES

SL NO TABLE NAME PAGE NO

1 User Authentication 48

2 Manage Nurses (Admin) 48

3 Manage Doctors (Admin) 48

4 Manage Medicines (Nurse) 49

5 Manage Equipment (Nurse + Patient) 49

6 Appointments (Doctor) 49

7 Homecare Requests (Patient + Nurse) 50

DEPARTMENT OF COMPUTER APPLICATIONS 77 MES AIMAT


MEDICO

12.3 REFERENCES
12.3.1 BOOKS

• IEEE 830-1998 standard for writing SRS document.


• “Software Engineering: A Practitioner’s Approach" by Roger S. Pressman
• “Web Programming” by Chris Bates
• "HTML and CSS: Design and Build Websites” by Jon Duckett
• "Learning Web Design" (5th Edition) by Jennifer Niederst Robbins
• "Flask Web Development" (2nd Edition) by Miguel Grinberg
• "Mastering Flask Web Development" by Daniel Gaspar

12.3.2 WEBSITES

• Google (https://www.google.co.in)
• Geeks for geeks (https://www.geeksforgeeks.org)
• Stack overflow (https://stackoverflow.com)
• w3schools (https://www.w3schools.com)
• Material UI (https://mui.com/material-ui/)
• GitHub (https://github.com/)

DEPARTMENT OF COMPUTER APPLICATIONS 78 MES AIMAT


MEDICO

SAMPLE CODES

DEPARTMENT OF COMPUTER APPLICATIONS 79 MES AIMAT


MEDICO

//api.py
from flask import *
from database import *
import uuid
# from newcnn import *

api=Blueprint('api',__name__)

@api.route('/userregister')
def userregister():

data={}

fname=request.args['fname']
lname=request.args['lname']
place=request.args['place']
phone=request.args['phone']
email=request.args['email']
uname=request.args['username']
passw=request.args['password']
q="select * from login where username='%s'"%(uname)
print(q)
res=select(q)
if res:
data['status']='duplicate'
else:
q="insert into login values(null,'%s','%s','user')"%(uname,passw)
print(q)
id=insert(q)
q="insert into user
values(null,'%s','%s','%s','%s','%s','%s')"%(id,fname,lname,place,phone,email)

DEPARTMENT OF COMPUTER APPLICATIONS 80 MES AIMAT


MEDICO

print(q)
insert(q)
data['status']='success'
return str(data)

@api.route('/login')
def login():
data={}
username=request.args['username']
password=request.args['password']

q="select * from login where username='%s' and password='%s'"%(username,password)


res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/uploadfile',methods=['get','post'])
def uploadfile():
data={}
image=request.files['image'];
lid=request.form['lid'];
path="static/uploads/"+str(uuid.uuid4())+image.filename
image.save(path)

q="insert into files values(null,(select user_id from user where


login_id='%s'),'%s','pending',now())" %(lid,path)
res=insert(q)

DEPARTMENT OF COMPUTER APPLICATIONS 81 MES AIMAT


MEDICO

if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
data['method']='uploadfile'

return str(data)

@api.route('/viewdoc')
def viewdoc():
data={}
q="select * from doctor"
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/makeappointment')
def makeappointment():
data={}
docid=request.args['docid']
loginid=request.args['loginid']
date=request.args['date']
time=request.args['time']
q="insert appointment values(null,'%s',(select user_id from user where
login_id='%s'),'%s','pending')"%(docid,loginid,date+"-"+time)

DEPARTMENT OF COMPUTER APPLICATIONS 82 MES AIMAT


MEDICO

insert(q)
q="select * from doctor"
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/viewmyappointment')
def viewmyappointment():
data={}
id=request.args['id']
q="SELECT * FROM doctor INNER JOIN appointment USING(doctor_id) where
user_id=(select user_id from user where login_id='%s')"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/viewoutputs')
def viewoutputs():
data={}
id=request.args['id']
q="SELECT * FROM USER INNER JOIN files USING(user_id) where user_id=(select
user_id from user where login_id='%s')"%(id)
res=select(q)

DEPARTMENT OF COMPUTER APPLICATIONS 83 MES AIMAT


MEDICO

if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/viewprecaution')
def viewprecaution():
data={}
id=request.args['id']
q="select *,concat(dfname,dlname) as dname from precautions inner join appointment
using (appointment_id) inner join doctor using(doctor_id) where appointment_id='%s'"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/viewenq')
def viewenq():
data={}
id=request.args['id']
q="select * from enquiry inner join user using (user_id) where login_id='%s'"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:

DEPARTMENT OF COMPUTER APPLICATIONS 84 MES AIMAT


MEDICO

data['status']='failed'
return str(data)

@api.route('/sendenq')
def sendenq():
data={}
id=request.args['id']
enq=request.args['enq']
q="insert into enquiry values(null,(select user_id from user where
login_id='%s'),'%s','pending',now())"%(id,enq)
insert(q)
q="select * from enquiry inner join user using (user_id) where login_id='%s'"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/viewprescription')
def viewprescription():
data={}
id=request.args['id']
q="select *,concat(dfname,dlname) as dname from prescription inner join appointment
using (appointment_id) inner join doctor using(doctor_id) where appointment_id='%s'"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:

DEPARTMENT OF COMPUTER APPLICATIONS 85 MES AIMAT


MEDICO

data['status']='failed'
return str(data)

@api.route('/forwordmedicine')
def forwordmedicine():
data={}
preid=request.args['preid']
logid=request.args['loginid']

shopid=request.args['shopid']

q="select * from request where prescription_id='%s'"%(preid)


res=select(q)
if res:
data['status']='failedd'
else:

q="insert into request values(null,'%s','%s','0',curdate(),'pending')"%(preid,shopid)


insert(q)
data['status']='success'
return str(data)

@api.route('/virerequeststatus')
def virerequeststatus():
data={}
lid=request.args['lid']

q="SELECT *,concat(doctor.dfname,doctor.dlname) as dname ,request.status as rstatus


FROM request INNER JOIN `prescription` USING(prescription_id) INNER JOIN
`appointment` USING(appointment_id) inner join doctor using (doctor_id) WHERE
user_id=(select user_id from user where login_id='%s') "%(lid)

DEPARTMENT OF COMPUTER APPLICATIONS 86 MES AIMAT


MEDICO

res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'

return str(data)

@api.route('/makepayment')
def makepayment():
data={}
login_id=request.args['log_id']
pmid=request.args['pmid']
amount=request.args['amount']
q="select request_id from request where prescription_id='%s'"%(pmid)
ress=select(q)
req_id=ress[0]['request_id']
q="insert into payment values(null,(select request_id from request where
prescription_id='%s'),'%s',curdate())"%(pmid,amount)
insert(q)
q="update request set status='paid' where request_id='%s'"%(req_id)
update(q)
data['status']='success'
return str(data)

@api.route('/viewphr')
def viewphr():
data={}
q="select * from nurse"
res=select(q)

DEPARTMENT OF COMPUTER APPLICATIONS 87 MES AIMAT


MEDICO

if res:
data['status']='success'
data['data']=res
else:
data['status']='failes'
return str(data)

@api.route('/viewlab')
def viewlab():
data={}
q="select * from nurse"
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failes'
return str(data)

@api.route('/vieweqp')
def vieweqp():
data={}
q="select * from equipment"
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failes'
return str(data)

DEPARTMENT OF COMPUTER APPLICATIONS 88 MES AIMAT


MEDICO

@api.route('/homecarerequest')
def homecarerequest():
labid=request.args['labid']
loginid=request.args['loginid']
data={}
q="select * from homecarerequest where nurse_id='%s' and user_id=(select user_id from
user where login_id='%s') and request_status='pending'"%(labid,loginid)
res1=select(q)
if res1:
data['status']='failed'
else:
q="insert into homecarerequest values(null,'%s',(select user_id from user where
login_id='%s'),curdate(),'pending')"%(labid,loginid)
id=insert(q)

if id:
data['status']='success'

else:
data['status']='failed'
return str(data)

@api.route('/eqprequest')
def eqprequest():
labid=request.args['labid']
loginid=request.args['loginid']
data={}
q="select * from eqprequest where eq_id='%s' and user_id=(select user_id from user
where login_id='%s') and request_status='pending'"%(labid,loginid)
res1=select(q)

DEPARTMENT OF COMPUTER APPLICATIONS 89 MES AIMAT


MEDICO

if res1:
data['status']='failed'
else:
q="insert into eqprequest values(null,'%s',(select user_id from user where
login_id='%s'),curdate(),'pending')"%(labid,loginid)
id=insert(q)

if id:
data['status']='success'

else:
data['status']='failed'
return str(data)

@api.route('/labappointment')
def labappointment():
data={}
docid=request.args['labid']
loginid=request.args['loginid']
date=request.args['date']
time=request.args['time']
q="insert labappointment values(null,'%s',(select user_id from user where
login_id='%s'),'%s','pending')"%(docid,loginid,date+time)
print(q)
insert(q)
q="select * from lab"
res=select(q)
if res:
data['status']='success'
data['data']=res
else:

DEPARTMENT OF COMPUTER APPLICATIONS 90 MES AIMAT


MEDICO

data['status']='failed'
return str(data)

@api.route('/Viewmylabappointment')
def Viewmylabappointment():
data={}
id=request.args['id']
q="select * from homecarerequest inner join user using(user_id) inner join nurse
using(nurse_id) where user_id=(select user_id from user where login_id='%s')"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

@api.route('/Vieweqpstatus')
def Vieweqpstatus():
data={}
id=request.args['id']
q="select * from eqprequest inner join user using(user_id) inner join equipment
using(eq_id) inner join nurse using (nurse_id) where user_id=(select user_id from user where
login_id='%s')"%(id)
res=select(q)
if res:
data['status']='success'
data['data']=res
else:
data['status']='failed'
return str(data)

DEPARTMENT OF COMPUTER APPLICATIONS 91 MES AIMAT


MEDICO

//admin.py
from flask import *
from database import *

admin=Blueprint('admin',__name__)

# import functools
# def login_required(func):
# @functools.wraps(func)
# def secure_function():
# if "log_id" not in session:
# return redirect("/")
# return func
# return secure_function

# def secure_function():
# if not session.get("log_id") is None:

# return redirect(url_for('public.login'))
# else:
# return "success"

@admin.route('/adminhome')
def adminhome():
if not session.get("log_id") is None:
return render_template('admin_home.html')
else:
return redirect(url_for('public.login'))

@admin.route('/adddoctors',methods=['get','post'])

DEPARTMENT OF COMPUTER APPLICATIONS 92 MES AIMAT


MEDICO

def adddoctors():
if not session.get("log_id") is None:
data={}
q="select * from doctor"
res=select(q)
data['dview']=res

if 'add' in request.form:
fname=request.form['fname']
lname=request.form['lname']
place=request.form['place']
phone=request.form['phone']
email=request.form['email']
uname=request.form['uname']
passw=request.form['passw']
q="select * from login where username='%s'"%(uname)
res=select(q)
if res:
flash("Username Already Exists.....")
return redirect(url_for('admin.adddoctors'))
else:
q="insert into login values(null,'%s','%s','doctor')"%(uname,passw)
id=insert(q)
q="insert into doctor
values(null,'%s','%s','%s','%s','%s','%s')"%(id,fname,lname,place,phone,email)
insert(q)
flash("Registration Successfull")
return redirect(url_for('admin.adddoctors'))

if 'action' in request.args:
action=request.args['action']

DEPARTMENT OF COMPUTER APPLICATIONS 93 MES AIMAT


MEDICO

did=request.args['id']

else:
action=None

if action=='update':
q="select * from doctor where doctor_id='%s'"%(did)
data['up']=select(q)

if 'update' in request.form:
fname=request.form['fname']
lname=request.form['lname']
place=request.form['place']
phone=request.form['phone']
email=request.form['email']

q="update doctor set dfname='%s',dlname='%s',place='%s',phone='%s',email='%s'


where doctor_id='%s'"%(fname,lname,place,phone,email,did)
update(q)
flash("Successfully Saved......")
return redirect(url_for('admin.adddoctors'))

if action=="delete":
q="delete from doctor where doctor_id='%s'"%(did)
delete(q)
flash("Successfully Deleted......")
return redirect(url_for('admin.adddoctors'))

return render_template('admin_manage_doctor.html',data=data)
else:

DEPARTMENT OF COMPUTER APPLICATIONS 94 MES AIMAT


MEDICO

return redirect(url_for('public.login'))

@admin.route('/addnurse',methods=['get','post'])
def addnurse():
if not session.get("log_id") is None:
data={}
q="select * from nurse"
res=select(q)
data['dview']=res

if 'add' in request.form:
fname=request.form['fname']
lname=request.form['lname']
place=request.form['place']
phone=request.form['phone']
email=request.form['email']
uname=request.form['uname']
passw=request.form['passw']
q="select * from login where username='%s'"%(uname)
res=select(q)
if res:
flash("Username Already Exists.....")
return redirect(url_for('admin.addnurse'))
else:
q="insert into login values(null,'%s','%s','nurse')"%(uname,passw)
id=insert(q)
q="insert into nurse
values(null,'%s','%s','%s','%s','%s','%s')"%(id,fname,lname,place,phone,email)
insert(q)
flash("Registration Successfull")
return redirect(url_for('admin.addnurse'))

DEPARTMENT OF COMPUTER APPLICATIONS 95 MES AIMAT


MEDICO

if 'action' in request.args:
action=request.args['action']
did=request.args['id']

else:
action=None

if action=='update':
q="select * from nurse where nurse_id='%s'"%(did)
data['up']=select(q)

if 'update' in request.form:
fname=request.form['fname']
lname=request.form['lname']
place=request.form['place']
phone=request.form['phone']
email=request.form['email']

q="update nurse set nfname='%s',nlname='%s',place='%s',phone='%s',email='%s'


where nurse_id='%s'"%(fname,lname,place,phone,email,did)
update(q)
flash("Successfully Saved......")
return redirect(url_for('admin.addnurse'))

if action=="delete":
q="delete from nurse where nurse_id='%s'"%(did)
delete(q)
flash("Successfully Deleted......")
return redirect(url_for('admin.addnurse'))

DEPARTMENT OF COMPUTER APPLICATIONS 96 MES AIMAT


MEDICO

return render_template('admin_manage_nurse.html',data=data)
else:
return redirect(url_for('public.login'))

@admin.route('/viewuser')
def viewuser():
if not session.get("log_id") is None:
data={}
q="select * from user"
data['view']=select(q)
return render_template('admin_view_users.html',data=data)
else:
return redirect(url_for('public.login'))

@admin.route('/viewrequest')
def viewrequest():
if not session.get("log_id") is None:
data={}
q="select * from homecarerequest inner join user using(user_id) inner join nurse
using(nurse_id)"
data['view']=select(q)

if 'acpt' in request.args:

acpt=request.args['acpt']
q="update homecarerequest set request_status='accept' where
hrequest_id='%s'"%(acpt)
update(q)
flash("Request Accepted....")
return redirect(url_for('admin.viewrequest'))

DEPARTMENT OF COMPUTER APPLICATIONS 97 MES AIMAT


MEDICO

if 'rejct' in request.args:
rjct=request.args['rejct']
q="update homecarerequest set request_status='reject' where hrequest_id='%s'"%(rjct)
update(q)
flash("Request Rejected....")
return redirect(url_for('admin.viewrequest'))

return render_template('admin_view_hrequest.html',data=data)
else:
return redirect(url_for('public.login'))

@admin.route('/viewlabs')
def viewlabs():
if not session.get("log_id") is None:
data={}
q="select * from lab"
data['view']=select(q)
return render_template('admin_view_labs.html',data=data)
else:
return redirect(url_for('public.login'))

@admin.route('/viewuploads')
def viewuploads():
if not session.get("log_id") is None:
data={}
q="SELECT * FROM USER INNER JOIN files USING(user_id) "
data['view']=select(q)
return render_template('admin_view_uploads.html',data=data)
else:
return redirect(url_for('public.login'))

DEPARTMENT OF COMPUTER APPLICATIONS 98 MES AIMAT


MEDICO

@admin.route('/viewenquiry',methods=['get','post'])
def viewenquiry():
if not session.get("log_id") is None:
data={}
q="SELECT * FROM USER INNER JOIN enquiry USING(user_id) "
data['view']=select(q)

if 'id' in request.args:
id=request.args['id']
data['id']=id
eq=request.args['eq']
data['enq']=eq

if 'add' in request.form:
eqid=request.form['eqid']
reply=request.form['reply']
q="update enquiry set reply='%s' where enquiry_id='%s'"%(reply,eqid)
update(q)
flash("replay Updated....")
return redirect(url_for('admin.viewenquiry'))
return render_template('admin_view_enquiry.html',data=data)
else:
return redirect(url_for('public.login'))

DEPARTMENT OF COMPUTER APPLICATIONS 99 MES AIMAT

You might also like