Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: INHOU1

INHOU1.m

Go to the documentation of this file.
  1. INHOU1 ;DJL,DP; 7 Oct 97 12:50;Interface Message Requeue Utilities
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. REQ ;Requeue an Entry for processing
  1. ; MODULE NAME: REQ ( Requeue INH message/s )
  1. ; DESCRIPTION: Prompts the user for a message to requeue. The user may
  1. ; enter any valid indexed message component for a single
  1. ; message requeue or '/' to search and requeue multiple
  1. ; messages. In either case a List will be displayed which
  1. ; allows requeueing THREE different ways. 1)use existing
  1. ; information, 2)use one set of info. for all message to
  1. ; be requeued, or 3) use unique info. for each message.
  1. ; RETURN = none
  1. ; PARAMETERS = none
  1. ;
  1. N X,Y,INQUIT,INDA,INREQLST,INPARM2,DIC,INMSG,DIRI,DIRCP,DLAYGO,INABORT,INCLRT,INQUED,INZ,POP,INCURT,INQUEUED,%ZIS
  1. ; Set up parameter for hot key and List Processor
  1. D SETP2^INHOU1
  1. ;
  1. EN2 ;This is the actual working loop of the routine
  1. S INQUIT=0 F D Q:INQUIT K X,Y
  1. . I '$O(^INTHU(0)) W !!,"There are no entries to requeue." S INQUIT=1 Q
  1. . ; handle initial user input
  1. . K X D CLEAR^DW W !!
  1. . D ^UTSRD("Enter a Message to Requeue: ;;;;;","Terminate:^ or <RETURN>, Search Queue:/, or a Valid Message Component")
  1. . ; handle the different error/exit conditions
  1. . I X="/" S INQUIT=$$TIEN^INHUTC(.INPARM2,"INREQLST") D CLEAR^DW Q
  1. . Q:'$D(X)
  1. . I X="^"!(X="") S INQUIT=$S(X="":1,1:2) Q
  1. . ; let DIC handle all other input checks for single message requeue
  1. . S DIC="^INTHU(",DIC(0)="NMEQ"
  1. . D ^DIC Q:Y<0
  1. . I +Y S INREQLST(1)=+Y,INREQLST(1,0)="" D REQONE^INHOU2(.INREQLST,.INPARM2) S INQUIT=0 Q
  1. D:$D(INDA) INKINDA^INHMS(INDA)
  1. Q
  1. ;
  1. REQ1 ; Requeue an entry for processing
  1. ; Description: REQ1 performs similar functions as REQ in which it
  1. ; allows requeing message in three different ways.
  1. ; However, REQ1 does not prompt user for a message to
  1. ; requeue. Upon enter REQ1, variable Y contains IEN of
  1. ; message to requeue.
  1. ;
  1. ; RETURN = none
  1. ; PARAMETERS = none
  1. ;
  1. N X,INQUIT,INDA,INREQLST,INPARM2,DIC,INMSG,DIRI,DIRCP,DLAYGO,INABORT,INCLRT,INQUED,INZ,POP,INCURT,INQUEUED,%ZIS
  1. ; Set up parameter for hot key and List Processor
  1. D SETP2^INHOU1
  1. ;
  1. EN3 ;This is the actual requeue operation
  1. S INREQLST(1)=+Y,INREQLST(1,0)="" D REQONE^INHOU2(.INREQLST,.INPARM2)
  1. D:$D(INDA) INKINDA^INHMS(INDA)
  1. D CLEAR^DW
  1. Q
  1. ;
  1. SETP2 ; Set up parameter for hot key and List Processor
  1. ; construct the structure defining the requeue operations, etc
  1. S INPARM2("LIST","TITLE")="W ?IOM-$L(""Interface Message Requeue"")/2,""Interface Message Requeue"",!,$$INMSGSTR^INHMS2("""",1,"""")"
  1. ; Create the list processor help text
  1. S INPARM2("LIST","HELP")="N INHELP D BLDHELP^INHOU2(.INHELP),SRCHHELP^INHMS3(.INHELP)"
  1. ; create the HOT KEY structure
  1. S INPARM2("LIST","HOT",1)="EXISTING^H1"
  1. S INPARM2("LIST","HOT",1,"ACTION")="D GOHOT1^INHOU5(.DWLMK,DWLRF),REMQUED^INHOU1(.DWLMK,DWLRF)"
  1. S INPARM2("LIST","HOT",2)="SINGLE^H2"
  1. S INPARM2("LIST","HOT",2,"ACTION")="D GOHOT2^INHOU5(.DWLMK,DWLRF),REMQUED^INHOU1(.DWLMK,DWLRF)"
  1. S INPARM2("LIST","HOT",3)="UNIQUE^H3"
  1. S INPARM2("LIST","HOT",3,"ACTION")="D GOHOT3^INHOU5(.DWLMK,DWLRF),REMQUED^INHOU1(.DWLMK,DWLRF)"
  1. Q
  1. ;
  1. REMQUED(INLIST1,INLIST2) ; remove items in list1 from list1,list2
  1. N INNODE
  1. S %ZIS="" D CLEAR^DW,^%ZIS Q:POP U IO I IO=$P W @IOF
  1. S POP=0
  1. S INNODE="" F S INNODE=$O(INLIST1(INNODE)) Q:'INNODE!POP D
  1. .;if second piece is null, user enter "^". Take no action
  1. .Q:'$L($P(INLIST1(INNODE),U,2))
  1. .I $Y>(IOSL-4) D CONT Q:POP
  1. .W !,$P(INLIST1(INNODE),U,2)
  1. .K INLIST1(INNODE),@INLIST2@(INNODE)
  1. K INLIST1
  1. D CONT
  1. D ^%ZISC S IOP="",%ZIS="" D ^%ZIS U IO K IO("Q"),IOP,POP
  1. Q
  1. ;
  1. CONT I IO=IO(0),$E(IOST)'="P" W ! S X=$$CR^UTSRD I X S POP=1 Q
  1. W @IOF
  1. Q
  1. ;
  1. FINDQUE(INREQIEN,INMSG) ;determines if entry is already on queue
  1. ; If entry is already on queue, prompts user if they want
  1. ; to requeue.
  1. ; INPUT:
  1. ; INREQIEN = IEN of entry being requeued
  1. ; INMSG = (PBR) message that will be displayed back to user at end
  1. ; RETURN = 0 if INREQUIEN is to be requeued
  1. ; 1 if user says "no"
  1. ; 2 if user enters "^"
  1. ;
  1. N INDET,INDEST,INMID,INCURP,INQUE,INQUED,OUT
  1. ; check to see if the message is already queued at the current
  1. ; priority and time-to-process
  1. S INDET=^INTHU(INREQIEN,0)
  1. S INDEST=+$P(INDET,U,2),INMID=$P(INDET,U,5),INCURP=+$P(INDET,U,16),INCURT=$P(INDET,U,19) S:'$L(INCURT) INCURT=+INCURT
  1. ;If requeue is suppressed, quit
  1. I $P(INDET,U,20) S INMSG=INMID_": Requeue of message is not allowed" Q 1
  1. ;Get the primary queue--0=INLHSCH, 1=INLHDEST
  1. S INQUE=+$P($G(^INRHD(INDEST,0)),U,12),OUT=0,INQUEUED=0
  1. ; check if already queued. If on INLHSCH, look there first, but
  1. ; it may have already processed to INLHDEST
  1. F INQUE=INQUE:1:1 I $L(INQUE),$L($T(@INQUE)) D @INQUE Q:INQUEUED
  1. I INQUEUED D CLEAR^DW W !,$$INMSGSTR^INHMS2(INREQIEN) D
  1. .W !!,"Message "_INMID_" is already queued on "_$S(INQUE=0:"^INLHSCH",1:"^INLHDEST")
  1. .W " for "_$$DATEOUT^%ZTFDT(INCURT,"F"),!,"with a priority of "_INCURP_".",!
  1. .S X=$$YN^UTSRD("Do you want to delete existing queue entry and requeue? ;N;")
  1. .S OUT=$S(X["^":2,X=0:1,1:0)
  1. I OUT S INMSG=INMID_": Message not requeued" Q OUT
  1. I INQUEUED D
  1. .;If requeue, kill exiting queue to prevent double entry
  1. .I 'INQUE K ^INLHSCH(INCURP,INCURT,INREQIEN) Q
  1. .K ^INLHDEST(INDEST,INCURP,INCURT,INREQIEN)
  1. S INMSG=INMID_": "_$S(INQUEUED:"Existing queue deleted.",1:""),INMSG=INMSG_" Message requeued"
  1. Q 0
  1. ;
  1. DOREQ(INREQIEN,INPRIO,INTTPROC) ; requeue the transaction
  1. ; MODULE NAME: DOREQ ( Requeue the transaction )
  1. ; DESCRIPTION: Requeues the transaction INREQIEN with the priority and
  1. ; time-to-process passed in INPRIO and INTTPROC
  1. ; RETURN None
  1. ; PARAMETERS:
  1. ; INREQIEN = The message IEN
  1. ; INPRIO = The priority of the message
  1. ; INTTPROC = The time to process the message
  1. ; CODE BEGINS
  1. D SET^INHD(INTTPROC,$P(^INTHU(INREQIEN,0),U,2),INREQIEN,"",INPRIO)
  1. ;Change status to "pending", update activity log
  1. D ULOG^INHU(INREQIEN,"P","Requeued by user "_$P(^DIC(3,DUZ,0),U))
  1. Q
  1. 0 ;
  1. S INQUEUED=$S($D(^INLHSCH(INCURP,INCURT,INREQIEN)):1,1:0)
  1. Q
  1. 1 ;
  1. S INQUEUED=$S($D(^INLHDEST(INDEST,INCURP,INCURT,INREQIEN)):1,1:0)
  1. Q