QAMPMON0 ;HISC/DAD-MONITOR DESCRIPTION REPORT ;7/2/92 09:22
;;1.0;Clinical Monitoring System;;09/13/1993
ASKSORT ;
R !!,"Sort report by Service or Monitor: Service// ",X:DTIME S:'$T X="^" G:$E(X)="^" EXIT X ^%ZOSF("UPPERCASE") S X=Y S QAMSORT=$S(X]"":$E(X),1:"S")
I $F("^SERVICE^MONITOR","^"_X)'>0 W:$E(X)'="?" " ??",*7 W !!?5,"Enter 'S' to sort monitors by service.",!?5,"Enter 'M' to sort monitors by monitor code." G ASKSORT
W $P($P("^SERVICE^MONITOR","^"_X,2),"^")
I QAMSORT="S" S QAQDIC="^DIC(49,",QAQDIC(0)="AEMNQZ",QAQDIC("A")="Select SERVICE: ",QAQUTIL="QAM SERVICE" D EN1^QAQSELCT S QAMQUIT=QAQQUIT
I QAMSORT="M" S QAQDIC="^QA(743,",QAQDIC(0)="AEMNQZ",QAQDIC("A")="Select MONITOR: ",QAQUTIL="QAM MONITOR" D EN1^QAQSELCT S QAMQUIT=QAQQUIT
G:QAMQUIT EXIT
K %ZIS,IOP S %ZIS="MQ" W ! D ^%ZIS G:POP EXIT I $D(IO("Q")) K IO("Q") S ZTDESC="Monitor Description Report",ZTRTN="ENTSK^QAMPMON0",ZTSAVE("QAMSORT")="",ZTSAVE("^UTILITY($J,")="" D ^%ZTLOAD G EXIT
ENTSK ;
U IO S QAMNAME="",(QAMFOUND,QAMQUIT)=0,X="T",%DT="" D ^%DT X ^DD("DD") S QAMTODAY=Y
S QAMXREF=$S(QAMSORT="M":"B",1:"ASRV"),QAMSORT="QAM "_$S(QAMSORT="M":"MONITOR",1:"SERVICE")
F QAMNAME(0)=0:0 S QAMNAME=$O(^UTILITY($J,QAMSORT,QAMNAME)) Q:QAMNAME=""!QAMQUIT F QAMIEN=0:0 S QAMIEN=$O(^UTILITY($J,QAMSORT,QAMNAME,QAMIEN)) Q:QAMIEN'>0!QAMQUIT D PRTLOOP
I 'QAMFOUND S QAMPAGE=1 D HEAD^QAMPMON1 W !!,"NO DATA FOUND FOR THIS REPORT"
EXIT ;
W ! D ^%ZISC
K %DT,%ZIS,POP,DIW,DIWF,DIWI,DIWL,DIWR,DIWT,DIWTC,DIWX,DN,QAMPAGE,POP,QA,QAMD0,QAMD1,QAMD2,QAMFLD,QAMFOUND,QAMHEAD,QAMIEN,QAMNAME,QAMPAUSE,QAMONE,QAMQUIT,QAMRAT,QAMSORT,QAMTODAY,QAMXREF,QAMZERO,X,Y,ZTDESC,ZTRTN,ZTSAVE,QAQQUIT
K ^UTILITY($J,"QAM MONITOR"),^UTILITY($J,"QAM SERVICE"),^UTILITY($J,"W")
S:$D(ZTQUEUED) ZTREQ="@"
Q
PRTLOOP ;
S QAMFLD=$S(QAMSORT["MONITOR":QAMNAME,1:QAMIEN) F QAMD0=0:0 S QAMD0=$O(^QA(743,QAMXREF,QAMFLD,QAMD0)) Q:QAMD0'>0!QAMQUIT D ^QAMPMON1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HQAMPMON0 1930 printed Nov 22, 2024@16:52:51 Page 2
QAMPMON0 ;HISC/DAD-MONITOR DESCRIPTION REPORT ;7/2/92 09:22
+1 ;;1.0;Clinical Monitoring System;;09/13/1993
ASKSORT ;
+1 READ !!,"Sort report by Service or Monitor: Service// ",X:DTIME
if '$TEST
SET X="^"
if $EXTRACT(X)="^"
GOTO EXIT
XECUTE ^%ZOSF("UPPERCASE")
SET X=Y
SET QAMSORT=$SELECT(X]"":$EXTRACT(X),1:"S")
+2 IF $FIND("^SERVICE^MONITOR","^"_X)'>0
if $EXTRACT(X)'="?"
WRITE " ??",*7
WRITE !!?5,"Enter 'S' to sort monitors by service.",!?5,"Enter 'M' to sort monitors by monitor code."
GOTO ASKSORT
+3 WRITE $PIECE($PIECE("^SERVICE^MONITOR","^"_X,2),"^")
+4 IF QAMSORT="S"
SET QAQDIC="^DIC(49,"
SET QAQDIC(0)="AEMNQZ"
SET QAQDIC("A")="Select SERVICE: "
SET QAQUTIL="QAM SERVICE"
DO EN1^QAQSELCT
SET QAMQUIT=QAQQUIT
+5 IF QAMSORT="M"
SET QAQDIC="^QA(743,"
SET QAQDIC(0)="AEMNQZ"
SET QAQDIC("A")="Select MONITOR: "
SET QAQUTIL="QAM MONITOR"
DO EN1^QAQSELCT
SET QAMQUIT=QAQQUIT
+6 if QAMQUIT
GOTO EXIT
+7 KILL %ZIS,IOP
SET %ZIS="MQ"
WRITE !
DO ^%ZIS
if POP
GOTO EXIT
IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTDESC="Monitor Description Report"
SET ZTRTN="ENTSK^QAMPMON0"
SET ZTSAVE("QAMSORT")=""
SET ZTSAVE("^UTILITY($J,")=""
DO ^%ZTLOAD
GOTO EXIT
ENTSK ;
+1 USE IO
SET QAMNAME=""
SET (QAMFOUND,QAMQUIT)=0
SET X="T"
SET %DT=""
DO ^%DT
XECUTE ^DD("DD")
SET QAMTODAY=Y
+2 SET QAMXREF=$SELECT(QAMSORT="M":"B",1:"ASRV")
SET QAMSORT="QAM "_$SELECT(QAMSORT="M":"MONITOR",1:"SERVICE")
+3 FOR QAMNAME(0)=0:0
SET QAMNAME=$ORDER(^UTILITY($JOB,QAMSORT,QAMNAME))
if QAMNAME=""!QAMQUIT
QUIT
FOR QAMIEN=0:0
SET QAMIEN=$ORDER(^UTILITY($JOB,QAMSORT,QAMNAME,QAMIEN))
if QAMIEN'>0!QAMQUIT
QUIT
DO PRTLOOP
+4 IF 'QAMFOUND
SET QAMPAGE=1
DO HEAD^QAMPMON1
WRITE !!,"NO DATA FOUND FOR THIS REPORT"
EXIT ;
+1 WRITE !
DO ^%ZISC
+2 KILL %DT,%ZIS,POP,DIW,DIWF,DIWI,DIWL,DIWR,DIWT,DIWTC,DIWX,DN,QAMPAGE,POP,QA,QAMD0,QAMD1,QAMD2,QAMFLD,QAMFOUND,QAMHEAD,QAMIEN,QAMNAME,QAMPAUSE,QAMONE,QAMQUIT,QAMRAT,QAMSORT,QAMTODAY,QAMXREF,QAMZERO,X,Y,ZTDESC,ZTRTN,ZTSAVE,QAQQUIT
+3 KILL ^UTILITY($JOB,"QAM MONITOR"),^UTILITY($JOB,"QAM SERVICE"),^UTILITY($JOB,"W")
+4 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+5 QUIT
PRTLOOP ;
+1 SET QAMFLD=$SELECT(QAMSORT["MONITOR":QAMNAME,1:QAMIEN)
FOR QAMD0=0:0
SET QAMD0=$ORDER(^QA(743,QAMXREF,QAMFLD,QAMD0))
if QAMD0'>0!QAMQUIT
QUIT
DO ^QAMPMON1
+2 QUIT