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

APCLSILM.m

Go to the documentation of this file.
APCLSILM ;IHS/CMI/LAB - AGGREGATE ILI REPORT;
 ;;3.0;IHS PCC REPORTS;**24,26,27,28,29**;FEB 05, 1997;Build 35
 ;
START ;
 W:$D(IOF) @IOF
 W !,"**********  LIST OF HL7 LAB EXPORTS TO THE EPI PROGRAM  **********",!
 D EN^XBVK("APCL")
BD ;get beginning date
 W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter beginning date for export search" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) D EOJ Q
 S APCLBD=Y
ED ;get ending date
 W ! S DIR(0)="DA^"_APCLBD_":DT:EP",DIR("A")="Enter ending date for export search:  " D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G BD
 S APCLED=Y
ZIS ;
 S XBRP="PRINT^APCLSILM",XBRC="PROC^APCLSILM",XBRX="EOJ^APCLSILM",XBNS="APCL"
 D ^XBDBQUE
 ;
EOJ ;ENTRY POINT
 D EN^XBVK("APCL")
 Q
PROC ;EP - called from xbdbque
 Q
PRINT ;
 S APCLPG=0
 D HEADER
 S APCLSD=$$FMADD^XLFDT(APCLBD,-1)
 F  S APCLSD=$O(^APCLILIC(1,13,"B",APCLSD)) Q:APCLSD=""!($D(APCLQUIT))!(APCLSD>APCLED)  D
 .S APCLX=0 F  S APCLX=$O(^APCLILIC(1,13,"B",APCLSD,APCLX)) Q:APCLX'=+APCLX!($D(APCLQUIT))  D
 ..I $Y>(IOSL-3) D HEADER Q:$D(APCLQUIT)
 ..W $$FMTE^XLFDT(APCLSD),?20,$P(^APCLILIC(1,13,APCLX,0),U,2),?61,$P(^APCLILIC(1,13,APCLX,0),U,4),?73,$S($P(^APCLILIC(1,13,APCLX,0),U,5):"YES",1:"NO"),!
 D EOP
 Q
 I 'APCLPG 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 APCLQUIT="" Q
HEAD1 ;
 I APCLPG W:$D(IOF) @IOF
 S APCLPG=APCLPG+1
 W ?3,$P(^DIC(4,DUZ(2),0),U),?58,$$FMTE^XLFDT(DT),?72,"Page ",APCLPG,!
 W !,$$CTR("*** HL7 LAB Exports to the EPI Program***",80),!
 S X="Dates: "_$$FMTE^XLFDT(APCLBD)_" through "_$$FMTE^XLFDT(APCLED) W $$CTR(X,80),!!
 W ?1,"DATE EXPORTED",?20,"FILENAME",?60,"# RECS",?68,"SUCCESSFULLY",!?68,"SENT?",!
 W $$REPEAT^XLFSTR("-",79),!
 Q
 ;
CTR(X,Y) ;EP - Center X in a field Y wide.
 Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
 ;----------
EOP ;EP - End of page.
 Q:$E(IOST)'="C"
 Q:$D(ZTQUEUED)!'(IOT["TRM")!$D(IO("S"))
 NEW DIR
 K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
 S DIR(0)="E" D ^DIR
 Q
 ;----------
USR() ;EP - Return name of current user from ^VA(200.
 Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
 ;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
 Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
 ;----------