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