I've be working on a 340B report off and on for a few months, strictly in SQL. I'm having trouble tying the prescription date to a visit date. Is there a table that has visit dates? I found one table with all the prescription information, but if someone opens a chart for a patient it actually writes to this table like an audit log. Anyone out there have a 340B report already?
You want to use the SDID Column, it will link to your DOCUMENT SDID. The SDID is key to a lot of linking within tables to your Visit itself.
WOOOOOOO! I love CHUG! Thanks @acantu - I see exactly what you are talking about!
But what format is clinicaldate in? For example, 1739357964000000 is that in seconds or something?
clinicaldate is an ID that is coded, you can decode it using:::
dbo.Convert_ID_to_date(CLINICALDATE)
Feel free to vote up my answers if you they have helped you solve your question.
Weird, that's still showing today as the clinical date.. The presecription was actuall on 2/5..
Maybe I need a different JOIN.
that is for the DOCUMENT, for the Prescription, look at the PRESCRIB table and CLINICALDATE or DB_CREATE_DATE
This was a big help, I deleted a row linking patient information, that's what screwed up my dates. But your suggestions were very useful!
Clinical date when an 16 digit number is converted to a date as follows:
DateAdd("d",Int([ClinicalDate]/1000000/24/3600),#01/01/1960#)
Join the appt to the view erx_activity_rpt (provides the script date)
Jill
Would someone share their 340B report please. Our 340B compliance analyst would like a report to make sure the scripts are coming from a 340B eligible provider and clinic since providers work at different locations some not 340B. I was wondering if any of the reports you all have worked on would help track this?
My email is [email protected]
thank you,
Maria Diaz