Ignore:
Timestamp:
Dec 4, 2009, 12:11:15 AM (14 years ago)
Author:
George Lilly
Message:

revised back to 6/30/08 version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPST5.m

    r613 r623  
    1 GMRAPST5        ;HIRMFO/WAA- PRINT TOTAL NUMBER OF REPORTED REACTION ;3/5/97  15:16
    2         ;;4.0;Adverse Reaction Tracking;**7,33**;Mar 29, 1996;Build 5
    3 EN1     ; 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
    9 EXIT    ; Exit of program kill cleanup
    10         D KILL^XUSCLEAN
    11         Q
    12 PRINTER ;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
    21 PRINT   ;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         ..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         ..Q
    33         .Q
    34         Q:GMRAOUT
    35         D HEAD
    36         W !,?19,"Total Number of Reported Reactions: ",GMRATOT
    37         W !,?27,"From: ",$$FMTE^XLFDT(GMAST,"2D"),?42,"To: ",$$FMTE^XLFDT(GMAEN,"2D")
    38         D CLOSE^GMRAUTL
    39         Q
    40         ;has the patient died within the date
    41 HEAD    ; Print header information
    42         I GMRAPG'=1  Q:$Y<(IOSL-4)
    43         I $E(IOST,1)="C" D  Q:GMRAOUT
    44         .I GMRAPG=1 W @IOF Q
    45         .I GMRAPG'=1 D  Q:GMRAOUT
    46         ..N DIR S DIR(0)="E" D ^DIR I 'Y S GMRAOUT=1
    47         ..K Y
    48         ..Q
    49         .Q
    50         Q:GMRAOUT
    51         I GMRAPG'=1 W @IOF
    52         W "Report Date: ",$P($$FMTE^XLFDT(GMRADPDT),"@"),?70,"Page: ",GMRAPG
    53         W !,?33,"Reported Reactions"
    54         W !,$$REPEAT^XLFSTR("-",79)
    55         S GMRAPG=GMRAPG+1
    56         I $D(ZTQUEUED) S:$$STPCK^GMRAUTL1 GMRAOUT=1 ; Check if stopped by user
    57         Q
     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 TracChangeset for help on using the changeset viewer.