CPS 12-
Unsure if this is possible or not, but I would like a data display to display a function, and if that function returns no value then return the value of another function.
Example:
{
if fnWhichOne("Hep B",1)==""
then fnSeriesVaxDt(DOCUMENT.HEPBHTMLV,1)
else "" endif
}
Just a very rough idea, I have no idea what the actual expression will look like.
I just want a date from either the first fn or the second fn. This is to view immunization dates from obsterms and HTML. Or, If anyone has a current way to view both they would like to share I would appreciate it.
Thanks in advance.
I've never tried this before in a data display so you made me curious. It worked for me. I did something very simple:
{
if (fnfirst() <> "") then
fnfirst()
else
fnsecond()
endif
}
I tried having the first function return a blank string and the second function output correctly. If I had the first function return a string it output correctly. Looking at your example above (I know its a rough idea) I would be concerned that fnWhichOne(“Hep B”,1) would never output even if there is a value.
Brad
Brad,
Worked perfectly!
{if (fnSeriesVaxDt(DOCUMENT.HEPBHTMLV,1) "") then fnSeriesVaxDt(DOCUMENT.HEPBHTMLV,1) else fnWhichOne("Hep B",1) endif}
Glad to hear it.
One more question. When the form first loads, most of the data displays say VOID. It is not until I click on another tab and then go back to the form that the data displays are displaying correctly. Does this have to do with a missing evaluate function somewhere?
Thanks