GMRACMR2 ;HIRMFO/WAA-This routine will find all valid patient ;12/16/97 10:34
;;4.0;Adverse Reaction Tracking;**9**;Mar 29, 1996
EN1 ;Use ACRP APIs to gather appointment data
Q:GMRASEL'["2"
N GMTSQRY
D OPEN^SDQ(.GMTSQRY)
D INDEX^SDQ(.GMTSQRY,"DATE/TIME","SET")
D DATE^SDQ(.GMTSQRY,GMRAST,GMRAED,"SET")
D SCANCB^SDQ(.GMTSQRY,"D CB^GMRACMR2(Y,Y0)","SET")
D ACTIVE^SDQ(.GMTSQRY,"TRUE","SET")
D SCAN^SDQ(.GMTSQRY,"FORWARD")
D CLOSE^SDQ(.GMTSQRY)
K GMRAX,GMRADFN,GMRADATE
Q
CB(GMTS,GMTS0) ;Callback execution, handles each entry from data set
I $P(GMTS0,U,12)'=2&($P(GMTS0,U,12)'=8) Q ;Only count inpatient and checked-out appts
S GMRAX=$P(GMTS0,U,4),GMRADFN=$P(GMTS0,U,2),GMRADATE=$P(GMTS0,U) D SETPT^GMRACMR3
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRACMR2 743 printed Dec 13, 2024@01:38:44 Page 2
GMRACMR2 ;HIRMFO/WAA-This routine will find all valid patient ;12/16/97 10:34
+1 ;;4.0;Adverse Reaction Tracking;**9**;Mar 29, 1996
EN1 ;Use ACRP APIs to gather appointment data
+1 if GMRASEL'["2"
QUIT
+2 NEW GMTSQRY
+3 DO OPEN^SDQ(.GMTSQRY)
+4 DO INDEX^SDQ(.GMTSQRY,"DATE/TIME","SET")
+5 DO DATE^SDQ(.GMTSQRY,GMRAST,GMRAED,"SET")
+6 DO SCANCB^SDQ(.GMTSQRY,"D CB^GMRACMR2(Y,Y0)","SET")
+7 DO ACTIVE^SDQ(.GMTSQRY,"TRUE","SET")
+8 DO SCAN^SDQ(.GMTSQRY,"FORWARD")
+9 DO CLOSE^SDQ(.GMTSQRY)
+10 KILL GMRAX,GMRADFN,GMRADATE
+11 QUIT
CB(GMTS,GMTS0) ;Callback execution, handles each entry from data set
+1 ;Only count inpatient and checked-out appts
IF $PIECE(GMTS0,U,12)'=2&($PIECE(GMTS0,U,12)'=8)
QUIT
+2 SET GMRAX=$PIECE(GMTS0,U,4)
SET GMRADFN=$PIECE(GMTS0,U,2)
SET GMRADATE=$PIECE(GMTS0,U)
DO SETPT^GMRACMR3
+3 QUIT