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

AZAX3PBF.m

Go to the documentation of this file.
AZAX3PBF ;IHS/PHXAO/AEF - FIX COVERED DAYS FIELD IN 3P BILL BATCHES
 ;;1.0;ANNE'S SPECIAL ROUTINES;;JULY 14, 2004
 ;;
 ;;DELETE THIS ROUTINE... THIS CODE HAS BEEN MOVED TO ^AZAXFCD
 ;
EN ;EP -- MAIN ENTRY POINT
 ;
 N EXPDT,OUT,QUIT
 ;
 D ^XBKVAR
 D HOME^%ZIS
 ;
 F  D  Q:QUIT
 . D EXP(.EXPDT,.OUT,.QUIT)
 . Q:QUIT
 . Q:OUT
 . ;
 . D PROC(EXPDT)
 ;
 Q
PROC(EXPDT) ;
 ;----- PROCESS ENTRIES
 ;
 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
 ;
 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
 ;
 N DA,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"
 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
EXTDT(Y) ;
 ;----- RETURNS EXTERNAL DATE
 ;
 X ^DD("DD")
 Q Y
NOW() ;
 ;----- RETURNS CURRENT DATE/TIME IN INTERNAL FM FORMAT CYYMMDD.HHMMSS
 ;
 N %,%I,X
 D NOW^%DTC
 Q %