APCPRCH1 ; IHS/TUCSON/LAB - AMBULATORY OPERATIONS SUMMARY AUGUST 14, 1992 ; [ 02/14/00 2:22 PM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,4**;APR 03, 1998
;IHS/CMI/LAB - patch 4 file 200 conversion
;IHS/CMI/LAB - XTMP
START ;
S APCPRCH("80D")="-------------------------------------------------------------------------------"
D CHKSITE^APCPDRI
S APCPRCH("RUN SITE")=+^APCPSITE(1,0)
S APCPRCH(" PRINT")=$P(^DIC(4,APCPRCH("RUN SITE"),0),U)
S Y=$P(^APCPLOG(APCPRCH("LOG"),0),U,3) D DD^%DT S APCPRCH("RUN DATE")=Y
S APCPRCH("PG")=0
D HEAD
I '$D(^XTMP("APCPRCH",APCPJOB,APCPBTH)) W !!,"No CHA records" G EOJ
K APCPRCH("QUIT")
D PROC
G:$D(APCPRCH("QUIT")) EOJ
W !!?50,"TOTAL CHA RECORDS: ",^XTMP("APCPRCH",APCPJOB,APCPBTH,"GEN","TOTAL")
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
EOJ ;
K ^XTMP("APCPRCH",APCPJOB,APCPBTH)
W:$D(IOF) @IOF
Q
PROC ;
S APCPRCH("V")=0 F S APCPRCH("V")=$O(^XTMP("APCPRCH",APCPJOB,APCPBTH,"VISITS",APCPRCH("V"))) Q:APCPRCH("V")'=+APCPRCH("V")!($D(APCPRCH("QUIT"))) D PRINT
Q
PRINT ;
I $Y>(IOSL-6) D HEAD Q:$D(APCPRCH("QUIT"))
S APCPRCH("VR")=^AUPNVSIT(APCPRCH("V"),0),APCPRCH("V LOC")=$P(APCPRCH("VR"),U,6),APCPRCH("V LOC")=$E($P(^DIC(4,APCPRCH("V LOC"),0),U),1,17),APCPRCH("TYPE")=$P(APCPRCH("VR"),U,3),APCPRCH("SC")=$P(APCPRCH("VR"),U,7)
CLINIC ;
S APCPRCH("CLINIC")=$P(^AUPNVSIT(APCPRCH("V"),0),U,8) I APCPRCH("CLINIC")="" S APCPRCH("CLINIC")="--" G HRN
S APCPRCH("CLINIC")=$P(^DIC(40.7,APCPRCH("CLINIC"),0),U,2)
HRN S APCPRCH("PAT DFN")=$P(APCPRCH("VR"),U,5),APCPRCH("HRN")="" S:$D(^AUPNPAT(APCPRCH("PAT DFN"),41,APCPRCH("RUN SITE"),0)) APCPRCH("HRN")=$P(^AUPNPAT(APCPRCH("PAT DFN"),41,APCPRCH("RUN SITE"),0),U,2)
S Y=$P(APCPRCH("VR"),U,13),APCPRCH("DATE LAST MOD")=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)
VD ;
S Y=+APCPRCH("VR") X ^DD("DD") S APCPRCH("RD")=Y
PRN ;
W !,APCPRCH("HRN"),?8,APCPRCH("RD"),?27,APCPRCH("V LOC"),?47,APCPRCH("CLINIC"),?51,APCPRCH("DATE LAST MOD")
S (X,C)=0 F S X=$O(^AUPNVPRV("AD",APCPRCH("V"),X)) Q:X'=+X D
.I $P(^DD(9000010.06,.01,0),U,2)[200 W:C>0 ! W ?61,$E($P(^VA(200,$P(^AUPNVPRV(X,0),U),0),U),1,18) S C=C+1
.I $P(^DD(9000010.06,.01,0),U,2)[6 W:C>0 ! W ?61,$E($P(^DIC(16,$P(^AUPNVPRV(X,0),U),0),U),1,18) S C=C+1
Q
HEAD I 'APCPRCH("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 APCPRCH("QUIT")="" Q
HEAD1 ;
W:$D(IOF) @IOF S APCPRCH("PG")=APCPRCH("PG")+1
S APCPRCH("LENG")=30+$L(APCPRCH(" PRINT"))
W !,"Report Run Date: ",APCPRCH("DTP"),?70,"Page ",APCPRCH("PG")
W !!?((80-APCPRCH("LENG"))/2),"PCC DATA TRANSMISSION FOR ",APCPRCH(" PRINT")
W !?15,"Listing of VISITS that Generated CHA Transactions"
W !?18,"Date Export Run: ",APCPRCH("RUN DATE")
W !?8,"Visits Processed for Posting Dates: ",APCPRCH("PRINT BEGIN")," to ",APCPRCH("PRINT END")
W !!,APCPRCH("80D"),!," HRN ",?8,"VISIT DATE/TIME",?28,"LOCATION",?47,"CL",?51,"DATE MOD",?61,"PROVIDERS",!,APCPRCH("80D"),!
Q
C42 ;;
C51 ;;
C52 ;;
C53 ;;
C54 ;;
C56 ;;
C60 ;;
C68 ;;
APCPRCH1 ; IHS/TUCSON/LAB - AMBULATORY OPERATIONS SUMMARY AUGUST 14, 1992 ; [ 02/14/00 2:22 PM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,4**;APR 03, 1998
+2 ;IHS/CMI/LAB - patch 4 file 200 conversion
+3 ;IHS/CMI/LAB - XTMP
START ;
+1 SET APCPRCH("80D")="-------------------------------------------------------------------------------"
+2 DO CHKSITE^APCPDRI
+3 SET APCPRCH("RUN SITE")=+^APCPSITE(1,0)
+4 SET APCPRCH(" PRINT")=$PIECE(^DIC(4,APCPRCH("RUN SITE"),0),U)
+5 SET Y=$PIECE(^APCPLOG(APCPRCH("LOG"),0),U,3)
DO DD^%DT
SET APCPRCH("RUN DATE")=Y
+6 SET APCPRCH("PG")=0
+7 DO HEAD
+8 IF '$DATA(^XTMP("APCPRCH",APCPJOB,APCPBTH))
WRITE !!,"No CHA records"
GOTO EOJ
+9 KILL APCPRCH("QUIT")
+10 DO PROC
+11 IF $DATA(APCPRCH("QUIT"))
GOTO EOJ
+12 WRITE !!?50,"TOTAL CHA RECORDS: ",^XTMP("APCPRCH",APCPJOB,APCPBTH,"GEN","TOTAL")
+13 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
EOJ ;
+1 KILL ^XTMP("APCPRCH",APCPJOB,APCPBTH)
+2 IF $DATA(IOF)
WRITE @IOF
+3 QUIT
PROC ;
+1 SET APCPRCH("V")=0
FOR
SET APCPRCH("V")=$ORDER(^XTMP("APCPRCH",APCPJOB,APCPBTH,"VISITS",APCPRCH("V")))
IF APCPRCH("V")'=+APCPRCH("V")!($DATA(APCPRCH("QUIT")))
QUIT
DO PRINT
+2 QUIT
PRINT ;
+1 IF $Y>(IOSL-6)
DO HEAD
IF $DATA(APCPRCH("QUIT"))
QUIT
+2 SET APCPRCH("VR")=^AUPNVSIT(APCPRCH("V"),0)
SET APCPRCH("V LOC")=$PIECE(APCPRCH("VR"),U,6)
SET APCPRCH("V LOC")=$EXTRACT($PIECE(^DIC(4,APCPRCH("V LOC"),0),U),1,17)
SET APCPRCH("TYPE")=$PIECE(APCPRCH("VR"),U,3)
SET APCPRCH("SC")=$PIECE(APCPRCH("VR"),U,7)
CLINIC ;
+1 SET APCPRCH("CLINIC")=$PIECE(^AUPNVSIT(APCPRCH("V"),0),U,8)
IF APCPRCH("CLINIC")=""
SET APCPRCH("CLINIC")="--"
GOTO HRN
+2 SET APCPRCH("CLINIC")=$PIECE(^DIC(40.7,APCPRCH("CLINIC"),0),U,2)
HRN SET APCPRCH("PAT DFN")=$PIECE(APCPRCH("VR"),U,5)
SET APCPRCH("HRN")=""
IF $DATA(^AUPNPAT(APCPRCH("PAT DFN"),41,APCPRCH("RUN SITE"),0))
SET APCPRCH("HRN")=$PIECE(^AUPNPAT(APCPRCH("PAT DFN"),41,APCPRCH("RUN SITE"),0),U,2)
+1 SET Y=$PIECE(APCPRCH("VR"),U,13)
SET APCPRCH("DATE LAST MOD")=$EXTRACT(Y,4,5)_"/"_$EXTRACT(Y,6,7)_"/"_$EXTRACT(Y,2,3)
VD ;
+1 SET Y=+APCPRCH("VR")
XECUTE ^DD("DD")
SET APCPRCH("RD")=Y
PRN ;
+1 WRITE !,APCPRCH("HRN"),?8,APCPRCH("RD"),?27,APCPRCH("V LOC"),?47,APCPRCH("CLINIC"),?51,APCPRCH("DATE LAST MOD")
+2 SET (X,C)=0
FOR
SET X=$ORDER(^AUPNVPRV("AD",APCPRCH("V"),X))
IF X'=+X
QUIT
Begin DoDot:1
+3 IF $PIECE(^DD(9000010.06,.01,0),U,2)[200
IF C>0
WRITE !
WRITE ?61,$EXTRACT($PIECE(^VA(200,$PIECE(^AUPNVPRV(X,0),U),0),U),1,18)
SET C=C+1
+4 IF $PIECE(^DD(9000010.06,.01,0),U,2)[6
IF C>0
WRITE !
WRITE ?61,$EXTRACT($PIECE(^DIC(16,$PIECE(^AUPNVPRV(X,0),U),0),U),1,18)
SET C=C+1
End DoDot:1
+5 QUIT
HEAD IF 'APCPRCH("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 APCPRCH("QUIT")=""
QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
SET APCPRCH("PG")=APCPRCH("PG")+1
+2 SET APCPRCH("LENG")=30+$LENGTH(APCPRCH(" PRINT"))
+3 WRITE !,"Report Run Date: ",APCPRCH("DTP"),?70,"Page ",APCPRCH("PG")
+4 WRITE !!?((80-APCPRCH("LENG"))/2),"PCC DATA TRANSMISSION FOR ",APCPRCH(" PRINT")
+5 WRITE !?15,"Listing of VISITS that Generated CHA Transactions"
+6 WRITE !?18,"Date Export Run: ",APCPRCH("RUN DATE")
+7 WRITE !?8,"Visits Processed for Posting Dates: ",APCPRCH("PRINT BEGIN")," to ",APCPRCH("PRINT END")
+8 WRITE !!,APCPRCH("80D"),!," HRN ",?8,"VISIT DATE/TIME",?28,"LOCATION",?47,"CL",?51,"DATE MOD",?61,"PROVIDERS",!,APCPRCH("80D"),!
+9 QUIT
C42 ;;
C51 ;;
C52 ;;
C53 ;;
C54 ;;
C56 ;;
C60 ;;
C68 ;;