Updates & Migrations
If you are upgrading from an earlier OSCAR version remember to run the data migration tools in Administration to finish your setup. These are only done ONCE at time of installation with details published there. Unexpected results (or duplication of entries) may occur if you re run them!
Migrate ONAREnhanced
This report will migrate OSCAR 12 ONAR data to the newer OSCAR 15/19 ONAR format. This is only run once on conversion of an OSCAR 12 system to an OSCAR 15
Migrate to NEW_CONTACTS_UI
This will migrate users of the older Contacts found in OSCAR 12 and supported in OSCAR 15 to the standard used in OSCAR 19 and documented in these pages
Upgrade Roster Data
This utility will migrate OSCAR 15 rostered physician data to the newer OSCAR 19 format (OntarioMD 5.0 CMS standard). This utility will set the Enrolled To Physician to that of MRP for patients where Roster Status was set to ROSTERED.
This can be accomplished in the administrative panel by following these steps:
- Click the “Administration” link in the OSCAR main menu
- Click the “Updates and Migrations” tab in the Administration Panel
- Select the “Upgrade Roster Data” option
- Click the “Run Report” button
Migrate HRM Data
This utility will migrate OSCAR 15 HRM data to the newer OSCAR 19 format.
This is only run once on conversion of an OSCAR 15 system to an OSCAR 19.
Allow at least an hour for this
when done the “Changes were successful” message will display
Migrate CMS/XML Data
All versions of Oscar approved in Ontario are required to import and export data using the CMS format.
https://ehealthontario.on.ca/en/standards/ontario-cms
Exporting data
There are 2 steps that are required to export data from Oscar.
1. Create a Query and Patient Set.
This is done from Report (top of main appointment screen), #11 Demographic Report Tool.
Enter the query used to select demographic records. eg. Provider, Age, Patient Status, etc.
Save & Run your Query. Note: In v19, this and the next step can be combined.
If successful, the total found and resulting list of patients will be displayed below.
Save the Patient Set.
Report #12 (v15) or #13 (v19) Demographic Set Edit will allow you to select, display and edit your Demographic Set.
2. Demographic Export. Admin, Data Management, Demographic Export
Here you select the Patient Set (previously created), the Export Template and the Export Categories (the source of the data to be exported).
Click Export to create a .zip file which will be downloaded to your browser.
Filename: export_PatientSet_YYYYMMDDHHMMSS.zip
The .zip will contain 1 .xml file for each patient.
Filename: FIRSTNAME_LASTNAME_Dem#_DDMMYYYY.xml
Note: For v19, PGP Encryption MUST be enabled.
This may take a while, depending on how many patients and how much data is being exported.
The export will also create a ReadMe.txt and detailed ExportEvent.log file.
Important: This CMS export is a mandatory requirement for all approved EMRs in Ontario. If it does not work, you should report the problem to your OSP so that it can be fixed!
Importing data:
Admin, Data Management, Import New Demographic
Migrate Oscar to Oscar
If you are migrating from an Oscar version that is locked down to your own unlocked installation, this is an alternate method.
Overview: This process will work when you are staying within the same Oscar version (eg. v15).
If you want to upgrade to a newer version (eg. v15 to v19), I would suggest migrating the data to the same version first, testing the transfer, THEN upgrading to a newer version.
Migrating to the same version first will simplify fixing any database differences between different forks.
Essentially, the process has 3 steps.
1) Use the Query By Example (QbE) or Report By Template (RbT) to export the data.
2) Check the exported data using Excel
3) Import the data using the SQL import
Advantages: The export works without back-end access.
Disadvantages: Will take longer. You need to export ALL the relevant files. There are many.
Export using QbE or RbT
All RbTs have a ‘Export to CSV’ button at the bottom. The Open Source version of the Oscar QbE does NOT have that button. The 2 methods (QbE or RbT) use the same SQL commands but have to be invoked differently.
The SQL command to dump all the demographic data is ‘SELECT * FROM demographic’
Warning: You may want to do a ‘SELECT count(*) FROM demographic’ before, so that you have an idea of how many records to expect.
If you have a QbE that has a ‘Export to CSV’ button, then just enter the SELECT line and run it. If you use the RbT, you need to create a dummy RbT to hold the SQL command. I call this RbT ‘Generic Query Wrapper’. The RbT code is below.
Warning: This may take significant server resources / bandwidth. It may take a while or slow the server. Do it outside of office hours. If the export is limited by time or volume, you may have to export the data in blocks. That’s another reason why an initial ‘SELECT count(*) FROM tablename’ is very useful.
Note: In the case of demographics (and most other areas of Oscar), the data you want to transfer is actually stored in multiple related tables. You will need to transfer all the related tables.
Check the data
Embedded commas in a CSV file will cause problems. If you open the exported CSV file with Excel, it will be easy to find these fields.
Import the data
The fastest way to import your CSV data is to use the LOAD DATA INFILE feature. The problem here is that the schema of the exported data must EXACTLY match the destination. You will need to compare the schemas and possibly make adjustments for the order or presence of fields. If the schemas do not exactly match, you will have to specify ALL the columns to be imported in the LOAD DATA INFILE command.
Export the documents
COMING SOON
Generic Query Wrapper
<report title="Generic Query Wrapper" description="Generic Query Wrapper for Ad-Hoc SQl queries" active="1"> <!-- put SQL command between 'query' and '/query' tags, below --> <query> select * from demographic where demographic_no < 1000 </query> </report>
Documentation Copyright © 2012-2024 by Peter Hutten-Czapski MD under the Creative Commons Attribution-Share Alike 3.0 Unported License