I'm trying to create a history view that will show the most recent document that came in from the patient portal. The document type is Secure Msg. However, I cannot find any MEL data symbols that will allow me to pull in the list of documents in the patient chart. Is there some way to run an external script (runtextprocess?) from the history view that will allow me to bring in the list of documents in the chart? I can probably figure out how to get what I need once I bring in the list.
Any and all help will be appreciated.
Thank you.
Robin
I have this, you could modify the filters to display what you need. Its only going to display the document type summary and date though, not the whole text of the document.
{!fn DocDisplay(which,type,jobtitle)
{
//which is all or last (since last OV)
//type is comma or list
//jobtitle is yes or no
//mldefs6
local rslt = ""
local tmp
local last = last_signed_obs_date("weight")
local hold = ""
if (last == "") then last = "01/01/1900" endif
for i = 0, i < getrowcount("FilteredDocuments"), i = i + 1 do
tmp = getrow("FilteredDocuments",i,"TypeDesc","Summary","ClinicalDate","JobTitle","PUBTIME","SDID")
hold = Convert_Time(tmp[5])
if durationdays(last,hold)>0 or tolower(which) == "all" then
rslt = rslt + Convert_Time(tmp[3]) + " " + tmp[1] + (if tmp[2] <> "" then ": " + tmp[2] else "" endif) +
(if tolower(jobtitle) == "yes" then " (" + tmp[4] + ")" else "" endif) +
(if tolower(type) == "comma" then "," else hret endif)
endif
endfor
return rslt
}
}
Thank you! I'll give this a shot. I'll report back with what I get to work, in case someone else has the same need.
Thanks for your help.
Thanks, Mike. Are you willing to share your Convert_Time function, too? I was able to make your script above work well, except for that.
Thank you very much.
Robin
Thanks, Mike. I was able to get what I needed using the code below, which is based on your code. I am using this in a history view to pull in the list of documents in the patient's chart. I will actually use this to then filter down to get only the documents that I want to display.
{local rslt
local tmp
local tmpsecs
local tmpdays
local tmpdate
rslt = ""
tmp = ""
tmpsecs = ""
tmpdays = ""
tmpdate = ""
for i = 0, i < getrowcount("FilteredDocuments"), i = i + 1 do
tmp = getrow("FilteredDocuments",i,"TypeDesc","Summary","ClinicalDate")
if tmp[3] <> "" then
tmpsecs = truncate(val(tmp[3])/1000000)
tmpdays = truncate((tmpsecs/3600)/24)
tmpdate = ADDDATES("01/01/1960","0","0", str(tmpdays))
else ""
endif
rslt = rslt + tmpdate + " " + tmp[1] + (if tmp[2] <> "" then ": " + tmp[2] else "" endif) + hret
endfor
rslt}