HLCSQUED ;ALB/MFK - Create and edit #870 entries
;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
EDITQ ; edit or create an entry in a queue
; INPUT: NONE (made to be called from a menu)
; OUTPUT: NONE
N DIR,DIE,DIC,DA,DR,FLAG,HLDIR,LLE,X,Y,HLZ,ENTRY,DTOUT,DUOUT
LINK ;
S DIC="^HLCS(870,"
S DIC(0)="AEMQ"
D ^DIC K DIC
Q:(+Y<0)
S LLE=$P(Y,"^",1)
Q:(LLE=-1)
DIRECT ;
S DIR(0)="S^I:IN QUEUE;O:OUT QUEUE"
S DIR("?")="Select the IN queue or OUT queue (relative to DHCP)"
S DIR("A")="Select queue"
S DIR("B")="I"
D ^DIR K DIR
Q:(+Y<0)!$D(DUOUT)!$D(DTOUT)
S HLDIR=$E(Y,1,1)
S HLDIR=$S(HLDIR="I":1,HLDIR="O":2)
EDCR ;
S DIR(0)="S^C:CREATE;E:EDIT"
S DIR("?")="Select if you want to EDIT or CREATE and entry in a queue"
S DIR("A")="CREATE or EDIT entry"
S DIR("B")="C"
D ^DIR K DIR
S FLAG=$E(Y,1,1)
Q:(FLAG="^")!(FLAG=-1)!$D(DUOUT)!$D(DTOUT)
I FLAG="C" S DA=$$CREATE(LLE,HLDIR)
I FLAG="E" S DA=$$EDIT(LLE,HLDIR)
Q:(DA'>0)
S DIE="^HLCS(870,"_LLE_","_HLDIR_","
S DR="3;1;2"
W !,"Editing entry number: "_DA,!
D ^DIE K DIE
Q
CREATE(LLE,HLDIR) ;
S ENTRY=$$ENQUEUE^HLCSQUE(LLE,HLDIR)
S ENTRY=$P(ENTRY,"^",2)
Q ENTRY
EDIT(LLE,HLDIR) ;
N ENTRY
S ENTRY=$O(^HLCS(870,LLE,HLDIR,0))
I ENTRY'>0 W !,"No Entries in this Queue !" G EXED
S DIC="^HLCS(870,"_LLE_","_HLDIR_","
S DIC(0)="AEQM"
D ^DIC K DIC
S ENTRY=$P(Y,"^",1)
EXED Q ENTRY
EDIT2 ; Create/edit a queue in file #870
; The previous routine created an entry in the queue. This
; routine actually creates that queue.
; INPUT: NONE (Made to be called from a menu)
; OUTPUT: NONE
N DIC,DA,LLE,DR,DIE,X,Y
S DIC="^HLCS(870,"
S DIC(0)="AEMQL"
D ^DIC K DIC
Q:(+Y<0)
S LLE=$P(Y,"^",1)
S DR=".01;1;2;21;17;12;13;13.1;15;16"
S DA=LLE
S DIE="^HLCS(870,"
D ^DIE K DIE
Q
HLCSQUED ;ALB/MFK - Create and edit #870 entries
+1 ;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
EDITQ ; edit or create an entry in a queue
+1 ; INPUT: NONE (made to be called from a menu)
+2 ; OUTPUT: NONE
+3 NEW DIR,DIE,DIC,DA,DR,FLAG,HLDIR,LLE,X,Y,HLZ,ENTRY,DTOUT,DUOUT
LINK ;
+1 SET DIC="^HLCS(870,"
+2 SET DIC(0)="AEMQ"
+3 DO ^DIC
KILL DIC
+4 IF (+Y<0)
QUIT
+5 SET LLE=$PIECE(Y,"^",1)
+6 IF (LLE=-1)
QUIT
DIRECT ;
+1 SET DIR(0)="S^I:IN QUEUE;O:OUT QUEUE"
+2 SET DIR("?")="Select the IN queue or OUT queue (relative to DHCP)"
+3 SET DIR("A")="Select queue"
+4 SET DIR("B")="I"
+5 DO ^DIR
KILL DIR
+6 IF (+Y<0)!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+7 SET HLDIR=$EXTRACT(Y,1,1)
+8 SET HLDIR=$SELECT(HLDIR="I":1,HLDIR="O":2)
EDCR ;
+1 SET DIR(0)="S^C:CREATE;E:EDIT"
+2 SET DIR("?")="Select if you want to EDIT or CREATE and entry in a queue"
+3 SET DIR("A")="CREATE or EDIT entry"
+4 SET DIR("B")="C"
+5 DO ^DIR
KILL DIR
+6 SET FLAG=$EXTRACT(Y,1,1)
+7 IF (FLAG="^")!(FLAG=-1)!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+8 IF FLAG="C"
SET DA=$$CREATE(LLE,HLDIR)
+9 IF FLAG="E"
SET DA=$$EDIT(LLE,HLDIR)
+10 IF (DA'>0)
QUIT
+11 SET DIE="^HLCS(870,"_LLE_","_HLDIR_","
+12 SET DR="3;1;2"
+13 WRITE !,"Editing entry number: "_DA,!
+14 DO ^DIE
KILL DIE
+15 QUIT
CREATE(LLE,HLDIR) ;
+1 SET ENTRY=$$ENQUEUE^HLCSQUE(LLE,HLDIR)
+2 SET ENTRY=$PIECE(ENTRY,"^",2)
+3 QUIT ENTRY
EDIT(LLE,HLDIR) ;
+1 NEW ENTRY
+2 SET ENTRY=$ORDER(^HLCS(870,LLE,HLDIR,0))
+3 IF ENTRY'>0
WRITE !,"No Entries in this Queue !"
GOTO EXED
+4 SET DIC="^HLCS(870,"_LLE_","_HLDIR_","
+5 SET DIC(0)="AEQM"
+6 DO ^DIC
KILL DIC
+7 SET ENTRY=$PIECE(Y,"^",1)
EXED QUIT ENTRY
EDIT2 ; Create/edit a queue in file #870
+1 ; The previous routine created an entry in the queue. This
+2 ; routine actually creates that queue.
+3 ; INPUT: NONE (Made to be called from a menu)
+4 ; OUTPUT: NONE
+5 NEW DIC,DA,LLE,DR,DIE,X,Y
+6 SET DIC="^HLCS(870,"
+7 SET DIC(0)="AEMQL"
+8 DO ^DIC
KILL DIC
+9 IF (+Y<0)
QUIT
+10 SET LLE=$PIECE(Y,"^",1)
+11 SET DR=".01;1;2;21;17;12;13;13.1;15;16"
+12 SET DA=LLE
+13 SET DIE="^HLCS(870,"
+14 DO ^DIE
KILL DIE
+15 QUIT