Is there anyway to change a Clinical Date on signed Documents? We are scanning in our paper charts and have had quite a few errors with the clinical dates. We have been filing the docs in error and re-importing them to get the correct clinical date. It would be incredibly helpful if we could just change the clinical date so we don't have all those filed in error docs.
Someone will probably post a better solution, but this is what we use:
/* This query adjusts the clinical date of a document in a chart. This is a 2 part query because I'm not a DBA and don't want to spend much time on it. Step 1: Get PID from PatientID Step 2: Update the clinical date of the document based on the # of seconds elapsed since Jan 1 1960. http://www.timeanddate.com/date/duration.html Step 3: Don't forget to commit when done. */ SELECT PID From PatientProfile WHERE PatientID='74184' -- select * from document where PID = 1504855590876000 and visdocid = 1514 -- get PID from previous query and Doc ID from the chart begin tran update document set clinicaldate = 1559347200000000 where PID = 1504855581442500 and visdocid = 116 --commit
We do it in SQL, if you run this you need to highlight commit or rollback (and not the -- part) and execute one. This is for CPS.
declare @pid varchar (8), @docid varchar (4), @clinicaldate varchar (16);
set @pid = '82008';
set @docid = '177';
set @clinicaldate = '2011-09-23';
select document.pid, document.clinicaldate from document, patientprofile
where
document.pid = patientprofile.pid and
patientprofile.patientid = @pid and
document.visdocid = @docid;
begin tran
update document set document.clinicaldate = cast(DATEDIFF(second, '1960-01-01', @clinicaldate) as numeric) * '1000000' from document,patientprofile where document.pid = patientprofile.pid and patientprofile.patientid = @pid and document.visdocid = @docid;
select document.pid, document.clinicaldate from document, patientprofile where document.pid = patientprofile.pid and patientprofile.patientid = @pid and document.visdocid = @docid;
-- You MUST commit or rollback this transaction or you will bring the EMR to a screeching HALT!!!!!!!
--commit
--rollback