source: FOIAVistA/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAFDA3.m@ 1470

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

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1GMRAFDA3 ;HIRMFO/WAA-DISPLAY FDA REPORT OVER DT RANGE ;12/1/95 11:34
2 ;;4.0;Adverse Reaction Tracking;**33**;Mar 29, 1996;Build 5
3EN1 ; Entry for PRINT ALL FDA EVENTS WITHIN D/T RANGE option
4 S GMRAOUT=0 K DIR
5 S DIR(0)="DO^:NOW:EXT",DIR("A")="Select Start Date/Time"
6 D ^DIR K DIR
7 I $D(DIRUT) G EXIT
8 S GMRABGDT=Y K Y
9 S DIR(0)="DO^"_GMRABGDT_":NOW:EXT",DIR("A")="Select End Date/Time",DIR("B")="T"
10 D ^DIR K DIR
11 I $D(DIRUT) G EXIT
12 S GMRAENDT=Y K Y
13EN2 ;
14 S GMRABGDT=GMRABGDT-.0000001
15 S GMRAENDT=$S($P(GMRAENDT,".",2)="":GMRAENDT_".24",1:(GMRAENDT+.000001))
16YN F S %=1 W !,"Do you want an Abbreviated report" D YN^DICN S:%=-1 %=2,GMRAOUT=1 Q:% W !,"ENTER ""Y"" FOR YES OR ""N"" FOR NO",$C(7)
17 G:GMRAOUT EXIT
18 S GMRAYN=%
19PRINTER ;Select printer
20 S GMRAOUT=0,GMRAPG=0
21 W ! K GMRAZIS S:GMRAYN=2 GMRAZIS="QM132S60" D DEV^GMRAUTL I POP W !,"PLEASE TRY LATER" G EXIT
22 I $D(IO("Q")) D G EXIT
23 .S ZTRTN="PRINT^GMRAFDA3",ZTSAVE("GMRAPG")="",ZTSAVE("GMRAOUT")="",ZTSAVE("GMRABGDT")="",ZTSAVE("GMRAENDT")="",ZTSAVE("GMRAYN")=""
24 .S ZTDESC="Print FDA Report by Date/Time" D ^%ZTLOAD
25 .W !!,$S($D(ZTSK):"Request queued...",1:"Request NOT queued please try later...")
26 .Q
27 U IO D PRINT U IO(0)
28 D CLOSE^GMRAUTL
29 G EXIT
30 Q
31PRINT ;Central Print
32 N GMRACNT S GMRACNT=0
33 S GMRAFLG=0,GMRANOW=$$NOW^XLFDT,GMRANOW=$$FMTE^XLFDT(GMRANOW,"1")
34 I IOST?1"C".E W @IOF
35 I GMRAYN=1 D HDR1
36 F S GMRABGDT=$O(^GMR(120.85,"B",GMRABGDT)) Q:GMRABGDT<1!(GMRABGDT>GMRAENDT)!(GMRAOUT) S GMRAPA1=0 F S GMRAPA1=$O(^GMR(120.85,"B",GMRABGDT,GMRAPA1)) Q:GMRAPA1<1 D Q:GMRAOUT
37 .I +$P($G(^GMR(120.8,+$P($G(^GMR(120.85,+GMRAPA1,0)),U,15),"ER")),U,1)=1 Q
38 .I GMRAYN=2 D PRT^GMRAFDA1 Q
39 .I $Y>(IOSL-3) D HEAD Q:GMRAOUT
40 .S GMRAPA1(0)=$G(^GMR(120.85,GMRAPA1,0)) Q:GMRAPA1(0)=""
41 .S GMRAPA(0)=$G(^GMR(120.8,$P(GMRAPA1(0),U,15),0)) Q:GMRAPA(0)=""
42 .S DFN=$P(GMRAPA(0),U) D PID^VADPT6
43 .Q:'$$PRDTST^GMRAUTL1(DFN) ;GMRA*4*33 Exclude test patient from report if production or legacy environment.
44 .S GMRACNT=GMRACNT+1
45 .W !,$E($P(^DPT(DFN,0),U),1,23)," (",VA("PID"),")" K VA,DFN
46 .W ?32,$E($P(GMRAPA(0),U,2),1,28)
47 .W ?62 S Y=$P(GMRAPA1(0),U),Y=$$DATE^GMRAUTL1(Y) W $P(Y,":",1,2) K Y
48 .I $P($G(^GMR(120.85,GMRAPA1,"PTC1")),U,5) D
49 ..W !,?5,"(SENT TO FDA: " S Y=$P(^GMR(120.85,GMRAPA1,"PTC1"),U,5),Y=$$DATE^GMRAUTL1(Y) W $P(Y,":",1,2),")" K Y
50 .Q
51 .K GMRAPA1(0),GMRAPA(0)
52 .Q
53 I 'GMRACNT W !,?30,"NO DATA FOR THIS REPORT"
54 Q
55HEAD ;Header Print
56HDR ;
57 I IOST?1"C".E K DIR S DIR(0)="E" D ^DIR K DIR I Y'>0 S GMRAOUT=1 Q
58 W @IOF
59HDR1 S GMRAPG=GMRAPG+1
60 W GMRANOW,?70,"Page: ",GMRAPG
61 W !,?30,"FDA ABBREVIATED REPORT"
62 W !,"PATIENT",?32,"SUSPECTED AGENT",?62,"D/T OF EVENT"
63 W !,$$REPEAT^XLFSTR("-",79),!
64 Q
65EXIT ;EXIT
66 K ^TMP($J,"GMRAEF")
67 D KILL^XUSCLEAN
68 Q
Note: See TracBrowser for help on using the repository browser.