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

KMPVLM.m

Go to the documentation of this file.
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
 ;