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

BARLNRPT.m

Go to the documentation of this file.
BARLNRPT ; IHS/SD/LSL - Report Generator ;
 ;;1.8;IHS ACCOUNTS RECEIVABLE;;OCT 26, 2005
 ;;
EN ;EP ENTRY POINT
DIR1 K DIR
 I '$D(BARDA) D SEL I '$G(BARDA) Q
 ;W !,"SPACE: ",$S,!
 W !!,?10,"Report: ",$$VAL^XBDIQ1(90056.1,BARDA,.01)
 W !,?10,"File:   ",$$VAL^XBDIQ1(90056.1,BARDA,.02)
 ;S DIR(0)="S^R:RUN REPORT;E:EDIT REPORT;N:NEW REPORT;L:LIST ITEMS;X:EXIT" D ^DIR
 S DIR(0)="S^R:RUN REPORT;E:EDIT REPORT;L:LIST ITEMS;X:EXIT" D ^DIR
 I Y="R" D RUN G DIR1
 I Y="N" D SEL G DIR1
 I Y="E" D EDIT G DIR1
 I Y="L" D ITEMLST(BARDA) G DIR1
 I Y="X" K BARDA G DIR1
EXIT ;EP -
 K BARDA
 Q
 ;
SEL S DIC=90056.1,DIC(0)="AEQMLZ"
 D ^DIC
 Q:Y'>0
 S BARDA=+Y
 Q
EDIT S DDSFILE=90056.1,DR="[BAR REPORT GENERATOR]",DA=BARDA
 D ^DDS
 Q
R ;EP - RUN A REPORT
 S DIC=90056.1,DIC(0)="AEQMLZ"
 D ^DIC
 Q:Y'>0
 S BARDA=+Y
RUN ;EP - run report BARDA
 S BARQUIT=0
 D ENP^XBDIQ1(90056.1,BARDA,".01:999","BARPT(")
 S XBSRCFL=$$VALI^XBDIQ1(90056.1,BARDA,.02)
 S DIC=XBSRCFL
 K DIR
 K BARS,BARP
 I $D(BARPT),+XBSRCFL
 E  W !,"Information Missing - Exiting",! H 2 Q
 D SORT
 I BARQUIT W !,"Sort Information Missing - Exiting",! H 2 Q
 D PRINT
 I BARQUIT W !,"Print Information Missing - Exiting",! H 2 Q
 I XBSRCFL=90056.3 D  Q:XBSRCFL'>0
 . W !,"You have picked the A/R Items master file ",!
 . ;K DIR S DIR(0)="P^90055.1" D ^DIR K DIR
 . N DIC S DIC=90055.5,DIC(0)="AEQM" D ^DIC
 . S XBSRCFL=+Y
 ;W ! ZW FLDS,FR,TO,BY K DIR S DIR(0)="E",DIR("A")="CR to continue" D ^DIR K DIR
 K BARS,BARP,BARPT
 S L=0 D EN1^DIP
 K DIR S DIR(0)="E",DIR("A")="CR - CONTINUE" D ^DIR K DIR
 Q
 ;
SORT ;EP reorder and build BY, FR, TO variables
 ;
 S BY=$$VAL^XBDIQ1(90056.1,BARDA,.03)
 I BY]"" S BY="["_BY_"]",FR="",TO="" Q
 ;
 D ENPM^XBDIQ1(90056.12,"BARDA,0",".01:999","BARS(")
 I '+$O(BARS(0)) S BARQUIT=1 Q
 N DA,SEQ S DA=0
 K BARSO,BARTS
 F  S DA=$O(BARS(DA)) Q:DA'>0  S SEQ=BARS(DA,.03) S BARSO(SEQ)=DA
 S SEQ=0
 K BARTS
 F K=1:1 S SEQ=$O(BARSO(SEQ)) Q:SEQ'>0  S DA=BARSO(SEQ) M BARTS(K)=BARS(DA)
 S BARS=K-1,BY=""
 F BARS=1:1:BARS S $P(BY,",",BARS)=BARTS(BARS,9.05)_BARTS(BARS,.02)
 S FR=""
 F BARS=1:1:BARS  S BARX=BARTS(BARS,.04) S:BARX="Q" BARX="?" S $P(FR,",",BARS)=BARX
 S TO=""
 F BARS=1:1:BARS  S BARX=BARTS(BARS,.05) S:BARX="Q" BARX="?" S $P(TO,",",BARS)=BARX
 K BARTS,BARSO
 Q
