GMRCST ;SLC/DCM,dee - Statistics on how long to complete consult/requests for a service ;23-Sep-2011 09:23;PLS
;;3.0;CONSULT/REQUEST TRACKING;**1,7,29,1002**;DEC 27, 1997;Build 1
; Modified - IHS/MSC/MGH - 09/20/2011 -
EN ; -- main entry point for GMRC REQUEST COMPLETE STAT
K GMRCSVC,GMRCSVCP,GMRTST
I $D(GMRCEACT),$L(GMRCEACT) D I '$D(^GMR(123.5,$G(GMRCSVC),0)) D EXIT Q
.S GMRCSVCP=GMRCEACT
.S GMRCSVC=$O(^GMR(123.5,"B",GMRCSVCP,0))
.Q:'$D(^GMR(123.5,$G(GMRCSVC),0))
.;Build service array
.S GMRCDG=GMRCSVC
.D SERV1^GMRCASV
.;Set date range to ALL
.S GMRCDT1="ALL"
.S GMRCDT2=0
.D LISTDATE^GMRCSTU1(GMRCDT1,GMRCDT2,.GMRCEDT1,.GMRCEDT2)
;If no service ask for one
I '$L($G(GMRCSVC)) D EN^GMRCSTU I $D(GMRCQUT) D EXIT Q
;Quit if no array of services
I '$O(^TMP("GMRCSLIST",$J,0)) S GMRCQUT=1 D EXIT Q
;
D ODT^GMRCSTU Q:$D(GMRCQUT)
D EN^VALM("GMRC REQUEST COMPLETE STAT")
Q
;
HDR ; -- header code
S VALMHDR(1)="Number Of Days To Complete A Consult For Services Statistics."
S VALMHDR(2)="FROM: "_$G(GMRCEDT1)_" TO: "_$G(GMRCEDT2)
Q
;
INIT ; -- init variables and list array
S VALMCNT=$G(GMRCCT),VALMBCK="R"
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("GMRCR",$J,"PRL"),^TMP("GMRCSVC",$J)
K GMRCCT,GMRCSVC,GMRCEDT1,GMRCEDT2,GMRTST
Q
;
EXPND ; -- expand code
Q
;
PRNTONLY ;Option to just send the report to a device.
;Get the service and date range.
N GMRCQUT,RETURN,GMRCDG,VALMBCK
N GMRCDT1,GMRCDT2,GMRCEDT1,GMRCEDT2,GMRTST
D EN^GMRCSTU
I $D(GMRCQUT) D EXIT Q
;Quit if no array of services
I '$O(^TMP("GMRCSLIST",$J,0)) S GMRCQUT=1 D EXIT Q
;Get the device
D PRNTASK^GMRCSTU
I $D(GMRCQUT) D EXIT Q
;Create the report if not queued
I '$D(IO("Q")) D ENOR^GMRCSTU(.RETURN,GMRCDG,GMRCDT1,GMRCDT2,GMRTST)
;Print the report
D PRNTIT^GMRCSTU("PRL","PRNTQ^GMRCST","CONSULT/REQUEST PACKAGE PRINT COMPLETION TIME STATISTICS FROM OPTION")
D EXIT
Q
;
PRNTQ ;Print Queued report from ^TMP global then kill off ^TMP & ^XTMP
;Create the report
N RETURN,INDEX
D ENOR^GMRCSTU(.RETURN,GMRCDG,GMRCDT1,GMRCDT2,GMRTST)
U IO
S INDEX=""
F S INDEX=$O(^TMP("GMRCR",$J,TMPNAME,INDEX)) Q:INDEX="" W ^TMP("GMRCR",$J,TMPNAME,INDEX,0),!
K ^TMP("GMRCR",$J,TMPNAME),^XTMP("GMRCR",J,DOLLARH,"PRINT"),J,DOLLARH
D ^%ZISC
D EXIT
Q
;
GMRCST ;SLC/DCM,dee - Statistics on how long to complete consult/requests for a service ;23-Sep-2011 09:23;PLS
+1 ;;3.0;CONSULT/REQUEST TRACKING;**1,7,29,1002**;DEC 27, 1997;Build 1
+2 ; Modified - IHS/MSC/MGH - 09/20/2011 -
EN ; -- main entry point for GMRC REQUEST COMPLETE STAT
+1 KILL GMRCSVC,GMRCSVCP,GMRTST
+2 IF $DATA(GMRCEACT)
IF $LENGTH(GMRCEACT)
Begin DoDot:1
+3 SET GMRCSVCP=GMRCEACT
+4 SET GMRCSVC=$ORDER(^GMR(123.5,"B",GMRCSVCP,0))
+5 IF '$DATA(^GMR(123.5,$GET(GMRCSVC),0))
QUIT
+6 ;Build service array
+7 SET GMRCDG=GMRCSVC
+8 DO SERV1^GMRCASV
+9 ;Set date range to ALL
+10 SET GMRCDT1="ALL"
+11 SET GMRCDT2=0
+12 DO LISTDATE^GMRCSTU1(GMRCDT1,GMRCDT2,.GMRCEDT1,.GMRCEDT2)
End DoDot:1
IF '$DATA(^GMR(123.5,$GET(GMRCSVC),0))
DO EXIT
QUIT
+13 ;If no service ask for one
+14 IF '$LENGTH($GET(GMRCSVC))
DO EN^GMRCSTU
IF $DATA(GMRCQUT)
DO EXIT
QUIT
+15 ;Quit if no array of services
+16 IF '$ORDER(^TMP("GMRCSLIST",$JOB,0))
SET GMRCQUT=1
DO EXIT
QUIT
+17 ;
+18 DO ODT^GMRCSTU
IF $DATA(GMRCQUT)
QUIT
+19 DO EN^VALM("GMRC REQUEST COMPLETE STAT")
+20 QUIT
+21 ;
HDR ; -- header code
+1 SET VALMHDR(1)="Number Of Days To Complete A Consult For Services Statistics."
+2 SET VALMHDR(2)="FROM: "_$GET(GMRCEDT1)_" TO: "_$GET(GMRCEDT2)
+3 QUIT
+4 ;
INIT ; -- init variables and list array
+1 SET VALMCNT=$GET(GMRCCT)
SET VALMBCK="R"
+2 QUIT
+3 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 KILL ^TMP("GMRCR",$JOB,"PRL"),^TMP("GMRCSVC",$JOB)
+2 KILL GMRCCT,GMRCSVC,GMRCEDT1,GMRCEDT2,GMRTST
+3 QUIT
+4 ;
EXPND ; -- expand code
+1 QUIT
+2 ;
PRNTONLY ;Option to just send the report to a device.
+1 ;Get the service and date range.
+2 NEW GMRCQUT,RETURN,GMRCDG,VALMBCK
+3 NEW GMRCDT1,GMRCDT2,GMRCEDT1,GMRCEDT2,GMRTST
+4 DO EN^GMRCSTU
+5 IF $DATA(GMRCQUT)
DO EXIT
QUIT
+6 ;Quit if no array of services
+7 IF '$ORDER(^TMP("GMRCSLIST",$JOB,0))
SET GMRCQUT=1
DO EXIT
QUIT
+8 ;Get the device
+9 DO PRNTASK^GMRCSTU
+10 IF $DATA(GMRCQUT)
DO EXIT
QUIT
+11 ;Create the report if not queued
+12 IF '$DATA(IO("Q"))
DO ENOR^GMRCSTU(.RETURN,GMRCDG,GMRCDT1,GMRCDT2,GMRTST)
+13 ;Print the report
+14 DO PRNTIT^GMRCSTU("PRL","PRNTQ^GMRCST","CONSULT/REQUEST PACKAGE PRINT COMPLETION TIME STATISTICS FROM OPTION")
+15 DO EXIT
+16 QUIT
+17 ;
PRNTQ ;Print Queued report from ^TMP global then kill off ^TMP & ^XTMP
+1 ;Create the report
+2 NEW RETURN,INDEX
+3 DO ENOR^GMRCSTU(.RETURN,GMRCDG,GMRCDT1,GMRCDT2,GMRTST)
+4 USE IO
+5 SET INDEX=""
+6 FOR
SET INDEX=$ORDER(^TMP("GMRCR",$JOB,TMPNAME,INDEX))
IF INDEX=""
QUIT
WRITE ^TMP("GMRCR",$JOB,TMPNAME,INDEX,0),!
+7 KILL ^TMP("GMRCR",$JOB,TMPNAME),^XTMP("GMRCR",J,DOLLARH,"PRINT"),J,DOLLARH
+8 DO ^%ZISC
+9 DO EXIT
+10 QUIT
+11 ;