source: FOIAVistA/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPST2.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1GMRAPST2 ;HIRMFO/WAA- PRINT SUM LISTING OF OUT COMES ;3/5/97 14:50
2 ;;4.0;Adverse Reaction Tracking;**7,33**;Mar 29, 1996;Build 5
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^GMRAPST2",(ZTSAVE("GMRAOUT"),ZTSAVE("GMAST"),ZTSAVE("GMAEN"))=""
16 . S ZTDESC="Summary of Outcomes" 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 (GMRARRAY("YES"),GMRARRAY("NO"),GMRARRAY("NULL"))="",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 ..Q:'$$PRDTST^GMRAUTL1($P(GMRAPA1(0),U,2)) ;GMRA*4*33 Exclude test patient from report if production or legacy environment.
31 ..S GMRATOT=GMRATOT+1
32 ..F GMRALAB=1:1 S GMRALINE=$T(TEXT+GMRALAB) Q:$P(GMRALINE,";",3)="" D
33 ...S GMRAP=$P(GMRALINE,";",4)
34 ...I $P(GMRAPA1(0),U,GMRAP)="y" S $P(GMRARRAY("YES"),U,GMRAP)=$P(GMRARRAY("YES"),U,GMRAP)+1
35 ...I $P(GMRAPA1(0),U,GMRAP)="n" S $P(GMRARRAY("NO"),U,GMRAP)=$P(GMRARRAY("NO"),U,GMRAP)+1
36 ...I $P(GMRAPA1(0),U,GMRAP)="" S $P(GMRARRAY("NULL"),U,GMRAP)=$P(GMRARRAY("NULL"),U,GMRAP)+1
37 ...Q
38 ..Q
39 .Q
40 Q:GMRAOUT
41 D HEAD
42 S (GMRAY,GMRAN,GMRANU)=0
43 F GMRALAB=1:1 S GMRALINE=$T(TEXT+GMRALAB) Q:$P(GMRALINE,";",3)="" D
44 .N GMRAP,GMRATAB
45 .S GMRAP=$P(GMRALINE,";",4)
46 .S GMRATAB=40-$L($P(GMRALINE,";",3))
47 .W !,?GMRATAB,$P(GMRALINE,";",3)
48 .W ?42,$P(GMRARRAY("YES"),U,GMRAP)
49 .S GMRAY=GMRAY+$P(GMRARRAY("YES"),U,GMRAP)
50 .W ?53,"| ",$P(GMRARRAY("NO"),U,GMRAP)
51 .S GMRAN=GMRAN+$P(GMRARRAY("NO"),U,GMRAP)
52 .W ?63,"| ",$P(GMRARRAY("NULL"),U,GMRAP)
53 .S GMRANU=GMRANU+$P(GMRARRAY("NULL"),U,GMRAP)
54 .Q
55 W !,?30," ---------------------------------------"
56 W !,?32,"Totals: ",?42,GMRAY,?53,"| ",GMRAN,?63,"| ",GMRANU
57 W !!,?22,"Total number of records processed ",GMRATOT
58 D CLOSE^GMRAUTL
59 Q
60 ;has the patient died within the date
61HEAD ; Print header information
62 I GMRAPG'=1 Q:$Y<(IOSL-4)
63 I $E(IOST,1)="C" D Q:GMRAOUT
64 .I GMRAPG=1 W @IOF Q
65 .I GMRAPG'=1 D Q:GMRAOUT
66 ..N DIR S DIR(0)="E" D ^DIR I 'Y S GMRAOUT=1
67 ..K Y
68 ..Q
69 .Q
70 Q:GMRAOUT
71 I GMRAPG'=1 W @IOF
72 W "Report Date: ",$P($$FMTE^XLFDT(GMRADPDT),"@"),?70,"Page: ",GMRAPG
73 W !,?30,"Summary of Outcomes"
74 W !,?25,"From: ",$$FMTE^XLFDT(GMAST,"2D")," To: ",$$FMTE^XLFDT(GMAEN,"2D")
75 W !,?42,"Yes",?55,"No",?65,"No Response"
76 W !,$$REPEAT^XLFSTR("-",79)
77 S GMRAPG=GMRAPG+1
78 I $D(ZTQUEUED) S:$$STPCK^GMRAUTL1 GMRAOUT=1 ; Check if stopped by user
79 Q
80TEXT ;;these are the labels that will denote the field data
81 ;;Patients that Died: ;3
82 ;;Reactions treated with RX drugs: ;4
83 ;;Life Threatening illness: ;5
84 ;;Required ER/MD visit: ;6
85 ;;Required hospitalization: ;7
86 ;;Prolonged Hospitalization: ;9
87 ;;Resulted in permanent disability: ;10
88 ;;Patient recovered: ;11
89 ;;Congenital Anomaly: ;16
90 ;;Required intervention: ;17
91 ;;
Note: See TracBrowser for help on using the repository browser.