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

ACDRLP2.m

Go to the documentation of this file.
ACDRLP2 ;IHS/ADC/EDE/KML - PRINT GEN RET;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
DONE ;EP
 D:ACDCTYP'="F" DONE^ACDRLU1
 K ^TMP("ACDRL",ACDJOB,ACDBT)
 D DEL^ACDRL
 K ACDBD,ACDSD,ACDED,ACDEDD,ACDBDD,ACDRPT,ACDHEAD,ACDLINE,ACDL,ACDRCNT,ACDI,ACDCRIT,ACDR,ACDRREC,ACDJOB,ACDBT,ACDBTH,ACDQUIT,ACDHDR,ACDDASH,ACDLENG,ACDPCNT,ACDTCW,ACDODAT,ACDPG,AUPNDAYS,AUPNPAT,AUPNDOD,AUPNDOB,AUPNSEX
 K ACDSORT,ACDSRT,ACDSORX,ACDFILE,ACDFIEL,ACDPRNT,ACDX,ACDFOUN,D0,J,K,L,ACDPRNM,ACDTEST,ACDLHDR,ACDFRST
 Q
 I 'ACDPG G HEAD1
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S ACDQUIT="" Q
HEAD1 ;EP
 W:$D(IOF) @IOF S ACDPG=ACDPG+1
 W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
 I $G(ACDTITL)="" S ACDTEXT="CDMIS "_$S(ACDPTVS="V":"VISIT",1:"PATIENT")_" LISTING",ACDLENG=$L(ACDTEXT) W !?(($S(ACDTCW<81:80,1:ACDTCW)-ACDLENG)/2),ACDTEXT,?($S(ACDTCW<81:80,1:ACDTCW)-8),"Page ",ACDPG
 I $G(ACDTITL)]"" S ACDLENG=$L(ACDTITL) W !?(($S(ACDTCW<81:80,1:ACDTCW)-ACDLENG)/2),ACDTITL,?($S(ACDTCW<81:80,1:ACDTCW)-8),"Page ",ACDPG
 I ACDPTVS="V" S ACDLENG=46 S:$S(ACDTCW<81:80,1:ACDTCW)<ACDLENG ACDLENG=$S(ACDTCW<81:80,1:ACDTCW) W !?(($S(ACDTCW<81:80,1:ACDTCW)-ACDLENG)/2),"Record Dates:  ",ACDBDD," and ",ACDEDD,!
 I ACDCTYP="S" S ACDLENG=$L(ACDSORV)+23 W !?(($S(ACDTCW<81:80,1:ACDTCW)-ACDLENG)/2),$S(ACDPTVS="V":"VISIT",1:"PATIENT")," SUB-TOTALS BY:  ",ACDSORV,!
 I $G(ACDSPAG) S ACDLENG=$L(ACDSRTR)+$L(ACDSORV)+2 S:$S(ACDTCW<81:80,1:ACDTCW)<ACDLENG ACDLENG=$S(ACDTCW<81:80,1:ACDTCW) W !?(($S(ACDTCW<81:80,1:ACDTCW)-ACDLENG)/2),ACDSORV,":  ",ACDSRTR,!
 I ACDHEAD]"" W !,ACDHEAD,!
 W ACDDASH,!
 I ACDCTYP="S" W !,ACDSORV,":"
 Q
WRITEF ;EP - write out flat file
 S XBGL="TMP("_$J_",""ACDFLAT"","
 S XBMED="F",XBFN=ACDFILE,XBTLE="SAVE OF CDMIS RECORDS GENERATED BY -"_$P(^VA(200,DUZ,0),U)
 S XBF=0,XBQ="N",XBFLT=1,XBE=$J
 D ^XBGSAVE
 ;check for error
 K ^TMP($J,"ACDFLAT")
 K XBGL,XBMED,XBTLE,XBFN,XBF,XBQ,XBFLT
 Q