Analysis and Formal Model of RFID-Based Patient Registration System

Patient Registration System (PRS) is an important part of hospital environment. Therefore, semiformal model of Patient Registration System that registers the patients by assigning Radio Frequency Identification (RFID) card or bracelet is presented in this paper. The existing Patient Registration Systems do not properly work due to ambiguities and semiformal modeling techniques. However, that is why we will propose formal modeling for PRS using Vienna Development Method (VDM-SL). Firstly, we develop the Unified Modeling Language (UML) based semiformal model of PRS because UML is used for better understanding of the system architecture. Formal methods are used to ensure accuracy and robustness of the system. Therefore, we transform the UML based model into formal model by writing formal specification of the system to improve accuracy and efficiency of PRS. In this way, development time, testing and maintenance cost in building RFID based PRS software is reduced to a great extent. Keywords—Patient registration system; Radio Frequency Identification (RFID); bracelet; formal method; semiformal modeling; verification


I. INTRODUCTION
The patient registration systems handle the complex situations.Therefore, a good patient registration system is very important for the development of healthcare system.The principal commitment for the patient registration system is to improve the quality of healthcare system.Mostly the existing patient registration systems (PRS) just provide basic functionalities and do not assign RFID card or RFID bracelet to the patients at registration time.RFID is used for remotely storing and retrieving records.An integrated structure is provided to build an RFID card system by inserting smart tags in medical cards and medical bracelets to store medical information [1].In this paper RFID bracelets or cards are used to track patients.Assigning RFID tag to patients improves the patient safety, prevention and depletion in medical errors.
We use Unified Modeling Language (UML) for semiformal modeling of PRS.UML describes a system in detail.Although UML provides deeper understanding of the system but it does not provide assurance about the correctness of the system.The specification of software system is a major issue in software engineering.There are always conflicts which cause errors in the upcoming stages of software development.Formal methods are good techniques for verifying and removing ambiguities.By using formal methods, we can identify the system in better way.Therefore, this paper presents formal modal of RFID base PCS.Formal methods are used in the very beginning level of the software development, so that the errors in later levels are eliminated.Formal methods are procedures used to model complex systems as mathematical entities.Formal strategies are used to transform the complex structures into mathematical models thereby making it possible to validate in more careful way than conventional testing strategies [2].
This RFID based PRS is based on the electronic storage of the patient records.The purpose of the system is to give access through internet to authorized users in the system.The patient information which is stored and put in the PRS system must also be correct.To improve the quality of patient registration system in terms of accuracy, robustness and reliability, we model the requirements of PRS in VDM-SL by removing all the errors.Currently we concentrated on registration of the patients in our model by inserting RFID tag into RFID bracelet or card and give it to the patient at registration time.Remaining sections are as follows.
II. LITERATURE REVIEW RFID based healthcare system and patient registration system has been studied by researchers in different backgrounds.RFID based conceptual system for smart hospital which provides safe and secure patient management system is described in [3].The proposed system in [4] uses RFID tags for reliable access, allows efficient positioning and identification of patients who are unfit to communicate.In [5] an RFID based smart suite is implemented to create a healthcare monitoring system for monitoring patients in realtime and it uses Android-based Smartphone for sending patient alarm messages to healthcare workers for improving daily emergency healthcare operations.The proposed system in [6] introduces electronic healthcare smart card (eHC) for patients and a counterpart health professional card (HPC) for doctors and paramedical staff.In [7], authors recommend a smart hospital that uses RFID identification technology to improve the patients' care, optimize the actions, reduce the operating costs, help avoiding serious mistakes and reduce costly thefts.www.ijacsa.thesai.org In [8], authors describe a hospital laboratory workflow, present the system modeling which deals with security matters related to information stored in the smart cards and use Bracelets for identification with RFID placed on the arm of hospitalized patients and also uses RFID tags stuck to containers containing patient's collected samples for the correct identification of the patient who gave away the samples.The system in [9] introduces a reliable health monitoring system designed for monitoring patients through wireless technology.It processes the large number of biomedical signals through wireless body area network and mobile technology.The system in [10] presents a new dynamic ID based lightweight RFID authentication protocol, which is designed to increase patient safety.
In [11], authors give emphasis on cost-effective applications of formal techniques in verification and validation by automatic test generation of conceptual model.The authors in [12] explain the formal specification and verification of two microprocessor based cryptographic devices that control access to a network of workstations, and a message authentication device.A Logical architecture of the Forest Fire Detection is presented in [13] which helps to generate algorithm and it is then converted into an equivalent formal model using Vienna Development Method-Specification language (VDM-SL).In [14], author presents a formal axiomatic model for ubiquitous healthcare systems which defines the formal specification requirements for healthcare systems including functional and security related requirements.In [15], authors evaluate the potential languages that can be used to formally show the extracted health insurance portability and accountability act privacy policies.
The proposed system in [16] applies and discusses the formal methods in the area of medical guidelines and protocols.In [17], authors adopt a first-order theorem proving method (Event-B) to model wireless body sensor network (WBSN) and verify security requirements of privacy at different level of abstraction for WBSN.In [18], the proposed system presents some cases of specifications for an e-Health system using Z to remove those errors which remain during the early phase of requirements collection.The developed system in [19] presents testing and verification of healthcare system by simulation based methods, formal methods and semi-formal methods which identify several open issues and challenges in healthcare environment.

