- KMPSUTL ;OAK/KAK/JML - SAGG Utilities ;9/1/2015
- ;;2.0;SAGG PROJECT;**1**;Jul 02, 2007;Build 67
- ;
- CURSTAT(STAT) ;-- current status
- ;---------------------------------------------------------------------
- ; input: STAT (optional) = data from $$TSKSTAT^KMPSUTL1
- ; output: See codes below
- ;---------------------------------------------------------------------
- ;
- N RESULT,SITNUM,STRTDT
- ;
- S RESULT="",SITNUM=^DD("SITE",1),STRTDT=$G(^XTMP("KMPS",SITNUM,0))
- ;
- I $D(^XTMP("KMPS","ERROR")) Q "6^ERRORS RECORDED"
- I $D(^XTMP("KMPS","STOP")) Q "7^STOPPING"
- I $D(^XTMP("KMPS","START")) L +^XTMP("KMPS"):0 I $T L -^XTMP("KMPS") Q "5^DID NOT COMPLETE"
- I +STRTDT I +$H-STRTDT>2 Q "5^DID NOT COMPLETE"
- I +STRTDT I +$H-STRTDT>1 Q "4^RUNNING TOO LONG"
- I $D(^XTMP("KMPS","START")) Q "0^RUNNING"
- I $D(STAT) Q $P(STAT,U,1,2)
- E Q "3^NOT RUNNING"
- Q "9^UNKNOWN"
- ;
- STOP ;-- stop SAGG collection routines
- ;
- N DIR,X,Y
- ;
- I '$D(^XTMP("KMPS","START")) D Q
- .W !!,?5,"The SAGG Project collection routines are not running.",!
- E W !!,"Current status of SAGG is ",$P($$CURSTAT(),U,2),!
- S DIR("A")="Do you wish to manually STOP the SAGG Project collection routines (Y/N)",DIR("B")="N",DIR(0)="Y"
- D ^DIR W !
- I Y D
- .S ^XTMP("KMPS","STOP")=1
- .W !,?5,"The SAGG Project collection routines have been notified to begin an"
- .W !,?5,"orderly shut-down process.",!
- Q
- ;
- FILE ;-- modifies data in the SAGG PROJECT file #8970.1
- ;
- N DA,DIC,DIE,DLAYGO,DR,PLTFRM,X
- ;
- S PLTFRM=$$MPLTF^KMPSUTL1
- W !!,"Specify the Directories"
- W " which hold your VistA production globals.",!!,"For example:",!!,?5
- I PLTFRM="CWINNT" W "Cache for Windows NT => W:\VAA, W:\VBB, W:\VCC ... V:\Vxx"
- I PLTFRM="CVMS" W "Cache for OpenVMS => _$1$DKAn:[CACHSYS.VAA] ... _$1$DKAx:[CACHSYS.Vxx]"
- I PLTFRM="UNK" W "Specify all locations of VistA globals"
- W !!,"Do NOT specify 'test/training' Directories, (i.e., UTL,TST, etc.).",!
- S DIE="^KMPS(8970.1,",DA=1,DR=.03
- S:PLTFRM'="DSM" DR(2,8970.11)=.01
- D ^DIE
- ;
- Q
- ;
- HELP ;-- extended help for SAGG PROJECT file VOLUME SET TO MONITOR (.01) field
- ;
- N PLTFRM
- ;
- S PLTFRM=$$MPLTF^KMPSUTL1 Q:PLTFRM="UNK"
- W !," This field will contain the name of the Directories that the site wants"
- W !," to monitor with the SAGG Project collection routines. The site should"
- W !," specify only the Directories which hold their VistA production globals:"
- W !!
- W " For example:",!!
- I PLTFRM="CWINNT" W " Cache for Windows NT => W:\VAA, W:\VBB, W:\VCC ... V:\Vxx",!!
- I PLTFRM="CVMS" W " Cache for OpenVMS => _$1$DKAn:[CACHSYS.VAA] ... _$1$DKAx:[CACHSYS.Vxx]",!!
- W " Do NOT specify 'test/training' Directories (e.g., UTL, TST, etc.).",!
- Q
- ;
- VERSION() ;-- extrinsic - return current version.
- Q $P($T(+2^KMPSUTL),";",3)_"^"_$P($T(+2^KMPSUTL),";",5)
- ;
- PTCHINFO ; -- patch information: routine name ^ current version ^ current patch(es) ^ package namespace
- ;;KMPSGE^2.0^**1**^KMPS
- ;;KMPSLK^2.0^**1**^KMPS
- ;;KMPSUTL^2.0^**1**^KMPS
- ;;KMPSUTL1^2.0^**1**^KMPS
- ;;%ZOSVKSD^8.0^**121,197,268,456,568**^XU
- ;;%ZOSVKSE^8.0^**90,94,197,268,456,568**^XU
- ;;%ZOSVKSS^8.0^**90,94,197,268,456**^XU
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPSUTL 3192 printed Jan 18, 2025@02:43:06 Page 2
- KMPSUTL ;OAK/KAK/JML - SAGG Utilities ;9/1/2015
- +1 ;;2.0;SAGG PROJECT;**1**;Jul 02, 2007;Build 67
- +2 ;
- CURSTAT(STAT) ;-- current status
- +1 ;---------------------------------------------------------------------
- +2 ; input: STAT (optional) = data from $$TSKSTAT^KMPSUTL1
- +3 ; output: See codes below
- +4 ;---------------------------------------------------------------------
- +5 ;
- +6 NEW RESULT,SITNUM,STRTDT
- +7 ;
- +8 SET RESULT=""
- SET SITNUM=^DD("SITE",1)
- SET STRTDT=$GET(^XTMP("KMPS",SITNUM,0))
- +9 ;
- +10 IF $DATA(^XTMP("KMPS","ERROR"))
- QUIT "6^ERRORS RECORDED"
- +11 IF $DATA(^XTMP("KMPS","STOP"))
- QUIT "7^STOPPING"
- +12 IF $DATA(^XTMP("KMPS","START"))
- LOCK +^XTMP("KMPS"):0
- IF $TEST
- LOCK -^XTMP("KMPS")
- QUIT "5^DID NOT COMPLETE"
- +13 IF +STRTDT
- IF +$HOROLOG-STRTDT>2
- QUIT "5^DID NOT COMPLETE"
- +14 IF +STRTDT
- IF +$HOROLOG-STRTDT>1
- QUIT "4^RUNNING TOO LONG"
- +15 IF $DATA(^XTMP("KMPS","START"))
- QUIT "0^RUNNING"
- +16 IF $DATA(STAT)
- QUIT $PIECE(STAT,U,1,2)
- +17 IF '$TEST
- QUIT "3^NOT RUNNING"
- +18 QUIT "9^UNKNOWN"
- +19 ;
- STOP ;-- stop SAGG collection routines
- +1 ;
- +2 NEW DIR,X,Y
- +3 ;
- +4 IF '$DATA(^XTMP("KMPS","START"))
- Begin DoDot:1
- +5 WRITE !!,?5,"The SAGG Project collection routines are not running.",!
- End DoDot:1
- QUIT
- +6 IF '$TEST
- WRITE !!,"Current status of SAGG is ",$PIECE($$CURSTAT(),U,2),!
- +7 SET DIR("A")="Do you wish to manually STOP the SAGG Project collection routines (Y/N)"
- SET DIR("B")="N"
- SET DIR(0)="Y"
- +8 DO ^DIR
- WRITE !
- +9 IF Y
- Begin DoDot:1
- +10 SET ^XTMP("KMPS","STOP")=1
- +11 WRITE !,?5,"The SAGG Project collection routines have been notified to begin an"
- +12 WRITE !,?5,"orderly shut-down process.",!
- End DoDot:1
- +13 QUIT
- +14 ;
- FILE ;-- modifies data in the SAGG PROJECT file #8970.1
- +1 ;
- +2 NEW DA,DIC,DIE,DLAYGO,DR,PLTFRM,X
- +3 ;
- +4 SET PLTFRM=$$MPLTF^KMPSUTL1
- +5 WRITE !!,"Specify the Directories"
- +6 WRITE " which hold your VistA production globals.",!!,"For example:",!!,?5
- +7 IF PLTFRM="CWINNT"
- WRITE "Cache for Windows NT => W:\VAA, W:\VBB, W:\VCC ... V:\Vxx"
- +8 IF PLTFRM="CVMS"
- WRITE "Cache for OpenVMS => _$1$DKAn:[CACHSYS.VAA] ... _$1$DKAx:[CACHSYS.Vxx]"
- +9 IF PLTFRM="UNK"
- WRITE "Specify all locations of VistA globals"
- +10 WRITE !!,"Do NOT specify 'test/training' Directories, (i.e., UTL,TST, etc.).",!
- +11 SET DIE="^KMPS(8970.1,"
- SET DA=1
- SET DR=.03
- +12 if PLTFRM'="DSM"
- SET DR(2,8970.11)=.01
- +13 DO ^DIE
- +14 ;
- +15 QUIT
- +16 ;
- HELP ;-- extended help for SAGG PROJECT file VOLUME SET TO MONITOR (.01) field
- +1 ;
- +2 NEW PLTFRM
- +3 ;
- +4 SET PLTFRM=$$MPLTF^KMPSUTL1
- if PLTFRM="UNK"
- QUIT
- +5 WRITE !," This field will contain the name of the Directories that the site wants"
- +6 WRITE !," to monitor with the SAGG Project collection routines. The site should"
- +7 WRITE !," specify only the Directories which hold their VistA production globals:"
- +8 WRITE !!
- +9 WRITE " For example:",!!
- +10 IF PLTFRM="CWINNT"
- WRITE " Cache for Windows NT => W:\VAA, W:\VBB, W:\VCC ... V:\Vxx",!!
- +11 IF PLTFRM="CVMS"
- WRITE " Cache for OpenVMS => _$1$DKAn:[CACHSYS.VAA] ... _$1$DKAx:[CACHSYS.Vxx]",!!
- +12 WRITE " Do NOT specify 'test/training' Directories (e.g., UTL, TST, etc.).",!
- +13 QUIT
- +14 ;
- VERSION() ;-- extrinsic - return current version.
- +1 QUIT $PIECE($TEXT(+2^KMPSUTL),";",3)_"^"_$PIECE($TEXT(+2^KMPSUTL),";",5)
- +2 ;
- PTCHINFO ; -- patch information: routine name ^ current version ^ current patch(es) ^ package namespace
- +1 ;;KMPSGE^2.0^**1**^KMPS
- +2 ;;KMPSLK^2.0^**1**^KMPS
- +3 ;;KMPSUTL^2.0^**1**^KMPS
- +4 ;;KMPSUTL1^2.0^**1**^KMPS
- +5 ;;%ZOSVKSD^8.0^**121,197,268,456,568**^XU
- +6 ;;%ZOSVKSE^8.0^**90,94,197,268,456,568**^XU
- +7 ;;%ZOSVKSS^8.0^**90,94,197,268,456**^XU