Thank you for this!

Used it this way to convert OBR-7 from yyyyMMddHHmmss to MMddyyyyHHmmss:

var DOS = msg['OBR']['OBR.7']['OBR.7.1'].toString();...