source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGMTOPYT.m@ 1141

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1DGMTOPYT ;ALB/CAW - Means Test with Previous Year Threshold ;8/14/92
2 ;;5.3;Registration;**33**;Aug 13, 1993
3 ;
4EN ;
5 I '$$RANGE^DGMTUTL("P") G ENQ
6 W !! S %ZIS="PMQ" D ^%ZIS I POP G ENQ
7 I '$D(IO("Q")) D MAIN G ENQ
8 S Y=$$QUE
9ENQ ;
10 D:'$D(ZTQUEUED) ^%ZISC
11 K DFN,DGBEG,DGC,DGDATE,DGDFN,DGEND,DGIEN,DGLINE,DGPAGE,DGP,DGPAT,DGPT,DGSTOP,DGTST,VA,VAERR,^TMP("DGMTO",$J)
12 Q
13 ;
14QUE() ; -- que job
15 ; return: did job que [ 1|yes 0|no ]
16 ;
17 K ZTSK,IO("Q")
18 S ZTDESC="Previous Year Threshold Output",ZTRTN="MAIN^DGMTOPYT"
19 F X="DGBEG","DGEND" S ZTSAVE(X)=""
20 D ^%ZTLOAD W:$D(ZTSK) " (Task: ",ZTSK,")"
21 Q $D(ZTSK)
22 ;
23MAIN ;
24 S DGDATE=DGBEG-.1,(DGIEN,DGSTOP,DGPAGE,DGPT)=0,$P(DGLINE,"-",IOM+1)=""
25 D HDR
26 F S DGDATE=$O(^DGMT(408.31,"AP",1,DGDATE)) Q:'DGDATE!(DGDATE>DGEND) F S DGIEN=$O(^DGMT(408.31,"AP",1,DGDATE,DGIEN)) Q:'DGIEN D Q:DGSTOP
27 .Q:'$G(^DGMT(408.31,DGIEN,"PRIM"))
28 .S DGDFN=$P(^DGMT(408.31,DGIEN,0),U,2),DGTST=$P(^DGMT(408.31,DGIEN,0),U)
29 .S DFN=DGDFN D PID^VADPT
30 .S ^TMP("DGMTO",$J,$P(^DPT(DGDFN,0),U))=DGDFN_"^"_VA("PID")_"^"_DGTST
31 D PRNT
32 D CLOSE^DGMTUTL
33 Q
34HDR ; Header
35 S DGC(1)="Means Test Using Previous Years Threshold"
36 S DGC(2)="Date Range: "_$$FDATE^DGMTUTL(DGBEG)_" to "_$$FDATE^DGMTUTL(DGEND) D NOW^%DTC S DGC(3)="Run Date: "_$E($$FTIME^DGMTUTL(%),1,18)
37 W:$E(IOST,1,2)["C-" @IOF F I=1:1:3 W !?(IOM-$L(DGC(I))/2),DGC(I)
38 S DGPAGE=DGPAGE+1 W !?68,"Page ",DGPAGE,!,DGLINE,!
39 W !?5,"Patient Name",?50," Patient ID ",?65,"Date of Test"
40 W !?5,"------------",?50,"------------",?65,"------------",!
41 Q
42PRNT ;Print patients
43 U IO I '$D(^TMP("DGMTO",$J)) W !,"NO MEANS TEST WITH PREVIOUS YEARS THRESHOLD" Q
44 F S DGPT=$O(^TMP("DGMTO",$J,DGPT)) Q:DGPT="" S DGPAT=^(DGPT) D Q:DGSTOP
45 .W !,?5,$P(^DPT(+DGPAT,0),U),?50,$P(DGPAT,U,2),?65,$$FDATE^DGMTUTL($P(DGPAT,U,3))
46 .D CHK
47 Q
48 ;
49CHK ;Check to pause on screen
50 I ($Y+5)>IOSL,$E(IOST,1,2)="C-" D PAUSE S DGP=Y D:DGP HDR I 'DGP S DGSTOP=1 Q
51 I $E(IOST,1,2)="P-",($Y+5)>IOSL D HDR Q
52 Q
53PAUSE ;
54 W ! S DIR(0)="E" D ^DIR K DIR W !
55 Q
56 ;
Note: See TracBrowser for help on using the repository browser.