[MEDITECH-L] Evaluate if a Fragment Returns a Value
=== QUESTION ===
I have a main report that calls a fragment report in a LC on HK7
Sometimes the Fragment returns a value and sometimes not
On my main report I want to count how many times a value is returned and
how many times not. Here is the LC from the main report:
LC=@acct.number.display%5E/R.FRAG.ARG.1,
LC=%Z.rw.fragment("PHA.RX.zcus.sh.R","PHA.JOB"),1
Any suggestions ???
Terry
=== ANSWER ===
As you know, NPR fragments do not clean up the /R.FRAG.VAL.xx variables after fragments run. Which is why the /R.FRAG.VAL.xx structures are used to return your data. Here is one strategy that might work for you:
Set this value: 0^/R.FRAG.VAL.RESULT at the beginning of the fragment: at the top of your macro or another suitable place like a line attribute, footnote or custom field.
If the fragment has data to return, set this value: 1^/R.FRAG.VAL.RESULT near the end of the fragment: near the bottom of the macro that gets your data or another suitable place like a line attribute, footnote or custom field.
Extend your HK7 line check to calculate the total:
LC=@acct.number.display%5E/R.FRAG.ARG.1,
LC=%Z.rw.fragment("PHA.RX.zcus.sh.R","PHA.JOB"),
LC=/R.FRAG.VAL.RESULT+/HK7.TOTAL^/HK7.TOTAL,1
Depending on your report's setup; you could define an xx.total field and set VAL=/HL7.TOTAL.
John

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home