When one of my variables contains no data I want to replace it with the text NA and I can't figure out how to do it in string replacement if there is no string in the first place. Is there a way to say if the var is blank or null in the string replacement options?
Announcement
Collapse
No announcement yet.
string replacement
Collapse
X
-
Re: string replacement
Here's a sample:
Code:// Get patient SSN with "-" removed var tempSSN = ""; if (pidSegment['PID.19'] != null) { tempSSN = pidSegment['PID.19'].toString(); if (tempSSN.length > 0) { tempSSN = tempSSN.replace(/-/g, ""); } else { tempSSN = 'NA'; } }
Comment