Hey Shamus. I do appreciate you replying, however I may not be being clear in my original question.

Even if I have the correct settings in the Business Service, if the content format is one that conflicts with UTF-8, the display within the management portal will show as per my examples because the browser is trying to display non UTF-8 content as UTF-8. My original question was asking how others work with this.

If you spot my second top-level comment, you will see that I had looked into using the browser to change the http content-type header, but that the major browsers no longer support such a feature.

I'm guessing my only option is to export a message and then review the content there.

Hey Shamus.

I'm back to eat some humble pie!

Turns out, I had confused myself early on and wrongly believed that Windows-1252/Latin1 were the same and I had my service set to Latin 1. This was then creating a scenario where I was digging myself into a hole of bad information.

In fact, they are almost the same except for the exact characters I was using in my example. These code points are used by Latin-1 as control codes, and when Windows-1252 is mislabeled as Latin-1 they get lost...

Thanks again for replying to my initial question and comments.

I have looked at how I can change the behavior of the browser, but it seems that the big 3 (well, two) no longer have this feature. Here is an article giving some back story.

Basically, Chrome used to have the option to manually overwrite the encoding type, but this was removed (however there are some 3rd party extensions out there to replace this feature, but I feel uncomfortable using random 3rd party extensions around healthcare data)

Firefox also used to have this feature, but they replaced it with a tool that attempts to repair the character encoding, however it didn't do a great job as it decided it was "IBM866" so the content looked like this:

Hey Leon.

The element of this issue that is perplexing me is that there is a difference between the RAW and Full view.

Could you try sending a sample message to a HL7 File operation with the charset set to UTF-8? I'm curious to know if the characters display as expected, stay as the ANSI character, or become something else.

I am wondering if the ANSI displaying in just the Full message viewer is contained to just the display of the full message, and any issues you are seeing in a destination system are a separate but similar issue with character encoding.

Hey Yuri.

Depending on the context, this answer I gave for a similar question may be relevant:

...you can pass ..Adapter.ExecuteQuery() a snapshot object (EnsLib.SQL.Snapshot) which will then get populated rather than a getting a result set returned. With this populated snapshot object, you can then iterate through it using its Next() method just like the result set, but then you can use its Rewind() method. 

For example:

Set Snapshot = ##Class(EnsLib.SQL.Snapshot).%New()
Set sql = "SELECT * FROM MY_TABLE WHERE X= '"_Y_"'"
Set status = ..Adapter.ExecuteQuery(Snapshot, sql)
While Snapshot.Next(){
  //First run through of snapshot
}
Do Snapshot.Rewind()
While Snapshot.Next(){
  //Second run through of snapshot
}

Hey Nicola.

As an alternative to Davids response, you can pass ..Adapter.ExecuteQuery() a snapshot object (EnsLib.SQL.Snapshot) which will then get populated rather than a getting a result set returned. With this populated snapshot object, you can then iterate through it using its Next() method just like the result set, but then you can use its Rewind() method. 

For example:

Set Snapshot = ##Class(EnsLib.SQL.Snapshot).%New()
Set sql = "SELECT * FROM MY_TABLE WHERE X= '"_Y_"'"
Set status = ..Adapter.ExecuteQuery(Snapshot, sql)
While Snapshot.Next(){
  //First run through of snapshot
}
Do Snapshot.Rewind()
While Snapshot.Next(){
  //Second run through of snapshot
}

Something to be mindful of - as I'm passing ..Adapter.ExecuteQuery() an object rather than trying to get it to output something, the period before the variable is intentionally missing in my example.

Hey Ben.

I use a program called ScreenToGif.

Since moving to remote working it has become invaluable for demonstrating functionality for apps via email or IM. However it gets the most use when I'm reporting bugs to a supplier, or in this case how I'm incorrectly using VSCode extensions smiley

I'm pretty sure it's a Windows-only app, so you may need to find an alt if you're on another OS and wish to try it out.

*edit*

As a tip, try to keep any gifs you do make for bug reporting fairly short. No one wants to be waiting 2 minutes for a gif to loop because they missed the important part!

Hey Ben.

Specifically looking to be able reformat the code layout. For example, if I was working with javascript or json, I can use the keyboard command Shift+Alt+F and it will reformat the code:

However, when I attempt this with the language set to ObjectScript or ObjectScript-Class, pressing that same keyboard shortcut gives a popup stating no formatter is installed and it directs me to the Extension Marketplace

Hey Kurro.

To access values from your message class, you will need to alter your references to your class in your if statements.

For example, rather than just calling "CodigoProveedor", you will need to state "Document.CodigoProveedor" so that the router is looking for "CodigoProveedor" within the document received by the router.

You can test this by adding a new "When" within your Rule and use the expression editor to start type "Document.Cod" and this should then start giving you autocomplete options. For example:

As an aside (and because it's caught me out a few times) if your router is working with just custom classes and not HL7, do make sure your router is a General message router and not a HL7 message router as this can sometimes lead to odd errors.

Hey Yone.

Assuming you're only using ObjectScript for this, then way to achieve this would be to take your HL7 as Enslib.HL7.Message, and then loop through the segments to pull out the PID segment, and then loop through PID:3 for a match.

For example:

//loop through HL7 and find PID Segment
set SegCount = request.SegCount
for i=1:1:SegCount{
    set segment = request.GetSegmentAt(i)
    if (segment.Name="PID"){
        //Loop through PID:3
        set numCnt = segment.GetValueAt("3(*)")
        for j=1:1:numCnt{
            set P341=segment.GetValueAt("3("_j_").4.1")
            set P5=segment.GetValueAt("3("_j_").5")
            if (P341="CAC")&&(P5="JHN") {
                $$$TRACE("Match found!")
                }
        }
    }
}

Alternatively, you could create a DTL with the logic which you can from the ObjectScript, and then have the target in your DTL be something like a string container that you can then grab a result from. However that might be a bit clunky depending on your use case.