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

APCPRPV1.m

Go to the documentation of this file.
APCPRPV1 ; IHS/TUCSON/LAB - AMBULATORY OPERATIONS SUMMARY AUGUST 14, 1992 ; [ 04/07/99 9:54 AM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1**;APR 03, 1998
 ;IHS/CMI/LAB - XTMP
START ;
 S APCPRPV("80D")="-------------------------------------------------------------------------------"
 D CHKSITE^APCPDRI
 S APCPRPV("RUN SITE")=+^APCPSITE(1,0)
 S APCPRPV("FAC PRINT")=$P(^DIC(4,APCPRPV("RUN SITE"),0),U)
 S Y=$P(^APCPLOG(APCPRPV("LOG"),0),U,3) D DD^%DT S APCPRPV("RUN DATE")=Y
 S APCPRPV("PG")=0
 D HEAD
 I '$D(^XTMP("APCPRPV",APCPJOB,APCPBTH)) W !!,"No transactions generated!!" G XIT
 K APCPRPV("QUIT")
 D PROC
 G:$D(APCPRPV("QUIT")) XIT
 I $E(IOST)="C",IO=IO(0) S DIR(0)="EO",DIR("A")="End of report.  HIT RETURN" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
XIT ;
 K ^XTMP("APCPRPV",APCPJOB,APCPBTH)
 W:$D(IOF) @IOF
 Q
PROC ;
 S APCPRPV("V")=0 F  S APCPRPV("V")=$O(^XTMP("APCPRPV",APCPJOB,APCPBTH,"VISITS",APCPRPV("V"))) Q:APCPRPV("V")'=+APCPRPV("V")!($D(APCPRPV("QUIT")))  D PRINT
 Q
PRINT ;
 I $Y>(IOSL-6) D HEAD Q:$D(APCPRPV("QUIT"))
 S APCPV0=^AUPNVSIT(APCPRPV("V"),0)
 S DFN=$P(APCPV0,U,5),APCPRPV("HRN")="" S:$D(^AUPNPAT(DFN,41,APCPRPV("RUN SITE"),0)) APCPRPV("HRN")=$P(^AUPNPAT(DFN,41,APCPRPV("RUN SITE"),0),U,2)
PRN ;
 W !,APCPRPV("HRN"),?8,$$VDTM^APCLV(APCPRPV("V"),"E"),?28,$E($$LOCENC^APCLV(APCPRPV("V"),"E"),1,20),?51,$$TYPE^APCLV(APCPRPV("V"),"I"),?55,$E($$SC^APCLV(APCPRPV("V"),"E"),1,12),?69,$E($$CLINIC^APCLV(APCPRPV("V"),"E"),1,10)
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCPRPV("QUIT")="" Q
HEAD1 ;
 W:$D(IOF) @IOF S APCPRPV("PG")=APCPRPV("PG")+1
 S APCPRPV("LENG")=30+$L(APCPRPV("FAC PRINT"))
 W !,"Report Run Date: ",APCPRPV("DTP"),?70,"Page ",APCPRPV("PG")
 W !!?((80-APCPRPV("LENG"))/2),"PCC DATA TRANSMISSION FOR ",APCPRPV("FAC PRINT")
 W !?24,"Listing of VISITS Exported"
 W !?18,"Date Export Run: ",APCPRPV("RUN DATE")
 W !?8,"Visits Processed for Posting Dates: ",APCPRPV("PRINT BEGIN")," to ",APCPRPV("PRINT END")
 W !!,APCPRPV("80D"),!," HRN ",?8,"VISIT DATE/TIME",?26,"  LOCATION",?50,"TYPE",?55,"SERV CAT",?67,"  CLINIC",!,APCPRPV("80D"),!
 Q