VistA-FOIAVistA/r/ORDER_ENTRY_RESULTS_REPORTI.../OCXOCMPU.m

72 lines
2.1 KiB
Mathematica

OCXOCMPU ;SLC/RJS,CLA - ORDER CHECK CODE COMPILER (Build Local Term Translator) ;2/02/99 11:33
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
Q
;
TERMLKUP ;
;
N OCXSR,OCXD0,OCXD1,OCXNAME,TEXT,OCXREC,OCXFILE
;
S OCXSR=""
D INCLUDE("TERMLKUP(OCXTERM,OCXLIST) ;")
;
I OCXTRACE D
.D INCLUDE(" W:$G(OCXTRACE) !,||LNTAG||,?27,""Compiler Function TERMLKUP(OCXTERM,OCXLIST) Execution trace. """)
.D INCLUDE(" W:$G(OCXTRACE) !,?35,"" OCXTERM: "",$G(OCXTERM)")
.D INCLUDE(" ;")
D INCLUDE(" Q $$||LINE:"_$$LINE^OCXOCMP4("TERM","OCXTERM","OCXLIST")_"||(OCXTERM,.OCXLIST)")
D INCLUDE(" ;")
;
K ^TMP("OCXCMP",$J,"INCLUDE","TERMLKUP")
M ^TMP("OCXCMP",$J,"INCLUDE","TERMLKUP")=OCXSR
;
Q
;
TERM ;
;
N OCXSR,OCXD0,OCXD1,OCXNAME,TEXT,OCXREC,OCXFILE
;
D IN(" Q:'$L(OCXTERM) 0")
D IN(" ;")
;
D IN(" N FILE,IEN,LINE,LTERM,NTERM,TEXT S FILE=0 K OCXLIST")
D IN(" F LINE=1:1:999 S TEXT=$T(TERM+LINE) Q:$P(TEXT,"";"",2) I ($E(TEXT,2,3)="";;"") D")
D IN(" .S TEXT=$P(TEXT,"";;"",2)")
D IN(" .S NTERM=$P(TEXT,U,1) Q:'$L(NTERM) Q:'(OCXTERM=NTERM)")
D IN(" .S FILE=$P(TEXT,U,2),IEN=$P(TEXT,U,3),LTERM=$P(TEXT,U,4)")
D IN(" .S OCXLIST(IEN)=LTERM,OCXLIST(""B"",LTERM,IEN)=""""")
D IN(" ;")
;
I (OCXTRACE) D
.D IN(" I $G(OCXTRACE) S IEN=0 F S IEN=$O(OCXLIST(IEN)) Q:'IEN D")
.D IN(" .W:$G(OCXTRACE) !,?35,"" OCXLIST: "",$J(IEN,7),"" = "",OCXLIST(IEN)")
.D IN(" W:$G(OCXTRACE) !,||LNTAG||,?30,""TERM RESULT: (FILE: "",+$G(FILE),"") "",$G(COUNT),"" Local term(s) found.""")
.D IN(" ;")
;
D IN(" Q FILE")
D IN(" ;")
;
D IN(" ;TERM DATA;")
S OCXD0=0 F S OCXD0=$O(^OCXS(860.9,OCXD0)) Q:'OCXD0 D
.K OCXREC M OCXREC=^OCXS(860.9,OCXD0)
.S OCXNAME=$P(OCXREC(0),U,1) Q:'$L(OCXNAME)
.S OCXFILE=$P(OCXREC(0),U,2) Q:'$L(OCXFILE)
.;Q:'$O(OCXREC(1,0))
.S OCXD1=0 F S OCXD1=$O(OCXREC(1,OCXD1)) Q:'OCXD1 D
..N IEN,NAME
..S NAME=$P($G(OCXREC(1,OCXD1,0)),"^",1) Q:'$L(NAME)
..S IEN=$P($G(OCXREC(1,OCXD1,0)),"^",2) Q:'IEN
..D IN(" ;;"_OCXNAME_U_OCXFILE_U_IEN_U_NAME)
D IN(" ;1;")
D IN(" ;")
;
Q
;
IN(CODE) D IN^OCXOCMP4("TERM",CODE,"Y",16000) Q
;
INCLUDE(LINE) ;
S OCXSR($O(OCXSR(" "),-1)+1,0)=LINE
Q
;