source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPST5.m@ 1432

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

revised back to 6/30/08 version

File size: 1.9 KB
RevLine 
[623]1GMRAPST5 ;HIRMFO/WAA- PRINT TOTAL NUMBER OF REPORTED REACTION ;3/5/97 15:16
2 ;;4.0;Adverse Reaction Tracking;**7**;Mar 29, 1996
3EN1 ; This routine will loop through the ADT entry point to get all
4 ; the entries in that date range.
5 S GMRAOUT=0
6 W !,"Select an Observed date range for this report."
7 D DT^GMRAPL G:GMRAOUT EXIT
8 D PRINTER
9EXIT ; Exit of program kill cleanup
10 D KILL^XUSCLEAN
11 Q
12PRINTER ;Select printer
13 W ! K GMRAZIS D DEV^GMRAUTL I POP W !,"PLEASE TRY LATER" S GMRAOUT=1 Q
14 I $D(IO("Q")) D Q
15 . S ZTRTN="PRINT^GMRAPST5",(ZTSAVE("GMRAOUT"),ZTSAVE("GMAST"),ZTSAVE("GMAEN"))=""
16 . S ZTDESC="Reported Reaction over a date range." D ^%ZTLOAD
17 . W !!,$S($D(ZTSK):"Request queued...",1:"Request NOT queued please try Later.")
18 . Q
19 U IO D PRINT U IO(0)
20 Q
21PRINT ;Queue point for report
22 ;loop through the 120.85 file and look for the field that
23 D NOW^%DTC S GMRADPDT=X
24 S GMRADATE=GMAST-.0001,GMRAPG=1
25 S GMRATOT=0
26 F S GMRADATE=$O(^GMR(120.85,"B",GMRADATE)) Q:GMRADATE<1 Q:GMRADATE>GMAEN D
27 .S GMRAPA1=0 F S GMRAPA1=$O(^GMR(120.85,"B",GMRADATE,GMRAPA1)) Q:GMRAPA1<1 D
28 ..S GMRAPA1(0)=$G(^GMR(120.85,GMRAPA1,0)) Q:GMRAPA1(0)="" ;Bad Node
29 ..Q:+$G(^GMR(120.8,$P(GMRAPA1(0),U,15),"ER")) ;Entered in Error Data
30 ..S GMRATOT=GMRATOT+1
31 ..Q
32 .Q
33 Q:GMRAOUT
34 D HEAD
35 W !,?19,"Total Number of Reported Reactions: ",GMRATOT
36 W !,?27,"From: ",$$FMTE^XLFDT(GMAST,"2D"),?42,"To: ",$$FMTE^XLFDT(GMAEN,"2D")
37 D CLOSE^GMRAUTL
38 Q
39 ;has the patient died with inthe dat
40HEAD ; Print header information
41 I GMRAPG'=1 Q:$Y<(IOSL-4)
42 I $E(IOST,1)="C" D Q:GMRAOUT
43 .I GMRAPG=1 W @IOF Q
44 .I GMRAPG'=1 D Q:GMRAOUT
45 ..N DIR S DIR(0)="E" D ^DIR I 'Y S GMRAOUT=1
46 ..K Y
47 ..Q
48 .Q
49 Q:GMRAOUT
50 I GMRAPG'=1 W @IOF
51 W "Report Date: ",$P($$FMTE^XLFDT(GMRADPDT),"@"),?70,"Page: ",GMRAPG
52 W !,?33,"Reported Reactions"
53 W !,$$REPEAT^XLFSTR("-",79)
54 S GMRAPG=GMRAPG+1
55 I $D(ZTQUEUED) S:$$STPCK^GMRAUTL1 GMRAOUT=1 ; Check if stopped by user
56 Q
Note: See TracBrowser for help on using the repository browser.