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
;
ACHSHVRC ; IHS/ITSC/PMF - CHECK STATUS OF HV VENDOR NOTIFICATION REPORTS (1/2) ; [ 10/16/2001 8:16 AM ]
+1 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
+2 ;
+3 DO HOME^%ZIS
+4 SET ACHSHMD=IO(0)
+5 IF $$DEL^%ZISH("/usr/spool/3780/","achshv.reports")
+6 SET ACHSHCMD="cd "_$$AOP^ACHS(2,1)_"; ls -l achshv.* | awk '{print $9,$5}' > /usr/spool/3780/achshv.reports"
+7 SET ACHSRTCD=$$TERMINAL^ACHSHCMD(ACHSHCMD)
+8 KILL ACHSUNMS,ACHSUFLS
+9 ;
+10 SET (ACHSLCTR,ACHSL1FD)=0
+11 SET ACHSZFN="/usr/spool/3780/achshv.reports"
+12 IF $$OPEN^%ZISH("/usr/spool/3780/","achshv.reports","R")
SET ACHSEMSG="M10"
DO ERROR^ACHSTCK1
GOTO ABEND^ACHSHVR2
+13 SET ACHSHFS1=IO
+14 FOR ACHSI=1:1
READ ACHSXX:1
IF '$TEST
GOTO C0
IF $$STATUS^%ZISH
GOTO C0
SET ACHSUFLS(ACHSI)=ACHSXX
C0 ;
+1 IF $DATA(ACHSHFS1)
SET IO=ACHSHFS1
SET IONOFF=""
DO ^%ZISC
+2 SET ACHSI=0
C1 ;
+1 SET ACHSI=$ORDER(ACHSUFLS(ACHSI))
+2 IF +ACHSI=0
GOTO C1A
+3 SET ACHSXX=ACHSUFLS(ACHSI)
+4 SET ACHSUFLS(ACHSI)=ACHSUFLS(ACHSI)_"^"
+5 DO TESTEX
+6 GOTO C1
+7 ;
C1A ;
+1 IF $DATA(ACHSHFS1)
SET IO=ACHSHFS1
SET IONOFF=""
DO ^%ZISC
+2 GOTO FILDELB^ACHSHVR2
+3 ;
TESTEX ;
+1 SET ACHSFNAM=$$AOP^ACHS(2,1)_$PIECE(ACHSXX," ",1)
SET ACHSFSIZ=+$PIECE(ACHSXX," ",2)
SET ACHSVPT=""
+2 SET ACHSZFN=ACHSFNAM
+3 IF $$OPEN^%ZISH($$AOP^ACHS(2,1),$PIECE(ACHSXX," ",1),"R")
SET ACHSEMSG="M10"
DO ERROR^ACHSTCK1
GOTO ABEND^ACHSHVR2
+4 SET ACHSHFS1=IO
SET ACHSLMT=5
SET ACHSRCT=0
TESTRD ;
+1 USE ACHSHFS1
+2 READ ACHSXX:1
+3 IF '$TEST
QUIT
+4 IF $$STATUS^%ZISH
GOTO EOF
+5 SET ACHSRCT=ACHSRCT+1
+6 IF ACHSRCT>ACHSLMT
GOTO EOF
+7 IF $EXTRACT(ACHSXX,1,3)="PCC"
SET X=$EXTRACT(ACHSXX,40,65)
DO VENDLK
+8 IF $EXTRACT(ACHSXX,1,4)="LHHS"
GOTO REPREAD
+9 GOTO TESTRD
+10 ;
REPREAD ;
+1 SET Y=$EXTRACT(ACHSXX,40,62)
SET ACHSHVNM=$PIECE(Y," ",1)
+2 SET Z=$FIND(ACHSXX,"FOR",75)
SET X=$EXTRACT(ACHSXX,Z,Z+8)
+3 SET ACHSHVDT=X
+4 DO ^%DT
+5 IF +Y>0
SET $PIECE(ACHSUFLS(ACHSI),U,2)=Y
+6 SET $PIECE(ACHSUFLS(ACHSI),U,3)=ACHSHVNM
+7 SET $PIECE(ACHSUFLS(ACHSI),U,5)=ACHSVPT
+8 GOTO EOJCHK
+9 ;
EOF ;
+1 SET $PIECE(ACHSUFLS(ACHSI),U,2)=""
+2 QUIT
+3 ;
VENDLK ;
+1 FOR ACHSJ=$LENGTH(X):-1:1
IF $EXTRACT(X,ACHSJ,ACHSJ)'=" "
QUIT
IF $EXTRACT(X,ACHSJ,ACHSJ)=" "
SET X=$EXTRACT(X,1,ACHSJ-1)
+2 SET ACHSVPT=""
+3 SET DIC="^AUTTVNDR("
SET DIC(0)="ZM"
SET D="AKA"
+4 DO IX^DIC
+5 IF +Y<1
USE ACHSHMD
WRITE !?10,"VENDOR NOT FOUND FOR ",X
QUIT
+6 SET ACHSVPT=+Y
+7 QUIT
+8 ;
EOJCHK ;
+1 IF $DATA(ACHSHFS1)
SET IO=ACHSHFS1
SET IONOFF=""
DO ^%ZISC
+2 SET ACHSZFN=$PIECE($PIECE(ACHSUFLS(ACHSI),U,1)," ",1)
+3 ;
+4 SET ACHSHCMD="cd "_$$AOP^ACHS(2,1)_"; tail -50 "_ACHSZFN_" > eof.achshv"
+5 SET ACHSRTCD=$$TERMINAL^ACHSHCMD(ACHSHCMD)
+6 ;
+7 SET ACHSZFN=$$AOP^ACHS(2,1)_"eof.achshv"
+8 IF $$OPEN^%ZISH($$AOP^ACHS(2,1),"eof.achshv","R")
SET ACHSEMSG="M10"
DO ERROR^ACHSTCK1
GOTO ABEND^ACHSHVR2
+9 SET ACHSHFS1=IO
SET ACHSLMT=5
SET ACHSRCT=0
+10 KILL ACHSERR
EOJRD ;
+1 USE ACHSHFS1
+2 READ ACHSXX:1
+3 IF '$TEST
QUIT
+4 IF $$STATUS^%ZISH
GOTO EOFB
+5 IF $EXTRACT(ACHSXX,1,6)'="TOTAL "
GOTO EOJRD
+6 SET ACHSHVPC=$EXTRACT(ACHSXX,17,$LENGTH(ACHSXX))
NOCHK ;
+1 FOR J=1:1
IF $EXTRACT(ACHSHVPC,1,1)=" "
SET ACHSHVPC=$EXTRACT(ACHSHVPC,2,$LENGTH(ACHSHVPC))
IF $EXTRACT(ACHSHVPC,1,1)
QUIT
+2 IF +ACHSHVPC>0
SET $PIECE(ACHSUFLS(ACHSI),U,4)=+ACHSHVPC
EOFB ;
+1 SET IO=ACHSHFS1
SET IONOFF=""
+2 DO ^%ZISC
+3 IF $PIECE(ACHSUFLS(ACHSI),U,4)<1!(+$PIECE(ACHSUFLS(ACHSI),U,2)<2900000)
SET ACHSHCMD=$$DEL^%ZISH($$AOP^ACHS(2,1),$PIECE($PIECE(ACHSUFLS(ACHSI),U,1)," ",1))
KILL ACHSUFLS(ACHSI)
+4 SET ACHSDATE=$PIECE(ACHSUFLS(ACHSI),U,2)
+5 SET ACHSVPT=$PIECE(ACHSUFLS(ACHSI),U,5)
+6 SET ACHSRDAT=9999999-ACHSDATE
+7 SET ACHSUFLS("C",ACHSVPT,ACHSRDAT,ACHSI)=""
+8 QUIT
+9 ;