Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRAPST2

GMRAPST2.m

Go to the documentation of this file.
  1. GMRAPST2 ;HIRMFO/WAA- PRINT SUM LISTING OF OUT COMES ;3/5/97 14:50
  1. ;;4.0;Adverse Reaction Tracking;**7,33**;Mar 29, 1996;Build 5
  1. EN1 ; This routine will loop through the ADT entry point to get all
  1. ; the entries in that date range.
  1. S GMRAOUT=0
  1. W !,"Select an Observed date range for this report."
  1. D DT^GMRAPL G:GMRAOUT EXIT
  1. D PRINTER
  1. EXIT ; Exit of program kill cleanup
  1. D KILL^XUSCLEAN
  1. Q
  1. PRINTER ;Select printer
  1. W ! K GMRAZIS D DEV^GMRAUTL I POP W !,"PLEASE TRY LATER" S GMRAOUT=1 Q
  1. I $D(IO("Q")) D Q
  1. . S ZTRTN="PRINT^GMRAPST2",(ZTSAVE("GMRAOUT"),ZTSAVE("GMAST"),ZTSAVE("GMAEN"))=""
  1. . S ZTDESC="Summary of Outcomes" D ^%ZTLOAD
  1. . W !!,$S($D(ZTSK):"Request queued...",1:"Request NOT queued please try Later.")
  1. . Q
  1. U IO D PRINT U IO(0)
  1. Q
  1. PRINT ;Queue point for report
  1. ;loop through the 120.85 file and look for the field that
  1. D NOW^%DTC S GMRADPDT=X
  1. S GMRADATE=GMAST-.0001,GMRAPG=1
  1. S (GMRARRAY("YES"),GMRARRAY("NO"),GMRARRAY("NULL"))="",GMRATOT=0
  1. F S GMRADATE=$O(^GMR(120.85,"B",GMRADATE)) Q:GMRADATE<1 Q:GMRADATE>GMAEN D
  1. .S GMRAPA1=0 F S GMRAPA1=$O(^GMR(120.85,"B",GMRADATE,GMRAPA1)) Q:GMRAPA1<1 D
  1. ..S GMRAPA1(0)=$G(^GMR(120.85,GMRAPA1,0)) Q:GMRAPA1(0)="" ;Bad Node
  1. ..Q:+$G(^GMR(120.8,$P(GMRAPA1(0),U,15),"ER")) ;Entered in Error data
  1. ..Q:'$$PRDTST^GMRAUTL1($P(GMRAPA1(0),U,2)) ;GMRA*4*33 Exclude test patient from report if production or legacy environment.
  1. ..S GMRATOT=GMRATOT+1
  1. ..F GMRALAB=1:1 S GMRALINE=$T(TEXT+GMRALAB) Q:$P(GMRALINE,";",3)="" D
  1. ...S GMRAP=$P(GMRALINE,";",4)
  1. ...I $P(GMRAPA1(0),U,GMRAP)="y" S $P(GMRARRAY("YES"),U,GMRAP)=$P(GMRARRAY("YES"),U,GMRAP)+1
  1. ...I $P(GMRAPA1(0),U,GMRAP)="n" S $P(GMRARRAY("NO"),U,GMRAP)=$P(GMRARRAY("NO"),U,GMRAP)+1
  1. ...I $P(GMRAPA1(0),U,GMRAP)="" S $P(GMRARRAY("NULL"),U,GMRAP)=$P(GMRARRAY("NULL"),U,GMRAP)+1
  1. ...Q
  1. ..Q
  1. .Q
  1. Q:GMRAOUT
  1. D HEAD
  1. S (GMRAY,GMRAN,GMRANU)=0
  1. F GMRALAB=1:1 S GMRALINE=$T(TEXT+GMRALAB) Q:$P(GMRALINE,";",3)="" D
  1. .N GMRAP,GMRATAB
  1. .S GMRAP=$P(GMRALINE,";",4)
  1. .S GMRATAB=40-$L($P(GMRALINE,";",3))
  1. .W !,?GMRATAB,$P(GMRALINE,";",3)
  1. .W ?42,$P(GMRARRAY("YES"),U,GMRAP)
  1. .S GMRAY=GMRAY+$P(GMRARRAY("YES"),U,GMRAP)
  1. .W ?53,"| ",$P(GMRARRAY("NO"),U,GMRAP)
  1. .S GMRAN=GMRAN+$P(GMRARRAY("NO"),U,GMRAP)
  1. .W ?63,"| ",$P(GMRARRAY("NULL"),U,GMRAP)
  1. .S GMRANU=GMRANU+$P(GMRARRAY("NULL"),U,GMRAP)
  1. .Q
  1. W !,?30," ---------------------------------------"
  1. W !,?32,"Totals: ",?42,GMRAY,?53,"| ",GMRAN,?63,"| ",GMRANU
  1. W !!,?22,"Total number of records processed ",GMRATOT
  1. D CLOSE^GMRAUTL
  1. Q
  1. ;has the patient died within the date
  1. I GMRAPG'=1 Q:$Y<(IOSL-4)
  1. I $E(IOST,1)="C" D Q:GMRAOUT
  1. .I GMRAPG=1 W @IOF Q
  1. .I GMRAPG'=1 D Q:GMRAOUT
  1. ..N DIR S DIR(0)="E" D ^DIR I 'Y S GMRAOUT=1
  1. ..K Y
  1. ..Q
  1. .Q
  1. Q:GMRAOUT
  1. I GMRAPG'=1 W @IOF
  1. W "Report Date: ",$P($$FMTE^XLFDT(GMRADPDT),"@"),?70,"Page: ",GMRAPG
  1. W !,?30,"Summary of Outcomes"
  1. W !,?25,"From: ",$$FMTE^XLFDT(GMAST,"2D")," To: ",$$FMTE^XLFDT(GMAEN,"2D")
  1. W !,?42,"Yes",?55,"No",?65,"No Response"
  1. W !,$$REPEAT^XLFSTR("-",79)
  1. S GMRAPG=GMRAPG+1
  1. I $D(ZTQUEUED) S:$$STPCK^GMRAUTL1 GMRAOUT=1 ; Check if stopped by user
  1. Q
  1. TEXT ;;these are the labels that will denote the field data
  1. ;;Patients that Died: ;3
  1. ;;Reactions treated with RX drugs: ;4
  1. ;;Life Threatening illness: ;5
  1. ;;Required ER/MD visit: ;6
  1. ;;Required hospitalization: ;7
  1. ;;Prolonged Hospitalization: ;9
  1. ;;Resulted in permanent disability: ;10
  1. ;;Patient recovered: ;11
  1. ;;Congenital Anomaly: ;16
  1. ;;Required intervention: ;17
  1. ;;