DDR FINDER and Compound Indexes

41 views
Skip to first unread message

Jonathan Harrison

unread,
Jul 15, 2021, 8:23:05 AM7/15/21
to Hardhats
I'm struggling to figure out the correct syntax for using the DDR FINDER RPC and a compound index. The RPC calls FIND^DIC() via DDR0.m but the documentation for FIND^DIC only shows setting array values as a separate step before calling FIND^DIC which isn't something that can be done (that I know of) via an RPC.

From FM 22.2 DG:
If the lookup index is compound, then lookup values can be provided for each of the data value subscripts in the index. In that case, value is passed by reference as an array where VALUE(n) represents the lookup value to be matched to the nth subscript in the index.

Example:
>K VAL S VAL(1)=“ADD”,VAL(2)=“01/01/69”
>D FIND^DIC(662001,“”,“@;IXIE”,“PK”,.VAL,“”,“”,“”,“”,“OUT”)


So my question is, how do I pass an array for VALUE to DDR FINDER?

Kevin Toppenberg

unread,
Jul 15, 2021, 10:03:10 AM7/15/21
to Hardhats

It seems to show the passing by reference (e.g.    .val  ).  But everwhere else in Fileman, arrays seem to always be passed by name, (e.g.   "val").   I have not used this functionality recently.  But I would be curious what would happen when passing by name.

Also, I'm looking at the value you gave for the field:  "@;IXIE"  -- I don't see that you are specifying any field at all for it to search.    You give a suffix of I and E.  And the documentation says this can be put after IX, but the example they give is .01IE etc.    I admit to being a bit confused about this.

Kevin

Sam Habiel

unread,
Jul 15, 2021, 10:15:16 AM7/15/21
to hardhats
DDR FINDER is scantly documented. My advice is to record what gets passed and experiment, which you are good at.

As to using specific Fileman calls, grep the VistA source code. There are good examples.

--Sam


--
--
http://groups.google.com/group/Hardhats
To unsubscribe, send email to Hardhats+u...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "Hardhats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hardhats+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hardhats/13fc454d-466b-48ce-8887-0854c5c38869n%40googlegroups.com.

Jonathan Harrison

unread,
Aug 3, 2021, 9:25:32 PM8/3/21
to Hardhats
Thanks for the responses. Gmail sent everything Hardhats to spam so I didn't see it until now.

The IXIE returns (as I understand it) the Internal and External (IE) values of the matched index (IX).

FIND^DIC does indeed take an array for .VAL but the issue is that the RPC, DDR FINDER takes just a single array of all parameters that will get passed on to FIND^DIC so there's no way to build a value array or pass it by reference when using the DDR FINDER RPC.

What's interesting is that that there is a tag in DDR0.m designed for exactly this case though. DDR FINDER uses the FINDC tag in DDR0 but there is also a FINDI tag with the comment " ; -- improved broker callback to find data,it can handle compound index" and it does have a method for unpacking an array value. Unfortunately there isn't a single RPC in any package that uses the FINDI tag.
Reply all
Reply to author
Forward
0 new messages