1 | DIEZ3 ;SFISC/MKO-COMPILE INPUT TEMPLATE, BUILD CODE TO CHECK KEYS ;2:54 PM 15 Jul 1999
|
---|
2 | ;;22.0;VA FileMan;**11**;Mar 30, 1999
|
---|
3 | ;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | ;In:
|
---|
6 | ; DIEZKEY(uniqxref#) = count
|
---|
7 | ; DQ = item # in DR string
|
---|
8 | ;
|
---|
9 | GETKEY(DIEZFIL,DIEZFLD,DIEZKEY,DQ) ;Build routine to check keys
|
---|
10 | Q:'$D(DIEZKEY)
|
---|
11 | N DIEZUI
|
---|
12 | ;
|
---|
13 | ;Build code to check field-level keys
|
---|
14 | D L("K"_DQ_"() N DIMAXL,DIUIR,DIXR")
|
---|
15 | S DIEZUI=0
|
---|
16 | F S DIEZUI=$O(DIEZKEY(DIEZUI)) Q:'DIEZUI D
|
---|
17 | . D BLD(DIEZFIL,DIEZFLD,DIEZUI,DQ,DIEZKEY(DIEZUI))
|
---|
18 | Q
|
---|
19 | ;
|
---|
20 | BLD(DIEZFIL,DIEZFLD,DIEZUI,DQ,DIEZCNT) ;Get code for one index DIEZXR
|
---|
21 | N DIEZMAXL,DIEZSLIS,DIEZUIR
|
---|
22 | D XRINFO^DIKCU2(DIEZUI,.DIEZUIR,"",.DIEZMAXL)
|
---|
23 | ;
|
---|
24 | D L(" S DIXR="_DIEZUI)
|
---|
25 | D L(" S @DIEZTMP@(""V"","_DIEZFIL_",DIIENS,"_DIEZFLD_",""N"")=X")
|
---|
26 | D L(" N X D C"_DQ_"X"_DIEZCNT_"(""N"")")
|
---|
27 | D L(" K @DIEZTMP@(""V"","_DIEZFIL_",DIIENS,"_DIEZFLD_",""N"")")
|
---|
28 | D L(" S DIUIR=$NA("_DIEZUIR_") Q:'$D(@DIUIR) 1")
|
---|
29 | ;
|
---|
30 | I $D(DIEZMAXL) D
|
---|
31 | . N ORD,X
|
---|
32 | . S X="S ",ORD=0
|
---|
33 | . F S ORD=$O(DIEZMAXL(ORD)) Q:'ORD D
|
---|
34 | .. S X=X_"DIMAXL("_ORD_")="_DIEZMAXL(ORD)_","
|
---|
35 | . I X?.E1"," D L(" "_$E(X,1,$L(X)-1))
|
---|
36 | ;
|
---|
37 | D L(" Q $$UNIQUE^DIE17(.X,.DA,DIUIR,""C"_DQ_"X"_DIEZCNT_U_DNM_DRN_""""_$S($D(DIEZMAXL):",.DIMAXL",1:"")_")")
|
---|
38 | Q
|
---|
39 | ;
|
---|
40 | L(X) ;Add CODE to ^UTILITY
|
---|
41 | S L=L+1,^UTILITY($J,0,L)=X,T=T+$L(X)+2
|
---|
42 | Q
|
---|