Updating PTS
End-user PTS 5 software updates are not covered by a standard support contract and are something we would only consider in very specific circumstances.
We are documenting the process here for reference.
We recommend you plan for around an hour of downtime. The points at which downtime starts and ends is documented below.
In summary, the upgrade will be comprised of updates to the PTS web/application files, an amendment to the PTS database via a SQL update script, updated and/or new report document templates, and optionally an update to the ePrescribing or EPMA service.
Update files
In the event that we provide the update files, you will likely be given a link to the appropriate PTS update repository on Sharepoint. If not, we may send you a zip archive containing the update files.
In any case the relevant files and folders are:
- ePrescribingService
The updated files for the ePrescribing or EPMA link. - Report rdls
New or updated report template documents. - SSRS Update Datasource for Reports Script
The tools for uploading the new reports to your SSRS server and registering them. - DatabaseUpdate.sql
The T-SQL script to update the PTS 5 database. - PTS 5.x.x.x Update.zip
The updated files for the PTS web application. - PTSCommsSetup64.msi
The matching PTS Comms Client installer for this version of PTS. - Web.config
The updated web.config file (may be included in the update zip file instead).
Update guide
The aim of this guide is to summarise the steps involved so that a server and/or database administrator could understand and follow them. It will not include enough detail for a novice.
Be sure to do the backups! Not only does it make good sense but you will actually use the backup files as part of the update.
- Login to the SQL server using SQL Management Studio and locate the PTS 5 database
Likely to be named "pharmacyDB". - TRUNCATE the ELMAH_Error table
This table can be huge and can massively increase the backup file size. - Backup the database
- Login to the application server and locate the PTSWeb IIS application folder
- Delete everything from the Contents\Labels folder
- Create a backup of the PTSWeb folder
Consider omitting the Content\Sounds folder. It's not important to back this up, and it will be quite large. - Open IIS and locate the application pool that is handling the PTS 5 application and stop it
The downtime starts now. - Copy everything from the PTS 5.x.x.x Update.zip folder and drop it into the live PTSWeb directory
You should have to confirm overwrites; make sure you do so. - Copy the new web.config file and drop it into the live PTSWeb directory
You should have to confirm an overwrite. - Locate the old copy of the web.config file in the backup directory and open it in Notepad
- Locate the <connectionStrings> section and copy it to your clipboard
- Locate the new web.config file in the live directory and open it in Notepad
- Locate the <connectionStrings> section and paste the copy of the old <connectionStrings> section from your clipboard and save the changes
This process is to replace the placeholder connection strings from the PTS update with the working connection strings from your existing installation. Make sure you replace the entire <connectionStrings> section cleanly. - Back on the database server, carefully execute the DatabaseUpdate.sql script against the PTS database
- Monitor the output window for errors and deal with them
For example older versions of PTS 5 allowed the same username to be assigned to multiple users. This behaviour was eventually changed, but the script cannot apply the fix while any duplicates still exist in the table. Monitor the output window for any affected records and change the username of one of them in the AspNetUsers table. It's better to do this manually, amongst other things to have the opportunity to choose which account to rename, but alternatively this script will automatically append a "B" character to any duplicated usernames:UPDATE AspNetUsers SET UserName=UserName+'B' WHERE id NOT IN (SELECT MIN(id) FROM AspNetUsers GROUP BY UserName);
- Having fixed any issues, execute the update script again and monitor the output window for further errors
Repeat this process until the script completes with no errors (warnings are expected and can be ignored). The script is failsafe and can be executed repeatedly without issue. - Restart the application pool
- Test that you can login to the application and that it reports the new version number
- Go to Application Settings in PTS, locate the "URL" setting and make sure it is set correctly
- Have your contact in pharmacy test the application (not including reports) and sign off on the update
If pharmacy report no issues they can resume using the system normally at this point. - Now is a good opportunity to implement the Database Maintenance Script as part of a SQL maintenance plan, or at least index the database
Updating reports
- Login to the SSRS server
You can identify the name of your SSRS server via the "URL of SQL Reports Server" setting in Application Settings in PTS. It may be the very same server as PTS itself, or the database. - Copy the "Report rdls" and "SSRS Update Datasource for Reports Script" folders to the server. If the folders are zipped up be sure to unzip them
- Run ReportSync.exe
- Under "Destination SSRS web service", connect to the web service using connection settings being used by PTS
- You can glean this information from Application Settings within PTS; do a search for "report" to see all pertinent settings. The URL setting will be equivalent to the "URL of SQL Reports Service" setting minus the "reportservice2010.asmx" part, e.g. http://ReportServerName:80/ReportServer.
- Similarly you can try the same username and password settings that PTS is using. However occasionally PTS will be using a user account with "read-only" permissions. In this situation you should try domain administrator credentials.
- It's also important to prefix the username with the domain/server name; you can find out the correct domain via the "SSRS Reports Service Domain" setting.
- Click Load; you should see PTS's live report folders loaded in the right hand pane
Note you don't have to use the left hand pane ("Source SSRS web service") for anything, we will be using the Local Path option. - At the bottom of the window, under Local Path, click the ellipses button (...)
- Navigate to the "Report rdls" folder
- Inside you will find a 2008 folder and a 2016 folder; open 2016
The 2008 files are for legacy versions of SQL Server that are no longer officially supported by PTS. - Select the Prescription folder and click OK
- In the right hand pane, tick the "PTS Reports" report folder
- Click Upload, and wait for the process to finish
- Repeat these steps for "PTS Activity Reports", "PTS CD Reports" and any other folders that have been made available to you
See the next section if any folders are missing from the server. - You can now close ReportSync
- In File Explorer navigate back to the "SSRS Update Datasource for Reports Script" folder and locate the UpdatePTSReports.bat file
- Right-click it and click Properties
- At the bottom of the General tab, if you see an Unblock tickbox, tick it and then click Apply and OK
- Repeat this for RS.exe and RS.exe.config
If you don't do this, Windows SmartScreen may prevent you from proceeding. - Right-click UpdatePTSReports.bat and click Edit
- At the top of the script you will see several variables being "set" with placeholder values, amend these to the correct values for your environment
- As before, the reportfolder, activityreportfolder and cdreportfolder settings can be found in Application Settings in PTS. Do a search for "report" to see the pertinent settings.
- The SSRSURL setting will be equivalent to the "URL of SQL Reports Service" setting minus the "reportservice2010.asmx" part, e.g. http://ReportServerName:80/ReportServer.
- To determine the two data source settings, copy and paste the "SSRSURL" setting value into a web browser and you should see a list of virtual folders. The data source location will be listed there; make a note of it before clicking on it to reveal the data source name.
- Save the changes and close Notepad, execute the .bat file and monitor it
It's important NOT to run this file as an administrator. Doing so will make it unable to find the files based on their relative paths. The output from the batch file will report any issues, but be advised that the red-herring text "command completed successfully" may appear even after an error message.
If a report folder is missing from the server (e.g. PTS CD Reports, PTS Labels)
If the update includes a whole brand new report category, you won't see it in the right-hand pane and therefore won't be able to upload the new reports to it. To remedy this you simply need to create a new subfolder on the SSRS server. Depending on the version of PTS you're updating from you may already have this issue with the PTS CD Reports folder, which were introduced in PTS v5.0.0.57, or the PTS Labels folder, which were introduced in PTS v5.0.4.0.
- Right-click UpdatePTSReports.bat and click Edit
- Near the top of the page, notice where it lists the various report folders. Make a note of the name of the new one
- Login to PTS as an administrator and go to Setup > Application Settings
- Search for "SSRS Subfolder"
- Try to find the new report folder reference via its "SSRS Subfolder containing..." setting
e.g. "SSRS Subfolder containing PTS CD Register Reports". - If the setting exists, make sure that the value of the setting matches what is in the .bat file
It's best to modify the .bat file if there is a discrepancy. - Login to the SSRS server
- Open the Reporting Services Configuration Manager application
- Click on the Web Portal URL tab
- Click on the link to the web portal or copy and paste it into a web browser
The Reporting Services Configuration Manager is known to sometimes fail to connect to the report server. If you can't connect, you may have luck guessing the web portal URL as it often takes the format http://ReportServerName:80/Reports - If you are prompted to log in, use the same User and Password details found in Application Settings
- Click the New button at the top right of the screen
- Choose Folder
- Enter the name that you established earlier
- Click Create
- Return to the updating reports section and retry ReportSync; it should now find the new report folder/s
Updating the ePrescribingService
This is of course only relevant if you are using an ePrescribing or EPMA link.
- Open Windows Services and stop the "PTS ePrescribing Service"
- Open Windows Explorer and navigate to the installation path for the service
- If there are a significant number of log files in the directory now is a good time to delete them
- Take a backup of the entire folder
As with the main PTS update, you will use this backup folder later so do not skip this step. - Copy the new files into the live folder and confirm all overwrites
- Navigate to the backup folder you took earlier and open PTSePrescribiing.exe.config in Notepad
In Explorer you should select View > File name extensions to make this file easier to locate. If file extensions are hidden it may, confusingly, display as PTSePrescribing.exe. - Locate the <applicationSettings> section and copy it to your clipboard
This section will probably be quite big and messy as it likely contains a large unformatted database query in it. Take care to locate the beginning and end of the applicationSettings section and copy it carefully. - Locate the new PTSePrescribiing.exe.config file in the live directory and open it in Notepad
- Locate the <applicationSettings> section and paste the copy of the old <applicationSettings> section from your clipboard and save the changes
This process is to replace the placeholder application settings from the update with the working settings from your existing installation. Make sure you replace the entire <applicationSettings> section cleanly. - Restart the "PTS ePrescribing Service" in Windows Services
- Monitor the log files in the installation directory for any issues
Updating the PTS Comms Client
Follow the instructions on the PTS Comms Client Installation to update PTS Comms to the version that corresponds to your new PTS installation.
Officially, the PTS Comms Client must version match the main PTS application and as such there is a dedicated download link for each version of PTS. However we are often asked about the intricate details of this policy and whether it is strictly necessary. To answer truthfully the comms software will probably continue to work as it did before, especially if your update was minor. If it will save you a lot of time it's not unreasonable to test this out before committing to updating each PC. The risk of data loss is practically non-existent.
Resetting the PTS 5 Database
Occasionally, and especially as part of a go-live plan, pharmacy may request that the PTS database be reset, or cleared of junk data. What they mean by this is the removal of dummy prescriptions that they have previously created, but with the preservation of the application setup that is also stored in the database.
The following script will achieve this. A backup of the database is strongly advised!
TRUNCATE TABLE [PatientDrugs] TRUNCATE TABLE [Patients] TRUNCATE TABLE [PrescriptionNotes] TRUNCATE TABLE [Events] TRUNCATE TABLE [PrescriptionChangeAudits] DELETE FROM [Prescriptions]