PRINT ;EP - reorder and build FLDS variable
 ;
 S FLDS=$$VAL^XBDIQ1(90056.1,BARDA,.04)
 I FLDS]"" S FLDS="["_FLDS_"]" Q
 ;
 D ENPM^XBDIQ1(90056.13,"BARDA,0",".01:999","BARP(")
 I '+$O(BARP(0)) S BARQUIT=1 Q
 S DA=0
 K BARPO,BARTP
 F  S DA=$O(BARP(DA)) Q:DA'>0  S SEQ=BARP(DA,.03) S BARPO(SEQ)=DA
 S SEQ=0
 F K=1:1 S SEQ=$O(BARPO(SEQ)) Q:SEQ'>0  S DA=BARPO(SEQ) M BARTP(K)=BARP(DA)
 S BARP=K-1
 F BARP=1:1:BARP K BARX S $P(BARX,",",BARTP(BARP,9.06))="" D
 . ;I $L(BARTP(BARP,.04)) S BARTP(BARP,9.05)=BARTP(BARP,.04)_"(#"_BARTP(BARP,9.05)_")"
 .S BARFLD(BARP)=BARTP(BARP,9.05)_BARTP(BARP,.02)
 .S X=$L(BARFLD(BARP),",") F I=1:1:X-1 S BARFLD(BARP)=BARFLD(BARP)_","
 S SEP=","
 S FLDS=BARFLD(1)
 ;F BARP=2:1:BARP S FLDS=FLDS_SEP_BARFLD(BARP)
 ;S FLDS=FLDS_SEP
 F I=2:1:BARP S FLDS(I-1)=BARFLD(I)
 K BARPO,BARTP,BARFLD
 Q
ITEMS ;EP - LIST SELECTABLE ITEMS
 K DIC,DA,DR
 S DIC=90055.5,DIC(0)="AEQM" D ^DIC
 Q:Y'>0
 S XBSRCFL=+Y
 D ITEMLST
 G ITEMS
 Q
ITEMLST(BARDA) ;EP - list items
 S XBSRCFL=$$VALI^XBDIQ1(90056.1,BARDA,.02)
 D LIST(XBSRCFL)
 Q
LIST(XBSRCFL) ;EP Print fields 
 S DIC=90056.3
 S FLDS=".01;L30;""Field"""
 S FLDS(1)=".05;L12;""FM Path"""
 S FLDS(2)="1.04;L25;""Data Path"""
 S FLDS(3)=".04;L2;""AT"""
 S FLDS(4)=".055;L0;"""
 S FR=",,",BY=".055,.05,.01"
 S L=0
 D EN1^DIP
 K DIR S DIR(0)="E",DIR("A")="CR CONTINUE" D ^DIR
END Q
PRT ;EP
 ;
 ; GET DEVICE (QUEUEING ALLOWED)
 S Y=$$DIR^XBDIR("S^P:PRINT Output;B:BROWSE Output on Screen","Do you wish to ","P","","","",1)
 K DA
 Q:$D(DIRUT)
 I Y="B" S XBFLD("BROWSE")=1,BARIOSL=IOSL,IOSL=600 D VIEWD^XBLM("EN1^DIP"),FULL^VALM1 W $$EN^BARVDF("IOF") D  Q
 .D CLEAR^VALM1  ;clears out all list man stuff
 .KILL XQORNEST,VALMKEY,VALM,VALMAR,VALMBCK,VALMBG,VALMCAP,VALMCNT,VALMOFF,VALMCON,VALMDN,VALMEVL,VALMIOXY,VALMLFT,VALMLST,VALMMENU,VALMSGR,VALMUP,VALMY,XQORS,XQORSPEW,VALMCOFF
DEVE .S IOSL=BARIOSL K BARIOSL Q
 D EN1^DIP
 ;S XBRP="LOOP^BAREDP07",XBNS="BAR;IMPDA",XBRX="EXIT^BAREDP07"
 ;D ^XBDBQUE
 K DIR S DIR(0)="E",DIR("A")="<CR> - Continue" D ^DIR K DIR
 ;G EN
ENDJOB Q
LOOP ;EP CLAIMS