III. PROBLEM STATEMENT AND SYSTEM MODEL
RFID based Patient registration system is a good model that reads the electronic information of patients.PRS provides safety, satisfaction, and identification of patients.However, here are some issues with PRS.These are defined in semiformal way to describe detailed specifications required to implement a reliably secure system.Patient registration is of great importance at global level, so all the ambiguities and nonaccuracy in patient registration must be dealt with great care.The main problem of building RFID based patient registration system is to remove ambiguities and inaccuracies in the system.Because the existing PRS systems are not verified using formal technique like VDM-SL.Thus, there is a need to generate a fully verified and accurate PRS.Therefore, we use mathematical techniques for formal modeling and a detailed formal specification is developed for proving correctness of the system.
In our model, we have described the main problems of PRS which are patient identification, manual storage of patient information and tracking the patient location without ambiguities and inaccuracies.Currently, we have focused on inpatient and outpatient registration and assign smart card or bracelet to each of patients in our model.RFID tag is inserted into the bracelet or card which is assigned to patients.Each RFID tag consists of RFID number and that tag number is assigned to the patient.The patient record is stored against that RFID number.We have assigned bracelet containing RFID chip to the inpatient and assign card containing RFID chip to outpatient.Outpatient is the patient that visits the hospital and consults with doctor and inpatient is the patient which admits in the hospital.Receptionist makes registration of patients.In patient registration system, receptionist takes real time data from patients and attaches RFID tag to bracelet or card and assigns it to the patient.For inpatient registration receptionist check the bed availability for the inpatient and appointment time for the outpatient.UML based models are given bellow.

A. UML Use Case of Patient Registration System
A use case diagram represents the system actions and relationship among actors and use cases.Interaction between receptionist and patient registration system described through use case diagram.In PRS use case has a receptionist as an actor and performs some action.Use cases defined in UML diagram are Schedule patient appointment and login which includes parent use case patient registration that has two child use cases inpatient and outpatient registration.In use case diagram inpatient registration use case includes two uses cases in it that are assign room and RFID card to inpatient.Outpatient registration use case includes the use case assign card and schedule appointment as presented in Fig. 1.

B. UML Sequence Diagram of Patient Registration System
Sequence diagram shows the interaction between system objects.In our system, the diagram of outpatient registration shows the participants, receptionist, outpatient, system and the sequence of messages between them presented in Fig. 2  Sequence diagram of Inpatient registration shows the interaction between receptionist, inpatient and system by sequence of messages between them presented in Fig. 3.In sequence diagram the object with an actor is specified in VDM-SL astypes.The object without an actor is defined as operation, self-messages of object are defined to invoke a function, incoming messages are used as an input and outgoing message represent the response of function or operation in VDM-SL.

