Electronic Patient Record System for a Psychiatry Unit in Sri Lanka

Electronic patient records improve the quality of patient care in psychiatry units. Many patients with long term illnesses have multiple patient encounters with psychiatric services. Although manual data gathering is available at present, data retrieval is time consuming as files have to be manually searched. Storage of past data is hampered by lack of space.  We describe the first electronic patient record system developed for use in a psychiatry unit in Sri Lanka. The system facilitates an electronic storage of data and easy retrieval of information. The system identifies a patient by a unique number and allows different episodes of in-patient and out-patient care to be linked together. The systems' value is enhanced by the generation of reports to assist and improve health administration. Clinical care is enhanced by the ability to view the longitudinal history of a patient. Discharge reports, reports of out-patient attendance and reports of analysis of data are generated by the system. The follow up report identifies outpatients who default treatment enabling community follow up. This would help improve compliance and reduce relapses. This is not currently done as it is not feasible to identify all those who default using a manual record keeping system. Analysis of patients based on different criteria such as diagnosis and treatment will assist in identifying trends and provide a database for research. The system was developed using MySQL database and is hosted on Apache server. As this uses only open source software this can be deployed in both Linux and Windows environment allowing easy and low cost deployment. The system is web based and can be connected to a network expanding the access capabilities.   Key Words: Psychiatry; web based system; open source; report generation; electronic patient records; Sri Lanka. Sri Lanka Journal of Bio-Medical Informatics 2010;1(4):214-22 DOI: 10.4038/sljbmi.v1i4.2250


Introduction
Electronic patient records are used in many countries to store patient information. It offers new methods of storing, manipulating and communicating medical information including text, images, sound, video (1) .Countries such as the United Kingdom, United States and Canada have extensive electronic patient record systems (2) . These systems store administrative data and clinical information. Structured data using codes, classifications and nomenclatures increase the quality of data in systems (3) . Although Electronic patient record systems increase efficiency of storing and sharing information concerns have been raised about privacy and confidentiality of data (1) . Medical data clearinghouses have been accused of selling medical patient data to insurance companies, police departments, employers, drug companies (1) .
Many psychiatric illnesses have a chronic course and patients have multiple contacts with psychiatric services. Linking the different episodes of care of a single patient allows the health care provider to access the longitudinal clinical history of the patient. This information can be used to enhance quality of clinical care, for clinical audit, to plan services and for research. We describe the development of an electronic patient record system for a psychiatry unit which was designed to meet the unique requirements of the service.

Description of clinical care services
Patients can access clinical services of the unit through several pathways. Patients referred from medical, surgical and other units in the hospital are registered in the liaison unit. Some liaison unit patients require follow up until discharge from their respective wards while some are admitted as in-patients to the psychiatry unit. Patients requiring long term follow up are referred to the out-patient unit. Patients referred by clinicians from other health services or self referrals are registered in the out-patient unit. If any of these patients require admission they are admitted to the in-patient unit. Others are followed up in the out-patient unit. Patients requiring regular psychotherapy are registered and followed up in the day patient unit.

Existing data recording system
The existing system is paper based. Each of the clinical services i.e. in-patient, out-patient, day patient and liaison units have their own data recording forms. Each patient contact is given a separate number. There is no unique patient number linking different episodes. For example a patient will have different in-patient record numbers for each admission. Paper based records are stored for a maximum of 5 years. The data entered is not structured and can vary depending on the clinician recording details.

Limitations of the existing system
Identification of previous episodes of care is difficult as there is no unique number linking different episodes. Identification of past records is done manually based on contact dates. When patients are discharged from the in-patient unit a diagnosis card with a brief summary of the hospital admission is given to the patient. Many patients with psychiatric illness are known to default treatment (4) . It is difficult to identify such patients with the paper based recording system. Although much clinical detail is recorded in the paper records, conducting research is difficult as the records have to be manually reviewed to elicit data. Similarly statistics regarding service provision is difficult to generate. Due to limitation of storage space records are maintained only for a period of 5 years leading to loss of valuable data.

