1 | OCXODSP3 ;SLC/RJS,CLA - Rule Display (Display a Data Field) ;10/29/98 12:37
|
---|
2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
|
---|
3 | ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
|
---|
4 | ;
|
---|
5 | EN(OCXD0,OCXTAB,OCXRM,OCXCON) ;
|
---|
6 | ;
|
---|
7 | N OCXD1,OCXD,OCXRD,OCXE,OCXSUB
|
---|
8 | ;
|
---|
9 | S OCXCON=$G(OCXCON),OCXTAB=+$G(OCXTAB) S:'$G(OCXD0) OCXD0=+$$DIC("^OCXS(860.4,","AEMQ") Q:'OCXD0
|
---|
10 | ;
|
---|
11 | S OCXRD="" D DIQ("^OCXS(860.4,",OCXD0,.OCXRD)
|
---|
12 | F OCXSUB="LINK" S OCXD1=0 F S OCXD1=$O(^OCXS(860.4,OCXD0,OCXSUB,OCXD1)) Q:'OCXD1 D
|
---|
13 | .S OCXD(0)=OCXD0,OCXD=OCXD1 D DIQ("^OCXS(860.4,"_OCXD0_","""_OCXSUB_""",",.OCXD,.OCXRD)
|
---|
14 | ;
|
---|
15 | W !
|
---|
16 | W ! D FIELD("Data Field Name:",$G(OCXRD(860.4,OCXD0,.01,"E")),OCXTAB,OCXRM)
|
---|
17 | W ! D FIELD(" Abbreviation:",$G(OCXRD(860.4,OCXD0,1,"E")),OCXTAB,OCXRM)
|
---|
18 | ;
|
---|
19 | I $L(OCXCON),'$D(OCXRD(860.41,OCXCON)) S OCXCON=$O(^OCXS(860.6,"B","DATABASE LOOKUP",0)) I OCXCON,'$D(OCXRD(860.41,OCXCON)) S OCXCON=0
|
---|
20 | ;
|
---|
21 | I 'OCXCON W ! D FIELD(" Data Context:"," ** ERROR ** Data Context not found for this data field.",OCXTAB,OCXRM) Q
|
---|
22 | ;
|
---|
23 | W ! D FIELD(" Data Context:",$P($G(^OCXS(860.6,OCXCON,0)),U,1),OCXTAB,OCXRM)
|
---|
24 | ;
|
---|
25 | D EN^OCXODSP4($G(OCXRD(860.41,OCXCON,1,"E")),OCXTAB+OCXOFF,OCXRM)
|
---|
26 | ;
|
---|
27 | Q
|
---|
28 | ;
|
---|
29 | PARNUM(OCXOPER) ;
|
---|
30 | ;
|
---|
31 | N OCXPF,OCXPFN
|
---|
32 | S OCXPF=$O(^OCXS(863.9,+OCXOPER,"PAR","B","OCXO GENERATE CODE FUNCTION",0)) Q:'OCXPF 0
|
---|
33 | S OCXPF=$G(^OCXS(863.9,+OCXOPER,"PAR",+OCXPF,"VAL"))
|
---|
34 | Q:'$L(OCXPF) 0
|
---|
35 | I OCXPF S OCXPFN=OCXPF
|
---|
36 | E S OCXPFN=0 F S OCXPFN=$O(^OCXS(863.7,"B",$E(OCXPF,1,30),OCXPFN)) Q:'OCXPFN Q:($P($G(^OCXS(863.7,+OCXPFN,0)),U,1)=OCXPF)
|
---|
37 | Q:'OCXPFN 0 Q +$O(^OCXS(863.7,+OCXPFN,"PAR",999),-1)
|
---|
38 | ;
|
---|
39 | FIELD(TITLE,STRING,TAB,MARGIN) ;
|
---|
40 | ;
|
---|
41 | W ?TAB,TITLE
|
---|
42 | ;
|
---|
43 | N PTR,SUBSTR,STRLEN
|
---|
44 | ;
|
---|
45 | S STRLEN=MARGIN-($L(TITLE)+TAB)-5
|
---|
46 | S SUBSTR="" F PTR=1:1:$L(STRING," ") D
|
---|
47 | .I ($L(SUBSTR)>STRLEN) W ?(TAB+$L(TITLE)+1),SUBSTR W:$L($P(STRING," ",PTR+1)) ! S SUBSTR=""
|
---|
48 | .S:$L(SUBSTR) SUBSTR=SUBSTR_" " S SUBSTR=SUBSTR_$P(STRING," ",PTR)
|
---|
49 | W:$L(SUBSTR) ?(TAB+$L(TITLE)+1),SUBSTR
|
---|
50 | Q
|
---|
51 | ;
|
---|
52 | DIC(OCXDIC,OCXDIC0,OCXDICA,OCXX,OCXDICS,OCXDR) ;
|
---|
53 | ;
|
---|
54 | N DIC,X,Y
|
---|
55 | S DIC=$G(OCXDIC) Q:'$L(DIC) -1
|
---|
56 | S DIC(0)=$G(OCXDIC0) S:$L($G(OCXX)) X=OCXX
|
---|
57 | S:$L($G(OCXDICS)) DIC("S")=OCXDICS
|
---|
58 | S:$L($G(OCXDICA)) DIC("A")=OCXDICA
|
---|
59 | S:$L($G(OCXDR)) DIC("DR")=OCXDR
|
---|
60 | D ^DIC Q:(Y<1) 0 Q Y
|
---|
61 | ;
|
---|
62 | ;
|
---|
63 | DIQ(DIC,DA,OCXARY) ;
|
---|
64 | ;
|
---|
65 | N DR,DIQ S DR=".01:99999",DIQ="OCXARY(",DIQ(0)="IEN" D EN^DIQ1
|
---|
66 | Q
|
---|
67 | ;
|
---|
68 | MULT(OCXD0,OCXTAB,OCXRM) ;
|
---|
69 | ;
|
---|
70 | N OCXCON
|
---|
71 | S OCXCON=0 F S OCXCON=$O(^OCXS(860.4,OCXD0,"LINK",OCXCON)) Q:'OCXCON D EN(OCXD0,OCXTAB,OCXRM,OCXCON)
|
---|
72 | Q
|
---|
73 | ;
|
---|