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

ACHSEOB7.m

Go to the documentation of this file.
ACHSEOB7 ; IHS/ITSC/PMF - PRINT 1 OR RANGE OF EOBRS ;    [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 S ACHSIO=IO,(ACHSBDOC,ACHSEDOC)=""
 I '$D(^ACHSEOBR("P")) W *7,!,"NO EOBRS AVAILABLE.",!! D RTRN^ACHS G K
 W !!,"NOTE:",!?5,"Selecting a P.O. will print EACH transaction for that document",!?5,"in this batch, if more than one transaction exists.",!
BDOC ;
 S ACHSBG=1
 W !,"BEGIN WITH DOCUMENT : "
 W:ACHSBDOC]"" ACHSBDOC," //"
 D READ^ACHSFU
 I $D(DUOUT)!$D(DTOUT)!((Y="")&(ACHSBDOC="")) D K Q
 I Y="",ACHSBDOC]"" S Y=ACHSBDOC G BDOC2
 I Y?1"?".E D SHOW G BDOC:Y="" G BDOC2
 I '$D(^ACHSEOBR("P",Y)) W *7,"??",!! D SHOW G BDOC:Y="" G BDOC2
BDOC2 ;
 I $D(^ACHSEOBR("P",Y)) G BDOCND
BDOCER ;
 W *7,"  ??"
 G BDOC
 ;
BDOCND ;
 S ACHSBDOC=Y
EDOC ;
 S ACHSBG=0,ACHSEG=1
 W !,"END WITH DOCUMENT : "
 W:ACHSEDOC]"" ACHSEDOC," //"
 D READ^ACHSFU
 G BDOC:$D(DUOUT)!((Y="")&(ACHSEDOC="")),K:$D(DTOUT)
 I Y="",ACHSEDOC]"" G EDOC2
 I Y?1"?".E D SHOW G EDOCER:Y="" ;G EDOC2
 I '$D(^ACHSEOBR("P",Y)) W *7,"??",!! D SHOW G EDOC:Y="" G EDOC2
EDOC2 ;
 I $D(^ACHSEOBR("P",Y)) G EDOCND
EDOCER ;
 W *7,"  ??"
 G EDOC
 ;
EDOCND ;
 S ACHSEDOC=Y
DEV ;
 S %=$$PB^ACHS
 I %=U!$D(DTOUT)!$D(DUOUT) D K Q
 I %="B" D VIEWR^XBLM("START^ACHSEOB7"),EN^XBVK("VALM"),K Q
 S %ZIS="OPQ"
 D ^%ZIS
 I POP D HOME^%ZIS G K
 G:'$D(IO("Q")) START
 K IO("Q")
 I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
 S ZTRTN="START^ACHSEOB7",ZTDESC="EOBR for "_ACHSBDOC_$S(ACHSEDOC]"":" to "_ACHSEDOC,1:"")
 F %="ACHSBDOC","ACHSEDOC" S ZTSAVE(%)=""
 D ^%ZTLOAD
 G:'$D(ZTSK) DEV
K ; Kill vars, do ERPT, quit.
 K ZTSK
 D ERPT^ACHS
 D EN^XBVK("ACHS")
 D ^ACHSVAR
 Q
 ;
START ;EP - From TaskMan.
 I ACHSEDOC="" S ACHSEDOC=ACHSBDOC
 S ACHSOLD="",ACHSEOIO=IO
 K ^TMP("ACHSEOB",$J)
 D BM^ACHSFU,NOW^ACHS
 S ACHSTIME=$$C^XBFUNC(ACHSTIME,80),ACHSTERR=0,ACHSCTR(1)=""
 U ACHSEOIO
 W @IOF
L1 ;
L2 ;
 G K:'$D(^ACHSEOBR("P",ACHSBDOC))
 S ACHSCTR(1)=$O(^ACHSEOBR("P",ACHSBDOC,ACHSCTR(1)))
 G L3:ACHSCTR(1)=""
 S ACHSFAC=$P(^ACHSEOBR("P",ACHSBDOC,ACHSCTR(1)),U),ACHSOLD=$E(^ACHSEOBR(ACHSFAC,ACHSCTR(1)),1,18)
 D PRNT
 G:$D(DUOUT)!$D(DTOUT) K
 G L2
 ;
L3 ;
 G K:ACHSBDOC=ACHSEDOC
L3A ;
 S ACHSBDOC=$O(^ACHSEOBR("P",ACHSBDOC))
 G K:ACHSBDOC=""
 G L2
 ;
PRNT ;
 F ACHSCTR=ACHSCTR(1):1 Q:'$D(^ACHSEOBR(ACHSFAC,ACHSCTR))  S ACHSEOBR=$G(^ACHSEOBR(ACHSFAC,ACHSCTR)) Q:$E(ACHSEOBR,1,18)'=ACHSOLD  D PRT^ACHSEOBB
 D ^ACHSEOB2,RTRN^ACHS
 K ^TMP("ACHSEOB",$J),ACHSEOBR
 Q
 ;
SHOW ;
 S ACHSY=""
 K ACHSP
 F ACHS=1:1 S ACHSY=$O(^ACHSEOBR("P",ACHSY)) Q:ACHSY=""  W !,$J(ACHS,4),".  ",ACHSY S ACHSP(ACHS)=ACHSY I '(ACHS#10) W !?7,"('^' to stop) Select: " D READ^ACHSFU Q:$D(DUOUT)!$D(DTOUT)  G SHOW2:Y]"" D:Y?1"?".E SHOWH
 W !?7,"('^' to stop) Select: "
 D READ^ACHSFU
 Q:$D(DUOUT)!$D(DTOUT)
 D:Y?1"?".E SHOWH
SHOW2 ;
 Q:Y']""
 I $D(^ACHSEOBR("P",Y)) W "  ",Y Q
 I '$D(ACHSP(Y)) D SHOWH Q
 S Y=ACHSP(Y)
 W "  ",Y
 Q
 ;
SHOWH ;
 W !!!,"ENTER ENTRY NUMBER OF ",$S(ACHSBG:"BEGINNING",ACHSEG:"ENDING",1:"")," DOCUMENT TO PRINT",!!
 Q
 ;