PXRMEXLD ;SLC/PJH - Reminder Dialog Exchange Main Routine. ;04/28/2009
;;2.0;CLINICAL REMINDERS;**4,6,12**;Feb 04, 2005;Build 73
;
START N PXRMBG,PXRMMODE,VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ
S X="IORESET"
D EN^VALM("PXRM EX LIST DIALOG")
;Rebuild Display
D CDISP^PXRMEXLC(PXRMRIEN)
K ^TMP("PXRMEXDGH",$J)
Q
;
ENTRY ; Entry point for List Manager
D FIND Q
;
DETAIL ;Detailed display
S PXRMMODE=0 D DISP(PXRMMODE) Q
;
FIND ;Display findings
S PXRMMODE=2 D DISP(PXRMMODE) Q
;
SUM ;Display dialog summary
S PXRMMODE=3 D DISP(PXRMMODE) Q
;
USE ;Display dialog usage
S PXRMMODE=4 D DISP(PXRMMODE) Q
;
TEXT ;Display dialog text
S PXRMMODE=1 D DISP(PXRMMODE) Q
;
EXIT ;
K ^TMP("PXRMEXLD",$J)
K ^TMP("PXRMEXDGH",$J)
Q
;
DISP(VIEW) ;Build the requested view and display it.
D BLDDISP^PXRMEXDB(VIEW)
;Change header
I VIEW=0 D CHGCAP^VALM("HEADER2","Dialog Details")
I VIEW=1 D CHGCAP^VALM("HEADER2","Dialog Text")
I VIEW=2 D CHGCAP^VALM("HEADER2","Dialog Findings")
I VIEW=3 D CHGCAP^VALM("HEADER2","Dialog Summary")
I VIEW=4 D CHGCAP^VALM("HEADER2","Dialog Usage")
S VALMCNT=^TMP("PXRMEXLD",$J,"VALMCNT"),VALMBG=1,VALMBCK="R"
;Reset protocol
D XQORM
Q
;
HELP ;
N ORU,ORUPRMT,XQORM,PXRMTAG
S PXRMTAG="DLG"
D EN^VALM("PXRM EX DIALOG HELP")
Q
;
HDR ;
S VALMHDR(1)="Packed reminder dialog: "
S VALMHDR(1)=VALMHDR(1)_$G(^TMP("PXRMEXTMP",$J,"PXRMDNAME"))
I $D(^TMP("PXRMEXTMP",$J,"PXRMDNAT")) S VALMHDR(1)=VALMHDR(1)_" [NATIONAL DIALOG]"
S VALMHDR("TITLE")=VALMHDR(1)
S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
Q
;
PEXIT ;PXRM EXCH DIALOG MENU protocol exit code
S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
;Reset after page up/down etc
D XQORM
Q
;
VALID(STRING) ;Validate sequence numbers
N CNT,FOUND,OK
S FOUND=0,OK=1
F CNT=1:1 S SEL=$P(STRING,",",CNT) Q:'SEL D
.;Invalid selection
.I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D Q
..S OK=0 W $C(7),!,SEL_" is not a valid item number." H 2
.S FOUND=1
Q:OK&FOUND 1
Q 0
;
XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT DIALOG",0))_U_"1:"_VALMCNT
S XQORM("A")="Select Action: "
Q
;
XSEL ;PXRM EXCH SELECT DIALOG validation
N ALL,CNT,ERR,IEN,IND,NAME,PXRMDONE,SELECT,SEL
S ALL="",PXRMDONE=0,PXRMBG=$G(VALMBG)
;Invalid selection
S SELECT=$P(XQORNOD(0),"=",2) I '$$VALID(SELECT) S VALMBCK="R" Q
;
;Sort the SELECTION into reverse order
D ORDER^PXRMEXLC(.SELECT,-1)
;
;Lock the file
I '$$LOCK^PXRMEXID S VALMBCK="R" Q
;
S NAME=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAME"))
;Install dialog component(s)
S CNT=0
F CNT=1:1 S SEL=$P(SELECT,",",CNT) Q:'SEL D Q:PXRMDONE
.D INSCOM^PXRMEXID(NAME,SEL,0)
;
;Unlock file
D UNLOCK^PXRMEXID
;
;Rebuild Workfile
D DISP^PXRMEXLD(PXRMMODE)
;
;Refresh
S VALMBCK="R" I $D(PXRMBG) S VALMBG=PXRMBG
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMEXLD 2899 printed Oct 16, 2024@17:45:55 Page 2
PXRMEXLD ;SLC/PJH - Reminder Dialog Exchange Main Routine. ;04/28/2009
+1 ;;2.0;CLINICAL REMINDERS;**4,6,12**;Feb 04, 2005;Build 73
+2 ;
START NEW PXRMBG,PXRMMODE,VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ
+1 SET X="IORESET"
+2 DO EN^VALM("PXRM EX LIST DIALOG")
+3 ;Rebuild Display
+4 DO CDISP^PXRMEXLC(PXRMRIEN)
+5 KILL ^TMP("PXRMEXDGH",$JOB)
+6 QUIT
+7 ;
ENTRY ; Entry point for List Manager
+1 DO FIND
QUIT
+2 ;
DETAIL ;Detailed display
+1 SET PXRMMODE=0
DO DISP(PXRMMODE)
QUIT
+2 ;
FIND ;Display findings
+1 SET PXRMMODE=2
DO DISP(PXRMMODE)
QUIT
+2 ;
SUM ;Display dialog summary
+1 SET PXRMMODE=3
DO DISP(PXRMMODE)
QUIT
+2 ;
USE ;Display dialog usage
+1 SET PXRMMODE=4
DO DISP(PXRMMODE)
QUIT
+2 ;
TEXT ;Display dialog text
+1 SET PXRMMODE=1
DO DISP(PXRMMODE)
QUIT
+2 ;
EXIT ;
+1 KILL ^TMP("PXRMEXLD",$JOB)
+2 KILL ^TMP("PXRMEXDGH",$JOB)
+3 QUIT
+4 ;
DISP(VIEW) ;Build the requested view and display it.
+1 DO BLDDISP^PXRMEXDB(VIEW)
+2 ;Change header
+3 IF VIEW=0
DO CHGCAP^VALM("HEADER2","Dialog Details")
+4 IF VIEW=1
DO CHGCAP^VALM("HEADER2","Dialog Text")
+5 IF VIEW=2
DO CHGCAP^VALM("HEADER2","Dialog Findings")
+6 IF VIEW=3
DO CHGCAP^VALM("HEADER2","Dialog Summary")
+7 IF VIEW=4
DO CHGCAP^VALM("HEADER2","Dialog Usage")
+8 SET VALMCNT=^TMP("PXRMEXLD",$JOB,"VALMCNT")
SET VALMBG=1
SET VALMBCK="R"
+9 ;Reset protocol
+10 DO XQORM
+11 QUIT
+12 ;
HELP ;
+1 NEW ORU,ORUPRMT,XQORM,PXRMTAG
+2 SET PXRMTAG="DLG"
+3 DO EN^VALM("PXRM EX DIALOG HELP")
+4 QUIT
+5 ;
HDR ;
+1 SET VALMHDR(1)="Packed reminder dialog: "
+2 SET VALMHDR(1)=VALMHDR(1)_$GET(^TMP("PXRMEXTMP",$JOB,"PXRMDNAME"))
+3 IF $DATA(^TMP("PXRMEXTMP",$JOB,"PXRMDNAT"))
SET VALMHDR(1)=VALMHDR(1)_" [NATIONAL DIALOG]"
+4 SET VALMHDR("TITLE")=VALMHDR(1)
+5 SET VALMSG="+ Next Screen - Prev Screen ?? More Actions"
+6 QUIT
+7 ;
PEXIT ;PXRM EXCH DIALOG MENU protocol exit code
+1 SET VALMSG="+ Next Screen - Prev Screen ?? More Actions"
+2 ;Reset after page up/down etc
+3 DO XQORM
+4 QUIT
+5 ;
VALID(STRING) ;Validate sequence numbers
+1 NEW CNT,FOUND,OK
+2 SET FOUND=0
SET OK=1
+3 FOR CNT=1:1
SET SEL=$PIECE(STRING,",",CNT)
if 'SEL
QUIT
Begin DoDot:1
+4 ;Invalid selection
+5 IF ('SEL)!(SEL>VALMCNT)!('$DATA(@VALMAR@("SEL",SEL)))
Begin DoDot:2
+6 SET OK=0
WRITE $CHAR(7),!,SEL_" is not a valid item number."
HANG 2
End DoDot:2
QUIT
+7 SET FOUND=1
End DoDot:1
+8 if OK&FOUND
QUIT 1
+9 QUIT 0
+10 ;
XQORM SET XQORM("#")=$ORDER(^ORD(101,"B","PXRM EXCH SELECT DIALOG",0))_U_"1:"_VALMCNT
+1 SET XQORM("A")="Select Action: "
+2 QUIT
+3 ;
XSEL ;PXRM EXCH SELECT DIALOG validation
+1 NEW ALL,CNT,ERR,IEN,IND,NAME,PXRMDONE,SELECT,SEL
+2 SET ALL=""
SET PXRMDONE=0
SET PXRMBG=$GET(VALMBG)
+3 ;Invalid selection
+4 SET SELECT=$PIECE(XQORNOD(0),"=",2)
IF '$$VALID(SELECT)
SET VALMBCK="R"
QUIT
+5 ;
+6 ;Sort the SELECTION into reverse order
+7 DO ORDER^PXRMEXLC(.SELECT,-1)
+8 ;
+9 ;Lock the file
+10 IF '$$LOCK^PXRMEXID
SET VALMBCK="R"
QUIT
+11 ;
+12 SET NAME=$GET(^TMP("PXRMEXTMP",$JOB,"PXRMDNAME"))
+13 ;Install dialog component(s)
+14 SET CNT=0
+15 FOR CNT=1:1
SET SEL=$PIECE(SELECT,",",CNT)
if 'SEL
QUIT
Begin DoDot:1
+16 DO INSCOM^PXRMEXID(NAME,SEL,0)
End DoDot:1
if PXRMDONE
QUIT
+17 ;
+18 ;Unlock file
+19 DO UNLOCK^PXRMEXID
+20 ;
+21 ;Rebuild Workfile
+22 DO DISP^PXRMEXLD(PXRMMODE)
+23 ;
+24 ;Refresh
+25 SET VALMBCK="R"
IF $DATA(PXRMBG)
SET VALMBG=PXRMBG
+26 QUIT