Ens.MessageHeader has a Status column. You may need to select on the name or its corresponding number depending on select mode. For example, status "Suspended" is 5. If selecting in display mode, use Status='Suspended' and in raw mode use Status=5 in your where clause.
The number for each status is defined in macros in EnsConstants.inc - the ones that start with eMessageStatus
I was able to find APIs for the tasks being performed in Sebastian's custom code. It is preferrable that APIs are used rather than direct global access. I also discovered another method of finding the PatientID, rather than having to extract it from the RowID. This code should be equivalent to Sebastian's code:
{
set patientid = %request.Data("PatientID",1)
set streamletID = ##class(web.SDA3.Loader).GetStreamletId(,patientid,"ALG",id)
set tSC = ##class(HS.SDA3.Container).LoadSDAObject(streamletID,.allergySDA3)
set sneeziness = allergySDA3.sneeziness
quit sneeziness
}
![Open Sesame!](https://community.intersystems.com/sites/default/files/badges/303371180-6de11138-f4e7-4113-b5cc-836269f07693.png)
![1,000 Points](https://community.intersystems.com/sites/default/files/badges/290121674-53216c4b-fe0c-44e7-9d75-2f24390135ed.png)
![Challenge Starter](https://community.intersystems.com/sites/default/files/badges/295959213-b83dd91a-663f-4f07-8e0e-e3287b7c2309.png)
![5,000 Points](https://community.intersystems.com/sites/default/files/badges/290121698-6976e2e4-084b-4026-bc5f-728c5e1ebe41.png)
![Popular writer](https://community.intersystems.com/sites/default/files/badges/poular_writer.png)
![Notable writer](https://community.intersystems.com/sites/default/files/badges/303371140-d391d770-6fa4-4540-a8d5-926f8dfe9f61.png)
![DC Author](https://community.intersystems.com/sites/default/files/badges/dc_author_0.png)
The reason this is happening is because your message specifies UTF-8 in MSH:18. If you remove that from your test message, it will look correct.
When using the 'test' button to test a DTL, it will always try to use the encoding defined in MSH:18 to read the message.
When using a business service to read the message, it will try to use the encoding defined in MSH:18 if it is defined. If it is not defined, then the 'Default Char Encoding' setting determines which encoding will be used. You can force the 'Default Char Encoding' to override MSH:18 by putting a ! before it.
http://docs.intersystems.com/ens20161/csp/docbook/DocBook.UI.Page.cls?KE...