APCPERR ; IHS/TUCSON/LAB - OHPRD-TUCSON/EDE WITE PCC TX ERRORS AUGUST 14, 1992 ; [ 08/18/03 6:05 AM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**6**;APR 03, 1998
;
START ;
S APCPE("ERR DFN")=$O(^APCDERR("B",APCPE("ERROR"),"")) I APCPE("ERR DFN")="" S APCPE("MSG")=APCPE("ERROR")_"-ERROR INFORMATION NOT IN ERROR FILE" G ERR
S APCPE("MSG")=APCPE("ERROR")_"-"_$P(^APCDERR(APCPE("ERR DFN"),0),U,2) S:$L(APCPE("MSG"))=5 APCPE("MSG")=APCPE("MSG")_"- ERROR INFORMATION NOT IN ERROR FILE" S APCPE("MSG")=$E(APCPE("MSG"),1,45)
ERR S:'$D(APCPE("FILE")) APCPE("FILE")=9000010 S:'$G(APCPE("EDFN")) APCPE("EDFN")=APCP("V DFN") S:'$D(APCPE("T-TCODE")) APCPE("T-TCODE")=99
S X=$P(APCPE("FILE"),".",2),X=$E("00",1,2-$L(X))_X,X="F"_X,APCPE("VARIABLE PREFIX")=X
I $P($G(^AUPNVSIT(APCP("V DFN"),0)),U,11) Q
K DIE,DR S DA=APCP("RUN LOG"),DR="5101///"""_APCPE("T-TCODE")_"""",DR(2,9001005.05101)=".02///"_APCPE("VARIABLE PREFIX")_".`"_APCPE("EDFN")_";.03///"_APCPE("MSG")_";.04///`"_APCP("V DFN"),DIE="^APCPLOG("
D ^DIE K DR,DIE
I $D(Y) S APCP("QFLG")=25 W:'$D(ZTQUEUED) !!,"Error encountered in ^APCPERR. Notify programmer!",! I $D(ZTQUEUED) D ERRBULL^APCPDRI3
Q
APCPERR ; IHS/TUCSON/LAB - OHPRD-TUCSON/EDE WITE PCC TX ERRORS AUGUST 14, 1992 ; [ 08/18/03 6:05 AM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**6**;APR 03, 1998
+2 ;
START ;
+1 SET APCPE("ERR DFN")=$ORDER(^APCDERR("B",APCPE("ERROR"),""))
IF APCPE("ERR DFN")=""
SET APCPE("MSG")=APCPE("ERROR")_"-ERROR INFORMATION NOT IN ERROR FILE"
GOTO ERR
+2 SET APCPE("MSG")=APCPE("ERROR")_"-"_$PIECE(^APCDERR(APCPE("ERR DFN"),0),U,2)
IF $LENGTH(APCPE("MSG"))=5
SET APCPE("MSG")=APCPE("MSG")_"- ERROR INFORMATION NOT IN ERROR FILE"
SET APCPE("MSG")=$EXTRACT(APCPE("MSG"),1,45)
ERR IF '$DATA(APCPE("FILE"))
SET APCPE("FILE")=9000010
IF '$GET(APCPE("EDFN"))
SET APCPE("EDFN")=APCP("V DFN")
IF '$DATA(APCPE("T-TCODE"))
SET APCPE("T-TCODE")=99
+1 SET X=$PIECE(APCPE("FILE"),".",2)
SET X=$EXTRACT("00",1,2-$LENGTH(X))_X
SET X="F"_X
SET APCPE("VARIABLE PREFIX")=X
+2 IF $PIECE($GET(^AUPNVSIT(APCP("V DFN"),0)),U,11)
QUIT
+3 KILL DIE,DR
SET DA=APCP("RUN LOG")
SET DR="5101///"""_APCPE("T-TCODE")_""""
SET DR(2,9001005.05101)=".02///"_APCPE("VARIABLE PREFIX")_".`"_APCPE("EDFN")_";.03///"_APCPE("MSG")_";.04///`"_APCP("V DFN")
SET DIE="^APCPLOG("
+4 DO ^DIE
KILL DR,DIE
+5 IF $DATA(Y)
SET APCP("QFLG")=25
IF '$DATA(ZTQUEUED)
WRITE !!,"Error encountered in ^APCPERR. Notify programmer!",!
IF $DATA(ZTQUEUED)
DO ERRBULL^APCPDRI3
+6 QUIT