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

MCARAP1.m

Go to the documentation of this file.
MCARAP1 ;WASH ISC/SAE-MEDICINE AUTO INSTRUMENT INTERFACE SUMMARY PRINT ;5/7/96  13:43
 ;;2.3;Medicine;;09/13/1996
 ;
PRINT ; Print Report
 S PG=0,(TOTS,TOTU)=0 K REDO
 D NOW^%DTC S Y=% D DD^%DT S MCNOW=$E(Y,1,18),MCDAY=$E(Y,1,12),MCTIME=$E(Y,13,18)
 D HEAD
 S PDATE=DATE1 D PRINT1 F PJ=0:0 S PDATE=$O(^MCAR(700.5,"C",PDATE)) D:PDATE="" WSTAT D:$P(PDATE,".")>DATE2 WSTAT G EXIT:PDATE="",EXIT:$P(PDATE,".")>DATE2 D STYPE I $D(TYPE) K TYPE D PRINT1 G:$D(EXIT) EXIT1
 Q
PRINT1 S ENTRY=0 F IJ=0:0 S ENTRY=$O(^MCAR(700.5,"C",PDATE,ENTRY)) Q:ENTRY=""  D STAT,PAGE Q:$D(EXIT)  D WRITE
 Q
WRITE ; Write report line
 I $D(NAME),(NAME'=$P(^MCAR(700.5,ENTRY,0),U,4)) Q
 I $D(BAD),($P(^MCAR(700.5,ENTRY,0),U,8)="S") Q
 I $D(GOOD),($P(^MCAR(700.5,ENTRY,0),U,8)="U") Q
 S DTT=$P(^MCAR(700.5,ENTRY,0),U),INST=$P(^(0),U,2),SSN=$P(^(0),U,3),P=$P(^(0),U,4),ERR=$P(^(0),U,5),DTI=$P(^(0),U,6),TRIES=$P(^(0),U,7),FLAG=$P(^(0),U,8),DTL=$P(^(0),U,9)
 S Y=DTT D DD^%DT S DTT=Y,Y=DTI D DD^%DT S DTI=$E(Y,1,18),Y=DTL D DD^%DT S DTL=$E(Y,1,18)
 W !,$P(DTT,"@"),?14,DTI,?34,P,?60,SSN,?71,TRIES,?76,ERR,!,?6,$E(DTT,13,18),?14,DTL
 Q
 S PG=PG+1 W @IOF,!,?18,"VETERANS ADMINISTRATION MEDICAL CENTER",?72,"Page ",PG
 ;W !,?28,^DD("SITE"),?66,MCDAY
 W !,?28,$$GET1^DIQ(4.3,1,217),?66,MCDAY
 W:$D(GOOD) !,?14,"SUMMARY OF SUCCESSFUL RECORD TRANSFER ATTEMPTS",?72,MCTIME
 W:$D(BAD) !,?13,"SUMMARY OF UNSUCCESSFUL RECORD TRANSFER ATTEMPTS",?72,MCTIME
 W:$D(ALL) !,?17,"SUMMARY OF ALL RECORD TRANSFER ATTEMPTS",?72,MCTIME
 K DATESAME S:DATE1=DATE2 DATESAME=1
 W:$D(DATESAME) !,?24 W:'$D(DATESAME) !,?19 W "DHCP ("
 S Y=DATE1 D DD^%DT S EDATE1=Y,Y=DATE2 D DD^%DT S EDATE2=Y
 W:$D(DATESAME) EDATE1,")" W:'$D(DATESAME) EDATE1," - ",EDATE2,")"
 W !!,"TEST DATE",?17,"FIRST TRANS",?37,"PATIENT",?63,"SSN",?69,"TRIES",?76,"ERR",!,"TEST TIME",?17,"LAST  TRANS"
 S DASH="",$P(DASH,"-",80)="" W !,DASH
 Q
EXIT ; Exit from program
 I IOST'?1"P-".E R !!,"Press return to continue, or '^' to escape: ",X:DTIME
 G EXIT1:'$T,EXIT1:X=U,^MCARAP
EXIT1 K GOOD,BAD,ALL,J,DIK,ENTRY,DATE1,DATE2,IJ,PG,RPT,DA,%,%DT,ZIP,%ZIS
 K POP,ZTRTN,ZTSAVE,ZTDESC,PG,TOTS,TOTU,PDATE,PJ,DTT,INST,SSN,P,ERR
 K DTI,TRIES,FLAG,DTL,EDATE1,EDATE2,NAME,%,MCNOW,MCDAY,MCTIME,%I,D,DASH,I,Y,Z
 I $D(ZTQUEUED)#2 D KILL^%ZTLOAD K ZTSK
 W @IOF D ^%ZISC G ^MCARAP:$D(REDO)
 Q
PAGE ; New screen control
 K EXIT I $Y>(IOSL-7),($E(IOST,1,2)="C-") R !!,"Press return to continue: '^' to escape: ",X:DTIME G:'$T EXIT S:X=U EXIT=1 Q:$D(EXIT)  D HEAD
 I $Y=(IOSL-1),(IOST?1"P-".E) D HEAD
 Q
STAT ; Statistical totals
 I $D(NAME),(NAME'=$P(^MCAR(700.5,ENTRY,0),U,4)) Q
 I $P(^MCAR(700.5,ENTRY,0),U,5)="" S TOTS=TOTS+1 Q
 S TOTU=TOTU+1 Q
WSTAT W !!
 W:$D(NAME) "For Patient  ",NAME,":",!
 I $D(GOOD),(TOTS>0) W "Successful: ",TOTS,"   "
 I $D(BAD),(TOTU>0) W "Unsuccessful: ",TOTU,"   "
 I $D(ALL),(TOTS>0!(TOTU>0)) W "Successful: ",TOTS,"    Unsuccessful: ",TOTU,"    Total Attempts: ",(TOTS+TOTU)
 I $D(GOOD),(TOTS=0) W "** No Successful Record transfers completed **"
 I $D(BAD),(TOTU=0) W "** No Unsuccessful Record Transfer attempts made **"
 I $D(ALL),(TOTS=0&(TOTU=0)) W "** No Record Transfer attempts made **"
 Q
STYPE ; Screen Summary Type
 S ENTRY=0 S ENTRY=$O(^MCAR(700.5,"C",PDATE,ENTRY)) Q:ENTRY=""
 I $D(MCARA) S:MCARA=$P(^MCAR(700.5,ENTRY,0),U,10) TYPE=1
 Q