APCDDVW2 ; IHS/CMI/LAB - PRINT TXER REPORT ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
TXER ;EP;print transaction errors
K APCDDEM
D HEAD^APCDDVW
W !!,"TOTAL NUMBER OF ERRORS ON THIS TXER REPORT: ",$G(APCDCNTR("TXER")),!!
I '$D(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER")) W !!,"There are no visits in the specified ",$S(APCDPROC="P":"Posting",APCDPROC="V":"Visit",1:"Posting")," date range ",!,"that have Transaction Errors." Q
S APCDCL=0 F S APCDCL=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL)) Q:APCDCL'=+APCDCL!($D(APCDQUIT)) S APCDCLIN="" F S APCDCLIN=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN)) Q:APCDCLIN=""!($D(APCDQUIT)) D
.S APCDH="" F S APCDH=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH)) Q:APCDH=""!($D(APCDQUIT)) D
..S APCDV=0 F S APCDV=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV)) Q:APCDV'=+APCDV!($D(APCDQUIT)) D:$Y>(IOSL-9) HEAD^APCDDVW Q:$D(APCDQUIT) D PRN1^APCDDVW W !?20,"ERROR INFORMATION" D TXER2
Q:$D(APCDQUIT)
S APCDDEM="",APCDPG=0
D HEAD^APCDDVW
I '$D(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG")) W !!,"NO VISITS WITH DEMOGRAPHIC (PAT REG) ERRORS"
S APCDCL=0 F S APCDCL=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL)) Q:APCDCL'=+APCDCL!($D(APCDQUIT)) D
.S APCDCLIN="" F S APCDH=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN)) Q:APCDCLIN=""!($D(APCDQUIT)) D
..S APCDH="" F S APCDH=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH)) Q:APCDH=""!($D(APCDQUIT)) D
...S APCDV=0 F S APCDV=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV)) Q:APCDV'=+APCDV!($D(APCDQUIT)) D:$Y>(IOSL-9) HEAD^APCDDVW Q:$D(APCDQUIT) D PRN1^APCDDVW W !?20,"ERROR INFORMATION" D TXERD2
Q:$D(APCDQUIT)
K APCDDEM S APCDDEMM="",APCDPG=0
D HEAD^APCDDVW
I '$D(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND")) W !!,"NO VISITS WITH MANDATORY DATA ITEMS MISSING OR INVALID",!
S APCDCL=0 F S APCDCL=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL)) Q:APCDCL'=+APCDCL!($D(APCDQUIT)) D
.S APCDCLIN="" F S APCDCLIN=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN)) Q:APCDCLIN=""!($D(APCDQUIT)) D
..S APCDH="" S APCDH=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH)) Q:APCDH=""!($D(APCDQUIT)) D
...S APCDV=0 F S APCDV=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV)) Q:APCDV'=+APCDV!($D(APCDQUIT)) D:$Y>(IOSL-4) HEAD^APCDDVW Q:$D(APCDQUIT) D PRN1^APCDDVW W !?20,"ERROR INFORMATION" D TXERD3
Q
TXERD2 ;
S (APCDFILE,APCDECNT)=""
F S APCDECNT=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT)) Q:APCDECNT="" S APCDFILE=$P(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U,2) D TXERDW
Q
TXER2 S (APCDFILE,APCDECNT)=""
F S APCDECNT=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT)) Q:APCDECNT="" S APCDFILE=$P(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U,2) D TXERW
Q
TXERDW W !," FILE: ",$E($P(^DIC(APCDFILE,0),U),1,13)," ",$P(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U)
Q
TXERW W !," FILE: ",$E($P(^DIC(APCDFILE,0),U),1,13)," ",$P(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U)
Q
TXERDMW W !," FILE: ",$E($P(^DIC(APCDFILE,0),U),1,13)," ",$P(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U)
Q
TXERD3 S (APCDFILE,APCDECNT)=""
F S APCDECNT=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT)) Q:APCDECNT=""!($D(APCDQUIT)) D
.S APCDFILE=$P(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U,2) D TXERDMW
Q
;
APCDDVW2 ; IHS/CMI/LAB - PRINT TXER REPORT ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
TXER ;EP;print transaction errors
+1 KILL APCDDEM
+2 DO HEAD^APCDDVW
+3 WRITE !!,"TOTAL NUMBER OF ERRORS ON THIS TXER REPORT: ",$GET(APCDCNTR("TXER")),!!
+4 IF '$DATA(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER"))
WRITE !!,"There are no visits in the specified ",$SELECT(APCDPROC="P":"Posting",APCDPROC="V":"Visit",1:"Posting")," date range ",!,"that have Transaction Errors."
QUIT
+5 SET APCDCL=0
FOR
SET APCDCL=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL))
IF APCDCL'=+APCDCL!($DATA(APCDQUIT))
QUIT
SET APCDCLIN=""
FOR
SET APCDCLIN=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN))
IF APCDCLIN=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:1
+6 SET APCDH=""
FOR
SET APCDH=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH))
IF APCDH=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:2
+7 SET APCDV=0
FOR
SET APCDV=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV))
IF APCDV'=+APCDV!($DATA(APCDQUIT))
QUIT
IF $Y>(IOSL-9)
DO HEAD^APCDDVW
IF $DATA(APCDQUIT)
QUIT
DO PRN1^APCDDVW
WRITE !?20,"ERROR INFORMATION"
DO TXER2
End DoDot:2
End DoDot:1
+8 IF $DATA(APCDQUIT)
QUIT
+9 SET APCDDEM=""
SET APCDPG=0
+10 DO HEAD^APCDDVW
+11 IF '$DATA(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG"))
WRITE !!,"NO VISITS WITH DEMOGRAPHIC (PAT REG) ERRORS"
+12 SET APCDCL=0
FOR
SET APCDCL=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL))
IF APCDCL'=+APCDCL!($DATA(APCDQUIT))
QUIT
Begin DoDot:1
+13 SET APCDCLIN=""
FOR
SET APCDH=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN))
IF APCDCLIN=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:2
+14 SET APCDH=""
FOR
SET APCDH=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH))
IF APCDH=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:3
+15 SET APCDV=0
FOR
SET APCDV=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV))
IF APCDV'=+APCDV!($DATA(APCDQUIT))
QUIT
IF $Y>(IOSL-9)
DO HEAD^APCDDVW
IF $DATA(APCDQUIT)
QUIT
DO PRN1^APCDDVW
WRITE !?20,"ERROR INFORMATION"
DO TXERD2
End DoDot:3
End DoDot:2
End DoDot:1
+16 IF $DATA(APCDQUIT)
QUIT
+17 KILL APCDDEM
SET APCDDEMM=""
SET APCDPG=0
+18 DO HEAD^APCDDVW
+19 IF '$DATA(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND"))
WRITE !!,"NO VISITS WITH MANDATORY DATA ITEMS MISSING OR INVALID",!
+20 SET APCDCL=0
FOR
SET APCDCL=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL))
IF APCDCL'=+APCDCL!($DATA(APCDQUIT))
QUIT
Begin DoDot:1
+21 SET APCDCLIN=""
FOR
SET APCDCLIN=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN))
IF APCDCLIN=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:2
+22 SET APCDH=""
SET APCDH=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH))
IF APCDH=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:3
+23 SET APCDV=0
FOR
SET APCDV=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV))
IF APCDV'=+APCDV!($DATA(APCDQUIT))
QUIT
IF $Y>(IOSL-4)
DO HEAD^APCDDVW
IF $DATA(APCDQUIT)
QUIT
DO PRN1^APCDDVW
WRITE !?20,"ERROR INFORMATION"
DO TXERD3
End DoDot:3
End DoDot:2
End DoDot:1
+24 QUIT
TXERD2 ;
+1 SET (APCDFILE,APCDECNT)=""
+2 FOR
SET APCDECNT=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT))
IF APCDECNT=""
QUIT
SET APCDFILE=$PIECE(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U,2)
DO TXERDW
+3 QUIT
TXER2 SET (APCDFILE,APCDECNT)=""
+1 FOR
SET APCDECNT=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT))
IF APCDECNT=""
QUIT
SET APCDFILE=$PIECE(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U,2)
DO TXERW
+2 QUIT
TXERDW WRITE !," FILE: ",$EXTRACT($PIECE(^DIC(APCDFILE,0),U),1,13)," ",$PIECE(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOG",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U)
+1 QUIT
TXERW WRITE !," FILE: ",$EXTRACT($PIECE(^DIC(APCDFILE,0),U),1,13)," ",$PIECE(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U)
+1 QUIT
TXERDMW WRITE !," FILE: ",$EXTRACT($PIECE(^DIC(APCDFILE,0),U),1,13)," ",$PIECE(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U)
+1 QUIT
TXERD3 SET (APCDFILE,APCDECNT)=""
+1 FOR
SET APCDECNT=$ORDER(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT))
IF APCDECNT=""!($DATA(APCDQUIT))
QUIT
Begin DoDot:1
+2 SET APCDFILE=$PIECE(^XTMP("APCDDV",APCDJOB,APCDBT,"TXER","DEMOGMAND",APCDCL,APCDCLIN,APCDH,APCDV,APCDECNT),U,2)
DO TXERDMW
End DoDot:1
+3 QUIT
+4 ;