I'm trying to retrieve inactive problems, specifically v70.0 and onset date to indicate that a physical exam has been completed, from the problem table. Unfortunately, all the mel data symbols appear to retrieve only active problems and a physical is made inactive after it happens. I think I had code somewhere that accesssed the problems table, but can't find it. We're not using the complete physical obsterm currently, though I suppose I could push a date into it upon assigning a v70.0 problem. Seems like more work than necessary, though, if the problem is already coded in the table.
Anyone have code to do this already?
Thanks,
Alison
Ok, I am getting the full problemset now with my code below, however, I'm still not able to access the assessments table with the line:
lassessDate = find('Assess','ClinicalDate','SPRID',lassessID)
below...anyone able to help me pull out the assessments associated with each of the problems in the set? Yes, I know this one line would only get me one assessment and I need to get multiple assessments, but this is where I'm stuck...anyone know the associated assessment table name?
{fn get_dx_inactive_and_active(){
//filter_str = toupper(document.ICD_Code)
local a,c,newcount
local i = getRowCount('_MasterProb')
document.ROW_COUNT = i
while i>0 do
i = i-1
ldescription = getRow('_MasterProb',i,'Description')
lonsetdate = getRow('_MasterProb',i,'OnsetDate')
lassessID = getRow('_MasterProb',i,'SPRID')
lstopreason = getRow('_MasterProb',i,'StopReason')
lchange = getRow('_MasterProb',i,'Change')
lannotate = getRow('_MasterProb',i,'Annotate')
lassessDate = find('Assess','ClinicalDate','SPRID',lassessID)
/* if (filter_str<>"") then
if match(a[1]+a[3],filter_str)==0 then continue else "" endif
else ""
endif */
if (lchange=="2") then
c=c+"|"+ldescription+"^"+lonsetdate+" - "+lassessID+" - update - " HRET
else ""
endif
endwhile
if (c=="") then dx_inactive = "No results, sorry" return "" else "" endif
dx_inactive = c
return ""
}
}