Saturday, January 23, 2010
Shortened patient names when displaying more than three columns
This fix changes the length of the names displayed in the appointments page.
sudo vi /usr/share/tomcat5.5/webapps/oscar/provider/appointmentprovideradminday.jsp
#update the values here:
int lenLimitedL=11, lenLimitedS=11; //L - long, S - short
if(numProvider >= 5) {lenLimitedL = 2; lenLimitedS = 3; }
Restart tomcat.
Nurse Clinics
One work around is to change them to 'doctor' in the provider section, set a schedule for them, and then change them back.
However, this is cumbersome - especially if you have a large clinic with lots of nurse clinics as we do.
To ensure nurses show up in the schedule section edit the following file:
sudo vi $CATALINA_HOME/webapps/oscar/schedule/scheduletemplatesetting.jsp
Search for both instances of the following text:
param = "receptionist";
and replace them each with:
param = "nurse";
Restart tomcat and that's it!
Advanced Access Appointment Features
To do this, we have a proportion of our appointments marked as 'W' and 'E'.
W appointments can only be booked within one week of the appointment date, and 'E' appointments (for emergency) can only be booked on the day of the appointment.
OSCAR allows us to select 'confirm' to check we want to book such an appointment,
but even the best staff (including doctors!) under pressure to give out appointments frequently ignore this.
So I want a feature that blocks the appointment from being booked at all outside these dates. Such a feature exists in the Scottish GPASS clinical system and is very effective.
To implement it in OSCAR, we need to update the following file on the server (backup the file first in case you want to revert to the original version):
sudo vi $CATALINA_HOME//webapps/oscar/provider/appointmentprovideradminday.jsp
After the line 'String strDay=day>9?(""+day):("0"+day); ' add this code:
Calendar apptDate = Calendar.getInstance();
apptDate.set(year, month-1 , day);
Calendar minDate = Calendar.getInstance();
minDate.set( minDate.get(Calendar.YEAR), minDate.get(Calendar.MONTH), minDate.get(Calendar.DATE) );
String allowDay = "";
if (apptDate.equals(minDate)) {
allowDay = "Yes";
}
else {
allowDay = "No";
}
minDate.add(Calendar.DATE, 7);
String allowWeek = "";
if (apptDate.before(minDate)) {
allowWeek = "Yes";
}
else {
allowWeek = "No";
}
Update this line to add the text in bold:
<a href=# onClick="confirmPopupPage(400,780,'../appointment/addappointment.jsp?provider_no=<%=curProvider_no[nProvider]%>&bFirstDisp=<%=true%>&year=<%=strYear%>&month=<%=strMonth%>&day=<%=strDay%>&start_time=<%=(hourCursor>9?(""+hourCursor):("0"+hourCursor))+":"+ (minuteCursor<10?"0":"") +minuteCursor %>&end_time=<%=(hourCursor>9?(""+hourCursor):("0"+hourCursor))+":"+(minuteCursor+depth-1)%>&duration=<%=dateTimeCodeBean.get("duration"+hourmin.toString())%>','<%= dateTimeCodeBean.get("confirm"+hourmin.toString()) %>','<%= allowDay %>','<%= allowWeek %>');return false;"
Then replace the following code:
function confirmPopupPage(height, width, queryString, doConfirm){
...
}
with this code:
function confirmPopupPage(height, width, queryString, doConfirm, allowDay, allowWeek){
if (doConfirm == "Yes") {
if (confirm("Are you sure you want to book this appointment?")){
popupPage(height, width, queryString);
}
}
else if (doConfirm == "Day"){
if (allowDay == "No") {
alert("ADVANCED ACCESS - RESTRICTED APPOINTMENT WARNING!\n\nSorry, this appointment can only be booked on the same day.");
}
else {
popupPage(height, width, queryString);
}
}
else if (doConfirm == "Wk"){
if (allowWeek == "No") {
alert("ADVANCED ACCESS - RESTRICTED APPOINTMENT WARNING!\n\nSorry, this appointment can only be booked within one week of the appointment time.");
}
else {
popupPage(height, width, queryString);
}
}
else {
popupPage(height, width, queryString);
}
}
Then restart your tomcat server for the changes to take effect:
sudo /etc/init.d/tomcat5.5 restart
To make this work properly, you will need to manually set the confirmation codes on the database (replacing 'E' and 'W' with the codes for your same day and one week appointments on your templates):
mysql> update scheduletemplatecode set confirm='Wk' where code='W';
mysql> update scheduletemplatecode set confirm='Day' where code='E';
(You could re-write the templates page to accept a text input, but I can't be bothered!)
Wednesday, December 30, 2009
OSCAR mods: Improving the Consult request letter
Unfortunately, there is no way to change this without altering the OSCAR code.
The good news, though, is that this alteration is relatively straightforward.
First, log into your server as an administrator (don't forget to back it up first!).
Then edit the following file:
/usr/share/tomcat5.5/webapps/oscar/oscarEncounter/oscarConsultationRequest/ConsultationFormPrint.jsp
You should backup the original before making any changes with, for example:
sudo cp /usr/share/tomcat5.5/webapps/oscar/oscarEncounter/oscarConsultationRequest/ConsultationFormPrint.jsp /usr/share/tomcat5.5/webapps/oscar/oscarEncounter/oscarConsultationRequest/ConsultationFormPrint.jsp.bakYou will see that the file contains the layout for the consultation request, and that by modifying the file you can alter the layout.
I've created a version that will fit into a double window envelope showing my clinic address and the name and address of the specialist I am referring to. You can view my version of the file here.
Once you have saved the new version of this file, then restart tomcat to make the changes take effect.
OSCAR mods: Named physician on all scripts
However, with a standard OSCAR install, this results in their names coming up as the prescriber rather than me.
To alter this so that your name always appears on prescriptions:
Log into your server and type:
sudo vi /usr/share/tomcat5.5/webapps/oscar/oscarRx/Preview.jsp
Then search for the sections that contains the line <%=doctorName% > and replace <%=doctorName %> with your name.Save the file and restart tomcat for the changes to take effect.
Tuesday, December 29, 2009
Run complex searches for CPP, encounter, and medication data using Report by Template
It allows searches to be run on the OSCAR database using templates that can be created by the user.
These templates allows you to perform complex searches for data in either the CPP and encounter sections of the eChart or the medication lists. It includes:
- Multiple search strings combined with AND/OR operators.
- Exclusion of patients already on a chronic disease register from the search.
- Searching of patients by registration status.
I use this search to periodically check for patients with conditions that may have accidentally not been added to our chronic disease registers (for example, patients with diabetes).
You can use this search by clicking on the 'Add Template' link in the Report By Template page on OSCAR and then copying and pasting this tex into the box (for the CPP/Encounter searchest or this text for medication searches. Click on EDIT to save your changes, then DONE to use the template.
Note: Searches using this template can take a long time to run and use a lot of resources. You should save them for when the server is not in heavy use.
Sunday, December 20, 2009
Walk In Clinic Swipe-Card System
This means needing to be able to take any patient, not just ones registered with us, and quickly enter them into the system and add them to the next appointment slot.
This script does all of that using a card-swipe.
1. The patient presents their health card
2. Our receptionist swipes on her reception computer. This brings up the patient's details on her screen.
3. The receptionist enters any extra data we want (their phone number and their own family doctor's name, which she selects from a list)
4. The patient is then automatically entered into the OSCAR EMR demographic table (if not already present) and given an appointment time which is automatically entered into the OSCAR EMR appointment table.
5. The script asks for the next patient, calculating the next appointment time based on the start time and appointment lengths entered by the receptionist when she first opened the script.
You can download the script here.
This print script prints out letters for the patients' own Family Doctors and can be run at the end of the clinic.
Online Registration for New Patients
I recently wrote and tested an online registration system that displayed the number of spaces available, and allowed patients to register all of their details online when space was available.
You can view our implementation from my clinic home page.
The patients enter not just demographics, but their medical history, medications, allergies, social history, family history, and preventions history (eg: date of last PAP). This is then imported into OSCAR so it is all available in the appropriate sections of the EMR when they come to visit.
We registered over 2500 patients in two months using the system, and it was fantastic. It saved me hundreds of hours of staff time as checking data is far, far faster than entering it by hand.
The system requires two servers (the usual OSCAR EMR server and a separate, but secure, web sever that is not connected to the OSCAR server) and has several parts:
1. The spaces available script - this script resides on the OSCAR server and generates text files containing the number of spaces available for registration (in plain text and as a javascript insert).
2. The sync script - this script resides on the OSCAR server and synchronizes the output of the spaces available script above between the OSCAR server and the web server.
3. The link to the registration page - usually found on the clinic home page, it lists the number of spaces available and links to the registration page.
4. The registration page script - this CGI script resides on the web server. You will need to have an SSL certificate for this page for security reasons, and you will need to have your Apache web server set up so that this page can only be accessed using https.
5. The data harvesting script - this resides on the OSCAR server and pulls registrations from the web server to the OSCAR server for processing.
6. The processing script - this resides on the OSCAR server and processes registrations, including checking that the patient is not already registered, and imports the patient data into OSCAR. It then emails the patient a confirmation email.
You can download each part of the system using the links above.
(Scripts still to be uploaded - coming soon!)
Importing Demographic Data
This script does that.
(Script still to be uploaded - coming soon!)
No Show Letters
This script can be run on a regular basis to print out letter for patients that fail to attend. It will search for patients that have missed an appointment and print out a letter to them.
The first letter will be a warning letter only.
Subsequent letters for the same patient (on future runs) will do two things:
1. It will mark them as 'Inactive' and 'SU' roster status (for suspended) in the demographic list. This prevents them from making any further appointments until the staff update their status.
2. It will print letter informing them that they will remain suspended until they pay the fee for the missed appointment.
Note that this script requires a new table to be created in the database to store no-show data. Also, note that correcting information (for example, where a letter has been sent in error) currently needs to be done manually on the database.
Also, if you have any searches that run on 'active' patients, you might want to update them to include inactive patients with the 'SU' roster code.
You can download the script here.
Instructions for installation are listed in the script. It is written to run on a CLIENT machine, but can be modified to run on the server (via a cron script with a connected printer).
Saturday, October 10, 2009
Connecting to OSCAR over the internet
You can connect to your OSCAR EMR over the internet, securely, from home.
You can do this simply by having your server on a fixed IP address and opening up port 8443 on your server to incoming traffic and then typing 'https://yourseveripaddress:8443/oscar' into your browser.
However, this allows anyone to access your login page.
A more secure method is to use an SSH tunnel to connect to your server. This means that only port 22 (the secure SSH port) is open to the outside world.
We'll assume for this post that your server SSH is securely set up (you have fail2ban installed to protect against brute-force attacks, only port 22 is open on your firewall, and you have your SSH users set up securely). We'll also assume that you have your router and fixed IP address set up.
1. Set up the SSH tunnel on the computer that you are going to use to log in (linux or mac):
Open up terminal and type:
ssh -nNL 8443:127.0.0.1:8443 yourusername@$yourserverIP &> /dev/null &
You will be asked for your password for the server.
This opens an SSH tunnel from your computer to your OSCAR program on the remote machine.
2. Set up firefox to use the tunnel
Install the foxyproxy firefox add on via tools -> add ons
Set up a new proxy as follows in the foxyproxy options:
Mode: use proxies based on their pre-defined patterns and priorities
Click on Add New Proxy
Under Proxy Details tab enter:
Select Manual Proxy Configuration
Host: localhost
Port: 8080
Tick SOCKS proxy v5
Under the URL patterns tab click add new pattern:
Pattern name: OSCAR
URL pattern (include the *s): *localhost:8443/oscar*
Save the pattern and the new proxy.
3. Connect to OSCAR
Type https://localhost:8443/oscar into your address bar.
You will be asked to confirm that you trust the server SSL certificate - confirm the exception and if all is well you will be connected to your login page.
More info:
SSH guide: http://unixwiz.net/techtips/ssh-agent-forwarding.html
How to use a key to avoid having to type your password each time:
http://www.debian-administration.org/articles/152
Wednesday, August 19, 2009
Setting up safer access to the MySQL database
It is important to be very, very careful with the root login to mysql as the root user can do anything - you don't want to accidentally delete your whole database when you only meant to ask how many users you have!
Clearly, it is important to make sure you have a regular archived backups of your database (not just incrementals, as you don't want to delete in the backup what you accidentally deleted in the live database).
However, I also strongly recommend that you set up 'read only' and 'read and write only' MySQL logins which you can then use more safely when writing scripts or accessing the database manually via MySQL.
First, log into your OSCAR server via SSH (eg: from a terminal app type ssh yourusername@yourserver.address).
Then log into MySQL as an administrator (eg: mysql -uroot -p). You will need the MySQL password.
Then grant the necessary privileges to your two new users:
mysql> GRANT all ON oscar_mcmaster.* TO OscarRead@localhost IDENTIFIED BY '[password1]';
mysql> GRANT select ON oscar_mcmaster.* TO OscarWrite@localhost IDENTIFIED BY '[password2]';
Now log out as root from MySQL:
mysql> exit
and log in again as the read only user:
mysql -uOscarRead -p
When you want to write to the database, log out and log in again as OscarWrite:
mysql> exit
mysql -uOscarWrite -p
I recommend using an alias in your .bash_profile on the server to make access to the OSCAR database simpler:
exit MySQL:
mysql> exit
and open up .bash_profile for editing:
vi ~/.bash_profile
add the following lines (scroll down to the bottom of the file and type 'i' to enter input mode)
alias sqloscar='mysql -u OscarRead -p[password1] oscar_mcmaster -A'
alias sqloscarwrite='mysql -u OscarWrite -p oscar_mcmaster -A'
alias sqloscaradmin='mysql -u root -p oscar_mcmaster -A'
Exit input more (hit 'esc' key) and save and quit:
:wq
You can now simply type 'sqloscar', 'sqloscarwrite', and 'sqloscaradmin' from the server command line to access the three levels of MySQL security.
As soon as you have completed the write (or admin) task, log out of MySQL and log back in again as the read-only user. This minimizes the risk of typo-disasters.
Important Note: if you're bash_profile can be accessed by other users on the system that should not have read access to the database, then don't include password1 in the .bash_profile.
OSCAR Mods: Tweaking the appointment status settings
As the appointment icon is clicked on the appointment screen, it advances one status (eg: from 'booked' to 'chart pulled'). The OSCAR manual shows how to make some changes to this setup using the admin section of the EMR, however it is also possible to make more changes.
First, log into your OSCAR server via SSH (eg: from a terminal app type ssh yourusername@yourserver.address).
Then log into MySQL as an administrator (eg: mysql -uroot -p). You will need the MySQL password.
You need to be very, very careful with the root login to mysql as the root user can do anything, so you might accidentally delete your database. Make sure you have a backup of your database before proceeding, or better still set up 'read only' and 'read and write only' MySQL logins which you can then use more safely.
From the MySQL command, select the oscar_mcmaster database:
mysql> use oscar_mcmaster;
You can show a list of appointment status settings by typing:
mysql> select * from appointment_status;
+----+--------+--------------+---------+--------------+--------+----------+
| id | status | description | color | icon | active | editable |
+----+--------+--------------+---------+--------------+--------+----------+
| 1 | t | Booked | #FDFEC7 | starbill.gif | 1 | 0 |
| 2 | T | Chart Pulled | #FDFEC7 | todo.gif | 0 | 0 |
| 3 | H | Arrived | #00ee00 | here.gif | 1 | 1 |
| 4 | P | Being Seen | #FFBBFF | picked.gif | 1 | 1 |
| 5 | E | Left | #FFFF33 | empty.gif | 1 | 1 |
| 11 | N | No Show | #999999 | noshow.gif | 1 | 0 |
| 12 | C | Cancelled | #999999 | cancel.gif | 1 | 0 |
| 13 | B | Billed | #3ea4e1 | billed.gif | 0 | 0 |
| 6 | a | Customized 1 | #897DF8 | 1.gif | 0 | 1 |
| 7 | b | Customized 2 | #897DF8 | 2.gif | 0 | 1 |
| 8 | c | Customized 3 | #897DF8 | 3.gif | 0 | 1 |
| 9 | d | Customized 4 | #897DF8 | 4.gif | 0 | 1 |
| 10 | e | Customized 5 | #897DF8 | 5.gif | 0 | 1 |
+----+--------+--------------+---------+--------------+--------+----------+
If you want to stop using a particular status in OSCAR (eg: skip the 'chart pulled' status, which can't be done from the admin screen in OSCAR), then - from a read-and-write MySQL login - type:
mysql> update appointment_status set active='0' where id=2;
If you would like to make all items editable in the Admin screen, then - from a read-and-write MySQL login - type:
mysql> update appointment_status set editable='1';
If you would like to add a new status line, then - from a read-and-write MySQL login - type:
mysql> insert into appointment_status set
id='14',
status='z',
description='New Status',
color='yellow',
icon='someicon.jpg',
active='1',
editable='1';
When you are finished exit MySQL:
mysql> exit
Have fun!
Saturday, August 1, 2009
Waiting Room Display
I've set up a display for the waiting room in my clinic which will show patients the current waiting time for each doctor/nurse consulting that day in the clinic.
The clinic details, waiting times, and messages of the day, are displayed on a web page that can be accessed from anywhere. (You can view our page here).
The 20" display is wall mounted and linked to a computer in our reception which displays the web page. (The computer is a dumb terminal that just has firefox running - so no security concerns).
The webpage is served from a separate server (ie: not the one that runs our OSCAR EMR). The OSCAR server runs a perl script every minute which sends a data file to the web server (a one way SSH key based login allows one way traffic from OSCAR to the server without comprimising security - much as MyOSCAR does).
This data file is then called by the web pages to display the names of the providers with booked appointments for that day, and whether those providers are running late or to time. The perl script and website auto-update every minute.
This is a very useful feature for patients and staff as the patients now have a good idea of how long their wait will be and can plan accordingly, and the staff don't get pestered with requests and 'evil eye' stares from punters that are in the dark about how long they are going to have to wait.
You can download the script here and the html for the webpage here - details of how to install the script on an Ubuntu machine are included in its comments section at the start of the file.
You can use a VGA splitter (or VGA twin cable if you can keep the distance short) to feed a second monitor cable through the wall to your waiting area and wall mount the monitor (or try one of these devices to run the monitor signal over your existing ethernet/cat5 cable system). You can then start up firefox when you open up in the morning (hit F11 to make it fullscreen), and close it again when you finish.
(Updated 10th Oct 2009 to new version)
Sunday, July 12, 2009
Scanning Script

Scanning in documents to the electronic chart is the most time consuming part of a paperless system.
I'm now using a perl script on the scanning computer which communicates directly with the OSCAR database.
This means that the user simply needs to enter the HIN of the patient for each document set and the system will pull up the patient details and ask for a document type and description.
The user then scans the document(s) in - they are then uploaded to the server and the patient record instantly.
There is also the option to have the user manually enter data for certain document types (eg: if they select Hematology they are asked to input the hemoglobin, HbA1C, and ESR results if present). These are then also entered in the patient chart automatically when the document is scanned.
If 'mammogram' or 'pap' is selected as the document type, then the user can be asked if the result is abnormal or normal and to enter the suggested return date which are then entered in the system. A tickler is created for the patient's doctor if the result is abnormal.
This is making our scanning very efficient and is helping us with our chronic disease management / prevention as we are not currently receiving electronic lab results.
You can download a copy of the script - its open source, like OSCAR. There is another simplified version that is designed just for batch 'old chart' scanning called 'oldchartscan.pl'.
(latest script versions Dec 20th 2009 - note the 'delete' function may not work in the current script).
There are instructions at the start of the script on how to use it.
**IMPORTANT SECURITY NOTE**
These scripts involve logging into the MySQL database on your OSCAR server. They do this via an SSH tunnel, but this tunnel could be used to gain access to the MySQL database directly using the password in the script. To prevent unauthorized data access, make sure that (1) the script permissions only allow the script to be run (not viewed), (2) these scripts are only run from machines that are secure from unauthorized physical access when they are running, and (3) that the SSH login key password is only known by trusted members of staff.
Saturday, June 13, 2009
How to upgrade OSCAR to the latest version
Oscar guru David Daley has an excellent 'how to' for doctors that want to set up OSCAR EMR for their clinic.
However, OSCAR is constantly being updated and improved upon. New features are being added, and bugs fixed by a small army of volunteer and professional programmers around Canada (and the world). The fantastic thing about open source is that when a family doctor in Saskatoon adds a new feature, it can become available to everyone else who uses OSCAR. The code for OSCAR is stored in a repository which is constantly updated.
To take advantage of the latests stable version of OSCAR, you can upgrade your system for free. Here's how.
Notes:
i. This how to assumes that you have installed using the settings and locations in David Daley's how-to which I have cribbed from here to create the update how-to).
ii. I use vi ‘vi’ as my text editor, but it is not for everyone. If you want to use another editor, replace ‘vi’ in the commands that follow with, for example, nano.
Log into your server using terminal.
Backup your server (if the update goes horribly wrong, it is essential that you can roll back your server to what you had before).
Change to your backup folder.
cd /usr/local/backups
We're going to create a backup script to totally backup your oscar installation, so open a new file:
sudo vi extendedBackupOSCAR.sh
Enter the following text and save the file:
#!/bin/sh -e
#set the backup directory name
installation=oscar
backup=/usr/local/backups
mysql_root_password=*******
oscarname=extended.$installation.backup
backupdir=$backup/$oscarname-`date +%F`
#create the backup directory
mkdir $backupdir
#dump the mysql data into the backup
sqlname=$oscarname.sqldump.`date +%F`
/usr/bin/mysqldump --add-drop-table -uroot -p$mysql_root_password oscar_mcmaster > $backupdir/$sqlname.sql
gzip $backupdir/$sqlname.sql
#tar the oscar server
tarname=$oscarname.webapps.`date +%F`
tar -cf $backupdir/$tarname.tar /usr/share/tomcat5.5/webapps
gzip $backupdir/$tarname.tar
Run the script:
sudo ./extendedBackupOSCAR.sh
Now transfer the backup files you just created to somewhere safe (make sure that they are stored encrypted and/or securely as they contain all your patient information).
Update the source code on your system
We are going to update to OSCAR 9.05 in this example (by setting the date for 31 May 2009).
cd $HOME/src/oscar_source
cvs -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster login
(you will be asked for a password, you can leave this blank).
cvs -z3 -r -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster co -r RELEASE_9_06 oscar_mcmaster
cvs -z3 -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster co -P -D "2009-07-20 23:59:59" drugref
cvs -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster logout
Wait for the files to download, then compile the new version of the software.
cd $HOME/src/oscar_source/oscar_mcmaster/build
ant
Once the build is finished (you should get a 'Build Successful' confirmation message), transfer ONLY the updated oscar.war file to your tomcat server:
**WARNING! copying all the .war files over (ie: including the OscarDocument.war file) will delete all of you uploaded documents such as scanned results and old charts.**
sudo cp $HOME/src/oscar_source/oscar_mcmaster/build/tmp/oscar.war $CATALINA_HOME/webapps/
and restart the tomcat server
sudo /etc/init.d/tomcat5.5 restart
Update the MySQL database
Now you need to update your MySQL database with any changes that have taken place since the last update.
First, we move to the oscar mysql updates directory and list all the MySQL update files:
cd $HOME/src/oscar_source/oscar_mcmaster/database/mysql/updates
ls -l
We need to run all the files ending in .sql which have a file name with a date BETWEEN the last installation date and our chosen update date. Run them in date order (oldest first).
(Replace ****** in the following with your MySQL root password.)
mysql -u root -p******** oscar_mcmaster < update-YYYY-MM-DD.sql
Then, we do the same with the caisi mysql updates directory and list all the MySQL update files:
cd /home/robbie21/src/oscar_source/oscar_mcmaster/database/mysql/caisi/updates/
ls -l
Again, we need to run all the files ending in .sql which have a file name with a date BETWEEN the last installation date and our chosen update date. Run them in date order (oldest first).
(Replace ****** in the following with your MySQL root password.)
mysql -u root -p******** oscar_mcmaster < patch-YYYY-MM-DD.sql
Update the DrugRef database
Delete the old drug ref folders and replace them with the new ones:
sudo rm -R /usr/local/DPD
sudo rm -R /usr/local/drugref-ca_1_5
sudo mkdir /usr/local/DPD
sudo mkdir /usr/local/drugref-ca_1_5
sudo cp $HOME/src/oscar_source/drugref/drugref2/DPD/* /usr/local/DPD
sudo cp $HOME/src/oscar_source/drugref/drugref2/drugref-ca_1_5/* /usr/local/drugref-ca_1_5
sudo chown -R postgres:postgres /usr/local/DPD
sudo chown -R postgres:postgres /usr/local/drugref-ca_1_5
Now change users to the postgres user:
su - postgres
Run postgresql and elete the old drug ref database
psqlwhich will bring up the postgresql prompt 'postgres=# '
drop database drugref2;and you should get back the confirmation 'DROP DATABASE'.
Quit out of postgresql:
\qOnce back at the normal command line, move to the new drug ref folder.
cd /usr/local/DPD
Make the scripts executable:
chmod +x create_database.sh
chmod +x import_dpd.sh
And run the scripts to create the new database. The second command will download the latest drug database from Health Canada. This import script will take some time, so be patient (a good time to get a fresh coffee). You can ignore the ERROR: table "*****" does not exist CREATE TABLE messages.
./create_database.sh
./import_dpd.sh
We need to add a new first line to the DrugRef calling program to compensate for a python issue.
First, edit the file:
vi /usr/local/drugref-ca_1_5/drugref_service.py
And now add as the very first line (including the hash # sign):
# coding: latin-1
Save that file, and then exit from the postgres user account.
exit
That's it!
Check everything is working by logging into OSCAR.
That's it!
Thursday, June 11, 2009
How many patients do I have?
These tools, called Query by Example and Report by Template, allow users to search for any combination of information on the database.
One of the things that amazed me when I came to Canada was that many of the GPs I spoke to did not know exactly how many patient they had.
With OSCAR, we simply go to 'Query by Example' and enter the following search line:
select count(*) AS 'Number of Active Patients' from demographic where patient_status='AC';
Hit the QUERY button and up pops:
Number of Active Patients
305
Ok, that's pretty simple.
But what about patients who are on our system but may have moved away, moved doctors etc.. This is a perennial problem for doctors.
Let's try a report template for this one.
First we need to save our template to a blank text file. Open up a text editor (for example, notepad on Windows, TextEdit on the mac, gEdit on Ubuntu) and cut and paste the following:
<report title="Admin - Stragglers" description="Lists patients who have not booked an appointment for a user-defined period of time.">
<query>
SELECT hin AS 'Health#',
CONCAT(last_name,', ',first_name) AS 'Name',
CONCAT(year_of_birth,'-',month_of_birth,'-',date_of_birth,' ') AS 'DoB',
phone AS 'Phone #',
CONCAT(address,',',city,' ',province,' ',postal) AS 'Address'
FROM demographic
WHERE patient_status='AC'
&& (roster_status='' || roster_status='RO')
&& demographic_no NOT IN (
select demographic_no
FROM appointment
WHERE appointment_date > DATE_SUB(NOW(), INTERVAL {qty} {unit})
GROUP BY demographic_no
)
GROUP BY demographic_no
ORDER BY Name
;
</query>
<param id="qty" type="list" description="Not seen for QUANTITY:">
<choice id="1">1</choice>
<choice id="2">2</choice>
<choice id="3">3</choice>
<choice id="4">4</choice>
<choice id="5">5</choice>
<choice id="6">6</choice>
<choice id="7">7</choice>
<choice id="8">8</choice>
<choice id="9">9</choice>
<choice id="10">10</choice>
<choice id="11">11</choice>
</param>
<param id="unit" type="list" description="Not seen for UNIT:">
<choice id="YEAR">years</choice>
<choice id="MONTH">months</choice>
</param>
</report>
In the main OSCAR screen, click on ADMIN, then REPORT BY TEMPLATE. Click on ADD A NEW TEMPLATE. Browse for the text file you just saved and click 'UPLOAD'.
Voila - you now have your saved report template.

Select how far back you want to go and hit run: you will then get a print out of the names, health numbers, phone numbers, and addresses of all your active patients who have not booked an appointment in the last x years.
The searches have endless uses, and allow you to take your patient care to a level that is simply not possible with paper charts (or is very, very, very, very, prohibitively, very time consuming with paper charts).
For example, how many of my diabetic patients have had their eGFR checked in the last year? How many of my diabetic patients are not on an ACE inhibitor? How many of my diabetic patients are not on a statin? How many patient are being prescribed diabetes medications but are not on our diabetes register for regular follow up? Etc. Etc.
There are lots of pre-written searches available on the OSCAR canada websites and on the user forums. However, if you are interested in writing your own (or paying someone to write them for you), the queries are all written in the widely-used SQL language which every professional programmer can understand. There is also a 'cookbook' which I would recommend to anyone (the MySQL Cookbook).
Monday, March 30, 2009
Firefox printing bug fixes for eForms
One of the things I really love about OSCAR is the eForms feature. This allows users to create their own forms, including scanning in local forms and being able to add HTML code which allows them to be filled and printed out from the computer.
Firefox is a good choice of browser when using OSCAR EMR - it has superior features, better browser compliance, and better security.
However, there are some problems with Firefox printing. Specifically, with complex forms, it can sometimes only print the first page and ignore the rest.
This affects OSCAR eForms that are more than one page long.
There are two solutions to this problem when designing eForms for OSCAR EMR, and I'll demonstrate both solutions here. I've included links to sample forms which you can download with these solutions included.
Firstly: the simple solution.
This is based on the information in Jaffer Heider's blog
1. Floating Elements
You need to unfloat all floated elements in your css style sheet:
.my-floated-elements {
float: none !important;
}
2. Overflow
Overflow must be set at 'visible':
.css-element {
overflow: visible !important;
}
3. Position
If any elements from the second page (or subsequent pages) are positioned absolutely, then you need to position them relatively:
.css-element {
position: relative;
}
4. Height
If the height of your body is set to 100%, that may also cause a problem. Remove this setting if it is present.
5. Set all widths to ‘auto’ for container divs.
This produces forms which will display and print normally, even if it is more than one page long.
However, the main problem from an eForms point of view is that to get the checkboxes and text entry boxes superimposed on the scanned image of the form, you have to use absolute positioning (relative positioning can only be used to position elements around each other, not on top of each other).
This means that the simple solution won't allow you to have user input in the second or subsequent pages, which brings us on to:
Secondly: the less simple solution.
For this we need to set up the form with all of the pages and elements on a single page. Clearly, this means that the form is an unusable mess all jumbled together, so we need to set up a style sheet for each page (thanks to OSCAR user Steve Carnis who suggested this solution to me and Christopher Heng at TheSiteWizard.com for some of the javascript).
When we select the style sheet for page 1 it hides everything except the page 1 elements, page 2's style sheet hides everything except the page 2 elements, etc..
We can then set the form up to display page 1 when it loads, and we include buttons to allow each page to be displayed separately (the buttons are linked to javascript within the form that changes style sheet). The user can then move between pages and print each page in turn.
To set up the form, you need to:
1. Create a style sheet for each page - simple text documents named 'oscar_page1.css', 'oscar_page2.css' etc. containing just the following code:
div#page1
{
display: inline;
visibility: visible;
}
div#page2
{
display: none;
visibility: hidden;
}
Change the page numbers so that the page you want displayed has the 'inline/visible' tags, and all the other pages have 'none/hidden' tags.
2. Insert a link to each style sheet just after the <head> tag in the eForm.
<link rel="stylesheet" type="text/css" title="page1" href="http://YourServer.com/oscar_page1.css">
<link rel="stylesheet" type="text/css" title="page2" href="http://YourServer.com/oscar_page2.css">
3. Add an ID to each <div> in your form so that the browser knows which page it belongs to.
eg:
<div id="page1">
for any DIV that should be on page 1. Do this for the divs for each page. This includes, clearly, your form images.
4. Add this javascript code somewhere between the <head></head> tags in the eForm:
<SCRIPT LANGUAGE="JavaScript">
function FormSetup() {
changeStyle('page1')
}
function changeStyle(css_title) {
var i, link_tag ;
for (i = 0, link_tag = document.getElementsByTagName("link") ; i < link_tag.length ; i++ ) {
if ((link_tag[i].rel.indexOf( "stylesheet" ) != -1) && link_tag[i].title) {
link_tag[i].disabled = true ;
if (link_tag[i].title == css_title) {
link_tag[i].disabled = false ;
}
}
}
}
function pagePrint(title) {
changeStyle(title);
window.print();
}
</SCRIPT>
5. Make sure page 1 is selected when the form loads by changing the opening <body> tag:
<body Onload="FormSetup()">
This runs the script above (FormSetup) which loads page 1.
6. Add the buttons which control which page to view/print.
These should be added at the end of the form after all the other elements (otherwise, they might not show up).
<div class="DoNotPrint" style="position: absolute; top: 10px; left: 10px;">
<table>
<tr>
<td class="subjectline">
<input type="button" value="View Page 1" onclick="javascript:changeStyle('page1')" class="button">
<input type="button" value="View Page 2" onclick="javascript:changeStyle('page2')" class="button">
<input type="button" value="Print Page 1" onclick="javascript:pagePrint('page1')" class="button">
<input type="button" value="Print Page 2" onclick="javascript:pagePrint('page2')" class="button">
Description: <input name="subject" size="10" type="text">
<input value="Save" name="SubmitButton" type="submit">
<input value="Reset" name="ResetButton" type="reset">
</td>
</tr>
</table>
</div>
You can view examples of this solution in action here:
2 page form
css for page1
css for page2
Sunday, March 8, 2009
Paperless
Reports, letters, and results are now being scanned into the patient's electronic record after they have been checked and all patient encounters and prescriptions are being handled via the EMR as well.
No more paper charts!
Anyone in PEI interested in seeing how a paperless practice works should visit me downstairs at the Sherwood Medical Center, Charlottetown.
Getting PDF files to open up within Firefox
To get these documents to open up within Firefox 3 in Ubuntu, do the following:
Open up terminal (Applications -> Accessories -> Terminal)
Type in:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
(you'll be asked for your password)
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update
sudo apt-get install acroread mozilla-acroread acroread-plugins
Restart firefox and open up the firefox preferences (Edit -> Preferences).
In the 'Applications' tab, check that under Adobe Acrobat Document the 'Use Adobe within Firefox' item is selected.
You should now be able to open PDFs within firefox.
Friday, February 20, 2009
High Scoring OSCAR not on CanadianEMR

OSCAR users have been questioning why CanadianEMR is shutting out OSCAR from it's reviews.
Despite scoring very highly from user reviews, those reviews do not appear on the Canadian EMR website.
CanadianEMR claim on their site to be a good source of information for physicians considering which EMR to choose. CanadianEMR is an authoritative and widely recognized national resource for physicians, medical office staff, healthcare planners, government organizations, and vendors of EMR systems.
However, when asked why the reviews of OSCAR - the free, Canadian, open source, EMR - were not appearing on their website, Alan Brookstone of CanadianEMR had this to say:
I have had this discussion with the OSCAR team. They are aware that there is a monthly fee to participate (that is partly what subsidizes the service in terms of support and development), however feel that they cannot put together sufficient to support the monthly payment ($349/month).
It would appear that Canadian EMR is only an 'authoritative' source of information on EMRs if you pay them lots of money.
That sounds an awful lot like paid advertising to me.
Interestingly, CanadianEMR does not provide a 'value for money' score for rated EMRs but does provide a 'support experience' score. Clearly, companies that charge a lot of money for a system are going to have more customer support than an open-source system that is free to download. Nonetheless, OSCAR scores well compared with the other top 10 paid-for EMRs in the CanadianEMR website.
Alan does say he is working on a way to allow non-paying software like OSCAR to receive reviews, and he provided us with the above 'unverified' review statistics that are, sadly, not available on their website.
Sunday, February 1, 2009
PEI forms
The forms are great and allow you to print out lab, xray, and drug exemption requests containing the patient's demographics as well as your own details.
A fantastic time saver!
To install the forms on OSCAR, you need to download the background images and the eForms sql file - import the SQL file into the oscar database.
You will need to edit each eform to replace my name with your doctor's details and to point the image in the form to your local image location.
PEI eForms SQL import file
PEI eForms images
For information on how to create your own eForms see the OSCAR website.
http://www.locum123.com/downloads/pei_xray.txt
Sunday, January 4, 2009
OSCAR Installation Costs
Richard Stallman, very much the face and voice of the Open Source movement, is keen to point out that open source means free of restrictions (like free speech) rather than free of cost (ie: not free beer!).
OSCAR software is both, in that you won't pay a cent for the software. However, it does have costs associated with it in terms of time and equipment. These costs will vary enormously depending on where you start from (ie: how much time you have already spent learning how to set up, run, and use computers yourself, and how much equipment you have already purchased).
In this section, we'll look at how those costs vary for different OSCAR installation scenarios.
1. The Zero Cost Scenario
Office size: single physician office, one receptionist, one nurse. 1500 patients.
Baseline IT: The physician is very IT savvy and knows how to set up and maintain a linux server. She already has a computer set up in her office, the nurse's office, and at the reception desk. All three computers are connected to the internet and each other via a local area network, have a laser printer and a label printer already installed. Her receptionist has used an EMR before in a previous job, and her nurse is quite computer literate.
Installation Plan: The physician decides to use a spare PC that she has at home as the server. It has a large enough hard drive, enough memory (RAM), and a fast enough processor to meet the minimum specifications for running Oscar (as listed in David Daley's excellent installation how-to). She downloads and installs the (free, open source) Ubuntu operating system on the server and then installs OSCAR (again, following David's instructions).
She plans to do this, and test the installation over the weekend. She searches online for any information she needs, including a free PDF copy of the OSCAR user manual.
She plans to see the patients in her room mainly, with the computer, and use the two examination rooms (without computers) as needed.
She plans to book no patients for Monday so she can train the staff in the use of OSCAR. She instructs her receptionist to enter the details for the patients for the rest of the week on Monday afternoon, and to enter other patient details as they are booked in. She expects to add one hundred patients per week for the first three months and have almost all patients to be on the system by the end of one year.
Total cost: $0
Ongoing costs: $0
Note: Although there are opportunity costs to this installation (the lost billings from Monday, losses due to the system being slow while the staff get used to it, and the cost of the receptionist's time as she enters patient demographics into the system) these should be compensated for by efficiency gains very rapidly.
Note 2: Had she not had a spare PC to install OSCAR on, the cost of a PC with the minimum specifications for a small office installation (eg: Dell Inspiron 530s) can be as low as $450 including taxes.
2. The Low Cost Scenario
Office size: three physician office, two receptionists, two nurses. 4500 patients.
Baseline IT: The physicians are computer literate, but they do not know much about setting up linux servers. They already have computers set up in their clinical rooms, their offices, and at the reception desk. All computers are connected to the internet and each other via a local area network, have access to a laser printer and a label printer (some of them to a central printer). Their receptionists have used a computerized billing and appointment system but not an EMR. The nurses are computer literate.
Installation Plan: The physicians plan to purchase a server with OSCAR pre-installed and to have a local IT expert set it up for them and provide regular support. They have discussed backup options with their IT provider, and have opted for a rotating backup to a series of USB keychains. One of them will store the backup discs securely in a safe at home.
The IT provider arrives as planned, sets up the OSCAR server and connects it to the existing computer network. The physicians close the office for the day to allow the installation and training.
They instructs their receptionists to enter the details for the patients for the rest of the week on Monday afternoon, and to enter other patient details as they are booked in. They expect to add two hundred patients per week for the first three months and have almost all patients to be on the system by the end of one year.
Costs:
Hardware: One server with Ubuntu pre-installed with surge protection and battery backup $1400
Time for IT installation and training: 7 hours @ $85/hr = 595
TOTAL SETUP COST: $1995
(Cost per physician: $665)
Ongoing Costs: Basic IT support package $200/month
Note: Again, the opportunity costs should be compensated for by efficiency gains after the first few weeks.
3. The High End Scenario
Office size: five physician office, four receptionists, one manager, three nurses. 10,000 patients.
Baseline IT: The physicians are computer literate, but they do not know much about setting up linux servers. They share a single, old, computer which has internet access but no printer. The reception has a single, old, computer which has access to a printer but it too is old and in need of replacement. The computers are very slow due to their lack of adequate memory (RAM) and their old processors.
Installation Plan: The physicians discuss their needs with an OSCAR-familar IT specialist who they commission to purchase and install the system.
The specialist recommends that they need to install computers in each of the seven clinical rooms, and that they should purchase a rack server with OSCAR pre-installed. He recommends a separate backup server system.
They plan on installing the computer network first, which should take about two days. It will disrupt the working of the clinic as the system is installed, and will involve a telecom engineer installing CAT5 cables running to each of the rooms.
Once this first phase is completed, the IT specialist installs the servers. This does not disrupt the working of the clinic.
For phase three, a temporary receptionist is hired to relieve the main reception staff who take it in turns to enter demographic details for all 10,000 patients. The IT specialist oversees the reception staff training for this phase. This takes three months.
Finally, the IT specialst returns and trains the staff in the use of the clinical system and a go-live date is picked.
The entire process takes around six months.
Costs:
Hardware:
Rack server with Ubuntu pre-installed $4,000
Surge protection and battery backup $1,000
Backup server $2,000
18 workstation computers @ $400/each = $7,200
18 monitors @ $200 each = $3,600
11 small laser printers @ $80 each = $880
11 small label printers @ $250 each = $2,750
1 large laser printer/copier $750
Installation of CAT5 network system (50 connection ports) $2,000
Router box $500
Locking rack cabinet $1,200
IT specialist time ($100/hr) 40 hours = $4,000
3 months full time receptionist cover $7,000
TOTAL SETUP COST: $36,880
Cost per physician: $7,376
Ongoing Costs: IT support package $500/month
Summary
An IT savvy physician with a reasonable IT setup already in place can install and run OSCAR EMR essentially for nothing.
However, offices that have no IT systems (or systems that are so old as to be obsolete) will require significant outlays in harware and installation to provide adequate internet access to their staff and physicians. This is because without near-patient internet access, OSCAR cannot function. This is true of all EMRs.
Caveat! These examples are entirely hypothetical. Although the hardware costs are reasonably accurate at the time of writing, IT support costs can vary dramatically.
Introduction to OSCAR EMR
What is OSCAR?
OSCAR EMR is a fully functional, open source, electronic medical record that is used by nearly 500 family physicians across Canada. OSCAR EMR is CMS 2.0 spec. government certified for funding in Ontario. It was developed by the family physicians at McMaster University in Hamilton, ON.
Why computerize?
The fact that computerization provides family practice doctors and their patients with significant advantages has been shown in numerous studies over the last ten years.
There are three main advantages:
1. Safety
Computerization offers major safety features. This explains why medical insurers in the US offer discounts on medical insurance premiums for physicians that use an EMR.
The safety advantages include:
- Legibility: no more calls from the pharmacist asking if you really meant to prescribe HRT to Mr Smith, no more huddling round trying to work out what the chart says.
- Availability: no more hunting for missing charts, no more re-scheduling patients because the chart is not available.
- Organizational: the OSCAR chart is automatically indexed and date ordered. No more misfiled entries.
- Clear medication, allergies, and medical history - avoid diagnostic and treatment errors with clear, legible summaries on one page.
- Drug dictionary: OSCAR's automatic interaction checking means safer prescribing and no more calls from the pharmacist to say that the drug you just prescribed interacts with the other medication the patient is taking.
- Chronic medication management - more and more patients are on multiple, complex, medication schedules. OSCAR's prescribing system allows you to easily monitor your patient's medications, increasing safety and improving chronic care.
- Lab results: OSCAR can import lab results automatically into the system. This means faster results delivered straight to the patient chart and reduces the risk of medical errors and adverse events due to delays.
2. Chronic Disease Management and Prevention
Not only does OSCAR have chronic disease flowsheets that can be used to keep track of, for example, diabetes care, but you can use OSCAR to do things that just were not possible before. For example, running searching for patients on particular medications, or keeping an up-to-date disease register, or running searches for all patients with a cholesterol above 4.0, or all diabetic patients who are not taking a statin.
3. Efficiency
Seeing more patients with no more effort. (Or, seeing the same number of patients with less effort = less burnout, better recruitment and retention).
- Medication refills: these visits account for a large proportion of family practice workload. With OSCAR's repeat prescribing system, you can check and re-issue prescriptions in seconds instead of minutes.
- Consultation referrals: OSCAR can quickly and automatically generate referral letters for you. You save time dictating and checking letters, the patient gets seen sooner, and you reduce the risk of letter's going astray.
- (Pharmacists have efficiency savings too as they receive legible prescriptions!)
Fee-for-service doctors could see increases in their billings of 10% or more for the same effort once OSCAR is up and running properly. Salaried systems could see a 10% improvement in patient throughput or an improvement in burnout rates with better recruitment and retention. If PEI has 10% of patients unable to find a family doctor, then introducing OSCAR across the province over the next 2-3 years could solve the problem of orphan patients without the need to recruit more physicians.
Common questions about OSCAR
Isn't this going to cost lots of money?
Actually, OSCAR McMaster is free. The software is free. Updates are free. A server installation takes around an hour from scratch, so installation costs are low.
Basically, you only have to pay for the hardware the server runs on and the time it takes someone to install it for you. That hardware can be purchased for as little as a few hundred dollars or you can rent it (usually for under a $100 a month).
The server is a linux server, so ongoing support costs are low. It is not uncommon for linux servers to be running for months or even years without the need for anything other than regular, automated, software updates.
Of course, OSCAR requires accessible computers with internet access. If your clinic lacks these, then it can be costly to install them. See examples of the cost of installing OSCAR.
The real question is how much money does it cost to NOT have OSCAR? With the very low implementation costs, the potential for increased efficiency, the potential to solve the problem of orphan patients (with the attendant knock on costs for emergency departments and secondary care), and the potential to reduce medical errors, the costs of not implementing OSCAR EMR are incalculable.
The hospital EMR cost $12 million and took years to implement. Are you really telling me that OSCAR only costs $1000 ?
Family practices are small units that operate largely in a static environment. They are much easier to provide an IT solution for.
What about getting all of our patients onto the new system?
This can be very time consuming. However, the simplest and cheapest way to do this is to simply enter each patient's demographics in the system as you encounter them. OSCAR can use a card reader to enter the demographics directly from their PEI Health Card.
Can't we just use the Hospital EMR in the medical practices?
That's not a good idea. Family practice EMRs have very different requirements. Good family practice requires systems for chronic disease management, chronic medication prescribing and monitoring, and regular visits spread out over a long time with a small number of providers.
Hospital EMRs are designed for acute care by a large number of providers over a short period of time. That's why few (if any) family physicians use hospital EMRs for their family practice encounters even if they have access to it.
But is OSCAR safe? Don't you need to pay for secure computer systems?
OSCAR is very safe. It is CMS 2.0 Spec. Ontario Government Certified for Funding in part because it is safe.Ironically, open-source software is safer than the much more expensive proprietary systems. Linux is an open-source operating system and it is much less vulnerable to computer viruses. That is why most web-servers in the world use open source servers: in fact, you rely almost exclusively on open-source security every time you use the web. You're bank relies on open-source SSL to keep your online transactions safe.
What about the support staff in the family practice? They are worried OSCAR will make them redundant.
Support staff have no need to worry about EMRs. In fact, EMRs tend to result in more staff being employed because the patient throughput increases.I've worked in over fifty family practices in the last 10 years. I've not seen one where the introduction of an EMR resulted in a reduction in the number of support staff.
In fact, support staff workload changes little when an EMR is introduced. In most installations, the paper chart is retained for correspondence and workflow reasons.
The only significant change in support staff workload occurs in practices that are totally paperless. In such practices staff no longer have to pull charts but instead have to scan letters and other paper documentation into the electronic charts.
We don't have computers in the clinical rooms, can we still use OSCAR?
You can use a netbook computer (about $400) with a wireless connection (about $100) to access the medical record securely over an SSL connnection from the clinical rooms.Another method is to set up a single 'consulting room' for each doctor for EMR-heavy visits (eg: medication refills, chronic disease management) and then use smaller clinical rooms for examination-heavy visits (eg: abdominal pain).
I can't type very fast and I'm not very computer literate. Won't an EMR slow me down?
OSCAR is a web-based EMR. That means that you access the program the same as any other internet page. Anyone can learn to use the internet, and anyone can learn to use the basic features of OSCAR.Also, being web-based, OSCAR can be used with voice-dictation software. You could even dictate your notes and have them transcribed into OSCAR by a secretary at the end of the clinic.
I already have an EMR on my system, but I don't use it. Why should I use OSCAR?
OSCAR is written by doctors for doctors (with the help of professional programmers). There are some EMRs that are written by software teams with little knowledge of how family physicians actually work.
Even better, if you don't like bits of OSCAR you can ask to have them changed. If you don't want to wait for the team of volunteers to get round to making the changes you have asked for, you can make the changes yourself or pay someone to make the changes for you. That's the great thing about open source software: you can build on it and modify it any way you like (so long as you make your improvements free to other users too).
I have heard horror stories of EMR vendors going out of business or dropping support for their EMR leaving physicians with no access to their medical records. Could that happen with OSCAR?
Again, this is the fantastic thing about open source software. You can't get locked out. Even if everyone else in the world stopped using OSCAR, you would still be free to carry on using it and modifying it to your heart's content.
Also, the data is stored using a standard MySQL database, which is also open source. So you can export that data relatively easily if you needed to.
(Of course, if you decide to pay a private company to host your installation for you, then you should make sure that you have easy access to a backup copy of your data in case anything was to happen).

