source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAFDA3.m@ 1361

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

revised back to 6/30/08 version

File size: 2.5 KB
Line 
1GMRAFDA3 ;HIRMFO/WAA-DISPLAY FDA REPORT OVER DT RANGE ;12/1/95 11:34
2 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
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 .S GMRACNT=GMRACNT+1
44 .W !,$E($P(^DPT(DFN,0),U),1,23)," (",VA("PID"),")" K VA,DFN
45 .W ?32,$E($P(GMRAPA(0),U,2),1,28)
46 .W ?62 S Y=$P(GMRAPA1(0),U),Y=$$DATE^GMRAUTL1(Y) W $P(Y,":",1,2) K Y
47 .I $P($G(^GMR(120.85,GMRAPA1,"PTC1")),U,5) D
48 ..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
49 .Q
50 .K GMRAPA1(0),GMRAPA(0)
51 .Q
52 I 'GMRACNT W !,?30,"NO DATA FOR THIS REPORT"
53 Q
54HEAD ;Header Print
55HDR ;
56 I IOST?1"C".E K DIR S DIR(0)="E" D ^DIR K DIR I Y'>0 S GMRAOUT=1 Q
57 W @IOF
58HDR1 S GMRAPG=GMRAPG+1
59 W GMRANOW,?70,"Page: ",GMRAPG
60 W !,?30,"FDA ABBREVIATED REPORT"
61 W !,"PATIENT",?32,"SUSPECTED AGENT",?62,"D/T OF EVENT"
62 W !,$$REPEAT^XLFSTR("-",79),!
63 Q
64EXIT ;EXIT
65 K ^TMP($J,"GMRAEF")
66 D KILL^XUSCLEAN
67 Q
Note: See TracBrowser for help on using the repository browser.