We would like the suffix to print for patient names in prescriptions (Jr., Sr. etc.). I tried changing this on the crystal report myself but then every once in awhile a name wouldn't print at all so I had to change it back. I suspect that we aren't the only one who would benefit from this, especially with controlled meds.
Stacey LaGrange
Software Developer/Analyst
St. Mary's Health System
[email protected]
(207) 777-8410
You are experiencing the problem that exists when sometimes the data is NULL. Adding a NULL value to a text string results in a NULL value. So what you have to do is this:
This example presumes you are using the {person.entitlements} field for suffixes. I don't see anywhere else they would be!
Create a formula {@suffix} that tests the suffix, like this:
if isnull({person.entitlements})
then ''
else {person.entitlements}
Add {@suffix} to your name formula in place of the {person.entitlements}.
--
Andrea James
Providence Health & Services
Thanks Andrea, I checked and your code is a little different than mine so maybe it will work. I did use IsNull though so it may not. I used the code below. Hopefully GE will fix this so we don't have to keep altering the prescription after each upgrade.
local StringVar sResult := "";
if not IsNull({PERSON.FIRSTNAME}) and Trim({PERSON.FIRSTNAME}) <> ""
then sResult := {PERSON.FIRSTNAME};
if not IsNull({PERSON.MIDDLENAME}) and Trim({PERSON.MIDDLENAME}) <> "" and {PERSON.MIDDLENAME}[1] in ["A" to "Z"]
then sResult := sResult & " " & {PERSON.MIDDLENAME}[1] & ".";
if not IsNull({PERSON.LASTNAME}) and Trim({PERSON.LASTNAME}) <> ""
then sResult := sResult & " " & {PERSON.LASTNAME};
if not IsNull({PERSON.ENTITLEMENTS}) and Trim({PERSON.ENTITLEMENTS}) <> ""
then sResult := sResult & " " & {PERSON.ENTITLEMENTS};