Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORPR010

ORPR010.m

Go to the documentation of this file.
  1. ORPR010 ; slc/dcm - Silence of the prints
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11,99**;Dec 17, 1997
  1. GET(ORHOOT,FMT,ORIFN,OACTION,ORVP,LOC,GIOM,DISP) ;Get display of a print format
  1. Q:'$G(FMT)
  1. I $G(DISP) W @IOF
  1. N X,IOM,IOF,TEST,OREND,ORPDAD
  1. Q:'$D(^OR(100,$G(ORIFN),0)) S X=^(0)
  1. S:'$G(OACTION) OACTION=1
  1. S:'$D(ORVP) ORVP=$P(X,"^",2)
  1. S:'$D(LOC) LOC=+$P(X,"^",10)
  1. S:'$G(GIOM) GIOM=79
  1. S IOM=GIOM,IOF="!",TEST=0
  1. I $G(DISP) D PRINT^ORPR00(FMT)
  1. N GCNT,CCNT
  1. S GCNT=1,CCNT=0
  1. D SHUSH(FMT,.ORHOOT,,.GCNT)
  1. Q
  1. SHUSH(FMT,ORHOOT,NUM,GCNT) ;
  1. ;FMT=Format ptr in ^ORD(100.23,FMT
  1. ;NUM=# of times to print
  1. ;^TMP("ORP:"_$J,... may be used by a print field
  1. Q:'$G(FMT) Q:'$D(^ORD(100.23,FMT,0)) Q:'$L($G(ORHOOT))
  1. N ORKI,ORK,X,ORTEST,OREND,ORPDAD,ORSILENT
  1. S ORSILENT=1 ;ORSILENT tells print utility not to display
  1. K ^TMP("ORP:"_$J)
  1. S OREND=0
  1. S:'$D(NUM) NUM=1
  1. I $D(^ORD(100.23,FMT,3)),$L(^(3)) X ^(3) I '$T Q ;Screen check!
  1. F ORKI=1:1:NUM Q:OREND D
  1. . S ORK=0 F S ORK=$O(^ORD(100.23,FMT,1,ORK)) Q:ORK'>0 I $D(^(ORK,0)) S X=+^(0) D
  1. .. I $G(ORIFN),$D(^ORD(100.22,+X,0)),$P(^(0),"^",7),$P(^(0),"^",7)'=$P($G(^OR(100,ORIFN,0)),"^",14) Q
  1. .. I $D(^ORD(100.22,+X,1)),'$P(^(0),"^",6) X ^(1)
  1. . 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
  1. .. S I=0 F S I=$O(@Y@(I)) Q:'I D LN^ORU4 S @ORHOOT@(GCNT,0)=@Y@(I,0)
  1. . K ^TMP("ORP:"_$J)
  1. Q
  1. CMPL(ORFMT) ;Compile Silent formatting code
  1. N ORROW,ORFL,ORK,OROUT,ORV,ORVAR,OROJ,ORCL,ORPT,I,X,CCNT,GCNT,ORPDAD
  1. Q:'$G(ORFMT) Q:'$D(^ORD(100.23,ORFMT,0)) S ORROW=$S($P(^(0),"^",2):$P(^(0),"^",2),1:6)
  1. 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)
  1. K ^ORD(100.23,ORFMT,4)
  1. S (CCNT,GCNT,ORFL,ORK,ORV)=0,OROUT="^ORD(100.23,ORFMT,4)"
  1. F S ORK=$O(^ORD(100.23,ORFMT,1,ORK)) Q:ORK'>0 I $D(^(ORK,0)) S X=^(0) D
  1. . S ^TMP("OR",$J,"FMT",+$P(X,"^",2),+$P(X,"^",3),$P(X,"^"))=$P(X,"^",4,7)
  1. F ORK=1:1:ORROW S:ORK>1 ORFL=1 D
  1. . I '$D(^TMP("OR",$J,"FMT",ORK)) D LN^ORU4 S @OROUT@(GCNT,0)="D LN^ORU4" Q
  1. . S ORCL=0 F S ORCL=$O(^TMP("OR",$J,"FMT",ORK,ORCL)) Q:ORCL'>0 S ORPT=$O(^(ORCL,"")),OROJ=^(ORPT) D STUF
  1. I $O(ORVAR(0)) S I=0,X="X" D
  1. . F S I=$O(ORVAR(I)) Q:I<1 S X=X_","_ORVAR(I)
  1. . D LN^ORU4 S @OROUT@(GCNT,0)="K "_X
  1. S @OROUT@(0)="^^"_GCNT_"^"_GCNT_"^"_DT
  1. 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)
  1. K ^TMP("OR",$J,"FMT")
  1. Q
  1. STUF ;
  1. 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)
  1. N ORDEF,ORFUN,ORTL,ORPRM,X,X1
  1. S ORVAR="DT",ORDEF=""
  1. S:$D(^ORD(100.22,+ORPT,0)) ORVAR=$P(^(0),"^",4),ORDEF=$P(^(0),"^",2),ORFUN=$P(^(0),"^",5)
  1. I $D(^(1)),$L(^(1)) S ORV=ORV+1,ORVAR(ORV)=ORVAR
  1. S ORTL=$S(ORVAR="ORFREE":"",$P(OROJ,"^")="NONE":"",$P(OROJ,"^")]"":$P(OROJ,"^"),1:ORDEF),ORPRM=""""_$P(OROJ,"^",3)_"""",ORTL=""""_ORTL_""""
  1. I $P(OROJ,"^",4),$L(ORVAR),ORVAR'="ORFREE" S ORTL="$S($L($G("_ORVAR_")):"_ORTL_",1:"""")"
  1. I ORFL D LN^ORU4 S @OROUT@(GCNT,0)="D LN^ORU4"
  1. D LN^ORU4
  1. S @OROUT@(GCNT,0)="S:'$D(@ORHOOT@(GCNT,0)) @ORHOOT@(GCNT,0)="""""
  1. D LN^ORU4
  1. 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)"
  1. D LN^ORU4
  1. S @OROUT@(GCNT,0)="I $D(@ORHOOT@(GCNT,0)),$D(X) S @ORHOOT@(GCNT,0)=@ORHOOT@(GCNT,0)_X"
  1. S ORFL=0
  1. Q
  1. OUT(OROOT) ;Display output
  1. N I,X
  1. Q:'$D(OROOT) Q:'$O(@OROOT@(0))
  1. F I=1:1 S X=$G(@OROOT@(I,0)) W !,X Q:'$O(@OROOT@(I))
  1. Q
  1. TEST(IFN,DISP) ;Test
  1. Q:'IFN
  1. N FMT
  1. S FMT=0
  1. F S FMT=$O(^ORD(100.23,FMT)) Q:'FMT D
  1. . N DAVE S DAVE="DAVE"
  1. . W !,FMT,?15,$P(^ORD(100.23,FMT,0),"^")
  1. . D GET(.DAVE,FMT,IFN,1),OUT("DAVE"):$G(DISP)
  1. Q