Event is on the wrong date error

Modified on Fri, 30 Dec 2016 08:18 by Kevin Ricciardo — Categorized as: Uncategorized

Some users have reported a sporadic error message when entering or importing medications for clients or when running custom reports.


The error message is:


Event is on the wrong date. at jMultiTier.jMultiTier.jDrugEventDateGrouping.Add(jDrugEvent DrugEvent) at jMultiTier.jMultiTier.jDrugEventGrouper.Add(jDrugEvent DrugEvent) at jMultiTier.jMultiTier.jRegimineDecoder.AddDrugSpan(jDrugSpan DrugSpan) at jProgBusiness.jBusiness.RGM_BusinessSideOperations.clientRegimenManager(String sessionToken, String DomainPK, String clientPK, Boolean useCustomDrugNames, Boolean ARTDrugsOnly)


To resolve this error:


Check for medications that have a time in the start or stop date column. The start and stop date columns should only have dates. Check to see if any medications have a start and stop date of the same day and no time to distinguish a difference or the same time. If the error is occurring when importing data using the Provider Data Import, it is likely the start and stop dates for medications are the same. The format for the column Start Date and Stop Date does not allow for time. If the error is occurring when adding a medication to a client record, the time may be in the cw_medication table in the database.


A SQL Server query can be run to resolve this issue if the problem is in the CAREWare database. This is the case if the error occurs when the user is running a custom report or adding a medication record to a client, unless the user is entering a stop date for the same date as the start date.


Make sure to create a backup of the database, before running this query, by following the instructions here.


Here is a query to resolve this issue:


UPDATE cw_medication
set mdc_start_date = DATEADD(dd, DATEDIFF(dd, 0, mdc_start_date), 0),
mdc_end_date = DATEADD(dd, DATEDIFF(dd, 0, mdc_end_date), 0)


If the error occurs when importing data and the issue is not in the cw_medication table in the database, the following queries can be run in the PDI Access database to resolve the issue with the import file:


UPDATE exp_medication
SET mdc_start_date = DATEVALUE(mdc_start_date)
WHERE mdc_start_date IS NOT NULL;


UPDATE exp_medication
SET mdc_end_date = DATEVALUE(mdc_end_date)
WHERE mdc_end_date IS NOT NULL;


Back to Recent Build Fixes