HLCSRE1 ;ALB/MFK - UTILITIES FOR HL7 MESSAGE REQUEUER; 08-JUN-1995
;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
SELECT(MODE) ;
; MODE=0 FOR DESELECT
; MODE=1 (DEFAULT) FOR SELECT
S:('$D(MODE)) MODE=1
; -- find out list of selected
D EN^VALM2(XQORNOD(0))
I ('$D(VALMY)) S VALMBCK="" Q
S LINE=""
F S LINE=$O(VALMY(LINE)) Q:(LINE="") D
.; -- select lines
.S STAR=$S(MODE=0:" ",1:" *")
.S ROW=STAR_$E($G(^TMP("HL","MESSAGE",$J,LINE,0)),3,245)
.S ^TMP("HL","MESSAGE",$J,LINE,0)=ROW
.D SELECT^VALM10(LINE,MODE)
.S ENTRY=$O(^TMP("HL","MESSAGE",$J,"B",LINE,""))
.S ^TMP("HL","MESSAGE",$J,"B",LINE,ENTRY)=MODE
S VALMBCK=""
K MODE,ROW,STAR
Q
EXIT ; -- exit code for HL7 REQUEUE MESSAGE
; -- compile list of messages to requeue
N DIR,LINE,ENTRY,DIRUT,Y,X
S LINE=""
F S LINE=$O(^TMP("HL","MESSAGE",$J,"B",LINE)) Q:(LINE="") D
.S ENTRY=""
.F S ENTRY=$O(^TMP("HL","MESSAGE",$J,"B",LINE,ENTRY)) Q:(ENTRY="") D
..I (^TMP("HL","MESSAGE",$J,"B",LINE,ENTRY)=1) S MSG(MATCH,ENTRY)=""
I $D(MSG) D
.D FULL^VALM1
.S DIR(0)="Y",DIR("B")="YES",DIR("A")="Re-queue these messages?"
.S DIR("?")="Select ""YES"" to re-queue, or ""NO"" to quit without re-queueing."
.D ^DIR Q:$D(DIRUT)
.I Y=1 D REPMSG^HLCSREP
K ^TMP("HL","MESSAGE",$J),MATCH,MSG
S VALMBCK="R"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLCSRE1 1306 printed Oct 16, 2024@17:57:41 Page 2
HLCSRE1 ;ALB/MFK - UTILITIES FOR HL7 MESSAGE REQUEUER; 08-JUN-1995
+1 ;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
SELECT(MODE) ;
+1 ; MODE=0 FOR DESELECT
+2 ; MODE=1 (DEFAULT) FOR SELECT
+3 if ('$DATA(MODE))
SET MODE=1
+4 ; -- find out list of selected
+5 DO EN^VALM2(XQORNOD(0))
+6 IF ('$DATA(VALMY))
SET VALMBCK=""
QUIT
+7 SET LINE=""
+8 FOR
SET LINE=$ORDER(VALMY(LINE))
if (LINE="")
QUIT
Begin DoDot:1
+9 ; -- select lines
+10 SET STAR=$SELECT(MODE=0:" ",1:" *")
+11 SET ROW=STAR_$EXTRACT($GET(^TMP("HL","MESSAGE",$JOB,LINE,0)),3,245)
+12 SET ^TMP("HL","MESSAGE",$JOB,LINE,0)=ROW
+13 DO SELECT^VALM10(LINE,MODE)
+14 SET ENTRY=$ORDER(^TMP("HL","MESSAGE",$JOB,"B",LINE,""))
+15 SET ^TMP("HL","MESSAGE",$JOB,"B",LINE,ENTRY)=MODE
End DoDot:1
+16 SET VALMBCK=""
+17 KILL MODE,ROW,STAR
+18 QUIT
EXIT ; -- exit code for HL7 REQUEUE MESSAGE
+1 ; -- compile list of messages to requeue
+2 NEW DIR,LINE,ENTRY,DIRUT,Y,X
+3 SET LINE=""
+4 FOR
SET LINE=$ORDER(^TMP("HL","MESSAGE",$JOB,"B",LINE))
if (LINE="")
QUIT
Begin DoDot:1
+5 SET ENTRY=""
+6 FOR
SET ENTRY=$ORDER(^TMP("HL","MESSAGE",$JOB,"B",LINE,ENTRY))
if (ENTRY="")
QUIT
Begin DoDot:2
+7 IF (^TMP("HL","MESSAGE",$JOB,"B",LINE,ENTRY)=1)
SET MSG(MATCH,ENTRY)=""
End DoDot:2
End DoDot:1
+8 IF $DATA(MSG)
Begin DoDot:1
+9 DO FULL^VALM1
+10 SET DIR(0)="Y"
SET DIR("B")="YES"
SET DIR("A")="Re-queue these messages?"
+11 SET DIR("?")="Select ""YES"" to re-queue, or ""NO"" to quit without re-queueing."
+12 DO ^DIR
if $DATA(DIRUT)
QUIT
+13 IF Y=1
DO REPMSG^HLCSREP
End DoDot:1
+14 KILL ^TMP("HL","MESSAGE",$JOB),MATCH,MSG
+15 SET VALMBCK="R"
+16 QUIT