Identification of system requirements
The requirements of a database for a psychiatry unit were identified by the staff in the unit. Input was obtained from different grades of staff including consultants, junior medical officers and clerical staff. The paper based system currently used was scrutinized. The following were identified as requirements of an electronic patient record system for the unit.
1. Create a repository of patient information with supporting information such as diagnosis, drugs prescribed and staff details 2. Identify patients using a unique patient number which could link different episodes of care. 3. Provide information links between different services of the unit i.e. in-patient, outpatient, liaison unit and day unit. 4. Coding of diagnosis using the ICD 10 (International Classification of Diseases) codes. 5. Be able to search database using different criteria such as patient name, diagnosis or treating clinician 6. Produce customized reports on patients as a discharge summary 7. Record out-patient appointments to enable tracking of patients who default 8. Develop a system that can be used by non IT professionals and is user friendly 9. Ensure security of data 10. System is simple, requiring little maintenance and is low cost

System design and architecture
The database design This is a data driven system where providing easy access to volumes of data piled up on a long term basis is a key requirement of the system. This makes the database design a key aspect of the system.
The stored data should be accessible and should be detailed enough to provide useful information to support improved patient care. The main data component of the system is the patient record. Patient demographic data provides background information about the patient. Diagnostic data and treatment data provide key clinical information of each treatment episode. Data about medical professionals who provide clinical care for each patient and administrative details such as bed occupancy are used as supporting data.
The existing manual method uses a comprehensive and well detailed recording system for patients as described above. The essential sections of the patients' records were selected for the electronic recording system. The patient record consists of two components, namely demographic data and episode data. Each patient may have multiple episodes over a long period and the key information of each episode is stored in the system. The records are categorised according to the different services of the unit namely, in-patient, out-patient, dayunit and liaison units.
The diagnosis data is coded according to the ICD-10 classification. Accordingly the system identifies 12 main categories of diagnosis and 53 sub-categories. Medications used to treat patients are coded in 16 predefined categories containing 70 drugs. Details of dose, frequency and time period for which it is prescribed is recorded. These categories can be edited as required.
The rest of the database components contain information of medical staff and the resources available at the ward, which all link to patients' data.

The System Architecture
The system consists of six modules namely, patients, staff, drugs and diagnosis, reports and resources and administrator modules. Figure1 describes the modular structure of the system.  Patients Module: This is the key module of the system which handles patients' data storage and retrieval of information. Each patient is uniquely identified by his or her national identity card (NIC) number or when the NIC number is not available a unique number generated by the system is used. All episodes of an individual patient are linked by this unique number which facilitates easy retrieval of patients' records.
This module provides facilities to create a new patient's record by entering demographic data. It also allows entering of episode data for any patient record already existing in the system, edit current episode's data including clinical information, diagnosis, drugs and medical staff details. Each episode allows recording of multiple diagnosis and multiple drugs prescribed for the patient.
Staff Module: The staff module facilitates the storing and editing of staff details. The information captured in this module provides staff details for episode data in the patients module. In order to facilitate data entry the names of consultants and medical officers stored in this module are provided as a drop down menu when entering patient episode data. It facilitates the generation of statistical reports categorised by consultant providing care.

Drugs and Diagnosis Module:
This module supports the storing of diagnosis and drug treatment. It also allows the editing of diagnosis categories and drugs available in the module and searching by diagnoses and drugs. The module provides diagnosis and treatment information for episode data in the patients module. This module serves as an important information module and also allows statistical analysis.
Reports Module: Generating different types of reports is a major requirement of the system. Reports module links with all other modules of the database to allow report generation based on needs of the user. Reports are generated based on one or more criteria as selected by the user. There are three main categories of reports that can be generated.
Discharge report: Discharge report is generated on demand as requested by a staff member when discharging the patient. It is prepared based on the present episode data. All previous discharge reports of a selected patient can be viewed on request.
Follow up report: This is a report of all the patients who have defaulted out-patient appointments during a defined period eg. last three months or six months.
Statistical Report: Different types of statistical reports can be generated based on different criteria. These reports are mainly based on patient's episode data. This allows for generation of reports such as patients treated by a particular consultant or medical officer, patients prescribed a particular drug, patients with a certain diagnosis or list of patients treated during a given time period. Reports can be viewed on-line or converted to a document format allowing saving or direct printing.
Resources module: This is an informative module about the status of resources available in the ward. At present only bed utilization is recorded. However it is possible to expand it to include other resources as required. The bed status is recorded as available, occupied and on leave (if the patient is on leave from the hospital). These are depicted in different colours. Patient details are shown if a bed is occupied. Thus an overview of the bed status of the ward is maintained.
Administrative module: This module handles user management of the system. Each user has a user type, a user name and a password. The password is stored in an encrypted way in the database for further protection.
System access privileges are assigned to user types. These privileges are assigned to map the current manual operations that are carried out at the ward. For example the nurses can view the patient clinical records but does edit them. The same privileges are allowed in the user type "nurse" in the system. The nurse will be able to view and access the episode information but editing privileges are not granted to this user type. The administrative module has the flexibility to add other administrative functions to the module. (eg user type management, system configuration etc)

