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>
}
}
Comments
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:
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]).
Checking Existing Index Entries: If fields from
EnsLib.HL7.SearchTablepersist, verify whether data on globals^Ens.Config.SearchTablePropDand^Ens.Config.SearchTablePropImatches your SearchSpec configuration. A potential approach to clean residual entries is calling.DeleteProps()on the class, then recompiling ([1]).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]).
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]).
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]).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") = 1This 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:
Just to check, how did you "build index on both EnsLib.HL7.SearchTable and OSU.HL7.SearchTable."?
d ##class(EnsLib.HL7.SearchTable).BuildIndex()
d ##class(OSU.HL7.SearchTable).BuildIndex()
Hi Scott. Is your business host (the business service or business operation) configured to use this custom search table?
Yes it was.
I tested with your custom search table and was able to see these fields in the extended criteria when the class is compiled successfully and when I chose the correct search table class. If you continue to have this issue, you could consider contacting the WRC so we can help you with the issue.