Using the new FH/SH CCC forms, family history data is stored in a new table in CPS as opposed to in an observation term. GE has provided the following data symbol "MEL_LIST_FHX_AFTER" that pulls the data from that table but it looks HORRIBLE and the ability to make it less horrible is very limited within the confines of the arguments of the data symbol. I am trying to use a data display in VFE to display the data from this new FH table in a more pleasing way so that our providers can more easily review and interpret this information. I found the following code in the default system History and the output of the data in the History view is pretty nice. I just can't figure out how to make this work in VFE in the data display. Any help would be greatly appreciated. Thanks so much! Wes
{global FHX_PROVIDER global FHX_LAST_UPDATED}{fn ccc_hview_fhx(){
local HV_FHX_list="", HV_HV_tmp_txt="", HV_HV_tmp_lst_str="", str_date="", temp_day="", last_day="", i
HV_FHX_list = getfield(str(MEL_LIST_FHX("delim")),"|","")
if str(HV_FHX_list)<>"" then
for i=1, i<= size(HV_FHX_list), i=i+1 do
HV_tmp_lst_str = getfield(str(HV_FHX_list[i]),"^","")
str_date = getfield(str(HV_tmp_lst_str[7])," ","")
if i==1 then
if i==size(HV_FHX_list) then
HV_tmp_txt = if HV_tmp_lst_str[5]<>"Relative" then HV_tmp_lst_str[5] + " - Has " else "" endif + HV_tmp_lst_str[3] + /*if HV_tmp_lst_str[6]<>"" then " (" + HV_tmp_lst_str[6] + ") " else "" endif +*/ if HV_tmp_lst_str[11]=="" then "" else " - " + HV_tmp_lst_str[11] endif + " - Entered On: " + str_date[1]
else
HV_tmp_txt = HV_tmp_lst_str[5] + " - Has " + HV_tmp_lst_str[3] + /*if HV_tmp_lst_str[6]<>"" then " (" + HV_tmp_lst_str[6] + ") " else "" endif +*/ if HV_tmp_lst_str[11]=="" then "" else " - " + HV_tmp_lst_str[11] endif + " - Entered On: " + str_date[1] + "\r\n" + "\r\n"
endif
else
if i==size(HV_FHX_list) then
HV_tmp_txt = HV_tmp_txt + HV_tmp_lst_str[5] + " - Has " + HV_tmp_lst_str[3] + /*if HV_tmp_lst_str[6]<>"" then " (" + HV_tmp_lst_str[6] + ") " else "" endif +*/ if HV_tmp_lst_str[11]=="" then "" else " - " + HV_tmp_lst_str[11] endif + " - Entered On: " + str_date[1]
else
HV_tmp_txt = HV_tmp_txt + HV_tmp_lst_str[5] + " - Has " + HV_tmp_lst_str[3] + /*if HV_tmp_lst_str[6]<>"" then " (" + HV_tmp_lst_str[6] + ") " else "" endif +*/ if HV_tmp_lst_str[11]=="" then "" else " - " + HV_tmp_lst_str[11] endif + " - Entered On: " + str_date[1] + "\r\n" + "\r\n"
endif
endif
temp_day = DURATIONDAYS(str_date[1],str(_TODAYSDATE))
if i==1 then last_date=temp_day endif
if temp_day <= last_date then
FHX_PROVIDER = HV_tmp_lst_str[8]
FHX_LAST_UPDATED=str_date[1]
last_date=temp_day endif
endfor
return HV_tmp_txt
else
return ""
endif
}}
Family History
|
{ccc_hview_fhx()}
{if str(ccc_hview_fhx())<>"" then fmt('Last updated by ' + FHX_PROVIDER + ' on ' + FHX_LAST_UPDATED,"I") else "" endif}
{if str(ccc_hview_fhx())<>"" then fmt("General Comments:","b,1") else "" endif} {LAST_SIGNED_OBS_VALUE('Family Hx')} |
I use this:
In the data display I call the function with :
fnDisplayFHx(HRET)
The function i use is as follows:
{! fn
fnDisplayFHx(strSeparator) {
local lResult = str("")
local lCounter
local lFamHx
local dash
lFamHx = MEL_LIST_FHX_AFTER("delimited",
"active")
lFamHx = getfield(lFamHx, "|",
"")
for lCounter = 1, lCounter < size(lFamHx), lCounter =
lCounter + 1 do
lFamHx[lCounter] = getfield(lFamHx[lCounter], "^", "")
if lFamHx[lCounter][11] <> ""
then
dash = " - "
else
dash = ""
endif
lResult = lResult + "-
" + lFamHx[lCounter][5] + ":
" + lFamHx[lCounter][3] + dash + lFamHx[lCounter][11] +
strSeparator
endfor
if size(lFamHx) > 0 then
lFamHx[lCounter] = getfield(lFamHx[lCounter],"^","")
if lFamHx[lCounter][11] <> ""
then
dash = " - "
else
dash = ""
endif
lResult = lResult + "-
" + lFamHx[lCounter][5] + ":
" + lFamHx[lCounter][3] + dash + lFamHx[lCounter][11]
endif
return lResult
}
}
Thank you so much for your help! I've inserted the function in the data display just as you have it in your post "fnDisplayFHx(HRET)". I've then inserted the function you use in the MEL window on the right. I copied and pasted everything into notepad before copying and pasting it again into VFE. When I save the form, I'm getting the following error -
ERROR: Possible syntax error in function definitions. Either function definition without preceding "fn " or MEL expression without opening "{". Expression beginning
1 error(s) found. 0 warning(s) found.
I went ahead and imported the form into CPS to test it and it's not giving any MEL errors but it's not displaying anything in the data display and this patient definitely has data entered in the new FH table. I'm sorry to be a pain, but do you have any suggestions? Thanks again for your help! I really appreciate it! I'm pretty much a novice when it comes to MEL programming.
Wes
wralston said:
Thank you so much for your help! I've inserted the function in the data display just as you have it in your post "fnDisplayFHx(HRET)". I've then inserted the function you use in the MEL window on the right. I copied and pasted everything into notepad before copying and pasting it again into VFE. When I save the form, I'm getting the following error -
ERROR: Possible syntax error in function definitions. Either function definition without preceding "fn " or MEL expression without opening "{". Expression beginning
1 error(s) found. 0 warning(s) found.
I went ahead and imported the form into CPS to test it and it's not giving any MEL errors but it's not displaying anything in the data display and this patient definitely has data entered in the new FH table. I'm sorry to be a pain, but do you have any suggestions? Thanks again for your help! I really appreciate it! I'm pretty much a novice when it comes to MEL programming.
Wes
Thats interesting. I wonder if when I copied it over it messed up some of the formatting. Tomorrow morning I can send over a form with the code/data display and you can see if when you import that form, it works.
Thanks
Dave
That would be great Dave! Thank you so much! If emailing would be easier, my address is [email protected] - whatever works best for you. Thank you again so much for your help!
Wes