Dynamic DNS setup with DNS2GO

Many locations have IP addresses that get changed frequently.  In order to be get remote access to your Oscar server, you need to install a Dynamic DNS client.  This can be on a workstation, router or server.  The workstation is probably easiest, but the workstation must always be on.  Router installation is good, but not supported by all routers.

I use DynDNS and DNS2GO. This post describes setting up the DNS2GO client on the Oscar Ubuntu server.  This was done for Ubuntu 12.04 and 13.10 servers.

Download Debian client from http://www.deerfield.net/download/dns2go/linux/index.htm and save in home folder.

For Ubuntu/Debian, use dns2go-2.0.tar.gz

Unzip file
tar -zxvf dns2go-2.0.tar.gz

Change to unzipped directory
cd dns2go-2.0

Check for location of libc library (see below)
find | grep libc.so.6

Install the DNS2GO client
sudo ./INSTALL.sh

Error – Could not find glibc library
Solution: change INSTALL.sh to check current location of libc library (see below)
for Ubuntu 13.10 /lib/x86_64-linux-gnu/libc.so.6

This will run the installer for the DNS2Go client and copy all necessary files to the correct locations. The executable is installed in /usr/local/bin, documentation in /usr/doc/dns2go-2.0, manual pages in /usr/local/man and conf file in /etc/dns2go.conf

To finish the installation, type:
sudo /usr/local/bin/dns2go

You will be asked if you want to create the dns2go.conf file, select Yes.
You will now be asked if for your domain name and registration key (if you do not have your key, do not run this yet).

eg. myclinic.dns2go.com

Add program ( /usr/local/bin/dns2go ) to /etc/rc.local to execute automatically when the server starts
sudo nano /etc/rc.local
/usr/local/bin/dns2go

Revised ~/dns2go-2.0/INSTALL.sh
#!/bin/sh
#
# Installation shell script, read INSTALL for details
#
echo " "
BINDEST=/usr/local/bin
DOCDEST=/usr/doc/dns2go-2.0
MANDEST=/usr/local/man
# select the architecture
case `uname` in
OpenBSD)
ARCH=OpenBSD
;;

FreeBSD)
ARCH=FreeBSD
;;

Linux)
ARCH=Linux
;;

*)
echo "Unrecognized version: Installing Linux binary"
ARCH=Linux
;;
esac

# If Linux, check for glibc library
if [ $ARCH = "Linux" ] ; then
if [ -f /lib/libc.so.5 ] ; then
ARCH=Linux/libc.so.5
elif [ -f /lib/i386-linux-gnu/libc.so.5 ] ; then
ARCH=Linux/libc.so.5
elif [ -f /lib/libc.so.6 ] ; then
ARCH=Linux/libc.so.6
elif [ -f /lib/i386-linux-gnu/libc.so.6 ] ; then
ARCH=Linux/libc.so.6
elif [ -f /lib/x86_64-linux-gnu/libc.so.6 ] ; then
ARCH=Linux/libc.so.6
else
echo "Error - Could not find glibc library";
exit -1;
fi
fi

echo " "
echo "Copying files..."

mkdir -p ${BINDEST} 2>/dev/null
cp ${ARCH}/dns2go ${BINDEST}/dns2go
chmod 755 ${BINDEST}/dns2go
mkdir -p ${MANDEST}/man1 2>/dev/null
cp dns2go.1 ${MANDEST}/man1
chmod 644 ${MANDEST}/man1/dns2go.1
mkdir -p ${MANDEST}/man5 2>/dev/null
cp dns2go.conf.5 ${MANDEST}/man5
chmod 644 ${MANDEST}/man5/dns2go.conf.5
mkdir -p ${DOCDEST} 2>/dev/null
cp README ${DOCDEST}
cp INSTALL ${DOCDEST}
cp LICENSE ${DOCDEST}
cp USAGE_POLICY ${DOCDEST}

echo " "
echo "DNS2Go unix client version 2.0 is installed"
echo " "
echo "The README is recommended for users upgrading from 1.x."
echo "Manual pages for dns2go and dns2go.conf are available."
echo "/usr/local/bin/dns2go -h is also useful."
echo " "
echo "Thanks for using DNS2Go from Deerfield.com"
echo " "

DSQ (Dossier Sante Quebec) Installation

The Quebec government is currently rolling out the Dossier Sante Quebec.
This enables any physician to view Lab Results, Medications and Images online.

