KMPVLM ;SP/JML - VSM List Manager Functions ;6/1/2020
;;4.0;CAPACITY MANAGEMENT;**1**;3/1/2018;Build 27
;
; Integration Agreements
; Reference to $$SITE^VASITE supported by ICR #10112
;
EN ; Main entry point for VSM MANAGEMENT menu option
D EN^VALM("KMPV MANAGEMENT")
Q
;
HDR ; Header code
N KMPVHEAD,KMPVKEY,KMPVLN,KMPVML,KMPVMNUM,KMPVMSTR
D MONLIST^KMPVCBG(.KMPVML)
S KMPVLN=0
S VALMHDR(KMPVLN)="",KMPVLN=KMPVLN+1
S KMPVHEAD="VistA System Monitor(VSM) -- Status and Configuration"
S KMPVMNUM=(VALMWD-$L(KMPVHEAD))/2,$P(KMPVMSTR," ",KMPVMNUM)=""
S VALMHDR(KMPVLN)="",KMPVLN=KMPVLN+1
S VALMHDR(KMPVLN)="",KMPVLN=KMPVLN+1
S VALMHDR(KMPVLN)=KMPVMSTR_KMPVHEAD,KMPVLN=KMPVLN+1
S VALMHDR(KMPVLN)="",KMPVLN=KMPVLN+1
Q
S KMPVKEY=0
F S KMPVKEY=$O(KMPVML(KMPVKEY)) Q:KMPVKEY="" D
.S VALMHDR(KMPVLN)=KMPVKEY_": "_KMPVML(KMPVKEY),KMPVLN=KMPVLN+1
Q
;
INIT ; Initialize variables and list array
D BUILD
Q
;
BUILD ; Build array with collector status information
N KMPMNAME,KMPVCOMP,KMPVDLY,KMPVMKEY,KMPVNEXT,KMPVSTAT,KMPVTCNT,KMPVTSK,KMPVX
;
S VALMCNT=0
D MONSTAT^KMPVCCFG(.KMPVSTAT)
S KMPVMKEY=""
F S KMPVMKEY=$O(KMPVSTAT(KMPVMKEY)) Q:KMPVMKEY="" D
.S VALMCNT=VALMCNT+1
.S KMPVX=""
.S KMPMNAME=KMPVMKEY_": "_KMPVSTAT(KMPVMKEY)
.S KMPVX=$$SETFLD^VALM1(KMPMNAME,KMPVX,"Monitor")
.S KMPVX=$$SETFLD^VALM1($G(KMPVSTAT(KMPVMKEY,"ONOFF")),KMPVX,"Status")
.S KMPVX=$$SETFLD^VALM1($G(KMPVSTAT(KMPVMKEY,"RETRY")),KMPVX,"Days Not Sent")
.S KMPVX=$$SETFLD^VALM1($G(KMPVSTAT(KMPVMKEY,"VERSION")),KMPVX,"Version")
.D SET^VALM10(VALMCNT,KMPVX,VALMCNT)
.D RESTORE^VALM10(VALMCNT)
Q
;
STARTMON ; Supports List Manager protocol 'STRT Start Monitor'
N KMPVMON
S KMPVMON=$$PICKMON()
I KMPVMON'=-1 D STARTMON^KMPVCBG($P(KMPVMON,"^",2))
D REFRESH
Q
;
STOPMON ; Supports List Manager protocol 'STOP Stop Monitor'
N KMPVMON
S KMPVMON=$$PICKMON()
I KMPVMON'=-1 D STOPMON^KMPVCBG($P(KMPVMON,"^",2))
D REFRESH
Q
;
TESTSYS ;
N KMPVMON
S KMPVMON=$$PICKMON()
I KMPVMON'=-1 D ALLOW^KMPVCBG($P(KMPVMON,"^",2))
D REFRESH
Q
;
CONTACT ;
N DIR,KMPEMAIL
S KMPEMAIL=$$GETVAL^KMPVCCFG("VTCM","NATIONAL SUPPORT EMAIL ADDRESS",8969)
N DIR S DIR(0)="E"
S DIR("A",3)="Email '"_KMPEMAIL_"' for VSM information.",DIR("A")="Press any key to continue"
D ^DIR
D REFRESH
Q
;
VIEWCFG ; Supports List Manager protocol 'VIEW View CFG'
N KMPVMON,KMPVMDA
N DDSFILE,DR,DA
;
S KMPVMON=$$PICKMON()
I KMPVMON>0 D
.S DDSFILE=8969,DR="[KMPV VIEW CONFIGURATION]",DA=+KMPVMON
.D ^DDS
D REFRESH
Q
;
EDITCFG ; Supports List Manager protocol 'EDIT Edit CFG'
; TO BE DEPRICATED - EDIT REMOVED FROM SCREEN
N KMPVMON,KMPVMDA,KMPVMKEY,KMPVOLD,KMPVNEW,KMPVFNAM,KMPVSET
N DDSFILE,DR,DA
;
S KMPVMON=$$PICKMON()
S KMPVMDA=+KMPVMON,KMPVMKEY=$P(KMPVMON,"^",2)
I KMPVMDA>0 D
.D CFGARR^KMPVCCFG(KMPVMKEY,.KMPVOLD)
.S DDSFILE=8969,DR="[KMPV EDIT CONFIGURATION]",DA=+KMPVMDA
.D ^DDS
.D CFGARR^KMPVCCFG(KMPVMKEY,.KMPVNEW)
.S KMPVFNAM="",KMPVSET=0
.F S KMPVFNAM=$O(KMPVOLD(KMPVFNAM)) Q:KMPVFNAM="" D
..I KMPVOLD(KMPVFNAM)'=$G(KMPVNEW(KMPVFNAM)) S KMPVSET=1
.I KMPVSET>0 D CFGMSG^KMPUTLW()
D REFRESH
Q
;
RESTCFG ; Supports List Manager protocol 'REST Restore CFG'
N KMPVMKEY,KMPVSTAT
S KMPVMON=$$PICKMON()
I KMPVMON>0 D
.S KMPVMKEY=$P(KMPVMON,"^",2)
.D CFGARR^KMPVCCFG(KMPVMKEY,.KMPVOLD)
.S KMPVSTAT=$$RESTCFG^KMPVCCFG(KMPVMKEY)
D REFRESH
Q
;
KILL(KMPVMKEY) ; Supports List Manager protocol 'DEL Delete Data
; Emergency KILL of all data for a given monitor
N DIR,DTOUT,DUOUT,KMPVERR,KMPVLN,KMPVMKEY,KMPVMON,KMPVSITE,Y,%
;
S KMPVMON=$$PICKMON()
S KMPVMKEY=$P(KMPVMON,"^",2)
W ! K DIR S DIR(0)="Y",DIR("B")="NO"
S DIR("?")="Answer YES to KILL all "_KMPVMKEY_" data."
S DIR("A")="Do you want to KILL all local "_KMPVMKEY_" data?"
S DIR("A",1)="This option is for emergency use only."
S DIR("A",2)="Data will be permanently DELETED and "_KMPVMKEY_" monitor will be STOPPED"
D ^DIR Q:$D(DTOUT)!$D(DUOUT)
I Y D
.K DIR
.K ^KMPTMP("KMPV",KMPVMKEY)
.D NOW^%DTC
.S KMPVSITE=$$SITE^VASITE($P(%,".")) ;IA 10112
.D CANMSG^KMPUTLW("KILL",KMPVMKEY,KMPVSITE,"") ; IA 10112
.D STOPMON^KMPVCBG(KMPVMKEY,1)
D REFRESH
Q
;
PICKMON() ; Supports selection of Monitor Type for List Manager functions
N DIC,Y
W !
S DIC=8969,DIC(0)="QEA"
S DIC("A")="Choose Monitor Type: "
D ^DIC
Q Y
;
REFRESH ; Refresh display
DO BUILD
SET VALMBCK="R"
QUIT
;
HELP ; Help code
N X
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; Exit code
Q
;
EXPND ; Expand code
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPVLM 4641 printed Dec 13, 2024@01:42:02 Page 2
KMPVLM ;SP/JML - VSM List Manager Functions ;6/1/2020
+1 ;;4.0;CAPACITY MANAGEMENT;**1**;3/1/2018;Build 27
+2 ;
+3 ; Integration Agreements
+4 ; Reference to $$SITE^VASITE supported by ICR #10112
+5 ;
EN ; Main entry point for VSM MANAGEMENT menu option
+1 DO EN^VALM("KMPV MANAGEMENT")
+2 QUIT
+3 ;
HDR ; Header code
+1 NEW KMPVHEAD,KMPVKEY,KMPVLN,KMPVML,KMPVMNUM,KMPVMSTR
+2 DO MONLIST^KMPVCBG(.KMPVML)
+3 SET KMPVLN=0
+4 SET VALMHDR(KMPVLN)=""
SET KMPVLN=KMPVLN+1
+5 SET KMPVHEAD="VistA System Monitor(VSM) -- Status and Configuration"
+6 SET KMPVMNUM=(VALMWD-$LENGTH(KMPVHEAD))/2
SET $PIECE(KMPVMSTR," ",KMPVMNUM)=""
+7 SET VALMHDR(KMPVLN)=""
SET KMPVLN=KMPVLN+1
+8 SET VALMHDR(KMPVLN)=""
SET KMPVLN=KMPVLN+1
+9 SET VALMHDR(KMPVLN)=KMPVMSTR_KMPVHEAD
SET KMPVLN=KMPVLN+1
+10 SET VALMHDR(KMPVLN)=""
SET KMPVLN=KMPVLN+1
+11 QUIT
+12 SET KMPVKEY=0
+13 FOR
SET KMPVKEY=$ORDER(KMPVML(KMPVKEY))
if KMPVKEY=""
QUIT
Begin DoDot:1
+14 SET VALMHDR(KMPVLN)=KMPVKEY_": "_KMPVML(KMPVKEY)
SET KMPVLN=KMPVLN+1
End DoDot:1
+15 QUIT
+16 ;
INIT ; Initialize variables and list array
+1 DO BUILD
+2 QUIT
+3 ;
BUILD ; Build array with collector status information
+1 NEW KMPMNAME,KMPVCOMP,KMPVDLY,KMPVMKEY,KMPVNEXT,KMPVSTAT,KMPVTCNT,KMPVTSK,KMPVX
+2 ;
+3 SET VALMCNT=0
+4 DO MONSTAT^KMPVCCFG(.KMPVSTAT)
+5 SET KMPVMKEY=""
+6 FOR
SET KMPVMKEY=$ORDER(KMPVSTAT(KMPVMKEY))
if KMPVMKEY=""
QUIT
Begin DoDot:1
+7 SET VALMCNT=VALMCNT+1
+8 SET KMPVX=""
+9 SET KMPMNAME=KMPVMKEY_": "_KMPVSTAT(KMPVMKEY)
+10 SET KMPVX=$$SETFLD^VALM1(KMPMNAME,KMPVX,"Monitor")
+11 SET KMPVX=$$SETFLD^VALM1($GET(KMPVSTAT(KMPVMKEY,"ONOFF")),KMPVX,"Status")
+12 SET KMPVX=$$SETFLD^VALM1($GET(KMPVSTAT(KMPVMKEY,"RETRY")),KMPVX,"Days Not Sent")
+13 SET KMPVX=$$SETFLD^VALM1($GET(KMPVSTAT(KMPVMKEY,"VERSION")),KMPVX,"Version")
+14 DO SET^VALM10(VALMCNT,KMPVX,VALMCNT)
+15 DO RESTORE^VALM10(VALMCNT)
End DoDot:1
+16 QUIT
+17 ;
STARTMON ; Supports List Manager protocol 'STRT Start Monitor'
+1 NEW KMPVMON
+2 SET KMPVMON=$$PICKMON()
+3 IF KMPVMON'=-1
DO STARTMON^KMPVCBG($PIECE(KMPVMON,"^",2))
+4 DO REFRESH
+5 QUIT
+6 ;
STOPMON ; Supports List Manager protocol 'STOP Stop Monitor'
+1 NEW KMPVMON
+2 SET KMPVMON=$$PICKMON()
+3 IF KMPVMON'=-1
DO STOPMON^KMPVCBG($PIECE(KMPVMON,"^",2))
+4 DO REFRESH
+5 QUIT
+6 ;
TESTSYS ;
+1 NEW KMPVMON
+2 SET KMPVMON=$$PICKMON()
+3 IF KMPVMON'=-1
DO ALLOW^KMPVCBG($PIECE(KMPVMON,"^",2))
+4 DO REFRESH
+5 QUIT
+6 ;
CONTACT ;
+1 NEW DIR,KMPEMAIL
+2 SET KMPEMAIL=$$GETVAL^KMPVCCFG("VTCM","NATIONAL SUPPORT EMAIL ADDRESS",8969)
+3 NEW DIR
SET DIR(0)="E"
+4 SET DIR("A",3)="Email '"_KMPEMAIL_"' for VSM information."
SET DIR("A")="Press any key to continue"
+5 DO ^DIR
+6 DO REFRESH
+7 QUIT
+8 ;
VIEWCFG ; Supports List Manager protocol 'VIEW View CFG'
+1 NEW KMPVMON,KMPVMDA
+2 NEW DDSFILE,DR,DA
+3 ;
+4 SET KMPVMON=$$PICKMON()
+5 IF KMPVMON>0
Begin DoDot:1
+6 SET DDSFILE=8969
SET DR="[KMPV VIEW CONFIGURATION]"
SET DA=+KMPVMON
+7 DO ^DDS
End DoDot:1
+8 DO REFRESH
+9 QUIT
+10 ;
EDITCFG ; Supports List Manager protocol 'EDIT Edit CFG'
+1 ; TO BE DEPRICATED - EDIT REMOVED FROM SCREEN
+2 NEW KMPVMON,KMPVMDA,KMPVMKEY,KMPVOLD,KMPVNEW,KMPVFNAM,KMPVSET
+3 NEW DDSFILE,DR,DA
+4 ;
+5 SET KMPVMON=$$PICKMON()
+6 SET KMPVMDA=+KMPVMON
SET KMPVMKEY=$PIECE(KMPVMON,"^",2)
+7 IF KMPVMDA>0
Begin DoDot:1
+8 DO CFGARR^KMPVCCFG(KMPVMKEY,.KMPVOLD)
+9 SET DDSFILE=8969
SET DR="[KMPV EDIT CONFIGURATION]"
SET DA=+KMPVMDA
+10 DO ^DDS
+11 DO CFGARR^KMPVCCFG(KMPVMKEY,.KMPVNEW)
+12 SET KMPVFNAM=""
SET KMPVSET=0
+13 FOR
SET KMPVFNAM=$ORDER(KMPVOLD(KMPVFNAM))
if KMPVFNAM=""
QUIT
Begin DoDot:2
+14 IF KMPVOLD(KMPVFNAM)'=$GET(KMPVNEW(KMPVFNAM))
SET KMPVSET=1
End DoDot:2
+15 IF KMPVSET>0
DO CFGMSG^KMPUTLW()
End DoDot:1
+16 DO REFRESH
+17 QUIT
+18 ;
RESTCFG ; Supports List Manager protocol 'REST Restore CFG'
+1 NEW KMPVMKEY,KMPVSTAT
+2 SET KMPVMON=$$PICKMON()
+3 IF KMPVMON>0
Begin DoDot:1
+4 SET KMPVMKEY=$PIECE(KMPVMON,"^",2)
+5 DO CFGARR^KMPVCCFG(KMPVMKEY,.KMPVOLD)
+6 SET KMPVSTAT=$$RESTCFG^KMPVCCFG(KMPVMKEY)
End DoDot:1
+7 DO REFRESH
+8 QUIT
+9 ;
KILL(KMPVMKEY) ; Supports List Manager protocol 'DEL Delete Data
+1 ; Emergency KILL of all data for a given monitor
+2 NEW DIR,DTOUT,DUOUT,KMPVERR,KMPVLN,KMPVMKEY,KMPVMON,KMPVSITE,Y,%
+3 ;
+4 SET KMPVMON=$$PICKMON()
+5 SET KMPVMKEY=$PIECE(KMPVMON,"^",2)
+6 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("B")="NO"
+7 SET DIR("?")="Answer YES to KILL all "_KMPVMKEY_" data."
+8 SET DIR("A")="Do you want to KILL all local "_KMPVMKEY_" data?"
+9 SET DIR("A",1)="This option is for emergency use only."
+10 SET DIR("A",2)="Data will be permanently DELETED and "_KMPVMKEY_" monitor will be STOPPED"
+11 DO ^DIR
if $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+12 IF Y
Begin DoDot:1
+13 KILL DIR
+14 KILL ^KMPTMP("KMPV",KMPVMKEY)
+15 DO NOW^%DTC
+16 ;IA 10112
SET KMPVSITE=$$SITE^VASITE($PIECE(%,"."))
+17 ; IA 10112
DO CANMSG^KMPUTLW("KILL",KMPVMKEY,KMPVSITE,"")
+18 DO STOPMON^KMPVCBG(KMPVMKEY,1)
End DoDot:1
+19 DO REFRESH
+20 QUIT
+21 ;
PICKMON() ; Supports selection of Monitor Type for List Manager functions
+1 NEW DIC,Y
+2 WRITE !
+3 SET DIC=8969
SET DIC(0)="QEA"
+4 SET DIC("A")="Choose Monitor Type: "
+5 DO ^DIC
+6 QUIT Y
+7 ;
REFRESH ; Refresh display
+1 DO BUILD
+2 SET VALMBCK="R"
+3 QUIT
+4 ;
HELP ; Help code
+1 NEW X
+2 SET X="?"
DO DISP^XQORM1
WRITE !!
+3 QUIT
+4 ;
EXIT ; Exit code
+1 QUIT
+2 ;
EXPND ; Expand code
+1 QUIT
+2 ;