INHOU5 ;DP; 7 May 96 11:41;Interface Message Requeue Utilities
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
;
GOHOT1(INSELECT,INLSTNAM) ; Hot Key #1 execution code
; MODULE NAME: GOHOT1 ( HotKey #1 execution code )
; DESCRIPTION: Requeue using existing priorities and time to process
; for each message
; RETURN = none
; PARAMETERS:
; INSELECT = Array of selected items from List Processor
; (DWLMK or DWLMK1)
; INLSTNAM = Array of IEN's into ^INTHU to be Queued for
; processing
N INNODE,INREQIEN,INPRIO,INTTPROC
S INNODE="",INABORT=0
F S INNODE=$O(INSELECT(INNODE)) Q:'INNODE!(INABORT>1) D
.S INREQIEN=$G(@INLSTNAM@(INNODE,0)) Q:'INREQIEN
.S INABORT=$$FINDQUE^INHOU1(INREQIEN,.INMSG) Q:INABORT>1
.S $P(INSELECT(INNODE),U,2)=INMSG Q:INABORT
.S INABORT=$$GETPT^INHOU5(1,INREQIEN,.INPRIO,.INTTPROC) Q:INABORT
.D DOREQ^INHOU1(INREQIEN,INPRIO,INTTPROC)
Q
;
GOHOT2(INSELECT,INLSTNAM) ; Hot Key #2 execution code
; MODULE NAME: GOHOT2 ( HotKey #2 execution code )
; DESCRIPTION: Requeue using one priority and time to process for all
; messages
; See GOHOT1^INHOU5 for Parameter information
N INNODE,INREQIEN,INPRIO,INTTPROC
;Prompt for priority and time to process first, then loop through
;all selected transactions
Q:$$GETPT(2,"",.INPRIO,.INTTPROC) S INNODE="",INABORT=0
F S INNODE=$O(INSELECT(INNODE)) Q:'INNODE!(INABORT>1) D
.S INREQIEN=$G(@INLSTNAM@(INNODE,0)) Q:'INREQIEN
.S INABORT=$$FINDQUE^INHOU1(INREQIEN,.INMSG) Q:INABORT>1
.S $P(INSELECT(INNODE),U,2)=INMSG Q:INABORT
.D DOREQ^INHOU1(INREQIEN,INPRIO,INTTPROC)
Q
;
GOHOT3(INSELECT,INLSTNAM) ; Hot Key #3 execution code
; MODULE NAME: GOHOT3 ( HotKey #3 execution code )
; DESCRIPTION: Requeue using unique priorities and time to process for each message
; See GOHOT1^INHOU5 for Parameter information
; CODE BEGINS
N INNODE,INREQIEN,INPRIO,INTTPROC
S INNODE="",INABORT=0
F S INNODE=$O(INSELECT(INNODE)) Q:'INNODE!(INABORT>1) D
.S INREQIEN=$G(@INLSTNAM@(INNODE,0)) Q:'INREQIEN
.S INABORT=$$FINDQUE^INHOU1(INREQIEN,.INMSG) I INABORT D Q
..;following sets second piece if msg is to not requeue,
..;but leaves it blank if user had entered "^"
..S:INABORT=1 $P(INSELECT(INNODE),U,2)=INMSG
.S INABORT=$$GETPT^INHOU5(1,INREQIEN,.INPRIO,.INTTPROC) Q:INABORT
.S $P(INSELECT(INNODE),U,2)=INMSG
.D DOREQ^INHOU1(INREQIEN,INPRIO,INTTPROC)
Q
GETPT(INHOTOPT,INREQIEN,INPRIO,INTTPROC) ; Prompt for new prior. and time-to-proc.
; MODULE NAME: GETPT ( acquire the priority and time-to-process msg)
; DESCRIPTION: Depending on the INHOTOPT parameter, the message prio-
; ity and time-to-process is returned for the message
; in ^INTHU(INREQIEN.
; RETURN = PASS/FAIL (0/2)
; PARAMETERS:
; INHOTOPTP = Option selector.
; INREQIEN = The IEN of the message of interest.
; INPRIO = (Ref.) The priority is returned here.
; INTTPROC = (Ref.) The Time-to-Process is returned here.
N INQUIT,INABORT
S INABORT=0
I INHOTOPT=1 D Q 0
. ; get the priority and time to process from the original message
.S INPRIO=+$P(^INTHU(INREQIEN,0),U,16)
.S INTTPROC=$P(^INTHU(INREQIEN,0),U,19)
. S:'$L(INTTPROC) INTTPROC=$H
; for option 3 kill the prio and ttproc and use option 2 to get
I INHOTOPT=3 K INPRIO,INTTPROC S (INPRIO,INTTPROC)=""
; for option 2 prompt for input only if prio and ttproc are not defined
I INHOTOPT=2!(INHOTOPT=3) D
. D CLEAR^DW
. ; get the priority and time to process from the user on the first
. ; pass and then use the passed value from then on.
. I '$G(INPRIO)!('$G(INTTPROC)) D
.. S INQUIT=0 F D Q:INQUIT K X,Y
... W:$G(INREQIEN) "Message:",!,$$INMSGSTR^INHMS2(INREQIEN)
... ; handle initial user input for time-to-process
... K X W ! D ^UTSRD("Time to process: ;;;;NOW;","Enter the Time-to-process the message.")
... I X["^"!(X="") S (INQUIT,INABORT)=2 Q
... S X=$$CASECONV^UTIL(X,"U")
... ; handle the different error/exit conditions
... I X="STAT" S INTTPROC="00000,00000",INQUIT=1 Q
... ; let DT handle all other input checks for time to process
... S %DT="ET" D ^%DT S INTTPROC=$$CDATF2H^UTDT(Y) I Y>-1 S INQUIT=1
.. Q:INABORT
.. S INPRIO=0 W ! D ^UTSRD("PRIORITY: ;;;;0;0,10","Enter the New Priority.") S INPRIO=+X
.. I X["^"!(X="") S (INQUIT,INABORT)=2
. Q:INABORT
. ; default the Priority and Time to Process if STILL not defined
. S:'INPRIO INPRIO=0 S:'$L(INTTPROC) INTTPROC=$H
Q INABORT
INHOU5 ;DP; 7 May 96 11:41;Interface Message Requeue Utilities
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 ;
GOHOT1(INSELECT,INLSTNAM) ; Hot Key #1 execution code
+1 ; MODULE NAME: GOHOT1 ( HotKey #1 execution code )
+2 ; DESCRIPTION: Requeue using existing priorities and time to process
+3 ; for each message
+4 ; RETURN = none
+5 ; PARAMETERS:
+6 ; INSELECT = Array of selected items from List Processor
+7 ; (DWLMK or DWLMK1)
+8 ; INLSTNAM = Array of IEN's into ^INTHU to be Queued for
+9 ; processing
+10 NEW INNODE,INREQIEN,INPRIO,INTTPROC
+11 SET INNODE=""
SET INABORT=0
+12 FOR
SET INNODE=$ORDER(INSELECT(INNODE))
IF 'INNODE!(INABORT>1)
QUIT
Begin DoDot:1
+13 SET INREQIEN=$GET(@INLSTNAM@(INNODE,0))
IF 'INREQIEN
QUIT
+14 SET INABORT=$$FINDQUE^INHOU1(INREQIEN,.INMSG)
IF INABORT>1
QUIT
+15 SET $PIECE(INSELECT(INNODE),U,2)=INMSG
IF INABORT
QUIT
+16 SET INABORT=$$GETPT^INHOU5(1,INREQIEN,.INPRIO,.INTTPROC)
IF INABORT
QUIT
+17 DO DOREQ^INHOU1(INREQIEN,INPRIO,INTTPROC)
End DoDot:1
+18 QUIT
+19 ;
GOHOT2(INSELECT,INLSTNAM) ; Hot Key #2 execution code
+1 ; MODULE NAME: GOHOT2 ( HotKey #2 execution code )
+2 ; DESCRIPTION: Requeue using one priority and time to process for all
+3 ; messages
+4 ; See GOHOT1^INHOU5 for Parameter information
+5 NEW INNODE,INREQIEN,INPRIO,INTTPROC
+6 ;Prompt for priority and time to process first, then loop through
+7 ;all selected transactions
+8 IF $$GETPT(2,"",.INPRIO,.INTTPROC)
QUIT
SET INNODE=""
SET INABORT=0
+9 FOR
SET INNODE=$ORDER(INSELECT(INNODE))
IF 'INNODE!(INABORT>1)
QUIT
Begin DoDot:1
+10 SET INREQIEN=$GET(@INLSTNAM@(INNODE,0))
IF 'INREQIEN
QUIT
+11 SET INABORT=$$FINDQUE^INHOU1(INREQIEN,.INMSG)
IF INABORT>1
QUIT
+12 SET $PIECE(INSELECT(INNODE),U,2)=INMSG
IF INABORT
QUIT
+13 DO DOREQ^INHOU1(INREQIEN,INPRIO,INTTPROC)
End DoDot:1
+14 QUIT
+15 ;
GOHOT3(INSELECT,INLSTNAM) ; Hot Key #3 execution code
+1 ; MODULE NAME: GOHOT3 ( HotKey #3 execution code )
+2 ; DESCRIPTION: Requeue using unique priorities and time to process for each message
+3 ; See GOHOT1^INHOU5 for Parameter information
+4 ; CODE BEGINS
+5 NEW INNODE,INREQIEN,INPRIO,INTTPROC
+6 SET INNODE=""
SET INABORT=0
+7 FOR
SET INNODE=$ORDER(INSELECT(INNODE))
IF 'INNODE!(INABORT>1)
QUIT
Begin DoDot:1
+8 SET INREQIEN=$GET(@INLSTNAM@(INNODE,0))
IF 'INREQIEN
QUIT
+9 SET INABORT=$$FINDQUE^INHOU1(INREQIEN,.INMSG)
IF INABORT
Begin DoDot:2
+10 ;following sets second piece if msg is to not requeue,
+11 ;but leaves it blank if user had entered "^"
+12 IF INABORT=1
SET $PIECE(INSELECT(INNODE),U,2)=INMSG
End DoDot:2
QUIT
+13 SET INABORT=$$GETPT^INHOU5(1,INREQIEN,.INPRIO,.INTTPROC)
IF INABORT
QUIT
+14 SET $PIECE(INSELECT(INNODE),U,2)=INMSG
+15 DO DOREQ^INHOU1(INREQIEN,INPRIO,INTTPROC)
End DoDot:1
+16 QUIT
GETPT(INHOTOPT,INREQIEN,INPRIO,INTTPROC) ; Prompt for new prior. and time-to-proc.
+1 ; MODULE NAME: GETPT ( acquire the priority and time-to-process msg)
+2 ; DESCRIPTION: Depending on the INHOTOPT parameter, the message prio-
+3 ; ity and time-to-process is returned for the message
+4 ; in ^INTHU(INREQIEN.
+5 ; RETURN = PASS/FAIL (0/2)
+6 ; PARAMETERS:
+7 ; INHOTOPTP = Option selector.
+8 ; INREQIEN = The IEN of the message of interest.
+9 ; INPRIO = (Ref.) The priority is returned here.
+10 ; INTTPROC = (Ref.) The Time-to-Process is returned here.
+11 NEW INQUIT,INABORT
+12 SET INABORT=0
+13 IF INHOTOPT=1
Begin DoDot:1
+14 ; get the priority and time to process from the original message
+15 SET INPRIO=+$PIECE(^INTHU(INREQIEN,0),U,16)
+16 SET INTTPROC=$PIECE(^INTHU(INREQIEN,0),U,19)
+17 IF '$LENGTH(INTTPROC)
SET INTTPROC=$HOROLOG
End DoDot:1
QUIT 0
+18 ; for option 3 kill the prio and ttproc and use option 2 to get
+19 IF INHOTOPT=3
KILL INPRIO,INTTPROC
SET (INPRIO,INTTPROC)=""
+20 ; for option 2 prompt for input only if prio and ttproc are not defined
+21 IF INHOTOPT=2!(INHOTOPT=3)
Begin DoDot:1
+22 DO CLEAR^DW
+23 ; get the priority and time to process from the user on the first
+24 ; pass and then use the passed value from then on.
+25 IF '$GET(INPRIO)!('$GET(INTTPROC))
Begin DoDot:2
+26 SET INQUIT=0
FOR
Begin DoDot:3
+27 IF $GET(INREQIEN)
WRITE "Message:",!,$$INMSGSTR^INHMS2(INREQIEN)
+28 ; handle initial user input for time-to-process
+29 KILL X
WRITE !
DO ^UTSRD("Time to process: ;;;;NOW;","Enter the Time-to-process the message.")
+30 IF X["^"!(X="")
SET (INQUIT,INABORT)=2
QUIT
+31 SET X=$$CASECONV^UTIL(X,"U")
+32 ; handle the different error/exit conditions
+33 IF X="STAT"
SET INTTPROC="00000,00000"
SET INQUIT=1
QUIT
+34 ; let DT handle all other input checks for time to process
+35 SET %DT="ET"
DO ^%DT
SET INTTPROC=$$CDATF2H^UTDT(Y)
IF Y>-1
SET INQUIT=1
End DoDot:3
IF INQUIT
QUIT
KILL X,Y
+36 IF INABORT
QUIT
+37 SET INPRIO=0
WRITE !
DO ^UTSRD("PRIORITY: ;;;;0;0,10","Enter the New Priority.")
SET INPRIO=+X
+38 IF X["^"!(X="")
SET (INQUIT,INABORT)=2
End DoDot:2
+39 IF INABORT
QUIT
+40 ; default the Priority and Time to Process if STILL not defined
+41 IF 'INPRIO
SET INPRIO=0
IF '$LENGTH(INTTPROC)
SET INTTPROC=$HOROLOG
End DoDot:1
+42 QUIT INABORT