source: WorldVistAEHR/trunk/r/MEDICINE-MC/MCARAP1.m@ 1766

Last change on this file since 1766 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.2 KB
RevLine 
[613]1MCARAP1 ;WASH ISC/SAE-MEDICINE AUTO INSTRUMENT INTERFACE SUMMARY PRINT ;5/7/96 13:43
2 ;;2.3;Medicine;;09/13/1996
3 ;
4PRINT ; Print Report
5 S PG=0,(TOTS,TOTU)=0 K REDO
6 D NOW^%DTC S Y=% D DD^%DT S MCNOW=$E(Y,1,18),MCDAY=$E(Y,1,12),MCTIME=$E(Y,13,18)
7 D HEAD
8 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
9 Q
10PRINT1 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
11 Q
12WRITE ; Write report line
13 I $D(NAME),(NAME'=$P(^MCAR(700.5,ENTRY,0),U,4)) Q
14 I $D(BAD),($P(^MCAR(700.5,ENTRY,0),U,8)="S") Q
15 I $D(GOOD),($P(^MCAR(700.5,ENTRY,0),U,8)="U") Q
16 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)
17 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)
18 W !,$P(DTT,"@"),?14,DTI,?34,P,?60,SSN,?71,TRIES,?76,ERR,!,?6,$E(DTT,13,18),?14,DTL
19 Q
20HEAD ; Header
21 S PG=PG+1 W @IOF,!,?18,"VETERANS ADMINISTRATION MEDICAL CENTER",?72,"Page ",PG
22 ;W !,?28,^DD("SITE"),?66,MCDAY
23 W !,?28,$$GET1^DIQ(4.3,1,217),?66,MCDAY
24 W:$D(GOOD) !,?14,"SUMMARY OF SUCCESSFUL RECORD TRANSFER ATTEMPTS",?72,MCTIME
25 W:$D(BAD) !,?13,"SUMMARY OF UNSUCCESSFUL RECORD TRANSFER ATTEMPTS",?72,MCTIME
26 W:$D(ALL) !,?17,"SUMMARY OF ALL RECORD TRANSFER ATTEMPTS",?72,MCTIME
27 K DATESAME S:DATE1=DATE2 DATESAME=1
28 W:$D(DATESAME) !,?24 W:'$D(DATESAME) !,?19 W "DHCP ("
29 S Y=DATE1 D DD^%DT S EDATE1=Y,Y=DATE2 D DD^%DT S EDATE2=Y
30 W:$D(DATESAME) EDATE1,")" W:'$D(DATESAME) EDATE1," - ",EDATE2,")"
31 W !!,"TEST DATE",?17,"FIRST TRANS",?37,"PATIENT",?63,"SSN",?69,"TRIES",?76,"ERR",!,"TEST TIME",?17,"LAST TRANS"
32 S DASH="",$P(DASH,"-",80)="" W !,DASH
33 Q
34EXIT ; Exit from program
35 I IOST'?1"P-".E R !!,"Press return to continue, or '^' to escape: ",X:DTIME
36 G EXIT1:'$T,EXIT1:X=U,^MCARAP
37EXIT1 K GOOD,BAD,ALL,J,DIK,ENTRY,DATE1,DATE2,IJ,PG,RPT,DA,%,%DT,ZIP,%ZIS
38 K POP,ZTRTN,ZTSAVE,ZTDESC,PG,TOTS,TOTU,PDATE,PJ,DTT,INST,SSN,P,ERR
39 K DTI,TRIES,FLAG,DTL,EDATE1,EDATE2,NAME,%,MCNOW,MCDAY,MCTIME,%I,D,DASH,I,Y,Z
40 I $D(ZTQUEUED)#2 D KILL^%ZTLOAD K ZTSK
41 W @IOF D ^%ZISC G ^MCARAP:$D(REDO)
42 Q
43PAGE ; New screen control
44 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
45 I $Y=(IOSL-1),(IOST?1"P-".E) D HEAD
46 Q
47STAT ; Statistical totals
48 I $D(NAME),(NAME'=$P(^MCAR(700.5,ENTRY,0),U,4)) Q
49 I $P(^MCAR(700.5,ENTRY,0),U,5)="" S TOTS=TOTS+1 Q
50 S TOTU=TOTU+1 Q
51WSTAT W !!
52 W:$D(NAME) "For Patient ",NAME,":",!
53 I $D(GOOD),(TOTS>0) W "Successful: ",TOTS," "
54 I $D(BAD),(TOTU>0) W "Unsuccessful: ",TOTU," "
55 I $D(ALL),(TOTS>0!(TOTU>0)) W "Successful: ",TOTS," Unsuccessful: ",TOTU," Total Attempts: ",(TOTS+TOTU)
56 I $D(GOOD),(TOTS=0) W "** No Successful Record transfers completed **"
57 I $D(BAD),(TOTU=0) W "** No Unsuccessful Record Transfer attempts made **"
58 I $D(ALL),(TOTS=0&(TOTU=0)) W "** No Record Transfer attempts made **"
59 Q
60STYPE ; Screen Summary Type
61 S ENTRY=0 S ENTRY=$O(^MCAR(700.5,"C",PDATE,ENTRY)) Q:ENTRY=""
62 I $D(MCARA) S:MCARA=$P(^MCAR(700.5,ENTRY,0),U,10) TYPE=1
63 Q
Note: See TracBrowser for help on using the repository browser.