Requirements:
DSQ Visualizer Software (only for Windows and Internet Explorer)
USB Security Key

Charges for installation are reimbursable by Sogique.

Details at:  http://www.sogique.qc.ca/Accueil—PQADME.aspx

 

Installation notes for Windows Internet Exploder Explorer:

Add gouv.qc.ca to Compatibility View Settings

Add to Trusted sites.  (Tools, Internet Options, Security, Trusted Sites, Sites, Add both Formation & Production)

Make sure the Security certificates are correctly installed.  (Tools, Internet Options, Content, Certificates: Intermediate should list all 4, Trusted Root should list AC Racine, )

Add to Compatibility View does not save?
Options, General, uncheck ‘Delete browsing history on exit’

PDF documents not showing?
Make sure Acrobat Reader X or XI is installed. Some of the free readers are not compatible with the DSQ.

Internet Explorer is not the default browser?
Make a shortcut to Internet Explorer and add the URL to the properties.
“C:\Program Files\Internet Explorer\iexplore.exe” https://visualiseur.forma.dossierdesante.gouv.qc.ca/

 

Oscar files

Here are the locations of some useful Oscar files (for v12.1):

Language specific files:

/var/lib/tomcat6/webapps/Oscar12_1/WEB-INF/classes/oscarResources_en.properties

 

Using Dynamic IPs with Oscar

Many lower cost Internet providers do not provide a static IP address to their clients. That means that you cannot connect remotely without knowing your current IP address. You must either contact someone at the office and ask them for the current IP, or you can install a Dynamic DNS Client. The Dynamic DNS client will allow you to use a domain name like myclinic.dns2go.com and will automatically convert it to your current IP address.

Some companies like dyndns.com or no-ip offer a limited free version which is adequate. I currently use both dyndns and DNS2GO.

There are three (3) places where you can install the Dynamic DNS client. 1) On any single PC 2) In some routers or 3) In the Oscar server.

To use the DNS2Go client with your Oscar server, you have to download the Linux/Debian client into the server (I used /usr/local/bin ) and add a single line to /etc/rc.local.
The line would be something like su -c “/usr/local/bin/dns2go” .
On Oscar 9.06 installations, I added the line at the end of the file (after the python drugref service startup).

 

Email appointment reminders

Adding email appointment reminders to Oscar is easy.

Our current implementation uses a Report by Template (on the Admin, oscarReport menu) that exports patient names and email addresses from the Appointment file. The data is used in an OpenOffice/LibreOffice Mail-merge that sends out the reminders. The following notes describe the process in detail.

The Report Template is:

<report title=”Appointment Reminder Email List” description=”List of Emails for Appointment Reminders” active=”1″>
<query>select dem.email as Email,
DATE_FORMAT(app.appointment_date,’%d/%m/%Y’) as Date, TIME_FORMAT(app.start_time,’%h:%i %p’) as Time, prov.last_name as Doctor,
dem.last_name as Lastname, dem.first_name as Firstname
from appointment app, demographic dem, provider prov
where LOCATE(‘@’, dem.email ) > 2
and appointment_date >= ‘{start}’ and appointment_date <= ‘{finish}’
and app.demographic_no = dem.demographic_no
and app.provider_no = prov.provider_no
order by app.appointment_date, app.provider_no, app.start_time ;
</query>
<param id=”start” type=”date” description=”Start date”> </param>
<param id=”finish” type=”date” description=”Finish date”> </param>
</report>

You can run the query for the following week and save the CSV file to your local PC. The first time you run the mail merge, you will have to setup the CSV as a LibreOffice/OpenOffice database and configure your email account (see below).

The next step is to write your message template and use that as a Mail-merge to Email.
Sample email template:

This is a system generated e-mail reminder.
<<last_name>> <<first_name>> has an appointment with Dr. <<Doctor>> on <<Date>> at <<Time>>.

Should there be a need to reschedule or cancel your appointment, please note we require 24hr notification at (514) 555-1212.
Please note there is a $40 charge for missed appointments.

Ceci est un rappel automatisé par courriel.
<<last_name>> <<first_name>> a un rendez-vous avec Dr. <<Doctor>> le <<Date>> à <<Time>>.

Veuillez nous aviser de tout changement ou cancellation au plus tard 24 heures avant l'heure prévue du rendez-vous au (514)555-1234.
Des frais de $40 seront perçus pour tous les rendez-vous manqués.

