- APCPRED1 ; IHS/TUCSON/LAB - CONTINUATION OF APCPREDO AUGUST 14, 1992 ; [ 04/17/02 11:19 AM ]
- ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
- ;IHS/CMI/LAB - no longer process APC,INPT,CHA
- ;
- INIT ;EP
- D CHKOLD^APCPDRI2
- Q:APCP("QFLG")
- S DIC="^APCPLOG(",DIC(0)="AEQ",DIC("S")="I $D(^(21)),$P(^(0),U,9)=DUZ(2),'$P(^(0),U,27)" D ^DIC K DIC
- I Y<0 S APCP("QFLG")=99 Q
- S APCP("RUN LOG")=+Y
- ;
- S X=^APCPLOG(APCP("RUN LOG"),0),APCP("RUN BEGIN")=$P(X,U),APCP("RUN END")=$P(X,U,2),APCP("COUNT")=$P(X,U,6),APCP("ORIG TX DATE")=$P($P(X,U,3),".")
- S Y=APCP("RUN BEGIN") X ^DD("DD") S APCP("PRINT BEGIN")=Y
- S Y=APCP("RUN END") X ^DD("DD") S APCP("PRINT END")=Y
- S APCP("VISITS")=$P(^APCPLOG(APCP("RUN LOG"),21,0),U,4)
- W !!,"Log entry ",APCP("RUN LOG")," was for date range ",APCP("PRINT BEGIN")," through",!,APCP("PRINT END")," and generated ",APCP("COUNT")," transactions from ",APCP("VISITS")," visits."
- ;
- W !!,"This routine will re-generate the following transaction types:"
- ;W:$D(APCPS("APC")) !?15,"APC - AMBULATORY SYSTEM " ;IHS/CMI/LAB - no apc records
- ;W:$D(APCPS("INPT")) !?15,"INPATIENT - DIRECT INPATIENT" ;IHS/CMI/LAB - no inpt records
- ;W:$D(APCPS("CHA")) !?15,"CHA - COMMUNITY HEALTH ACTIVITY" ;IHS/CMI/LAB - no cha records
- W !?15,"STATISTICAL DATABASE RECORDS" ;IHS/CMI/LAB - all sites send stat records
- RDD ;
- S DIR(0)="Y",DIR("A")="Do you want to regenerate the transactions for this run",DIR("B")="N" K DA D ^DIR K DIR
- I $D(DIRUT)!'Y S APCP("QFLG")=99 Q
- K ^APCPLOG(APCP("RUN LOG"),51)
- S APCP("COUNT")=0
- Q
- APCPRED1 ; IHS/TUCSON/LAB - CONTINUATION OF APCPREDO AUGUST 14, 1992 ; [ 04/17/02 11:19 AM ]
- +1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
- +2 ;IHS/CMI/LAB - no longer process APC,INPT,CHA
- +3 ;
- INIT ;EP
- +1 DO CHKOLD^APCPDRI2
- +2 IF APCP("QFLG")
- QUIT
- +3 SET DIC="^APCPLOG("
- SET DIC(0)="AEQ"
- SET DIC("S")="I $D(^(21)),$P(^(0),U,9)=DUZ(2),'$P(^(0),U,27)"
- DO ^DIC
- KILL DIC
- +4 IF Y<0
- SET APCP("QFLG")=99
- QUIT
- +5 SET APCP("RUN LOG")=+Y
- +6 ;
- +7 SET X=^APCPLOG(APCP("RUN LOG"),0)
- SET APCP("RUN BEGIN")=$PIECE(X,U)
- SET APCP("RUN END")=$PIECE(X,U,2)
- SET APCP("COUNT")=$PIECE(X,U,6)
- SET APCP("ORIG TX DATE")=$PIECE($PIECE(X,U,3),".")
- +8 SET Y=APCP("RUN BEGIN")
- XECUTE ^DD("DD")
- SET APCP("PRINT BEGIN")=Y
- +9 SET Y=APCP("RUN END")
- XECUTE ^DD("DD")
- SET APCP("PRINT END")=Y
- +10 SET APCP("VISITS")=$PIECE(^APCPLOG(APCP("RUN LOG"),21,0),U,4)
- +11 WRITE !!,"Log entry ",APCP("RUN LOG")," was for date range ",APCP("PRINT BEGIN")," through",!,APCP("PRINT END")," and generated ",APCP("COUNT")," transactions from ",APCP("VISITS")," visits."
- +12 ;
- +13 WRITE !!,"This routine will re-generate the following transaction types:"
- +14 ;W:$D(APCPS("APC")) !?15,"APC - AMBULATORY SYSTEM " ;IHS/CMI/LAB - no apc records
- +15 ;W:$D(APCPS("INPT")) !?15,"INPATIENT - DIRECT INPATIENT" ;IHS/CMI/LAB - no inpt records
- +16 ;W:$D(APCPS("CHA")) !?15,"CHA - COMMUNITY HEALTH ACTIVITY" ;IHS/CMI/LAB - no cha records
- +17 ;IHS/CMI/LAB - all sites send stat records
- WRITE !?15,"STATISTICAL DATABASE RECORDS"
- RDD ;
- +1 SET DIR(0)="Y"
- SET DIR("A")="Do you want to regenerate the transactions for this run"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +2 IF $DATA(DIRUT)!'Y
- SET APCP("QFLG")=99
- QUIT
- +3 KILL ^APCPLOG(APCP("RUN LOG"),51)
- +4 SET APCP("COUNT")=0
- +5 QUIT