PID 3 is the field that contains identifiers for a patient.
The normal format should be
TM0000216^^^^HKID
PID 3 Components: <ID (ST)> ^ <check digit (ST)>
^ <code identifying the check digit scheme employed (ID)>
^ <assigning authority (HD)> ^ <identifier type code (IS)>
^ <assigning facility (HD)>
In the above example TM0000216 at the PID 3.1 is the ID no,
while HKID at PID 3.5 is the ID identifier code.
However, sometimes the source may send out PID 3 in other format, e.g.
HKID:A1234567
In this case, Mirth Connect can be used to transform the PID3:
from:
|HKID:A1234567|
to:
|A1234567^^^^HKID|
before sending the HL7 message to the destination.
The following Javascript Code can be used:
Reference:
Please refer to the excellent article by Mr Ben Nadel on
the difference between Javascript slice( ), substring( ), and substr( ):
http://www.bennadel.com/blog/2159-using-slice-substring-and-substr-in-javascript.htm