Announcement

Collapse
No announcement yet.

Making an Entire Message Upper Case

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • siddharth
    replied
    you need to do it in the pre-processing script where the message is in a Javascript string format, just what Nick has mentioned in earlier post.

    Leave a comment:


  • vnetherw
    replied
    I also need to ensure the entire message is upper case, however capitalizing each word is not the same as making each word upper case.
    When I tried to call toUpperCase() on msg, I found that the message became undefined because the tags were no longer recognised following conversion to upper case.
    The same problem happened when I called toUpperCase() on a single segment.
    Is there a method I can use that will leave the tags and only capitalize the content?

    Leave a comment:


  • narupley
    replied
    In the preprocessor script, "message" is a JavaScript String.

    Leave a comment:


  • sanderson
    replied
    String?

    Is message a string or an instance of a class called message?

    the method will only work on a string if its a class all you'll get is MESSAGE - I think !??!? or in most cases with something that fails badly in javascript it kind of pretends that there was no problem!


    Originally posted by atibbits View Post
    Is there a way to tell the whole message to change to Upper Case? I have tried to put

    var newMessage = message.toUpperCase();

    in the preprocessor, but that doesn't seem to work.

    Any suggestions??


    Thanks!!!!

    Leave a comment:


  • narupley
    replied
    Did you actually return that?

    Code:
    return newMessage;
    Also, that will only work if the raw message starts with a word... if you're trying to do that with an HL7 v2.x message it won't work because that starts with "MSH|^~\&".

    If you want to convert each individual field/component to uppercase, then you should do that in a transformer. You can do something similar to this: http://www.mirthcorp.com/community/f...0642#post30642

    Instead of replacing, you can just call toUpperCase(). Or if you want to capitalize every single word (not just the first), use this: WordUtils.capitalizeFully(str)

    Leave a comment:


  • atibbits
    started a topic Making an Entire Message Upper Case

    Making an Entire Message Upper Case

    Is there a way to tell the whole message to change to Upper Case? I have tried to put

    var newMessage = message.toUpperCase();

    in the preprocessor, but that doesn't seem to work.

    Any suggestions??


    Thanks!!!!
Working...
X