Patient
In UML class diagram, class is transformed as composite type and attributes are defined as fields of that composite type in VDM-SL.The methods of a class are transformed as functions or operations.Enumerations are transformed into enumeration types containing each possible value in VDM-SL.
To implement this system, we need to know some information about the patient, doctor and receptionist therefore, we have defined the types which are used in the system.The attributes we have defined in UML class diagram are called the types in VDM-SL.The properties of inpatient, outpatient, doctor and user are specified as types.
Firstly, for authorized usage, a composite object user is defined occupying four fields.The first field is uname which is user name provided to each authorized user.The second field is user_type which defines the type of user like patient, receptionist or doctor and third one is password of the user.types name=seq of char;password=nat; user_type=<patient>|<receptionist>|<Doctor>; user::UName:name User_type:user_type Password:password; Date is required to check the doctor availability at that date and required to store patient visit or admit date in hospital.Therefore, date is also a composite object in the system having www.ijacsa.thesai.orgthree fields.The first field is day which defines the day of the month.Second field is month which defines the month number and the third one is year which defines the current year.To identify the patients, RFID tags which are embedded in bracelet or card are used which are defined as composite object prfid_tag having two fields.The first field is rtag which defines the RFID tag having RFID number.The second field atype defines the assign type which is bracelet or card assigned to the patient at registration time.assigntype=<bracelet>|<card>; prfid_tag:: rtag:rfid atype:assigntype; The patient who visits the hospital and not hospitalized is defined as composite object outpatient having nine fields.The first field is P_id which shows card with RFID tag and patient record is being stored against this RFID number.The seventh field History shows the medical history about patient.The eighth field Papp the appointment of that patient and visit_date defines the date when patient visits the healthcare.When patients are admitted to the hospital, room is assigned to each inpatient.Room is defined as composite object having two fields.The first one represents the room number and the second field shows the bed number which is assigned to the at admission time.
room::room_no:nat bed_no:nat; The patient who is hospitalized is described as composite object inpatient having nine fields.First field in inpatient is P_id which shows bracelet with RFID tag and inpatient record is being stored against that RFID number.The sixth field prom shows the room in which the patient is admitted.The field Admitdate shows the patient admission date when the patient is admitted in the hospital for treatment.To show the doctor availability in the hospital, doctor schedules are used which is defined as composite object doctorschedule having three fields.The first field defines the id of the doctor.The second and third fields define the date and time availability of that doctor.

doctorschedule::
Did:id Ddate:set of date Dtime:set of time; State of the system introduces permanent data which is used by the PRS functions and operations.The state of the system must have variables that stores data that is used by the system operations.In patient registration state users, Doctor, Outpatient, Inpatient, rfid_tag, room, Appointment and Davailability are variables of the system.
Invariants: Invariants are the conditions that must be fulfilled to use this system.Invariants of the PRS are defined as every tag must consist of an RFID number or it must not be empty.The doctor availability schedule should not be empty.
Initialization: Initialization in the system prescribes the condition that the system must fulfill when it comes into existence.So, in the Patient monitoring system the state variables user, inpatient, outpatient, Rfid_tag, room, and Appointment are set to empty at system starting state.,-,-,-,-,t,-,-,da)==t<>{} and da<>{} init mk_Patientregistration(u,d,i,o,rt,-,r,a,da)==u={}and d={}and i={}and o={} and rt={|->}and r={}and a={} and da={} end There are different functions involved in PRS.To check the doctor availability, chkdavail function is used.This function takes set of, doctor schedule, doctor id, time and date as input.First of all, doctor id that must match the doctor id.If precondition is true, then post condition executed.In post condition first of all it is checked that if the doctor id is in the doctor availability schedule it is checked that the entered date and time is in doctor availability schedule.To check the time availability of new appointment chktimeavailability function is used.This function takes list or set of appointments, doctor id, date and time as an input and checks that the given date and time of that doctor is not reserved for another patient.To check availability of a room chcroomavailability function is used.It takes list of inpatients, list of rooms, room number and bed number as an input and checks that the room bed number is not assigned to another patient.Operations describe the functionality and real working of the system on specific inputs.All functionalities of the system describe through the functions and each task of the system is defined by a distinct operation.The VDM-SL specification of PRS operations are described below.
The login operation is used to provide the authorized access of the different users to the system.This operation defines that the users of the system are already stored in the system and takes username and password of the user as an input, and then the username and password is matched with the stored username and password if both are matched then the user is permitted to use this system.login(un:name,upaswrd:password)rep:reply ext rd users:set of user pre true post forall u in set users & if u.UName=un and u.Password=upaswrd then rep=<Successfull> else rep=<Fail> For taking the RFID number from RFID tag, scanning is provided.Therefore, scantag operation is used for this purpose.Scan tag operation takes the tag as an input and returns the RFID number of that tag as an output.
scantag(tagin:tag)output:rfid ext rd Tag:set of tag pre tagin in set Tag post output=tagin; For assigning RFID bracelet to inpatients and RFID card to the outpatients, assigntag operation is used.The assigntag operation takes RFID tag and type which should be card or bracelet as an input.The tag must be scanned which is precondition of the function.If pre-condition is successful then attach tag with type and check that if the tag type is card, then assign it to the outpatient and if the type is bracelet then assign to the outpatient.To register the outpatient, outpatientreg operation is used.This operation registers the outpatients by adding the detail of www.ijacsa.thesai.orgoutpatient.First of all, checks that the patient is not already registered and the user that performs the patient registration should be receptionist and must be login.Then assign RFID card to the patient by calling its function, add appointment of that patient by checking date and doctor availability, by calling add appointment operation in outpatient registration and register the patient by adding all other information, RFID number and appointment of that patient.To register the inpatients inpatientreg operation is defined.This operation registers the inpatient by adding the detail about inpatient.First of all, it is checked that the patient is not already registered and the user that performs the patient registration should be receptionist and must be login.Then it is checked that room is available for patient by calling chkroomavailability function.If room availability is true then assign RFID bracelet to the patient by calling assigntag operation, and then add the patient by adding RFID, room, bed number and other information about the inpatient.

