source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOCMPK.m@ 1389

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1OCXOCMPK ;SLC/RJS,CLA - ORDER CHECK CODE COMPILER (Build LIST Function Code 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 ;
5 Q
6 ;
7RANGE(ROOT,ELEM,INDEX,PARAM,CD) ;
8 ;
9 Q:$G(OCXWARN) 1
10 N OCXDTYP,FIELD,VARNDX,VARVAL,VARCNT,VSTRT,VSTOP
11 S FIELD=$P(PARAM," ",1),VSTRT=$P(PARAM," ",3),VSTOP=$P(PARAM," ",5)
12 S VARNDX="OCXLX"_(+INDEX),VARVAL="OCXLV"_(+INDEX),VARCNT="OCXLC"_(+INDEX),VARLIM="OCXLB"_(+INDEX)
13 ;
14 I '$L($G(ROOT)) D WARN^OCXOCMPV("'RANGE' Function array root not defined.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
15 I '$L($G(ELEM)) D WARN^OCXOCMPV("'RANGE' Function element not defined.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
16 I ($L(PARAM," ")>5) D WARN^OCXOCMPV("'RANGE' Function with too many parameters.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
17 ;
18 S FIELD=$P(PARAM," ",1) I '($E(FIELD,1)="|")!'($E(FIELD,$L(FIELD))="|") D Q OCXWARN
19 .D WARN^OCXOCMPV("'RANGE' Function field name missing in parameter list.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
20 S FIELD=+$P(FIELD,"|",2),OCXDTYP=$$GETDTYP^OCXOCMPI(FIELD)
21 ;
22 I '$L(VSTRT) D Q OCXWARN
23 .D WARN^OCXOCMPV("'RANGE' Function start value missing in parameter list.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
24 I '$L(VSTOP) D Q OCXWARN
25 .D WARN^OCXOCMPV("'RANGE' Function stop value missing in parameter list.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
26 S VSTRT=""""_VSTRT_"""",VSTOP=""""_VSTOP_""""
27 I (OCXDTYP="DATE/TIME") S VSTRT="$$INT2DT("_VSTRT_")",VSTOP="$$INT2DT("_VSTOP_")"
28 ;
29 S CD(1)="; RANGE"
30 S CD(2)="S "_VARVAL_"="_VSTRT_","_VARLIM_"="_VSTOP_" D K "_VARVAL_","_VARLIM_","_VARNDX
31 S CD(3)=".D:$L("_VARVAL_") F S "_VARVAL_"=$O("_ROOT_"""D"","_ELEM_","_FIELD_","_VARVAL_")) Q:'$L("_VARVAL_") Q:("_VARVAL_"]"_VARLIM_") D"
32 S CD(4)="..S "_VARNDX_"="""" F S "_VARNDX_"=$O("_ROOT_"""D"","_ELEM_","_FIELD_","_VARVAL_","_VARNDX_")) Q:'"_VARNDX_" D @@@@"
33 Q OCXWARN
34 ;
35ANY(ROOT,ELEM,INDEX,PARAM,CD) ;
36 ;
37 N OCXDTYP
38 I '$L($G(ROOT)) D WARN^OCXOCMPV("'ANY' Function array root not defined.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
39 I '$L($G(ELEM)) D WARN^OCXOCMPV("'ANY' Function element not defined.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
40 I $L(PARAM) D WARN^OCXOCMPV("'ANY' Function does not require parameters.",2,OCXD0,$P($T(+1)," ",1)) Q OCXWARN
41 S VARNDX="OCXLX"_(+INDEX)
42 ;
43 S CD(1)="; ANY"
44 S CD(2)="S "_(VARNDX)_"="""" F "_(VARNDX)_"=$O("_ROOT_"""C"","_ELEM_","_(VARNDX)_")) Q:'"_(VARNDX)_" D @@@@ K "_VARNDX
45 ;
46 Q OCXWARN
47 ;
Note: See TracBrowser for help on using the repository browser.