I have a report that returns the latest HGBA1C results within a certain date range, for a specific Diabetic population defined in the report. Any ideas on how to report the base population including those with most recent HGBA1C results in past year. So if part of the population has not had an HGBA1C entry made within the past year I see which patients those are. I usually run a series of reports and compile the information in excel. I'd just like to streamline my efforts. I thought maybe using isnull might work, but it seems that a "blank" entry needs to have been made.
Any thoughts/suggestions is very much appreciated. Thanks in advance!
Ever consider a command? I typically use a command to view the base population; i.e. diabetics seen by these folks in this time frame. Then I link that table of PIDs to the obs term table and any ob term(s) that you are interested in. Shows all patient's in base population regardless of if they have the obs term associated with them or not. Patient's without the obs term show blanks in the obs term value and date columns of the report.
Right! A command... I have seen them in use before, but have never written one myself. Great pointer. Thanks!
PID command example:
SELECT "DOCUMENT"."PID"
FROM (("ML"."DOCUMENT" "DOCUMENT" INNER JOIN "ML"."DOCTYPES" "DOCTYPES" ON "DOCUMENT"."DOCTYPE"="DOCTYPES"."DTID") INNER JOIN "ML"."LOCREG" "LOCREG" ON "DOCUMENT"."LOCOFCARE"="LOCREG"."LOCID") INNER JOIN "ML"."PROBLEM" "PROBLEM" ON "DOCUMENT"."PID"="PROBLEM"."PID"
WHERE "PROBLEM"."STOPDATE">={ts '2013-06-07 00:00:00'} AND ("PROBLEM"."CODE">='ICD-249.999' AND "PROBLEM"."CODE"<='ICD-251.000') AND ("LOCREG"."SEARCHNAME"='FAMILY PRACTICE') AND "DOCTYPES"."DESCRIPTION"='Office Visit'
AND "DOCUMENT"."STATUS"='S'
AND "DOCUMENT"."DB_CREATE_DATE">={ts '2012-01-01 00:00:00'}
Let me know if you have question as to what I was trying to capture.
Gerald Neale, RN
One approach that I have used is to select records where the OBS Code is in ["BP SYSTOLIC", "HGBA1C"] and then use a variable to store the A1C date. My thought being that a blood pressure should be recorded at every visit and be indicative of active patients, and then get the latest A1C also. (I often do this with the LASTLABS view.)
So, my selection logic is like:
{PERSON.PSTATUS} = "A" and
{PERSON.ISPATIENT} = "Y" and
{LASTLABS.HDID} in [28.00, 53.00]
and then I just define a variable to store the last A1C
if {LASTLABS.HDID} = 28.00 then {LASTLABS.MAXLABDATE}