V. FORMAL ANALYSIS OF PRS
The Patient Registration System is formally proved by VDM-SL Toolbox.The specification of PRS is verified by syntax checker, type checker, C++ code generator and pretty printer.The syntax checker demonstrates that the written specification is according to the syntax of the VDM-SL.The type checker checked out the misuse of values.The C++ code generator creates the similar C++ code and the pretty printer identified the errors in the PRS specification.The identifying errors in specification are removed by upgrading the properties of invariants and pre/post conditions.The main advantage of VDM-SL is detecting all the ambiguities and gaps in objects as compare to other semiformal languages like UML.VDM-SL provides the more detailed, refined model and algorithm verification of the system as compare to semiformal languages.The analysis of PRS is presented in Fig. 5.

VI. CONCLUSION
The UML based model of the Patient Registration System (PRS) is presented for the semi-formal representation.UML based model of the system describes the functionality of the system.Previous systems just use UML model for developing the system but the UML model does not give assurance about the correctness of the system.The VDM-SL gives the assurance about the correctness of the system.So, the detailed analysis of the PRS is done by using VDM-SL.The generated formal specification of PRS has been examined by VDM-SL Toolbox.Run time errors are discovered by allowing dynamic checking and discovering errors in specification are eliminated by enhancing the properties of invariants and pre/post conditions.The Patient Registration System will help to build cost effective and correct system.

Fig. 1 .
Fig. 1.Use case diagram of patient registration system.

Fig. 3 .
Fig. 3. Sequence diagram of inpatient registration.C. UML Class Diagram of Patient Registration System Class diagram represents the static structure of the RFID based patient registration system.Class diagram of patient registration system shows the set of classes and their relationship.The UML class diagram illustrates the dependencies of source code between classes.A class in PRS class diagram describes the functions and variables of the object that is a distinct entity in a program.The classes in a class diagram are organized in groups that share common attributes.The PRS class diagram is shown in Fig. 4.

Fig. 4 .
Fig. 4. Class diagram of PRS.IV.FORMAL SPECIFICATION USING VDM-SL UML based models are transformed into formal model by developing formal specification in VDM-SL.In use case diagram of the PRS receptionist is an actor or user of the PRS which is defined under types in VDM-SL specification.All use cases in use case diagram are transformed as operations in VDM-SL specification.

Receptionist Handheld RFID Reader Inpatient Regitration Room Inpatient Registration Form Inpatient database
Enter (RFID no, name, room no,bed no etc) Time is required to check the available time slot for the patient appointment.Therefore, time is a composite object which having two fields.The first field hour defines the hour of the day and second field Min defines the minute of the hour.To meet doctor at specific time, appointments are used which are specified as composite object appointment having five fields.The first field Docid shows the id of the doctor patient wants to meet.The second field Appid shows the appointment id which identifies the patient appointment.The third and fourth fields define the date and time of appointment.The fifth one Description shows the detail of the appointment.
To schedule appointments, Addappointment operation is used.In this function first of all check that appointment id is unique, which is pre-condition in this operation.Then the doctor and his time availability are checked by calling doctor availability and time availability functions and then appointment is added.