Sidebar
0 votes
516 views
by gary-t-8719 (15.1k points)
In some cases we need to left pad the patient id in PID-3 with leading zeros so that the patient id is a specifed length.

1 Answer

0 votes
 
Best answer

You can use StringUtils to pad a string to a specified length.  Do something like this:
 
var pid3 = "129018";
var desiredDigits = 10;
var padChar = "0";
StringUtils.leftPad(pid3, desiredDigits, padChar);
by mike-r-7535 (13.8k points)
selected by ron-s-6919
...