CAREWare includes options to import data in several formats including importing from a SQL Server Database. When using the SQL Server Import option, CAREWare creates a database called cw_pdi in the CAREWare database instance. The cw_pdi database uses the same specifications as the PDI Template.mdb file located in the RW CAREWare Business Tier folder. Once the SQL Server Import is enabled, the cw_pdi database is created and ready for importing or exporting data using SQL.
Follow these steps to enable SQL Server Imports:
- Log into Central Administration.
- Click Administrative Options.
- Click Data Import and Export Features.
- Click Provider Data Import.
- Click SQL Server Import.
- Check Enable PDI SQL Server Import.
- Enter the Scheduled Time.
- Set the frequency by selecting the Scheduled Day.
- Click Save.
To import custom field records, custom fields need to be saved as a template.
Each of these templates listed under Custom Field Template (optional) are saved under Custom Field Templates.
To add a Custom Field Template to the list, follow the steps here.
The SQL Server Imports feature includes an option to email users error messages that occur during the import.
To prompt users for import errors check Email on Error.
To add email recipients follow these instructions:
- Click Email Recipients.
- Click Add.
- Enter the Email Recipient’s email address.
- Click Save.
SQL Server Import configuration requirements
For SQL Server Imports to work the database connection string between the CAREWare Business Tier and the cw_pdi database in the CAREWare SQL Server database instance must work. When SQL Server Imports are enabled. CAREWare creates the cw_pdi database and the database connection string in the CAREWare Business Tier Settings.
If imports to SQL are not working, it may be the connection failed. If that is the case, the database connection string may need to be updated.
The settings that need to be complete are listed below:
- Server Address – This is the name of the CAREWare SQL Server database instance.
- Database Name – The default name is cw_pdi, however a DBA can change the name from the default to a unique name. The name in this setting needs to match the name used in the CAREWare SQL Server database instance.
- SQL Login ID – This is the same login used for the clinical data in cw_data. The login can also be changed to a unique login. It much be created in SQL and granted necessary permissions. The login must be set as the database owner for cw_pdi.
- Password – This password created is the default password used for the connection to cw_data CWtemp100%. This password can be set to a unique password and must patch the password set in the CAREWare SQL Server database instance.
Troubleshooting Provider Data Import errors after enabling SQL Server Imports
The most likely reasons SQL importing and exporting stops working is when the database is restored from a backup from an old server or CAREWare is moved to a new server. If CAREWare is moved to a new server the cw_pdi database needs to be moved the same way the cw_data database is moved. The cw_pdi database should be restored from a backup and the login cwbt should be set as the database owner after the restore, before the CAREWare Business Tier service is restarted. Here are instructions for migrating CAREWare to a new server.
In cases, where a test server is upgraded or users decide to discontinue using the cw_pdi database after migrating, the setting for determining if the cw_pdi database was created needs to be reset or there may be an error trying to click Provider Data Import in CAREWare in Central Administration. If the cw_pdi database doesn’t exist or the database connection string is missing, the setting SQLServerPDICreated can be set to 0 in common storage to disable importing and exporting to SQL.
To set SQLServerPDICreated to 0, follow these instructions:
- Go to C:\Program Files\CAREWare Business Tier.
- Right click CW Admin.
- Click Run as Administrator.
- Click Stop Server.
- Click Common Storage Settings.
- Click cmm_st_pk to set the list in alphabetical order.
- Scroll to SQLServerPDICreated.
- Double click the cmm_st_number.
- Change the value to 0.
- Click another box to save the change.
- Click Server Settings.
- Click Start Server.