source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORPR010.m@ 1353

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1ORPR010 ; slc/dcm - Silence of the prints
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11,99**;Dec 17, 1997
3GET(ORHOOT,FMT,ORIFN,OACTION,ORVP,LOC,GIOM,DISP) ;Get display of a print format
4 Q:'$G(FMT)
5 I $G(DISP) W @IOF
6 N X,IOM,IOF,TEST,OREND,ORPDAD
7 Q:'$D(^OR(100,$G(ORIFN),0)) S X=^(0)
8 S:'$G(OACTION) OACTION=1
9 S:'$D(ORVP) ORVP=$P(X,"^",2)
10 S:'$D(LOC) LOC=+$P(X,"^",10)
11 S:'$G(GIOM) GIOM=79
12 S IOM=GIOM,IOF="!",TEST=0
13 I $G(DISP) D PRINT^ORPR00(FMT)
14 N GCNT,CCNT
15 S GCNT=1,CCNT=0
16 D SHUSH(FMT,.ORHOOT,,.GCNT)
17 Q
18SHUSH(FMT,ORHOOT,NUM,GCNT) ;
19 ;FMT=Format ptr in ^ORD(100.23,FMT
20 ;NUM=# of times to print
21 ;^TMP("ORP:"_$J,... may be used by a print field
22 Q:'$G(FMT) Q:'$D(^ORD(100.23,FMT,0)) Q:'$L($G(ORHOOT))
23 N ORKI,ORK,X,ORTEST,OREND,ORPDAD,ORSILENT
24 S ORSILENT=1 ;ORSILENT tells print utility not to display
25 K ^TMP("ORP:"_$J)
26 S OREND=0
27 S:'$D(NUM) NUM=1
28 I $D(^ORD(100.23,FMT,3)),$L(^(3)) X ^(3) I '$T Q ;Screen check!
29 F ORKI=1:1:NUM Q:OREND D
30 . S ORK=0 F S ORK=$O(^ORD(100.23,FMT,1,ORK)) Q:ORK'>0 I $D(^(ORK,0)) S X=+^(0) D
31 .. I $G(ORIFN),$D(^ORD(100.22,+X,0)),$P(^(0),"^",7),$P(^(0),"^",7)'=$P($G(^OR(100,ORIFN,0)),"^",14) Q
32 .. I $D(^ORD(100.22,+X,1)),'$P(^(0),"^",6) X ^(1)
33 . S ORK=0 F S ORK=$O(^ORD(100.23,FMT,4,ORK)) Q:ORK'>0 X ^ORD(100.23,FMT,4,ORK,0) Q:OREND I $G(ORPICKUP) D K ORPICKUP
34 .. S I=0 F S I=$O(@Y@(I)) Q:'I D LN^ORU4 S @ORHOOT@(GCNT,0)=@Y@(I,0)
35 . K ^TMP("ORP:"_$J)
36 Q
37CMPL(ORFMT) ;Compile Silent formatting code
38 N ORROW,ORFL,ORK,OROUT,ORV,ORVAR,OROJ,ORCL,ORPT,I,X,CCNT,GCNT,ORPDAD
39 Q:'$G(ORFMT) Q:'$D(^ORD(100.23,ORFMT,0)) S ORROW=$S($P(^(0),"^",2):$P(^(0),"^",2),1:6)
40 S ORK=0 F S ORK=$O(^ORD(100.22,ORK)) Q:ORK'>0 I $D(^(ORK,0)),$L($P(^(0),"^",4)) S @$P(^(0),"^",4)=$P(^(0),"^",3)
41 K ^ORD(100.23,ORFMT,4)
42 S (CCNT,GCNT,ORFL,ORK,ORV)=0,OROUT="^ORD(100.23,ORFMT,4)"
43 F S ORK=$O(^ORD(100.23,ORFMT,1,ORK)) Q:ORK'>0 I $D(^(ORK,0)) S X=^(0) D
44 . S ^TMP("OR",$J,"FMT",+$P(X,"^",2),+$P(X,"^",3),$P(X,"^"))=$P(X,"^",4,7)
45 F ORK=1:1:ORROW S:ORK>1 ORFL=1 D
46 . I '$D(^TMP("OR",$J,"FMT",ORK)) D LN^ORU4 S @OROUT@(GCNT,0)="D LN^ORU4" Q
47 . S ORCL=0 F S ORCL=$O(^TMP("OR",$J,"FMT",ORK,ORCL)) Q:ORCL'>0 S ORPT=$O(^(ORCL,"")),OROJ=^(ORPT) D STUF
48 I $O(ORVAR(0)) S I=0,X="X" D
49 . F S I=$O(ORVAR(I)) Q:I<1 S X=X_","_ORVAR(I)
50 . D LN^ORU4 S @OROUT@(GCNT,0)="K "_X
51 S @OROUT@(0)="^^"_GCNT_"^"_GCNT_"^"_DT
52 S ORK=0 F S ORK=$O(^ORD(100.22,ORK)) Q:ORK'>0 I $D(^(ORK,0)),$L($P(^(0),"^",4)) K @$P(^(0),"^",4)
53 K ^TMP("OR",$J,"FMT")
54 Q
55STUF ;
56 I $P(^ORD(100.22,+ORPT,0),"^",6),$D(^(1)),$L(^(1)) D LN^ORU4 S @OROUT@(GCNT,0)=^ORD(100.22,+ORPT,1) Q ;Direct execute (not compiled)
57 N ORDEF,ORFUN,ORTL,ORPRM,X,X1
58 S ORVAR="DT",ORDEF=""
59 S:$D(^ORD(100.22,+ORPT,0)) ORVAR=$P(^(0),"^",4),ORDEF=$P(^(0),"^",2),ORFUN=$P(^(0),"^",5)
60 I $D(^(1)),$L(^(1)) S ORV=ORV+1,ORVAR(ORV)=ORVAR
61 S ORTL=$S(ORVAR="ORFREE":"",$P(OROJ,"^")="NONE":"",$P(OROJ,"^")]"":$P(OROJ,"^"),1:ORDEF),ORPRM=""""_$P(OROJ,"^",3)_"""",ORTL=""""_ORTL_""""
62 I $P(OROJ,"^",4),$L(ORVAR),ORVAR'="ORFREE" S ORTL="$S($L($G("_ORVAR_")):"_ORTL_",1:"""")"
63 I ORFL D LN^ORU4 S @OROUT@(GCNT,0)="D LN^ORU4"
64 D LN^ORU4
65 S @OROUT@(GCNT,0)="S:'$D(@ORHOOT@(GCNT,0)) @ORHOOT@(GCNT,0)="""""
66 D LN^ORU4
67 S @OROUT@(GCNT,0)="S X=$$S^ORU4("_(ORCL-1)_",.CCNT,"_ORTL_"_"_$S(ORVAR="ORFREE":""""_$P(OROJ,"^",2)_"""",$L(ORFUN):"$$"_ORFUN_"^ORU4($G("_ORVAR_"),"_ORPRM_",.ORHOOT,"_(ORCL-1)_",.GCNT,.CCNT)",1:"$G("_ORVAR_")")_",.CCNT)"
68 D LN^ORU4
69 S @OROUT@(GCNT,0)="I $D(@ORHOOT@(GCNT,0)),$D(X) S @ORHOOT@(GCNT,0)=@ORHOOT@(GCNT,0)_X"
70 S ORFL=0
71 Q
72OUT(OROOT) ;Display output
73 N I,X
74 Q:'$D(OROOT) Q:'$O(@OROOT@(0))
75 F I=1:1 S X=$G(@OROOT@(I,0)) W !,X Q:'$O(@OROOT@(I))
76 Q
77TEST(IFN,DISP) ;Test
78 Q:'IFN
79 N FMT
80 S FMT=0
81 F S FMT=$O(^ORD(100.23,FMT)) Q:'FMT D
82 . N DAVE S DAVE="DAVE"
83 . W !,FMT,?15,$P(^ORD(100.23,FMT,0),"^")
84 . D GET(.DAVE,FMT,IFN,1),OUT("DAVE"):$G(DISP)
85 Q
Note: See TracBrowser for help on using the repository browser.