Question
· Mar 24, 2022

Howto add / remove searchtable items

Hello,

I'd like to add/remove items to/from a custom HL7 searchtable (which extends EnsLib.HL7.SearchTable).

Adding new items worked fine by:

  • -add new item to class definition
  • compile class in all namespaces
  • reindexing messages with the BuildIndex() method

Question 1:

How can I remove items from the searchtable properly? Doing the same as above (removing them from the class, recompiling, reindexing) seemed to work, but the removed items still appear in the message viewer's search criteria list. So I think there must be an additional step to the procedure. What am I missing?

I've seen the globals ^Ens.Config.SearchTablePropD and ^Ens.Config.SearchTablePropI. Must I delete the corresponding entries by hand or is there a more secure way?

Question 2:

I'd like to do the same with the messagebank searchtable. Our messagebank contains more than 2x10^9 HL7 messages, is there a way to do the reindexing efficiently, e.g. reindexing in chunks of a certain number of messages, (how) can I turn off journaling, etc.?

Thanks in advance for your help!

Regards,
Stefan

Product version: IRIS 2021.1
$ZV: IRIS for UNIX (SUSE Linux Enterprise Server for x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:48:27 EDT
Discussion (3)1
Log in or sign up to continue

1. I would stay away from Modifying the current EnsLib.HL7.SearchTable if at all necessary. Modifying the source code could lead to consequences down the road, especially when you upgrade it might get overwritten. What I did was that I copied the existing code and modified it for our use. That way we can add and remove fields anytime we want.

Class osuwmc.HL7SearchTable Extends (%Persistent, Ens.VDoc.SearchTable) [ ClassType = persistent, CompileAfter = EnsLib.HL7.Message, Inheritance = right, ProcedureBlock, System = 4 ]

{

Parameter DOCCLASS = "EnsLib.HL7.Message";

Parameter EXTENTSIZE = 4000000;

/* Re-declare indices because the superclass is abstract */

Index indexValue On (PropId, PropValue, DocId) [ IdKey, Unique ];

Index indexDocId On (DocId, PropId, PropValue) [ Unique ];

XData SearchSpec [ XMLNamespace = "http://www.intersystems.com/EnsSearchTable" ]

{

<Items>

<Item DocType=""  PropName="MSHTypeName" Unselective="true">{1:9.1}_"_"_{1:9.2}</Item>

<Item DocType=""  PropName="MSHControlID" PropType='String:CaseSensitive' >{1:10}</Item>

<Item DocType=""  PropName="PatientID"   >[PID:2.1]</Item>

<Item DocType=""  PropName="PatientID"   >[PID:3().1]</Item>

<Item DocType=""  PropName="PatientID"   >[PID:4().1]</Item>

<Item DocType=""  PropName="PatientName" >[PID:5()]</Item>

<Item DocType=""  PropName="PatientAcct" >[PID:18.1]</Item>

<Item DocType=""  PropName="Order#"      >[ORC:2.1]</Item>

<Item DocType=""  PropName="Order#"      >[SCH:26.1]</Item>

<Item DocType=""  PropName="Order#"      >[ZOR:1]</Item>

<Item DocType=""  PropName="Accession#"  >[ORC:3.1]</Item>

<Item DocType=""  PropName="SIUVisitType">[AIS():3.1]</Item>

<Item DocType=""  PropName="SIUProvider#">[AIP():3.1]</Item>

</Items>

}

Storage Default

{

<Data name="HL7SearchTableDefaultData">

<Value name="1">

<Value>%%CLASSNAME</Value>

</Value>

</Data>

<DataLocation>^osuwmc.HL7SearchTableD</DataLocation>

<DefaultData>HL7SearchTableDefaultData</DefaultData>

<ExtentSize>4000000</ExtentSize>

<IdLocation>^osuwmc.HL7SearchTableD</IdLocation>

<IndexLocation>^osuwmc.HL7SearchTableI</IndexLocation>

<StreamLocation>^osuwmc.HL7SearchTableS</StreamLocation>

<Type>%Library.CacheStorage</Type>

}

}

Hi Scott,

1. I would stay away from Modifying the current EnsLib.HL7.SearchTable if at all necessary. Modifying the source code could lead to consequences down the road, especially when you upgrade it might get overwritten.  

Thanks for your answer!

First: we did not modify EnsLib.HL7.SearchTable directly, our searchtable class is a subclass of this class.

But defining a new searchtable as you suggest seems to make sense. On the other hand all config items using the "old" searchtable must be modified.

Regards

Stefan