source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXODSP4.m@ 619

Last change on this file since 619 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1OCXODSP4 ;SLC/RJS,CLA - Rule Display (Display a MetaDictionary Link) ;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 ;
5EN(OCXLINK,OCXTAB,OCXRM,OCXCON) ;
6 ;
7 N OCXD0,OCXD1,OCXD,OCXRD,OCXE,OCXSUB,OCXPAR,OCXSP,OCXMAX
8 ;
9 I '$L(OCXLINK) W !! D FIELD("Metadictionary Link:"," ** ERROR ** Link not found ",OCXTAB,OCXRM)
10 ;
11 S OCXD0=$O(^OCXS(863.3,"B",OCXLINK,0))
12 I 'OCXD0 W !! D FIELD("Metadictionary Link:"," '"_OCXLINK_"' ** ERROR ** Link not found ",OCXTAB,OCXRM)
13 S OCXTAB=+$G(OCXTAB)
14 ;
15 S OCXRD="" D DIQ("^OCXS(863.3,",OCXD0,.OCXRD)
16 F OCXSUB="PAR" S OCXD1=0 F S OCXD1=$O(^OCXS(863.3,OCXD0,OCXSUB,OCXD1)) Q:'OCXD1 D
17 .S OCXD(0)=OCXD0,OCXD=OCXD1 D DIQ("^OCXS(863.3,"_OCXD0_","""_OCXSUB_""",",.OCXD,.OCXRD)
18 ;
19 W !
20 W ! D FIELD("Metadictionary Link:",OCXRD(863.3,OCXD0,.01,"E"),OCXTAB,OCXRM)
21 W ! D FIELD(" Attribute:",OCXRD(863.3,OCXD0,.05,"E"),OCXTAB,OCXRM)
22 W ! D FIELD(" Data Type:",$$DTYP(OCXRD(863.3,OCXD0,.05,"I")),OCXTAB,OCXRM)
23 ;
24 S (OCXMAX,OCXD1)=0 F S OCXD1=$O(OCXRD(863.32,OCXD1)) Q:'OCXD1 D
25 .I $D(OCXRD(863.32,OCXD1,.01,"E")),$D(OCXRD(863.32,OCXD1,1,"E")) D
26 ..N PARNAME S PARNAME=OCXRD(863.32,OCXD1,.01,"E") S:($L(PARNAME)>OCXMAX) OCXMAX=$L(PARNAME)+2
27 ;
28 S OCXSP="",$P(OCXSP," ",OCXMAX+10)=" ",OCXD1=0 F S OCXD1=$O(OCXRD(863.32,OCXD1)) Q:'OCXD1 D
29 .I $D(OCXRD(863.32,OCXD1,.01,"E")),$D(OCXRD(863.32,OCXD1,1,"E")) D
30 ..N PARNAME,PARVAL S PARNAME=OCXRD(863.32,OCXD1,.01,"E"),PARVAL=OCXRD(863.32,OCXD1,1,"E")
31 ..S PARNAME=$E(OCXSP,$L(PARNAME),OCXMAX)_PARNAME W ! D FIELD(PARNAME_":",PARVAL,OCXTAB,OCXRM)
32 ;
33 Q
34 ;
35DTYP(ATTR) ;
36 ;
37 N OCXDTYP,PARNUM
38 Q:'ATTR " ** ATTRIBUTE NOT DEFINED ** "
39 Q:'$D(^OCXS(863.4,ATTR,0)) " ** ATTRIBUTE '"_ATTR_"' NOT DEFINED ** "
40 S OCXDTYP=$O(^OCXS(863.8,"B","DATA TYPE",0)) Q:'OCXDTYP " ** NOT IN PARAMETER FILE **"
41 S PARNUM=$O(^OCXS(863.4,ATTR,"PAR","B",OCXDTYP,0)) Q:'PARNUM " ** DATA TYPE NOT SPECIFIED **"
42 S OCXDTYP=$G(^OCXS(863.4,ATTR,"PAR",PARNUM,"VAL")) Q:'$L(OCXDTYP) " ** DATA TYPE NOT SPECIFIED **"
43 Q OCXDTYP
44 ;
45PARNUM(OCXOPER) ;
46 ;
47 N OCXPF,OCXPFN
48 S OCXPF=$O(^OCXS(863.9,+OCXOPER,"PAR","B","OCXO GENERATE CODE FUNCTION",0)) Q:'OCXPF 0
49 S OCXPF=$G(^OCXS(863.9,+OCXOPER,"PAR",+OCXPF,"VAL"))
50 Q:'$L(OCXPF) 0
51 I OCXPF S OCXPFN=OCXPF
52 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)
53 Q:'OCXPFN 0 Q +$O(^OCXS(863.7,+OCXPFN,"PAR",999),-1)
54 ;
55FIELD(TITLE,STRING,TAB,MARGIN) ;
56 ;
57 W ?TAB,TITLE
58 ;
59 N PTR,SUBSTR,STRLEN
60 ;
61 S STRLEN=MARGIN-($L(TITLE)+TAB)-5
62 S SUBSTR="" F PTR=1:1:$L(STRING," ") D
63 .I ($L(SUBSTR)>STRLEN) W ?(TAB+$L(TITLE)+1),SUBSTR W:$L($P(STRING," ",PTR+1)) ! S SUBSTR=""
64 .S:$L(SUBSTR) SUBSTR=SUBSTR_" " S SUBSTR=SUBSTR_$P(STRING," ",PTR)
65 W:$L(SUBSTR) ?(TAB+$L(TITLE)+1),SUBSTR
66 Q
67 ;
68DIC(OCXDIC,OCXDIC0,OCXDICA,OCXX,OCXDICS,OCXDR) ;
69 ;
70 N DIC,X,Y
71 S DIC=$G(OCXDIC) Q:'$L(DIC) -1
72 S DIC(0)=$G(OCXDIC0) S:$L($G(OCXX)) X=OCXX
73 S:$L($G(OCXDICS)) DIC("S")=OCXDICS
74 S:$L($G(OCXDICA)) DIC("A")=OCXDICA
75 S:$L($G(OCXDR)) DIC("DR")=OCXDR
76 D ^DIC Q:(Y<1) 0 Q Y
77 ;
78 ;
79DIQ(DIC,DA,OCXARY) ;
80 ;
81 N DR,DIQ S DR=".01:99999",DIQ="OCXARY(",DIQ(0)="IEN" D EN^DIQ1
82 Q
83 ;
84MULT(OCXD0,OCXTAB,OCXRM) ;
85 ;
86 Q
87 ;
Note: See TracBrowser for help on using the repository browser.