Beruflich Dokumente
Kultur Dokumente
OF
SIX MONTHS INDUSTRIAL TRAINING, UNDERTAKEN
AT
He has been punctual, intellectually alert, and morally capable and has good knowledge of
training subject. To the best of our knowledge and belief, he bears an excellent moral
character. We wish success to his in future.
Yours Sincerely
HRD
PREFACE
The aim of this project was to design and develop a software prototype which integrates
with an external scheduling component to manage hospital appointments for patients on
fixed treatment pathways and is extendible in the future to include additional functionality.
The application has been designed to be used by hospital receptionists to assist them with
scheduling patients.
Following the successful implementation of the system, the application was tested and
evaluated for usability and functionality to see overall how successful the project had
been. The final solution developed met all the minimum requirements and also included
some additional features.
The report covers the whole project from start to finish, including the requirements
analysis, background reading, design, implementation, testing and evaluation stages.
ACKNOWLEDGEMENT
I would like to thank everyone that have contributed to the making of this Recommendation
project, which is the final chapter of my Postgraduate education in Computer Science at Guru
Jambheswer University of Science & Techonology, Hisar Haryana. We deeply express our
sincere thanks to our Raps iTech for encouraging and allowing us to present the project on the
topic "Patient Information System" at our department premises for the partial fulfillment of the
requirements leading to the award of MCA degree. We take this opportunity to thank all our
lecturers who have directly or indirectly helped our project.
I would also like to express my sincere gratitude to all my friends who have patiently helped me
in accomplishing this undertaking and for their constant support throughout the project work.
Finally I would like to thank my parents who were always there for me giving encouragement
and guidance.
Place: Chandigarh
CONTENTS
Certificate......................................................................................................... - 2 -
Preface............................................................................................................. - 3 -
Acknowledgement............................................................................................ - 4 -
I. Project Undertaken....................................................................................................... - 7 -
I.1 Objective...........................................................................................- 7 -
I.2 Need To Choose The Project............................................................ - 7-
I.3 Industry Application.......................................................................... - 8 -
VII. Design..................................................................................................... - 32 -
VIII.1 Home Page................................................................................ - 32 -
VIII.2 Add Patient................................................................................ - 33 -
VIII.3 Add Doctor................................................................................ - 33 -
VIII.4 Appointment...................................... .........................................-34 -
VIII.5 Add Appointment....................................................................... - 35 -
VIII.6 Doctor........................................................................................- 36 -
VIII. Coding................................................................................................... - 38 -
VIII.1 Application Setup...................................................................... - 38 -
VIII.2 Routing..................................................................................... - 38 -
VIII.3 Templates................................................................................. - 39 -
VIII.4 Static Files...................................................................................-39-
VIII.5 Request Objects......................................................................... - 41 -
IX. Testing..................................................................................................... - 42 -
X. Future Enhancements................................................................................ - 43 -
XI. Conclusion.............................................................................................. - 44 -
I.1 Objective
The aim of the project is to develop a framework which allows management of appointments
using the external scheduling component. The system will have a data model which stores
patient, nurse staff, multiday pattern and intraday pattern data. A prototype system will be
developed which inputs, queries and outputs from the data model. It is the aim of this project to
display the results of the generated schedules and not to actually generate schedules for patients
and nurses. The system needs to integrate with a scheduling component which has been
developed by researchers at the University of Leeds to schedule the appointments. The system
should be able to manually modify schedules generated by the external scheduling program. The
system will be operated by hospital receptionists and other staff to assist them in scheduling
appointments for patients in the near future with respect to staffing resources. Also an aim of the
project is to develop the framework so that it is easy to extend in the future.
It is a very complex problem scheduling the patients such that they follow their required pathway
(multiday pattern) accurately while utilising hospital resources to full potential such as nurses
and doctors. It is imperative to schedule patients in a way in which nurses and doctors can be
allocated systematically to each patient within their normal working hours and also not to have
any clashes. It is also important for the patients to have their treatments in accordance to the
prescribed medical procedures.
Currently staff schedule patients using a manual diary with pen and paper , however due to the
large number of patients treated there may be clashes where a single nurse is allocated two
patients at the same time and required to perform treatment on multiple patients at the same time,
which in practice is not possible. Also a problem which arises is that patients end up not
following their required medical procedure so for example a treatment which should be
completed in twenty-one days can take twenty-eight days. Also the treatment pattern on a
specific day is not always followed accurately due to limitations of the current booking and
resource allocation system. This makes it very difficult for both staff and patients to follow the
timetables while conforming to the medical requirements.
This can be frustrating for the patients as sometimes they have to stay longer at the hospital than
they had anticipated and also for staff as they often have high workloads which they cannot
always cope with. This is a major problem for the receptionists who are responsible for booking
patient appointments, as they have to consider the patients preferences for appointments while
ensuring there are sufficient staff to perform the treatments.
II. INTRODUCTION
Currently staff schedule patients using a manual diary with pen and paper , however due
to the large number of patients treated there may be clashes where a single nurse is
allocated two patients at the same time and required to perform treatment on multiple
patients at the same time, which in practice is not possible. Also a problem which arises is
that patients end up not following their required medical procedure so for example a
treatment which should be completed in twenty-one days can take twenty-eight days. Also
the treatment pattern on a specific day is not always followed accurately due to limitations
of the current booking and resource allocation system. This makes it very difficult for both
staff and patients to follow the timetables while conforming to the medical requirements.
This can be frustrating for the patients as sometimes they have to stay longer at the
hospital than they had anticipated and also for staff as they often have high workloads
which they cannot always cope with. Also there are government set targets for the NHS,
which need to be achieved.
An algorithm has been developed by researchers at the University of Leeds to schedule the
patients and allocate nurses to each action slot within an intraday pattern, with the aim of
eliminating clashes and also to fulfil patient requests.
Advancements in information technology have provided methods for capturing and
storing information more effectively and efficiently, while allowing for backups to be
created in the case of data corruption. Such information systems can be used to improve
time management within organisations.
It has been decided after reviewing the methodologies that the most appropriate methodology in
this project is the prototyping methodology using an evolutionary prototype, however RAD will be
used within prototyping so that features of the solution can be quickly developed. It has been
decided to not solely use RAD as has been discussed it can lead to errors and prototyping will
allow for any errors to be corrected, by modifying a prototype.
III.2 FRAMEWORK SYSTEM ARCHITECTURE
The proposed solution has two main components which need to be designed and combined
together to form the end solution. The first part of this section is about the design of the main
application architecture and the second part is the design of the data model which will store the
data.
IV.1 OS Compatibility
I have opted for Flask framework with Python version 3.6 to build this web application. Because
it has provides some key features such as tons of packages, speed (it is very fast, encourages
rapid development), security, scalability (can serve many users simultaneously) and many more.
Flask in its 'out-of-the-box' state is set up to communicate with SQLite -- a lightweight relational
database included with the Python distribution. So by default, Flask automatically creates a
SQLite database for my project.
Installations Required:
• Installing Python v3.6
• Installing Flask– latest version
IV.3 Dataset
Flask is a web framework. This means flask provides you with tools, libraries and technologies
that allow you to build a web application. This web application can be some web pages, a blog, a
wiki or go as big as a web-based calendar application or a commercial website.
Flask is part of the categories of the micro-framework. Micro-framework are normally
framework with little to no dependencies to external libraries. This has pros and cons. Pros
would be that the framework is light, there are little dependency to update and watch for security
bugs, cons is that some time you will have to do more work by yourself or increase yourself the
list of dependencies by adding plugins. In the case of Flask, its dependencies are:
• Werkzeug a WSGI utility library
• jinja2 which is its template engine
IV.4 Template Engine
If your website contains only few pages, changing its style will take you some time but is doable.
However, if you have a lot of pages (for example the list of items you sell in your store), this task
become overwhelming.
Using templates you are able to set a basic layout for your pages and mention which element will
change. This way you can define your header once and keep it consistent over all the pages of
your website, and if you need to change your header, you will only have to update it in one place.
Using a template engine will save you a lot of time when creating your application but also when
updating and maintaining it.
V. MODULAR DESCRIPTION OF THE PATIENT INFORMATION
SYSTEM
A project is a sum of many applications. Every application has an objective and can be reused
into another project, like the contact form on a website can be an application, and can be reused
for others. See it as a module of your project.
There are several modules that were created and used during the building of this movie
recommender system. The project follows the design of the high-level architecture system. All of
which are listed as below:
The url_for() function is very useful for dynamically building a URL for a specific function. The
function accepts the name of a function as first argument, and one or more keyword arguments,
each corresponding to the variable part of URL.
The User() function checks if an argument received matches ‘admin’ or not. If it matches, the
application is redirected to the hello_admin() function using url_for(), otherwise to
the hello_guest() function passing the received argument as guest parameter to it.
V.2 Templates
It is possible to return the output of a function bound to a certain URL in the form of HTML.
However, generating HTML content from Python code is cumbersome, especially when variable
data and Python language elements like conditionals or loops need to be put. This would require
frequent escaping from HTML.
This is where one can take advantage of Jinja2 template engine, on which Flask is based. Instead
of returning hardcode HTML from the function, a HTML file can be rendered by
the render_template() function.
A web application often requires a static file such as a javascript file or a CSSfile supporting
the display of a web page. Usually, the web server is configured to serve them for you, but
during the development, these files are served from static folder in your package or next to your
module and it will be available at /static on the application.
A special endpoint ‘static’ is used to generate URL for static files.
V.4 Request Object
The data from a client’s web page is sent to the server as a global request object. In order to
process the request data, it should be imported from the Flask module.
Important attributes of request object are listed below −
• Form − It is a dictionary object containing key and value pairs of form parameters and
their values.
• args − parsed contents of query string which is part of URL after question mark (?).
• Cookies − dictionary object holding Cookie names and values.
• files − data pertaining to uploaded file.
• method − current request method.
A Flask application is an instance of the Flask class. Everything about the application, such as
configuration and URLs, will be registered with this class.
Instead of creating a Flask instance globally, you will create it inside a function. This function is
known as the application factory. Any configuration, registration, and other setup the application
needs will happen inside the function, then the application will be returned.
VI.2 Routing
Modern web frameworks use the routing technique to help a user remember application URLs.
It is useful to access the desired page directly without having to navigate from the home page.
The route() decorator in Flask is used to bind URL to a function
As a result, if a user visits http://localhost:5000/appointment URL, the output of
the appointment() function will be rendered in the browser.
The add_url_rule() function of an application object is also available to bind a URL with a
function as in the above example, route() is used.
@app.route('/appointment')
VI.3 Templates
• It is possible to return the output of a function bound to a certain URL in the form of
HTML. For instance, in the following script, hello() function will render ‘Hello
World’ with <h1> tag attached to it.
• However, generating HTML content from Python code is cumbersome, especially when
variable data and Python language elements like conditionals or loops need to be put.
This would require frequent escaping from HTML.
• This is where one can take advantage of Jinja2 template engine, on which Flask is based.
Instead of returning hardcode HTML from the function, a HTML file can be rendered by
the render_template() function.
• appointment.html
• Adding session controls - to provide the login and logout buttons in our menu.
• Adding the nav bar.
• The important part here is how I make use of the context object user.is_authenticated
within a {% if %} expression in order to show the right menu elements. When the
user is logged in, we show the logout button and vice versa.
• Registration
• logged_out.html
• login.html
• registration_complete.html
• registration_form.html
• about.html
• home.html
• doctors.html
• patient.html
• addpatient.html
• deletepatient.html
• updatepatient.html
• contacts.html
A web application often requires a static file such as a javascript file or a CSS file supporting the
display of a web page. Usually, the web server is configured to serve them for you, but during
the development, these files are served from static folder in your package or next to your module
and it will be available at /static on the application.
A special endpoint ‘static’ is used to generate URL for static files.
The data from a client’s web page is sent to the server as a global request object. In order
to process the request data, it should be imported from the Flask module.
We have already seen that the http method can be specified in URL rule. The Form data
received by the triggered function can collect it in the form of a dictionary object and forward it
to a template to render it on a corresponding web page.
In the following example, ‘/’ URL renders a web page (student.html) which has a form. The
data filled in it is posted to the ‘/result’ URL which triggers the result() function.
The results() function collects form data present in request.form in a dictionary object and
sends it for rendering to result.html.
Address<br>
<textarea name = "add" ></textarea><br>
City<br>
<input type = "text" name = "city" /><br>
PINCODE<br>
<input type = "text" name = "pin" /><br>
<input type = "submit" value = "submit" /><br>
</form>
</body>
</html>
As it can be seen, form data is posted to the ‘/addrec’ URL which binds the addrec() function.
This addrec() function retrieves the form’s data by POST method and inserts in students table.
Message corresponding to success or error in insert operation is rendered to ‘result.html’.
The HTML script of result.html contains an escaping statement {{msg}}that displays the result
of Insert operation.
cur.execute("INSERT INTO students (name,addr,city,pin) VALUES
(?,?,?,?)",(nm,addr,city,pin) )
This list.html is a template, which iterates over the row set and renders the data in an HTML
table.
Finally, the ‘/’ URL rule renders a ‘home.html’ which acts as the entry point of the application.
@app.route('/')
def home():
return render_template('home.html')
VII. DESIGN
Patient Information System Project in Flask web Framework Architecture with all the project
modules defined in the section above.
VIII. CODING
I have coded the entire project in Python version 3.6 with Django Web Framework.
A Flask application is an instance of the Flask class. Everything about the application, such as
configuration and URLs, will be registered with this class.
Instead of creating a Flask instance globally, you will create it inside a function. This function is
known as the application factory. Any configuration, registration, and other setup the application
needs will happen inside the function, then the application will be returned.
VIII.2 Routing
Modern web frameworks use the routing technique to help a user remember application URLs.
It is useful to access the desired page directly without having to navigate from the home page.
The route() decorator in Flask is used to bind URL to a function
As a result, if a user visits http://localhost:5000/appointment URL, the output of
the appointment() function will be rendered in the browser.
The add_url_rule() function of an application object is also available to bind a URL with a
function as in the above example, route() is used.
from flask import Flask,send_from_directory,render_template
from flask_restful import Resource, Api
from package.patient import Patients, Patient
from package.doctor import Doctors, Doctor
from package.appointment import Appointments, Appointment
from package.common import Common
import json
api.add_resource(Patients, '/patient')
api.add_resource(Patient, '/patient/<int:id>')
api.add_resource(Doctors, '/doctor')
api.add_resource(Doctor, '/doctor/<int:id>')
api.add_resource(Appointments, '/appointment')
api.add_resource(Appointment, '/appointment/<int:id>')
api.add_resource(Common, '/common')
VIII.3 Templates
• It is possible to return the output of a function bound to a certain URL in the form of
HTML. For instance, in the following script, hello() function will render ‘Hello
World’ with <h1> tag attached to it.
• However, generating HTML content from Python code is cumbersome, especially when
variable data and Python language elements like conditionals or loops need to be put.
This would require frequent escaping from HTML.
• This is where one can take advantage of Jinja2 template engine, on which Flask is based.
Instead of returning hardcode HTML from the function, a HTML file can be rendered by
the render_template() function.
• appointment.html
• Adding session controls - to provide the login and logout buttons in our menu.
• Adding the nav bar.
• The important part here is how I make use of the context object user.is_authenticated
within a {% if %} expression in order to show the right menu elements. When the
user is logged in, we show the logout button and vice versa.
• Registration
logged_out.html
login.html
registration_complete.html
registration_form.html
about.html
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1">
<meta name="description" content="Bootstrap Admin App + jQuery">
<meta name="keywords" content="app, responsive, jquery, bootstrap, dashboard,
admin">
<title>HospitalManagementSystem</title>
<link rel="stylesheet" href="vendor/fontawesome/css/font-awesome.min.css">
<link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">
<link rel="stylesheet" href="vendor/animate.css/animate.min.css">
<link rel="stylesheet" href="vendor/whirl/dist/whirl.css">
home.html
• doctors.html
• patient.html
• addpatient.html
• deletepatient.html
• updatepatient.html
• contacts.html
A web application often requires a static file such as a javascript file or a CSS file supporting the
display of a web page. Usually, the web server is configured to serve them for you, but during
the development, these files are served from static folder in your package or next to your module
and it will be available at /static on the application.
A special endpoint ‘static’ is used to generate URL for static files.
The data from a client’s web page is sent to the server as a global request object. In order
to process the request data, it should be imported from the Flask module.
VIII.4.1 Important Attributes
• Form − It is a dictionary object containing key and value pairs of form
parameters and their values.
We have already seen that the http method can be specified in URL rule. The Form data
received by the triggered function can collect it in the form of a dictionary object and forward it
to a template to render it on a corresponding web page.
In the following example, ‘/’ URL renders a web page (student.html) which has a form. The
data filled in it is posted to the ‘/result’ URL which triggers the result() function.
The results() function collects form data present in request.form in a dictionary object and
sends it for rendering to result.html.
A web application often requires a static file such as a javascript file or a CSS file
supporting the display of a web page. Usually, the web server is configured to serve
them for you, but during the development, these files are served from static folder in
your package or next to your module and it will be available at /static on the
application.
A special endpoint ‘static’ is used to generate URL for static files.
VIII.5.2 Debug Mode
A Flask application is started by calling the run() method. However, while the
application is under development, it should be restarted manually for each change
in the code. To avoid this inconvenience, enable debug support. The server will
then reload itself if the code changes. It will also provide a useful debugger to
track the errors if any, in the application.
The Debug mode is enabled by setting the debug property of
the application object to True before running or passing the debug parameter to
the run() method.
City<br>
<input type = "text" name = "city" /><br>
PINCODE<br>
<input type = "text" name = "pin" /><br>
<input type = "submit" value = "submit" /><br>
</form>
</body>
</html>
As it can be seen, form data is posted to the ‘/addrec’ URL which binds the addrec() function.
This addrec() function retrieves the form’s data by POST method and inserts in students table.
Message corresponding to success or error in insert operation is rendered to ‘result.html’.
The HTML script of result.html contains an escaping statement {{msg}}that displays the result
of Insert operation.
cur.execute("INSERT INTO students (name,addr,city,pin) VALUES
(?,?,?,?)",(nm,addr,city,pin) )
This list.html is a template, which iterates over the row set and renders the data in an HTML
table.
Finally, the ‘/’ URL rule renders a ‘home.html’ which acts as the entry point of the application.
@app.route('/')
def home():
return render_template('home.html')
Unit testing was undertaken during the actual implementation of the system. Each time some
code was written it was run and monitored using the ‘debug’ feature in MS Visual Studio which
proved to be extremely useful throughout the development phase. As bugs were discovered they
were corrected by adding additional code or modifying the existing code. Several bugs were
corrected using ‘try and catch’ block statements using VB.NETs exception class, for example the
try and catch statement in the actual executable code had been written, as it was discovered
during testing that if a user clicked on cancel when prompted for a patient ID the application
would terminate and go into debug mode. Similarly many other minor errors were discovered
and corrected. This method of testing proved to be very effective in discovering trivial errors
relatively quickly, which were fixed before they created more complicated problems further
down the line during development. After development of the system had been completed testing
was also performed.
Integration testing involves testing the interfaces between programs. Integration testing
was applied to this project by testing the integration between the database and the main
application. Integration testing between the main application, scheduling component and
database was also performed however due to the developer not having the scheduling
component available only the parsing was tested.
Information needs to be read from the database and also inserted into the database by the
main application for the system to work successfully as intended. To perform these tasks
INSERT and SELECT queries are executed by the main application. Using dummy data
several tests were carried out to ensure data is being correctly entered into the appropriate
fields and tables in the database and also retrieved from the database. Some problems were
discovered using this method, for example there are several fields which are required for a
patient, for example their multiday pattern ID is required however the system was still
allowing records to be added without this data. This was solved by adding validation code
to the ‘Save’ button to ensure all required fields had been filled in. Reading data from the
data was successful and required no further coding or modification.
X. FUTURE ENHANCEMENTS
From the results of the evaluation and during development further enhancements were
found which could be incorporated in future extensions to the project enhancing system
functionality. As the framework has been designed and developed to be extended there are
many extensions possible to the system. Some of these are stated below:
• Include a help feature. This could be done by including more help messages in the
application and could be done by creating an interactive screen which
demonstrates use of the software and explain features more clearly. This was
identified by evaluators of the system.
• Include nurse break times when entering the rota for each day. This could be done
by modifying the database to include break times for nurses.
• A calendar feature could be incorporated within the application or by linking the
application to an external calendar. This was another feature identified by
evaluators of the system who said a ‘clever calendar’ could be used with various
views enabling users to zoom in and out of several timeframes; for example an
entire month could be shown or a user could zoom into a specific day. This feature
could also allow for ‘drag and drop’ of appointments.
• A web based application could be added to allow patients to view their
appointments. This major addition could allow patients to change their intraday
appointments. More focus on the actual scheduling could be placed on such a
project to re-allocate nurses to patients if they wish to change their appointments.
Also nurses could login to view their security would have to be a consideration
with such a project.
• The system could be extended to deal with the preparation of medicines prior to a
patients appointment, so that any required medications are ready for a patient and
this process does not have to be done manually.
XI. CONCLUSION
We conclude that the objective of the project were completed successfully thus the project
aim has been achieved.
• The problem was analysed in detail and all the requirements were sought at the
initial stages which made development of the solution easier as no new
requirements were introduced during development
• A software engineering was chosen which was then successfully followed during
the project which can be seen from the Gantt chart in appendix B with the actual
schedule
• A data model has been developed using MS Access which accurately stores all the
data required from which data can be retrieved and inserted appropriately
• An application has been developed which integrates with the data model and can
query it successfully
• The system has been tested and several bugs have been corrected.
• The framework developed can be easily extended in the future using the same or
additional technologies. Using the software engineering principle of ‘Separation of
Concerns’ with a layered design has achieved the required adaptability, reusability
and extensibility.
XII. BIBLIOGRAPHY AND REFERENCES
• https://coursera.org/learn/patient-information/
• https://medium.com/patient
• https://www.data.com/community/tutorials/patientinformation-systems-python
• https://www.analyticsvidhya.com/blog/2016/06/quick-guide-build-patient-engine-python/
• https://www.klipfolio.com/blog/patient-system
• services.lovelycoding.org/medical-store-billing-management-system-project