This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. 
Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.
 If you received this e-mail in error, please advise us (by return e-mail or otherwise) immediately.
 
Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent.
 Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite.
 Si vous recevez ce courrier électronique par erreur, veuillez nous en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.

ConsultationRequest bug (v10.12)

If you enter a consultation request without an appointment date and specify that the patient will book their own appointment, the consultation request will not be viewable. This is because the page that displays the consultation requests expects a valid appointment date and time.
The current back-end solution is to plug in a dummy appointment date and time:
update consultationRequests set appointmentDate = ‘1900-01-01′, appointmentTime = ’01:01:01’ where patientWillBook = 1 and appointmentDate is NULL ;

OutOfMemoryError: PermGen space problem

When installing an Oscar v12 demo on my windows laptop, I encountered Java memory problems. I added the following lines to the Tomcat parameters (in Java, Java Options) :
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-XX:PermSize=128m
-XX:MaxPermSize=512m

Backups

The backup procedure written by Peter Hutton-Czapski works nicely. I’ve added a few lines to sync the backup with a removable USB drive that can be taken home.

The files on the USB drive are encrypted and compressed, so if lost, they are not readable.

To list devices and find out where the USB drive is located:
sudo fdisk -l
should see /dev/sdc1

Create a mount point
sudo mkdir /media/usb_external
Mount the drive
sudo mount -t ntfs-3g /dev/sdc1 /media/usb_external -o force
Edit the backup script.
/usr/local/backups/backup.sh

Add the following lines to the end of the backup script
cp /usr/local/backups/data/2012-06* /media/usb_external/backup/
sudo rsync –delete -dptgoD -e ssh /usr/local/backups/data/ /media/usb_external/backup

if backup files are in /home/mysql
sudo rsync –delete -dptgoD -e ssh /home/mysql/ /media/usb_external/backup
sudo umount /media/usb_external

Some clients have a LOT of scanned documents in Oscar. If a complete set of 30 backups is too large for the existing system, you can replace the lines that delete the month-old backup with the following. This removes any files that end with .gz and are over 7 days old:
find ${DEST} -type f -name “*.gz” -mtime +7 -exec rm {} \;

Oscar logo customization

The default logo is located in:
/var/lib/tomcat6/webapps/Oscar12_1/images/OSCAR-LOGO.gif

You can specify an altername logo in the Oscar.properties file:
sudo nano /usr/share/tomcat6/Oscar12_1.properties
loginlogo=

The location of the file is relative to the /var/lib/tomcat6/webapps/Oscar12_1/ directory
If you want to put the replacement image in the images folder, you need to specify that.
loginlogo=images/NEW-LOGO.gif

Note: Any change to the .properties file requires that you restart tomcat
sudo service tomcat6 restart

Once you have changed the .properties file, you can modify the images as required.

Images notes:
600 to 700 pixels high is a good size.
é is Alt-0233

 

TIF to PDF conversions

Oscar works with TIF format images, but PDFs work better. Here are some approaches to automating the conversion from TIF to PDF.

Windows:
Irfanview and the IMPDF plugin. Normally, there is a window that pops up when you save the converted PDF. In order to disable the pop up box, run through the conversion process once manually. When you File, Save (original folder), the Save window opens. Make sure that the Show options dialog at the bottom is on, so that the PDF Settings window will also be open. In the PDF Settings window, General tab, make sure that the Preview of PDF during save operation is set to ‘not needed’. Save the document.

Now you can use the following .BAT to automate the conversion without the pop-up.
rem tif2pdf.BAT
rem Uses IrfanView to convert TIFs to PDFs
rem from
@echo off
set Source=C:\temp\tif
for /F "tokens=* delims=" %%a in ('dir /ad /b /s "%Source%"') do call :Sub "%%a"
if exist "%Source%\*.tif" ("%ProgramFiles%\IrfanView\i_view32.exe" "%Source%\*.tif" /convert="%Source%\*.pdf")
goto :eof
:Sub
if exist "%~1\*.tif" ("%ProgramFiles%\IrfanView\i_view32.exe" "%~1\*.tif" /convert="%~1\*.pdf")
goto :eof

from: https://irfanview-forum.de/archive/index.php/t-890.html
Thanks Skippybox

If you are using hylafax on your linux server, you can add the following line to convert the incoming fax TIFs to PDFs.
tiff2pdf -o {destinationfile}.pdf {sourcefile}.tif