Brendan's post is a related issue, but it's important to note that what he describes only applies if you want to update the value of a specific field when that field contains > 32K of data.  The total size of the message isn't an issue.

As an example: if you have an ORU message with a 10 MB PDF stored in OBX:5, you will still be able to update fields in the PID segment using standard DTL functions. But if you want to update OBX:5 you will need to use the functions that Brendan mentioned.

The content of an EnsLib.HL7.Message is actually stored in streams, which don't have a fixed size, so theoretically there is no maximum size for an HL7 message.

The RawContent property is a bit misleading. This is a convenience for accessing the content of the message, but it's not where the content is actually stored. RawContent is generated dynamically from the underlying streams but only returns the first 10000 characters.

If you want to access the full, raw, untruncated message you can use one of the OutputTo* methods such as OutputToLibraryStream.

Hi Stephen,

This can be done with a custom query. See below for some sample code that takes the form of a stored procedure. This stored procedure only handles items in a single namespace, but you could adapt it to run across multiple namespaces.

To call the stored procedure from a SQL query tool:
call Sample.Util_SettingsByName('Port')

The parameter you pass is the name (or names, comma-separated) of the setting(s) you want to get a list of. Leave it blank to get a list of all settings.


Class Sample.Util Extends %RegisteredObject

         *                 ** N O T I C E **                 *
         *               - TEST/DEMO SOFTWARE -              *
         * This and related items are not supported by       *
         * InterSystems as part of any released product.     *
         * It is supplied by InterSystems as a demo/test     *
         * tool for a specific product and version.          *
         * The user or customer is fully responsible for     *
         * the maintenance of this software after delivery,  *
         * and InterSystems shall bear no responsibility nor *
         * liabilities for errors or misuse of this item.    *
         *                                                   *
Query SettingsByName(SettingName As %String) As %Query(ROWSPEC = "BusinessHost:%String,SettingName:%String,SettingValue:%String") [ SqlProc ]

ClassMethod SettingsByNameExecute(ByRef qHandle As %Binary, SettingNames As %String = "") As %Status
    s qHandle=##class(%ArrayOfObjects).%New()

    &sql(select %DLIST(id) into :tHostIDs from ENS_Config.Item order by Name desc)
    s tHostIDList=##class(%Library.ListOfDataTypes).%New()
    s tSC=tHostIDList.InsertList(tHostIDs)
    s tSC=qHandle.SetAt(tHostIDList,"HostIDs")

    s tSC=qHandle.SetAt(##class(%ArrayOfDataTypes).%New(),"Counters")
    s tSC=qHandle.GetAt("Counters").SetAt(0,"CurrHost")
    s tSC=qHandle.GetAt("Counters").SetAt(0,"CurrSetting")
    if ($L(SettingNames)>1) {
        s SettingNames=$ZCONVERT(SettingNames,"U")
        s tFilterList=##class(%Library.ListOfDataTypes).%New()
        s tSC=tFilterList.InsertList($LISTFROMSTRING(SettingNames))
         s tSC=qHandle.SetAt(tFilterList,"FilterList")

    Quit $$$OK

ClassMethod SettingsByNameClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = SettingsByNameExecute ]
    Quit $$$OK

ClassMethod SettingsByNameFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = SettingsByNameExecute ]
    s tCurrHost=qHandle.GetAt("Counters").GetAt("CurrHost")
    s tCurrSetting=qHandle.GetAt("Counters").GetAt("CurrSetting")
    s tHostIDs=qHandle.GetAt("HostIDs")
    s tFilterList=qHandle.GetAt("FilterList")
    s oHost=qHandle.GetAt("Host")

    do {
        if ('$IsObject(oHost)||(oHost.VirtualSettings.Count()<tCurrSetting)) {
            if (tCurrHost=tHostIDs.Count()) {
                s AtEnd=1

            s tCurrHost=tCurrHost+1
            s tCurrSetting=1
            s tHostID=tHostIDs.GetAt(tCurrHost)
            s oHost=##class(Ens.Config.Item).%OpenId(tHostID,0)
            s tSC=oHost.PopulateVirtualSettings()

            s tSC=qHandle.SetAt(oHost,"Host")                
            s tSC=qHandle.GetAt("Counters").SetAt(tCurrHost,"CurrHost")

        s tSettings=oHost.VirtualSettings
        s tSetting=tSettings.GetAt(tCurrSetting)
        s tStngName=$LISTGET(tSetting,2)
        s tStngValue=$LISTGET(tSetting,3)
        s tCurrSetting=tCurrSetting+1
    } while ($IsObject(tFilterList)&&('tFilterList.Find($ZCONVERT(tStngName,"U"))))
    if ('AtEnd) {
        s Row=$LB(oHost.Name,tStngName,tStngValue)
    s tSC=qHandle.GetAt("Counters").SetAt(tCurrSetting,"CurrSetting")
    Quit $$$OK


If you just need to get an output value based on different input values, a lookup table would be the best option.

If you actually need to execute completely different logic depending on the input value, then you can consider using code actions to add a series of ElseIfs, which are much easier to read than deeply nested if blocks.