Question
· Sep 2

SearchTable properties not populating

I created a Custom Search Table that extends EnsLib.HL7.Search Table. I saved, compiled, and rebuilt the index however when I go into Message Search to try to use the Search Table, within the conditions the proper fields are not showing up that was defined. It is showing the fields from EnsLib.HL7.SearchTable. I did a build index on both EnsLib.HL7.SearchTable and OSU.HL7.SearchTable.

Class OSU.HL7.SearchTable Extends EnsLib.HL7.SearchTable
{

Parameter DOCCLASS = "EnsLib.HL7.Message";

Parameter EXTENTSIZE = 4000000;

XData SearchSpec [ XMLNamespace = "http://www.intersystems.com/EnsSearchTable" ]
{
<Items>
<Item DocType=""  PropName="PrimaryIdent" >[STF:1.1]</Item>
<Item DocType=""  PropName="StaffIdent"   >[STF:2().1]</Item>
<Item DocType=""  PropName="StaffName"    >[STF:3()]</Item>
</Items>
}

/// Location and Revision of this file in Perforce (Auto-updating)
Parameter SrcVer = "$Id$";

Storage Default
{
<Type>%Storage.Persistent</Type>
}

}
Product version: IRIS 2024.2
$ZV: HealthShare Provider Directory 2024.2.0 Build: 1009 [HealthShare Modules: Core:28.0 + Provider Directory:28.0] - IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2_24113U) Wed Jul 2 2025 16:36:55 EDT [Core:28.0|Provider Directory:2
Discussion (6)4
Log in or sign up to continue

Your issue with the custom search table not showing the correct fields in Message Search likely stems from incomplete steps or improperly applied configurations when rebuilding the indices.

Key Points and Suggestions:

  1. Rebuilding the Index:
    After modifying a SearchTable, you must rebuild its index to ensure updates take effect. Utilize the .BuildIndex() method on your class after recompiling it. This process enables the system to index messages using your newly added properties, replacing old indexed fields. To confirm, try:

    Set sc = ##class(OSU.HL7.SearchTable).BuildIndex()
    

    This ensures that the SearchTable recognizes your fields ([1][2]).

  2. Checking Existing Index Entries:
    If fields from EnsLib.HL7.SearchTable persist, verify whether data on globals ^Ens.Config.SearchTablePropD and ^Ens.Config.SearchTablePropI matches your SearchSpec configuration. A potential approach to clean residual entries is calling .DeleteProps() on the class, then recompiling ([1]).

  3. Namespace Configuration:
    If the issue persists, confirm the namespace's mappings for the SearchTable are correct. The Business Service (or Operation) using your custom SearchTable must reference the new class explicitly. Open the production settings for the HL7 Business Service and verify the lookup table assignment ([3][2]).

  4. Extended XData Validation:
    Ensure XData SearchSpec syntax accurately reflects your intended fields. Misconfigurations like unqualified paths or unsupported formats may lead to indexing issues ([4][1]).

  5. Message Viewer and Globals:
    If fields still don't appear in the Message Viewer, check the global ^Ens.DocClassMap. If corrupted, rebuilding might be necessary as outlined in the documentation ([5]).

  6. Assess Field Uniqueness:
    Using Unselective="true" might help in cases where certain fields (like [STF:3()]) aren't highly unique and affect indexing and search performance. For detailed query evaluation, enable SQL logging with:

    Set ^Ens.Debug("UtilEnsMessages","sql") = 1
    

    This allows testing query execution for refining criteria ([6][7]).

These steps should guide you toward resolving field visibility and SearchTable functionality issues. If problems persist despite proper configurations, ensure all components and schema pathways align.

Sources: