source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOCMPE.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1OCXOCMPE ;SLC/RJS,CLA - ORDER CHECK CODE COMPILER (Compile Rule Elements cont...) ;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 ;
6 ;
7 Q
8 ;
9GETC(OCXD0,OCXD1,OCXP) ;
10 ;
11 N OCXNULL
12 S OCXNULL=$$GETPARM(39,OCXOPER,"OCXO NULL VALUE ALLOWED")
13 I '$D(OCXP("PDFLD")) D WARN^OCXOCMPV("CMPE1 Primary Data field not defined",3,OCXD0,$P($T(+1)," ",1)) Q
14 I $D(OCXP("PDFLD")) S OCXP("PDFLD")=$$GV(OCXD0,OCXD1,"DFLD1",OCXOPDT,OCXNULL)
15 I '$L(OCXP("PDFLD")) D WARN^OCXOCMPV("CMPE2 Primary Data field not defined",3,OCXD0,$P($T(+1)," ",1)) Q
16 ;
17 I $D(OCXP("CVAL")) D I '$L(OCXP("CVAL")) D WARN^OCXOCMPV("Comparison Value/Field not defined",3,OCXD0,$P($T(+1)," ",1)) Q
18 .S OCXP("CVAL")=$$GV(OCXD0,OCXD1,"VAL1",OCXOPDT,OCXNULL)
19 .I '$L(OCXP("CVAL")) S OCXP("CVAL")=$$GV(OCXD0,OCXD1,"DFLD2",OCXOPDT,OCXNULL)
20 ;
21 I $D(OCXP("CLVAL")) D I '$L(OCXP("CLVAL")) D WARN^OCXOCMPV("Comparison Value/Field minimum value not defined",3,OCXD0,$P($T(+1)," ",1)) Q
22 .S OCXP("CLVAL")=$$GV(OCXD0,OCXD1,"VAL1",OCXOPDT,OCXNULL)
23 .I '$L(OCXP("CLVAL")) S OCXP("CLVAL")=$$GV(OCXD0,OCXD1,"DFLD2",OCXOPDT,OCXNULL)
24 ;
25 I $D(OCXP("CHVAL")) D I '$L(OCXP("CHVAL")) D WARN^OCXOCMPV("Comparison Value/Field maximum value not defined",3,OCXD0,$P($T(+1)," ",1)) Q
26 .S OCXP("CHVAL")=$$GV(OCXD0,OCXD1,"VAL2",OCXOPDT,OCXNULL)
27 .I '$L(OCXP("CHVAL")) S OCXP("CHVAL")=$$GV(OCXD0,OCXD1,"DFLD3",OCXOPDT,OCXNULL)
28 ;
29 S OCXCOD1="S OCXCODE=$$"_OCXP
30 I $O(OCXP(0)) S OCXCOD1=OCXCOD1_"(",OCXD2=0 F S OCXD2=$O(OCXP(OCXD2)) Q:'OCXD2 D
31 .I ($E(OCXP(OCXP(OCXD2)),1)="""") S OCXCOD1=OCXCOD1_""""""_OCXP(OCXP(OCXD2))_""""""
32 .E S OCXCOD1=OCXCOD1_""""_OCXP(OCXP(OCXD2))_""""
33 .I $O(OCXP(OCXD2)) S OCXCOD1=OCXCOD1_","
34 .E S OCXCOD1=OCXCOD1_")"
35 X OCXCOD1
36 I '$L(OCXCODE) D WARN^OCXOCMPV("Execute code missing for '"_OCXCOD1_"'",2,OCXD0,$P($T(+1)," ",1)) Q
37 I OCXTLOG,(OCXCODE["$$") D FILECODE("S OCXBOOLV="_OCXCODE,"S"),FILECODE("I OCXBOOLV","I") I 1
38 E D FILECODE("I "_OCXCODE,"I")
39 Q
40 ;
41 ;
42GETPARM(FILE,INST,PARM) ;
43 Q:'$L(FILE) "" Q:'$L(INST) "" Q:'$L(PARM) ""
44 N OCXP,OCXP1,OCXI,OCXGL
45 S OCXGL="^OCXS" S:(FILE=1) OCXGL="^OCXD" S:(FILE=7) OCXGL="^OCXD" S:(FILE=10) OCXGL="^OCXD" S FILE=FILE/10+860
46 Q:'$D(@OCXGL@(+FILE,0)) ""
47 I (PARM=+PARM),$D(^OCXS(863.8,PARM,0)) S OCXP=PARM
48 E S OCXP=$O(^OCXS(863.8,"B",PARM,0))
49 Q:'OCXP ""
50 I (INST=+INST),$D(@OCXGL@(FILE,INST,0)) S OCXI=INST
51 E S OCXI=$O(@OCXGL@(FILE,"B",INST,0))
52 Q:'OCXI ""
53 S OCXP1=$O(@OCXGL@(FILE,OCXI,"PAR","B",OCXP,0)) S:'OCXP1 OCXP1=$O(@OCXGL@(FILE,OCXI,"PAR","B",PARM,0))
54 Q:'$L(OCXP1) ""
55 Q $G(@OCXGL@(FILE,OCXI,"PAR",OCXP1,"VAL"))
56 ;
57GV(D0,D1,SUB,DTYP,NULL) ;
58 ;
59 N OCXVAL,OCXFLDN,OCXFLDG,OCXD2,OCXCON,OCXCONN,OCXFREC
60 ;
61 S OCXVAL=$G(^OCXS(860.3,D0,"COND",D1,SUB)) Q:'$L(OCXVAL) ""
62 Q:(SUB["VAL") $$EXT2INT^OCXOCMPA($P($G(^OCXS(864.1,+DTYP,0)),U,1),OCXVAL)
63 ;
64 S OCXVAL=+OCXVAL,OCXFLDN=$P($G(^OCXS(860.4,OCXVAL,0)),U,1),OCXCON=$P($G(^OCXS(860.3,+D0,0)),U,2)
65 I 'OCXCON D WARN^OCXOCMPV("Element context missing for '"_$P($G(^OCXS(860.3,D0,0)),U,1)_"'",3,D0,$P($T(+1)," ",1)) Q
66 I '$L(OCXFLDN) D WARN^OCXOCMPV("Data Field Name missing for '"_OCXDFLD_"'",3,D0,$P($T(+1)," ",1)) Q
67 S OCXFREC="" I $D(^TMP("OCXCMP",$J,"DATA FIELD",OCXVAL)) M OCXFREC=^TMP("OCXCMP",$J,"DATA FIELD",OCXVAL)
68 I '$O(OCXFREC(0)) D Q ""
69 .D WARN^OCXOCMPV("CMPE Get data code not defined for '"_OCXFLDN_"' ("_(+OCXVAL)_")",3,D0,$P($T(+1)," ",1)) Q
70 ;
71 I '$D(OCXFREC(OCXCON)) D
72 .S OCXCONN=0 F S OCXCONN=$O(OCXFREC(OCXCONN)) Q:'OCXCONN Q:$G(OCXFREC(OCXCONN,"DA MODE"))
73 .I 'OCXCONN D WARN^OCXOCMPV("CMPE Get data code mising for '"_$P($G(^OCXS(860.6,+OCXCON,0)),U,1)_"' ("_(+OCXCON)_") context of field '"_OCXFLDN_"' ("_(+OCXVAL)_")",3,D0,$P($T(+1)," ",1))
74 .S OCXCON=+OCXCONN
75 Q:'OCXCON ""
76 ;
77 I '$L($G(OCXFREC(OCXCON,"DTYP","DATA TYPE INDEX")))!'$L($G(OCXFREC(OCXCON,"DTYP","DATA TYPE NAME"))) D Q ""
78 .D WARN^OCXOCMPV("Data Type not defined for '"_OCXFLDN_"' Field",3,D0,$P($T(+1)," ",1)) Q
79 I '(+DTYP=$G(OCXFREC(OCXCON,"DTYP","DATA TYPE INDEX"))) D Q ""
80 .N OCXX S OCXX="'"_OCXVAL_"-"_OCXFLDN_"' field's Data Type '"_OCXFREC(OCXCON,"DTYP","DATA TYPE NAME")
81 .S OCXX=OCXX_"' is not valid for '"_OCXOPN_"' Operator ("_(+DTYP)_"-"_$P($G(^OCXS(864.1,+DTYP,0)),U,1)_")"
82 .D WARN^OCXOCMPV(OCXX,3,D0,$P($T(+1)," ",1)) Q
83 ;
84 S OCXFLDG="OCXDF("_(+OCXVAL)_")"
85 ;
86 I 'NULL D FILECODE("I $L("_OCXFLDG_")","I")
87 ;
88 Q OCXFLDG
89 K D0,D1
90 ;
91FILECODE(CODE,OPLIST) ;
92 ;
93 N OCXNDX S OCXNDX=$O(OCXFCODE(9999),-1)+1,OCXFCODE(OCXNDX)=CODE
94 S:$L($G(OPLIST)) OCXFCODE(OCXNDX,"OPLIST")=OPLIST
95 Q
Note: See TracBrowser for help on using the repository browser.