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

ACHSHVRC.m

Go to the documentation of this file.
ACHSHVRC ; IHS/ITSC/PMF - CHECK STATUS OF HV VENDOR NOTIFICATION REPORTS (1/2) ;  [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 D HOME^%ZIS
 S ACHSHMD=IO(0)
 I $$DEL^%ZISH("/usr/spool/3780/","achshv.reports")
 S ACHSHCMD="cd "_$$AOP^ACHS(2,1)_"; ls -l achshv.* | awk '{print $9,$5}' > /usr/spool/3780/achshv.reports"
 S ACHSRTCD=$$TERMINAL^ACHSHCMD(ACHSHCMD)
 K ACHSUNMS,ACHSUFLS
 ;
 S (ACHSLCTR,ACHSL1FD)=0
 S ACHSZFN="/usr/spool/3780/achshv.reports"
 I $$OPEN^%ZISH("/usr/spool/3780/","achshv.reports","R") S ACHSEMSG="M10" D ERROR^ACHSTCK1 G ABEND^ACHSHVR2
 S ACHSHFS1=IO
 F ACHSI=1:1 R ACHSXX:1 G C0:'$T G C0:$$STATUS^%ZISH S ACHSUFLS(ACHSI)=ACHSXX
C0 ;
 I $D(ACHSHFS1) S IO=ACHSHFS1 S IONOFF="" D ^%ZISC
 S ACHSI=0
C1 ;
 S ACHSI=$O(ACHSUFLS(ACHSI))
 G C1A:+ACHSI=0
 S ACHSXX=ACHSUFLS(ACHSI)
 S ACHSUFLS(ACHSI)=ACHSUFLS(ACHSI)_"^"
 D TESTEX
 G C1
 ;
C1A ;
 I $D(ACHSHFS1) S IO=ACHSHFS1 S IONOFF="" D ^%ZISC
 G FILDELB^ACHSHVR2
 ;
TESTEX ;
 S ACHSFNAM=$$AOP^ACHS(2,1)_$P(ACHSXX," ",1),ACHSFSIZ=+$P(ACHSXX," ",2),ACHSVPT=""
 S ACHSZFN=ACHSFNAM
 I $$OPEN^%ZISH($$AOP^ACHS(2,1),$P(ACHSXX," ",1),"R") S ACHSEMSG="M10" D ERROR^ACHSTCK1 G ABEND^ACHSHVR2
 S ACHSHFS1=IO,ACHSLMT=5,ACHSRCT=0
TESTRD ;
 U ACHSHFS1
 R ACHSXX:1
 Q:'$T
 G EOF:$$STATUS^%ZISH
 S ACHSRCT=ACHSRCT+1
 I ACHSRCT>ACHSLMT G EOF
 I $E(ACHSXX,1,3)="PCC" S X=$E(ACHSXX,40,65) D VENDLK
 I $E(ACHSXX,1,4)="LHHS" G REPREAD
 G TESTRD
 ;
REPREAD ;
 S Y=$E(ACHSXX,40,62),ACHSHVNM=$P(Y," ",1)
 S Z=$F(ACHSXX,"FOR",75),X=$E(ACHSXX,Z,Z+8)
 S ACHSHVDT=X
 D ^%DT
 S:+Y>0 $P(ACHSUFLS(ACHSI),U,2)=Y
 S $P(ACHSUFLS(ACHSI),U,3)=ACHSHVNM
 S $P(ACHSUFLS(ACHSI),U,5)=ACHSVPT
 G EOJCHK
 ;
EOF ;
 S $P(ACHSUFLS(ACHSI),U,2)=""
 Q
 ;
VENDLK ;
 F ACHSJ=$L(X):-1:1 Q:$E(X,ACHSJ,ACHSJ)'=" "  I $E(X,ACHSJ,ACHSJ)=" " S X=$E(X,1,ACHSJ-1)
 S ACHSVPT=""
 S DIC="^AUTTVNDR(",DIC(0)="ZM",D="AKA"
 D IX^DIC
 I +Y<1 U ACHSHMD W !?10,"VENDOR NOT FOUND FOR  ",X Q
 S ACHSVPT=+Y
 Q
 ;
EOJCHK ;
 I $D(ACHSHFS1) S IO=ACHSHFS1 S IONOFF="" D ^%ZISC
 S ACHSZFN=$P($P(ACHSUFLS(ACHSI),U,1)," ",1)
 ;
 S ACHSHCMD="cd "_$$AOP^ACHS(2,1)_"; tail -50 "_ACHSZFN_" > eof.achshv"
 S ACHSRTCD=$$TERMINAL^ACHSHCMD(ACHSHCMD)
 ;
 S ACHSZFN=$$AOP^ACHS(2,1)_"eof.achshv"
 I $$OPEN^%ZISH($$AOP^ACHS(2,1),"eof.achshv","R") S ACHSEMSG="M10" D ERROR^ACHSTCK1 G ABEND^ACHSHVR2
 S ACHSHFS1=IO,ACHSLMT=5,ACHSRCT=0
 K ACHSERR
EOJRD ;
 U ACHSHFS1
 R ACHSXX:1
 Q:'$T
 G EOFB:$$STATUS^%ZISH
 I $E(ACHSXX,1,6)'="TOTAL " G EOJRD
 S ACHSHVPC=$E(ACHSXX,17,$L(ACHSXX))
NOCHK ;
 F J=1:1 I $E(ACHSHVPC,1,1)=" " S ACHSHVPC=$E(ACHSHVPC,2,$L(ACHSHVPC)) Q:$E(ACHSHVPC,1,1)
 I +ACHSHVPC>0 S $P(ACHSUFLS(ACHSI),U,4)=+ACHSHVPC
EOFB ;
 S IO=ACHSHFS1,IONOFF=""
 D ^%ZISC
 I $P(ACHSUFLS(ACHSI),U,4)<1!(+$P(ACHSUFLS(ACHSI),U,2)<2900000) S ACHSHCMD=$$DEL^%ZISH($$AOP^ACHS(2,1),$P($P(ACHSUFLS(ACHSI),U,1)," ",1)) K ACHSUFLS(ACHSI)
 S ACHSDATE=$P(ACHSUFLS(ACHSI),U,2)
 S ACHSVPT=$P(ACHSUFLS(ACHSI),U,5)
 S ACHSRDAT=9999999-ACHSDATE
 S ACHSUFLS("C",ACHSVPT,ACHSRDAT,ACHSI)=""
 Q
 ;