source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPST2.m@ 1036

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

revised back to 6/30/08 version

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