Our registration adds a + symbol to the name in order designate the patient as confidential. Normally they add a space then + and the regex has no issues removing it. But when they don't add a space like SMITH+ it doesn't pick it up I've tried different javascript and the regular expression in the transformer but I can't seem to get it remove the +. The regular expression I have is [&\/\\#+^()$~%\\^\\'":?*@^<>{}()]. Any help would much appreciated.
Announcement
Collapse
Mirth Connect 4.3.0 Released!
Mirth Connect 4.3.0 is now available as an appliance update and on our GitHub page.
This is a major release containing new features like adding new functionality to the Mirth Connect Setup Wizard, adding the ability for resource and channel-specific classloaders to load child-first or parent-first, and added a default implementation of the getObjectsForSwaggerExamples() method in the ServicePlugin class. This release also contains enhancements for the Mirth Connect Administrator Launcher, the Mirth Connect Docker images, and several bug fixes and security improvements.
Download | See What's New | Upgrade Guide | Release Notes
For discussion on this release, see this thread.
This is a major release containing new features like adding new functionality to the Mirth Connect Setup Wizard, adding the ability for resource and channel-specific classloaders to load child-first or parent-first, and added a default implementation of the getObjectsForSwaggerExamples() method in the ServicePlugin class. This release also contains enhancements for the Mirth Connect Administrator Launcher, the Mirth Connect Docker images, and several bug fixes and security improvements.
Download | See What's New | Upgrade Guide | Release Notes
For discussion on this release, see this thread.
See more
See less
Replacing + in name
Collapse
X
-
PHP Code:var myField = msg['PID']['PID.5']['PID.5.1'].toString();
myField = myField.replace(/[\s\+]*$/, '');
msg['PID']['PID.5']['PID.5.1'] = myField;
Diridium Technologies, Inc.
https://diridium.com
-
Worked great, thank you.
final code
var mapping;
var MIDDLE = msg['PID']['PID.5']['PID.5.1'].toString();
MIDDLE = MIDDLE.replace(/[\s\+]*$/, '');
mapping = msg['PID']['PID.5']['PID.5.1'] = MIDDLE;
channelMap.put('MIDDLE', validate(mapping, '', new Array()));
Comment
-
That can just be with one liners like below if you are just trying to put it in the channelMap and/or assign it back to msg.
PHP Code:$c('middle',msg['PID']['PID.5']['PID.5.1'].toString().replace(/[\s\+]*$/, ''))
msg['PID']['PID.5']['PID.5.1'] = msg['PID']['PID.5']['PID.5.1'].toString().replace(/[\s\+]*$/, '')
Looks like you are viewing the generated script from a mapper step. That generated script, while it works, isn't really what you would code yourself.Last edited by pacmano; 03-19-2023, 11:11 AM.Diridium Technologies, Inc.
https://diridium.com
Comment
Comment