AZAXFCD ;IHS/PHXAO/AEF - FIX COVERED DAYS FIELD IN 3P BILL BATCHES
;;1.0;ANNE'S SPECIAL ROUTINES;;JULY 14, 2004
;;
;;DISCLAIMER: This routine is written for local use by Phoenix Area
;;facilities. Phoenix Area offers no support for the installation
;;or use of this routine nor claims responsibility for any adverse
;;effects resulting from its use.
;;
DESC ;----- ROUTINE DESCRIPTION
;;
;;This routine is written specifically to correct the COVERED DAYS
;;field for Medicare batches.
;;
;;This routine prompts for a specific batch entry in the 3P TX
;;STATUS file. It will then loop through each bill contained in
;;that batch and set the COVERED DAYS field contained in the
;;3P BILL file to null for each of those bills. The batch can
;;then be recreated and submitted.
;;$$END
;;
;;NOTE: Audit trails of the bills that were changed are placed
;;in the ^AZAX3PBF global for retrieval in case a batch is
;;accidentally processed. See the ARCH subroutine for more details.
Q
EN ;EP -- MAIN ENTRY POINT
;
N EXPDT,OUT,QUIT
;
D ^XBKVAR
D HOME^%ZIS
;
D TXT
;
F D Q:QUIT
. D EXP(.EXPDT,.OUT,.QUIT)
. Q:QUIT
. Q:OUT
. ;
. D PROC(EXPDT)
;
Q
PROC(EXPDT) ;
;----- PROCESS ENTRIES
;
; INPUT:
; EXPDT = IEN OF ENTRY IN 3P TX STATUS FILE TO BE PROCESSED
;
N BILL,CD,CNT,D1,NOW
;
Q:'EXPDT
;
S CNT=0
S NOW=$$NOW
;
W !!,"PROCESSING BATCH #",EXPDT," ",$$EXTDT($P($G(^ABMDTXST(DUZ(2),EXPDT,0)),U)),"..."
;
S D1=0
F S D1=$O(^ABMDTXST(DUZ(2),EXPDT,2,D1)) Q:'D1 D
. S CNT=$G(CNT)+1
. I '(CNT#10) W "."
. S BILL=$P($G(^ABMDTXST(DUZ(2),EXPDT,2,D1,0)),U)
. Q:'BILL
. S CD=$P($G(^ABMDBILL(DUZ(2),BILL,7)),U,3)
. D ARCH(NOW,EXPDT,BILL,CD)
. D ONE(BILL)
;
W !,CNT," BILLS PROCESSED"
Q
ONE(DA) ;
;----- EDIT ONE BILL
;
; INPUT:
; DA = IEN OF BILL IN 3P BILL FILE
;
N DIE,DR,X,Y
;
S DIE="^ABMDBILL("_DUZ(2)_","
S DR=".73///^S X=""@"""
D ^DIE
Q
EXP(EXPDT,OUT,QUIT) ;
;----- SELECT EXPORT DATE FROM 3P TX STATUS FILE
;
; INPUT:
; NONE
;
; OUTPUT:
; EXPDT = IEN OF ENTRY IN 3P TX STATUS FILE TO BE PROCESSED
; OUT = QUIT FLAG
; QUIT = QUIT FLAG
;
N DA,D0,DIC,DIQ,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
;
S OUT=0
S QUIT=0
;
W !
S DIC="^ABMDTXST("_DUZ(2)_","
S DIC(0)="AEQM"
S DIC("S")="I $P(^(0),U,3)=""R"""
D ^DIC
I $D(DTOUT)!($D(DUOUT))!(+Y'>0) S QUIT=1
Q:QUIT
;
W !
S DA=+Y
S DR="0:1"
S DIQ(0)="R"
D EN^DIQ
;
W !
S DIR("A",1)="WARNING! This option will delete the COVERED DAYS from all bills"
S DIR("A",2)="contained in this batch."
S DIR("A",3)=""
S DIR("A")="Do you REALLY want to delete the COVERED DAYS from this batch"
S DIR("B")="NO"
S DIR(0)="Y"
D ^DIR
I $D(DTOUT)!($D(DUOUT))!($D(DIRUT))!($D(DIROUT))!(+Y'>0) S OUT=1
Q:OUT
;
S EXPDT=DA
Q
ARCH(NOW,EXPDT,BILL,CD) ;
;----- PUT AN ENTRY INTO THE ^AZAX3PBF GLOBAL FOR EACH 'COVERED DAYS'
; FIELD THAT IS CHANGED BY THIS ROUTINE. USED AS AN AUDIT TRAIL.
; THIS GLOBAL CAN BE DELETED AFTER A WHILE.
;
; GLOBAL STRUCTURE IS:
; ^AZAX3PBF(DUZ(2),NOW,EXPORT_IEN,BILL_IEN)=COVERED_DAYS_OLD_VALUE^DUZ
;
; INPUT:
; NOW = DATE/TIME THE CHANGE WAS MADE
; EXPDT = EXPORT DATE IEN FROM 3P TX STATUS FILE
; BILL = BILL IEN FROM 3P TX STATUS FILE
; CD = COVERED DAYS FROM 3P BILL FILE
;
I '$D(^AZAX3PBF(0)) D
. S ^AZAX3PBF(0)="RECORD OF 3P BILL FILE ENTRIES WHOSE COVERED DAYS FIELD HAS BEEN CHANGED BY AZAX3PBF ROUTINE. "
. S ^AZAX3PBF(0)=^AZAX3PBF(0)_" THIS GLOBAL CAN BE DELETED AFTER A WHILE."
;
S ^AZAX3PBF(DUZ(2),NOW,EXPDT,BILL)=CD_U_DUZ
Q
TXT ;----- PRINT ROUTINE DESCRIPTION TEXT
;
N I,X
F I=1:1 S X=$T(DESC+I) Q:X["$$END" D
. W !,$P(X,";;",2)
Q
EXTDT(Y) ;
;----- RETURNS EXTERNAL DATE
;
; INPUT:
; Y = DATE IN FM FORMAT
;
X ^DD("DD")
Q Y
NOW() ;
;----- RETURNS CURRENT DATE/TIME IN INTERNAL FM FORMAT CYYMMDD.HHMMSS
;
N %,%I,X
D NOW^%DTC
Q %
AZAXFCD ;IHS/PHXAO/AEF - FIX COVERED DAYS FIELD IN 3P BILL BATCHES
+1 ;;1.0;ANNE'S SPECIAL ROUTINES;;JULY 14, 2004
+2 ;;
+3 ;;DISCLAIMER: This routine is written for local use by Phoenix Area
+4 ;;facilities. Phoenix Area offers no support for the installation
+5 ;;or use of this routine nor claims responsibility for any adverse
+6 ;;effects resulting from its use.
+7 ;;
DESC ;----- ROUTINE DESCRIPTION
+1 ;;
+2 ;;This routine is written specifically to correct the COVERED DAYS
+3 ;;field for Medicare batches.
+4 ;;
+5 ;;This routine prompts for a specific batch entry in the 3P TX
+6 ;;STATUS file. It will then loop through each bill contained in
+7 ;;that batch and set the COVERED DAYS field contained in the
+8 ;;3P BILL file to null for each of those bills. The batch can
+9 ;;then be recreated and submitted.
+10 ;;$$END
+11 ;;
+12 ;;NOTE: Audit trails of the bills that were changed are placed
+13 ;;in the ^AZAX3PBF global for retrieval in case a batch is
+14 ;;accidentally processed. See the ARCH subroutine for more details.
+15 QUIT
EN ;EP -- MAIN ENTRY POINT
+1 ;
+2 NEW EXPDT,OUT,QUIT
+3 ;
+4 DO ^XBKVAR
+5 DO HOME^%ZIS
+6 ;
+7 DO TXT
+8 ;
+9 FOR
Begin DoDot:1
+10 DO EXP(.EXPDT,.OUT,.QUIT)
+11 IF QUIT
QUIT
+12 IF OUT
QUIT
+13 ;
+14 DO PROC(EXPDT)
End DoDot:1
IF QUIT
QUIT
+15 ;
+16 QUIT
PROC(EXPDT) ;
+1 ;----- PROCESS ENTRIES
+2 ;
+3 ; INPUT:
+4 ; EXPDT = IEN OF ENTRY IN 3P TX STATUS FILE TO BE PROCESSED
+5 ;
+6 NEW BILL,CD,CNT,D1,NOW
+7 ;
+8 IF 'EXPDT
QUIT
+9 ;
+10 SET CNT=0
+11 SET NOW=$$NOW
+12 ;
+13 WRITE !!,"PROCESSING BATCH #",EXPDT," ",$$EXTDT($PIECE($GET(^ABMDTXST(DUZ(2),EXPDT,0)),U)),"..."
+14 ;
+15 SET D1=0
+16 FOR
SET D1=$ORDER(^ABMDTXST(DUZ(2),EXPDT,2,D1))
IF 'D1
QUIT
Begin DoDot:1
+17 SET CNT=$GET(CNT)+1
+18 IF '(CNT#10)
WRITE "."
+19 SET BILL=$PIECE($GET(^ABMDTXST(DUZ(2),EXPDT,2,D1,0)),U)
+20 IF 'BILL
QUIT
+21 SET CD=$PIECE($GET(^ABMDBILL(DUZ(2),BILL,7)),U,3)
+22 DO ARCH(NOW,EXPDT,BILL,CD)
+23 DO ONE(BILL)
End DoDot:1
+24 ;
+25 WRITE !,CNT," BILLS PROCESSED"
+26 QUIT
ONE(DA) ;
+1 ;----- EDIT ONE BILL
+2 ;
+3 ; INPUT:
+4 ; DA = IEN OF BILL IN 3P BILL FILE
+5 ;
+6 NEW DIE,DR,X,Y
+7 ;
+8 SET DIE="^ABMDBILL("_DUZ(2)_","
+9 SET DR=".73///^S X=""@"""
+10 DO ^DIE
+11 QUIT
EXP(EXPDT,OUT,QUIT) ;
+1 ;----- SELECT EXPORT DATE FROM 3P TX STATUS FILE
+2 ;
+3 ; INPUT:
+4 ; NONE
+5 ;
+6 ; OUTPUT:
+7 ; EXPDT = IEN OF ENTRY IN 3P TX STATUS FILE TO BE PROCESSED
+8 ; OUT = QUIT FLAG
+9 ; QUIT = QUIT FLAG
+10 ;
+11 NEW DA,D0,DIC,DIQ,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
+12 ;
+13 SET OUT=0
+14 SET QUIT=0
+15 ;
+16 WRITE !
+17 SET DIC="^ABMDTXST("_DUZ(2)_","
+18 SET DIC(0)="AEQM"
+19 SET DIC("S")="I $P(^(0),U,3)=""R"""
+20 DO ^DIC
+21 IF $DATA(DTOUT)!($DATA(DUOUT))!(+Y'>0)
SET QUIT=1
+22 IF QUIT
QUIT
+23 ;
+24 WRITE !
+25 SET DA=+Y
+26 SET DR="0:1"
+27 SET DIQ(0)="R"
+28 DO EN^DIQ
+29 ;
+30 WRITE !
+31 SET DIR("A",1)="WARNING! This option will delete the COVERED DAYS from all bills"
+32 SET DIR("A",2)="contained in this batch."
+33 SET DIR("A",3)=""
+34 SET DIR("A")="Do you REALLY want to delete the COVERED DAYS from this batch"
+35 SET DIR("B")="NO"
+36 SET DIR(0)="Y"
+37 DO ^DIR
+38 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!($DATA(DIROUT))!(+Y'>0)
SET OUT=1
+39 IF OUT
QUIT
+40 ;
+41 SET EXPDT=DA
+42 QUIT
ARCH(NOW,EXPDT,BILL,CD) ;
+1 ;----- PUT AN ENTRY INTO THE ^AZAX3PBF GLOBAL FOR EACH 'COVERED DAYS'
+2 ; FIELD THAT IS CHANGED BY THIS ROUTINE. USED AS AN AUDIT TRAIL.
+3 ; THIS GLOBAL CAN BE DELETED AFTER A WHILE.
+4 ;
+5 ; GLOBAL STRUCTURE IS:
+6 ; ^AZAX3PBF(DUZ(2),NOW,EXPORT_IEN,BILL_IEN)=COVERED_DAYS_OLD_VALUE^DUZ
+7 ;
+8 ; INPUT:
+9 ; NOW = DATE/TIME THE CHANGE WAS MADE
+10 ; EXPDT = EXPORT DATE IEN FROM 3P TX STATUS FILE
+11 ; BILL = BILL IEN FROM 3P TX STATUS FILE
+12 ; CD = COVERED DAYS FROM 3P BILL FILE
+13 ;
+14 IF '$DATA(^AZAX3PBF(0))
Begin DoDot:1
+15 SET ^AZAX3PBF(0)="RECORD OF 3P BILL FILE ENTRIES WHOSE COVERED DAYS FIELD HAS BEEN CHANGED BY AZAX3PBF ROUTINE. "
+16 SET ^AZAX3PBF(0)=^AZAX3PBF(0)_" THIS GLOBAL CAN BE DELETED AFTER A WHILE."
End DoDot:1
+17 ;
+18 SET ^AZAX3PBF(DUZ(2),NOW,EXPDT,BILL)=CD_U_DUZ
+19 QUIT
TXT ;----- PRINT ROUTINE DESCRIPTION TEXT
+1 ;
+2 NEW I,X
+3 FOR I=1:1
SET X=$TEXT(DESC+I)
IF X["$$END"
QUIT
Begin DoDot:1
+4 WRITE !,$PIECE(X,";;",2)
End DoDot:1
+5 QUIT
EXTDT(Y) ;
+1 ;----- RETURNS EXTERNAL DATE
+2 ;
+3 ; INPUT:
+4 ; Y = DATE IN FM FORMAT
+5 ;
+6 XECUTE ^DD("DD")
+7 QUIT Y
NOW() ;
+1 ;----- RETURNS CURRENT DATE/TIME IN INTERNAL FM FORMAT CYYMMDD.HHMMSS
+2 ;
+3 NEW %,%I,X
+4 DO NOW^%DTC
+5 QUIT %
+6 +7
***** ERRORS & WARNINGS IN AZAXFCD *****
NOW+6 W - Null line (no commands or comment).
NOW+7 W - Null line (no commands or comment).