Security of the system
The confidentiality of the patients' records are of utmost importance and a key constraint in designing the system. In order to maintain the required level of privacy and protection of data several mechanisms were introduced into the system.
Password protection-Users must login to the system in order to access the system. A user name and a password are given to authorized users of the system.
User access levels-The system has four user types and each type is given only required access, according to the existing methodology adopted in the ward. Level 1 users can enter patient demographic data but cannot view clinical data. Level 2 users can enter demographic data and view patient records but cannot edit them. Level 3 users can enter, view and edit demographic and episode data. Level 4 users have administrative access.
Validation and verification-Validation and verification is implemented throughout the system to avoid loss of data due to human errors. For an example confirmation is sought before deletion of a record and the system is checked before adding a new patient to the system to prevent duplication of data. Validation is also carried out for many data fields. Backups-Automatic system backup mechanism is incorporated to the system to carry out back-up of the system on a regular basis with minimum human interaction. Manual backup facility is also available. Data encryption-Credentials needed for database access is stored separately in an encrypted format and used by the system after decrypting. This will prevent hacking into the system.

Implementation
The system is implemented as a web based system. Initially the system will run on a local area network only. However in the future access through internet which allows access to the system directly from different physical locations such as clinics may be required. Web enabling the system allows it to be smoothly expanded from a local area network to a wide area network and the access capabilities can be expanded accordingly.
Stack of open source software was used for implementation of the system, namely MySQL as the database, PHP, JavaScript and HTML as the scripting languages and Apache server as the web server purposes. Users can access the system using any standard web browser. This combination allows the system to be deployed in both Linux and Windows hosting environments. Use of open source software reduced development cost considerably.

Discussion
This system was developed taking into account the requirements of the University Psychiatry Unit, Colombo. The main advantages of the system are the storage and retrieval of patient data, generation of different types of reports, searching for individual patient records using unique patient number or name, tracking of patient attendance to identify patients defaulting treatment and providing statistical data for research. The use of the database is still in its early stages. Feedback from users will enable modifications to the system which will enhance its capacities.
Although the database was developed based on the requirements of one psychiatry unit it could easily be adopted for use in any psychiatry unit in Sri Lanka. Electronic patient record systems are used in many countries but Sri Lanka still depends only on paper based data recording systems. This system is a pioneering project in use of electronic patient record systems in psychiatry services in Sri Lanka.
It has been designed to facilitate expansion from a local area network to access through the internet. This allows the possibility of linking different psychiatry services in the country.
The data stored in the database can be further utilized to identify different trends and patterns through data mining. Patterns in relapse, genetic relationships between illnesses, illness prevalence in different environments can be identified by running a data mining application on top of the database. The identification of patterns will be a tremendous asset in research and service planning.
Along with the advantages of electronic patient recording systems the users also needs to be aware of the disadvantages. Confidentiality of patient data is one of the main disadvantages of such a system. Because electronic record systems link patients records over many years unauthorized users can access much information. The ability to maintain the patient's right to refuse access to certain information may be difficult in electronic patient recording systems. When electronic data systems are available nationally clinicians could view the entire health record of the patient. Patients who do not wish to share sensitive information such as history of psychiatric illness or sexually transmitted disease with certain clinicians may be denied the right to decide what information should remain confidential. Along with development of electronic patient recording systems in Sri Lanka a discussion about its uses and disadvantages should also be initiated.

Conclusion
A system was developed using MySQL database and is hosted on Apache server. It uses only open source software and can be deployed in both Linux and windows environment allowing easy and low cost deployment. Use of the electronic patient record system enhances clinical care and research capacity.