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

APCPRCH1.m

Go to the documentation of this file.
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
 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 ;;