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

ACHSHVR2.m

Go to the documentation of this file.
ACHSHVR2 ; IHS/ITSC/PMF - CHECK STATUS OF HV VENDOR NOTIFICATION REPORTS (2/2) ;  [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
FILDELB ;EP
 S ACHSI=""
FILDELB0 ;
 S ACHSI=$O(ACHSUFLS(ACHSI))
 G FILDELC:+ACHSI=0
FILDELB1 ;
 S Y=$P(ACHSUFLS(ACHSI),U,5),ACHSDATE=$P(ACHSUFLS(ACHSI),U,2)
 G:Y=""!(ACHSDATE="") FILDELB0
 I '$D(^ACHSHVLG(Y)) S X=$P(^AUTTVNDR(Y,0),U,1),DA(1)=+Y,DIC="^ACHSHVLG(",DIC(0)="ZML" D ^DIC I +Y<1 U ACHSHMD W !,*7,"FACILITY LOOK-UP ERROR -- JOB CANCELLED" G ABEND
 S ACHSVPT=+Y
 I '$D(^ACHSHVLG(ACHSVPT,1,0)) S ^ACHSHVLG(ACHSVPT,1,0)=$$ZEROTH^ACHS(9002078,1)
 I '$D(^ACHSHVLG(ACHSVPT,1,"B",ACHSDATE)) D DICN G FILDELB0
DREPCK ;
 S (ACHSK,ACHSDFLG)=0
DREPCK1 ;
 S ACHSK=$O(^ACHSHVLG(ACHSVPT,1,"B",ACHSDATE,ACHSK))
 G DREPCKZ:+ACHSK=0
 S ACHSRTY=$E($P(ACHSUFLS(ACHSI),U,3)),ACHSCMP=$P(^ACHSHVLG(ACHSVPT,1,ACHSK,0),U,2)
 I ACHSRTY=ACHSCMP U ACHSHMD W *7,!,"REPORT ALREADY ON FILE FOR THIS DATE - SKIPPING ",$P($P(ACHSUFLS(ACHSI),U,1)," ",1),! S ACHSDFLG=ACHSDFLG+1
 G DREPCK1
 ;
DREPCKZ ;
 I ACHSDFLG=0 D DICN
 G FILDELB0
 ;
FILDELC ;
 S (ACHSR,ACHSRR,ACHSDELD,ACHSCNT,ACHSDSAV,ACHSV)=0
FILDELC0 ;
 S ACHSV=$O(ACHSUFLS("C",ACHSV))
 G FILDELF:+ACHSV=0
FILDELC1 ;
 S ACHSR=$O(ACHSUFLS("C",ACHSV,ACHSR))
 G FILDELC0:+ACHSR=0
FILDELC2 ;
 S ACHSRR=$O(ACHSUFLS("C",ACHSV,ACHSR,ACHSRR))
 G FILDELC1:+ACHSRR=0
 I ACHSR'=ACHSDSAV S ACHSCNT=ACHSCNT+1,ACHSDSAV=ACHSR
 S ACHSCNT=ACHSCNT+1
 I ACHSCNT=5 S ACHSDELD=9999999-ACHSR
 G FILDELC2
 ;
FILDELF ;
 G FILDEND:+ACHSDELD<5
FILDELG ;
 U ACHSHMD
 W !
 K DIR
 S DIR(0)="Y",DIR("A")="Delete ALL Vendor Note. Reports with DOS BEFORE "_$$FMTE^XLFDT(ACHSDELD),DIR("B")="Y"
 D ^DIR
 K DIR
 I Y=1 G FILDELK
 G FILDEND
 ;
FILDELK ;
 S ACHSR=9999999-ACHSDELD
FILDELK1 ;
 S ACHSR=$O(ACHSUFLS("C",ACHSR))
 G FILDEND:+ACHSR=0
 S ACHSRR="",ACHSRR=$O(ACHSUFLS("C",ACHSR,ACHSRR))
 G FILDELK1:+ACHSRR=0
 S ACHSZFN=$P($P(ACHSUFLS(ACHSRR),U)," ")
 I '$$DEL^%ZISH($$AOP^ACHS(2,1),ACHSZFN) U ACHSHMD W !!?10,ACHSZFN,"  has been DELETED" K ACHSUFLS("C",ACHSR,ACHSRR),ACHSUFLS(ACHSRR)
 G FILDELK1
 ;
FILDEND ;
 Q
 ;
ABEND ;EP
 U ACHSHMD
 W *7,!!?10,"JOB ENDED WITH ERROR(S) - NOTIFY SUPERVISOR",!
 D RTRN^ACHS
 Q
 ;
DICN ;
 S DIC="^ACHSHVLG("_ACHSVPT_",1,",DIC(0)="ZML",X=ACHSDATE,DA(1)=ACHSVPT
 K DO,DD D FILE^DICN
 S ACHSRTY=$E($P(ACHSUFLS(ACHSI),U,3)),ACHSCNT=$P(ACHSUFLS(ACHSI),U,4),ACHSVPT=$P(ACHSUFLS(ACHSI),U,5)
 S $P(^ACHSHVLG(ACHSVPT,1,+Y,0),U,2)=ACHSRTY,$P(^ACHSHVLG(ACHSVPT,1,+Y,0),U,3)=ACHSCNT,$P(^ACHSHVLG(ACHSVPT,1,+Y,0),U,4)=$P($P(ACHSUFLS(ACHSI),U)," ")
 Q
 ;