Hello Everybody,
Is there a query i can run in SQL for an Audit trail for one of our providers? He is claiming that he finished the HPI and ROS for a patient but its not showing up on the note and I looked in Contributors List and it didn't look like he even started the HPI or ROS. So i wanted to double check in SQL.
Is the note signed or unsigned?
Its signed.
The only thing you can really do it look at the OBS table, which stores the data for HPI and ROS, depending on what form you used (CCC or Custom) and what OBS Term was used. There will be a few things you will need:
1. SDID - this is a unique ID for the document in the DOCUMENT table for the Chart Note in question.
2. HDID - this is a unique ID for the OBS Term that the data was stored into.
To get the SDID, you can run the following: Input the patient id where stated
SELECT *
FROM DOCUMENT
WHERE PID = (SELECT PID FROM PatientProfile WHERE PatientId = 'INPUT PATIENT ID HERE') AND STATUS = 'S'
ORDER BY dbo.Convert_ID_to_date(CLINICALDATE) DESC
Search through the records using the VISDOCID to match the one in the chart. Once you got the SDID, you now need the HDID, hopefully you know what OBS term is being used for those records. Run this script to see the data that was signed off:
SELECT *
FROM OBS
WHERE SDID = 'INPUT SDID HERE' AND (SELECT COUNT(*) FROM OBSHEAD WHERE HDID = OBS.HDID AND NAME = 'INPUT OBS TERM HERE') > 0
or you can just run this to see everything that had been saved into the OBS for that document:
SELECT (SELECT NAME FROM OBSHEAD WHERE HDID = OBS.HDID) AS OBSTERM, OBS.*
FROM OBS
WHERE SDID = 'INPUT SDID HERE'
if you need anymore assistance, please let me know.