GMRACMR ;HIRMFO/WAA,RM-LIST Chart/ID Band mark report ;9/29/97 08:11
;;4.0;Adverse Reaction Tracking;**8,35**;Mar 29, 1996
;;
EN1 ;PRIMARY ENTRY POINT
S GMRAOUT=0
QST K DIR S DIR(0)="LAO^1:4"
S DIR(0)=DIR(0)_"^I X[""."" W !,""DO NOT USE DECIMAL VALUES."",$C(7) K X Q"
S DIR("A",1)=" 1 Current Inpatients",DIR("A",2)=" 2 Outpatients over Date/Time range",DIR("A",3)=" 3 New Admissions over Date/Time range",DIR("A",4)=" 4 All of the above"
S DIR("A")="Enter the number(s) for those groups to be used in this report: (1-4):"
S DIR("?",1)=" ENTER THE NUMBER(S) FOR THOSE GROUPS TO BE INCLUDED IN THIS REPORT.",DIR("?")=" THIS RESPONSE MUST BE A LIST OR RANGE, E.G., 1,3 OR 2-3"
D ^DIR K DIR
I "^^"[Y S GMRAOUT=1 Q
S GMRAQST=""
S:Y["4" Y="1,2,3"
S GMRASEL=Y
S:GMRASEL["1" GMRAQST=GMRAQST_"W"
S:GMRASEL["2" GMRAQST=GMRAQST_"CM"
S:GMRASEL["3" GMRAQST=GMRAQST_"W"
D DATE Q:GMRAOUT
;Select the ward or clinic
S Y=$$MDIC^GMRACMR1 I Y<1 S GMRAOUT=1
Q:GMRAOUT
Q
DATE ;DATE SELECTION
;FROM DATE
Q:'(GMRASEL["2"!(GMRASEL["3"))
W !," Enter date/time range in which patients were",!,$S(GMRASEL["3":" admitted into the hospital"_$S(GMRASEL["2":" or",1:""),1:""),$S(GMRASEL["2":" seen at an outpatient clinic",1:""),"."
W !!," Please note! This report will show patients as not having received an"
W !,"assessment if the assessment was entered after the end date of"
W !,"the range. For this reason, it is recommended to end the range"
W !,"with today. This can be done with an entry of 'T' (for Today) at"
W !,"the 'Enter END Date (time optional): T//' prompt."
W !!,"Enter START Date (time optional): " R X:DTIME S:'$T X="^^" I "^^"[X S GMRAOUT=1 Q
I X?1"?".E D G DATE
. S %DT="TEX" D HELP^%DTC
. W !!?4,"ENTER THE START DATE/TIME OF RANGE TO SEE PATIENTS THAT WERE",!?3,$S(GMRASEL["3":" ADMITTED TO THE HOSPITAL"_$S(GMRASEL["2":" OR",1:""),1:""),$S(GMRASEL["2":" SEEN AT AN OUTPATIENT CLINIC",1:""),".",!
. Q
S %DT="TEX" D ^%DT
I +Y'>0 G DATE
S GMRAST=Y K %DT,Y
END ;
W !,"Enter END Date (time optional): T// " R X:DTIME S:'$T X="^^" S:X="" X="T" I "^^"[X S GMRAOUT=1 Q
I X?1"?".E D G END
. S %DT="TEX",%DT(0)=GMRAST D HELP^%DTC
. W !!?4,"ENTER THE END DATE/TIME OF RANGE TO SEE PATIENTS THAT WERE",!?3,$S(GMRASEL["3":" ADMITTED TO THE HOSPITAL"_$S(GMRASEL["2":" OR",1:""),1:""),$S(GMRASEL["2":" SEEN AT AN OUTPATIENT CLINIC",1:""),".",!
. Q
S %DT(0)=GMRAST,%DT="TEX" D ^%DT
I +Y'>0 G END
S GMRAED=Y_$S(Y=(Y\1):".24",1:"") K %DT,Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRACMR 2550 printed Dec 13, 2024@01:38:42 Page 2
GMRACMR ;HIRMFO/WAA,RM-LIST Chart/ID Band mark report ;9/29/97 08:11
+1 ;;4.0;Adverse Reaction Tracking;**8,35**;Mar 29, 1996
+2 ;;
EN1 ;PRIMARY ENTRY POINT
+1 SET GMRAOUT=0
QST KILL DIR
SET DIR(0)="LAO^1:4"
+1 SET DIR(0)=DIR(0)_"^I X[""."" W !,""DO NOT USE DECIMAL VALUES."",$C(7) K X Q"
+2 SET DIR("A",1)=" 1 Current Inpatients"
SET DIR("A",2)=" 2 Outpatients over Date/Time range"
SET DIR("A",3)=" 3 New Admissions over Date/Time range"
SET DIR("A",4)=" 4 All of the above"
+3 SET DIR("A")="Enter the number(s) for those groups to be used in this report: (1-4):"
+4 SET DIR("?",1)=" ENTER THE NUMBER(S) FOR THOSE GROUPS TO BE INCLUDED IN THIS REPORT."
SET DIR("?")=" THIS RESPONSE MUST BE A LIST OR RANGE, E.G., 1,3 OR 2-3"
+5 DO ^DIR
KILL DIR
+6 IF "^^"[Y
SET GMRAOUT=1
QUIT
+7 SET GMRAQST=""
+8 if Y["4"
SET Y="1,2,3"
+9 SET GMRASEL=Y
+10 if GMRASEL["1"
SET GMRAQST=GMRAQST_"W"
+11 if GMRASEL["2"
SET GMRAQST=GMRAQST_"CM"
+12 if GMRASEL["3"
SET GMRAQST=GMRAQST_"W"
+13 DO DATE
if GMRAOUT
QUIT
+14 ;Select the ward or clinic
+15 SET Y=$$MDIC^GMRACMR1
IF Y<1
SET GMRAOUT=1
+16 if GMRAOUT
QUIT
+17 QUIT
DATE ;DATE SELECTION
+1 ;FROM DATE
+2 if '(GMRASEL["2"!(GMRASEL["3"))
QUIT
+3 WRITE !," Enter date/time range in which patients were",!,$SELECT(GMRASEL["3":" admitted into the hospital"_$SELECT(GMRASEL["2":" or",1:""),1:""),$SELECT(GMRASEL["2":" seen at an outpatient clinic",1:""),"."
+4 WRITE !!," Please note! This report will show patients as not having received an"
+5 WRITE !,"assessment if the assessment was entered after the end date of"
+6 WRITE !,"the range. For this reason, it is recommended to end the range"
+7 WRITE !,"with today. This can be done with an entry of 'T' (for Today) at"
+8 WRITE !,"the 'Enter END Date (time optional): T//' prompt."
+9 WRITE !!,"Enter START Date (time optional): "
READ X:DTIME
if '$TEST
SET X="^^"
IF "^^"[X
SET GMRAOUT=1
QUIT
+10 IF X?1"?".E
Begin DoDot:1
+11 SET %DT="TEX"
DO HELP^%DTC
+12 WRITE !!?4,"ENTER THE START DATE/TIME OF RANGE TO SEE PATIENTS THAT WERE",!?3,$SELECT(GMRASEL["3":" ADMITTED TO THE HOSPITAL"_$SELECT(GMRASEL["2":" OR",1:""),1:""),$SELECT(GMRASEL["2":" SEEN AT AN OUTPATIENT CLINIC",1:""),".",!
+13 QUIT
End DoDot:1
GOTO DATE
+14 SET %DT="TEX"
DO ^%DT
+15 IF +Y'>0
GOTO DATE
+16 SET GMRAST=Y
KILL %DT,Y
END ;
+1 WRITE !,"Enter END Date (time optional): T// "
READ X:DTIME
if '$TEST
SET X="^^"
if X=""
SET X="T"
IF "^^"[X
SET GMRAOUT=1
QUIT
+2 IF X?1"?".E
Begin DoDot:1
+3 SET %DT="TEX"
SET %DT(0)=GMRAST
DO HELP^%DTC
+4 WRITE !!?4,"ENTER THE END DATE/TIME OF RANGE TO SEE PATIENTS THAT WERE",!?3,$SELECT(GMRASEL["3":" ADMITTED TO THE HOSPITAL"_$SELECT(GMRASEL["2":" OR",1:""),1:""),$SELECT(GMRASEL["2":" SEEN AT AN OUTPATIENT CLINIC",1:""),".",!
+5 QUIT
End DoDot:1
GOTO END
+6 SET %DT(0)=GMRAST
SET %DT="TEX"
DO ^%DT
+7 IF +Y'>0
GOTO END
+8 SET GMRAED=Y_$SELECT(Y=(Y\1):".24",1:"")
KILL %DT,Y
+9 QUIT