VENPCCP3 ; IHS/OIT/GIS - PRINT DEAMON - MANAGE ERRORS, MISC. ASMU OPTIONS ;
;;2.6;PCC+;**1,3**;APR 03, 2012;Build 24
;
; DEAD CODE IN 2.5
;
CLEAN ; EP-CLEAN OUT OLD Z FILES FROM THE PRINT DIRECTORY
I $G(CFIGIEN),$L($G(PATH)),$G(DT)
E Q
I $P($G(^VEN(7.5,CFIGIEN,0)),U,22)=DT Q ; CLEANUP ALREADY COMPLETED
N TMP,FILE,EIEN,%,DA,DR,DIE
S TMP="^TMP(""VEN Z CLEAN"","""_$J_""")"
D FILES^VENPCCP2(PATH,TMP)
S FILE="z" F S FILE=$O(@TMP@(FILE)) Q:'$L(FILE) D
. I $E(FILE)'="z" Q
. S EIEN=$O(^VEN(7.7,"F",FILE,0))
. I 'EIEN D DEL^VENPCCP1(PATH,FILE) Q ; DELETE ALL Z FILES NOT ENERTERED IN ERROR LOG
. S %=$P($G(^VEN(7.7,EIEN,0)),U)
. I %'=DT D DEL^VENPCCP1(PATH,FILE) ; DELETE OLD Z FILES
. Q
K @TMP
S DIE="^VEN(7.5,",DA=CFIGIEN,DR=".22////"_DT L +^VEN(7.5,DA):0 I $T D ^DIE L -^VEN(7.5,DA)
D ^XBFMK
Q
;
PATCH ; EP-PATCH VENPCCP & VENPCC TO INCLUDE NEW ERROR MANAGEMENT UTILITIES
W !,"Patch option has been disabled. Request terminated..." Q
Q
;
UNPATCH ; EP-REMOVE ERROR MANAGEMENT PATCHES FROM VENPCCP AND VENPCC
W !,"Un-patch option has been disabled. Request terminated..." Q
Q
;
ELOG ; EP-PRINT ERROR LOG
N BY,FR,TO,FLDS,DIC,POP
S BY="+PRINT GROUP,@TIMESTAMP",(TO,FR)=",?",FLDS="[VENE ERROR LIST",DIC="^VEN(7.7,"
D EN1^DIP
Q
;
BLOCK(TYPE) ; EP-BLOCK A CLINIC FOR REPAIRS
I '$L(TYPE) Q
N DIC,X,Y,DIE,DA,DR
S DIC("A")=$S(TYPE=1:"Stop",1:"Resume")_" printing PCC+ forms at what clinic: "
S DIC="^VEN(7.95,",DIC(0)="AEQ" D ^DIC I Y=-1 Q
S DIE=DIC,DA=+Y,DR="2.15////"_TYPE
L +^VEN(7.95,DA):0 I $T D ^DIE L -^VEN(7.95,DA)
D ^XBFMK
W !,"PCC+ forms will "_$S(TYPE:"not",1:"now")_" be printed at this clinic",!!
Q
;
MAX ; EP-SET THE MAXIMUM NUMBER OF "z" FILES FOR A CLINIC
N DIC,X,Y,DIE,DA,DR,MAX,A,B
S DIC("A")="Clinic name: "
S DIC="^VEN(7.95,",DIC(0)="AEQ" D ^DIC I Y=-1 Q
S DA=+Y,B=$P($G(^VEN(7.95,DA,2)),U,14) I B="" S B=20
S A="Maximum number of 'z' files allowed for this clinic"
S MAX=$$DIR^XBDIR("N^0:999:0",A,B)
I MAX?1."^" D ^XBFMK Q
S DIE=DIC,DR="2.14////^S X=MAX"
L +^VEN(7.95,DA):0 I $T D ^DIE L -^VEN(7.95,DA)
D ^XBFMK
W !,"For this clinic, A maximum of ",MAX," 'z' files will be allowed in the print folder.",!!
Q
;
CLN(TYPE) ; EP-TURN AUTO-CLEANUP ON/OFF
N DIE,DA,DR,X,Y,%
W !,"Want to turn ",$S(TYPE:"on",1:"off")," the auto cleanup feature for the PRINT folder"
S %="" D YN^DICN I %'=1 Q
S DA=$$CFG^VENPCCU I 'DA Q
S DIE="^VEN(7.5,",DR=".21////^S X=TYPE" L +^VEN(7.5,DA):0 I $T D ^DIE L -^VEN(7.5,DA)
D ^XBFMK
Q
;
CLNYES ; EP-TURN ON AUTO CLEANUP
D CLN(1) Q
;
CLNNO ; EP-TURN OFF AUTO CLEANUP
D CLN(0) Q
;
DV ; EP - DELETE A TEST VISIT, ASSOCIATED TEST V FILE ENTRIES, AND ASSOCIATED VEN QUEUE ENTRY
D GETPAT^APCDVDEL
I APCDPAT="" W !!,"No PATIENT selected!" D EOJ Q
D GETVISIT^APCDVDEL
I APCDVSIT="" W !!,"No VISIT selected!" D EOJ Q
D DSPLY^APCDVDEL
D DELETE^APCDVDEL
N DA,DIK S DA=$O(^VEN(7.2,"AV",APCDVSIT,0))
I DA S DIK="^VEN(7.2," D ^DIK ; CLEAN UP QUEUE FILE
EOJ D EOJ^APCDVDEL
Q
;
BLOCKON ; EP-BLOCK PCC+ DOCUMENT GENERATION FOR A SPECIFIC CLINIC
D BLOCK(1) Q
;
BLOCKOFF ; EP-DON'T BLOCK PCC+ DOCUMENT GENERATION FOR A SPECIFIC CLINIC
D BLOCK(0) Q
;
HE ; EP-ERROR HELPER
N DIC,X,Y
S DIC="^VEN(7.71,",DIC(0)="AEQM",DIC("A")="Enter error name or number: " D ^DIC I Y=-1 Q
S BY="ERROR NUMBER="_+Y,FLDS="[VENE ERROR HELPER",DHD="W ""PCC+ ERROR RESOLUTION"",!,""---------------------------""" D EN1^DIP
Q
;
IP ; EP - RESET IP ADDRESSSES FOR THE PRINT SERVERS
N CFIGIEN,DIC,DIE,DA,DR,X,Y,IP1,IP2,IP4,IP5
S DA=$$CFG^VENPCCU,X=$G(^VEN(7.5,+DA,11))
S IP1=$P(X,U) I '$L(X) Q
S IP2=$P(X,U,2) I '$L(IP2) S IP2=IP1
S IP4=$P(X,U,4),IP5=$P(X,U,5)
I IP1=IP2,'$L(IP4) W !,"Both Print Servers already have the same IP address! Request denied..." H 3 Q
I IP1=IP2 W !,"Want to reactivate both print servers" S %=1 D YN^DICN Q:%'=1 S DR="11.1////"_IP4_";11.2////"_IP5_";11.4///@;11.5///@" D IPDIE Q
S DIR(0)="SX^1:Shut down Print Server #1;2:Shut down Print Server #2;3:Quit"
S DIR("A")="Select an action:"
D ^DIR K DIR
I Y=1 S DR="11.1////"_IP2_";11.4////"_IP1_";11.5////"_IP2 D IPDIE Q
I Y=2 S DR="11.2////"_IP1_";11.4////"_IP1_";11.5////"_IP2 D IPDIE Q
Q
;
IPDIE S DIE=19707.5
L +^VEN(7.5,DA):0 I $T D ^DIE L -^VEN(7.5,DA)
D KILLTASK^VENPCCP
W !,"Resetting the Print Server IP addresses. Please wait..." H 5
I $$MSG^VENPCCMX(0)
D ^XBFMK
Q
;
VENPCCP3 ; IHS/OIT/GIS - PRINT DEAMON - MANAGE ERRORS, MISC. ASMU OPTIONS ;
+1 ;;2.6;PCC+;**1,3**;APR 03, 2012;Build 24
+2 ;
+3 ; DEAD CODE IN 2.5
+4 ;
CLEAN ; EP-CLEAN OUT OLD Z FILES FROM THE PRINT DIRECTORY
+1 IF $GET(CFIGIEN)
IF $LENGTH($GET(PATH))
IF $GET(DT)
+2 IF '$TEST
QUIT
+3 ; CLEANUP ALREADY COMPLETED
IF $PIECE($GET(^VEN(7.5,CFIGIEN,0)),U,22)=DT
QUIT
+4 NEW TMP,FILE,EIEN,%,DA,DR,DIE
+5 SET TMP="^TMP(""VEN Z CLEAN"","""_$JOB_""")"
+6 DO FILES^VENPCCP2(PATH,TMP)
+7 SET FILE="z"
FOR
SET FILE=$ORDER(@TMP@(FILE))
IF '$LENGTH(FILE)
QUIT
Begin DoDot:1
+8 IF $EXTRACT(FILE)'="z"
QUIT
+9 SET EIEN=$ORDER(^VEN(7.7,"F",FILE,0))
+10 ; DELETE ALL Z FILES NOT ENERTERED IN ERROR LOG
IF 'EIEN
DO DEL^VENPCCP1(PATH,FILE)
QUIT
+11 SET %=$PIECE($GET(^VEN(7.7,EIEN,0)),U)
+12 ; DELETE OLD Z FILES
IF %'=DT
DO DEL^VENPCCP1(PATH,FILE)
+13 QUIT
End DoDot:1
+14 KILL @TMP
+15 SET DIE="^VEN(7.5,"
SET DA=CFIGIEN
SET DR=".22////"_DT
LOCK +^VEN(7.5,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.5,DA)
+16 DO ^XBFMK
+17 QUIT
+18 ;
PATCH ; EP-PATCH VENPCCP & VENPCC TO INCLUDE NEW ERROR MANAGEMENT UTILITIES
+1 WRITE !,"Patch option has been disabled. Request terminated..."
QUIT
+2 QUIT
+3 ;
UNPATCH ; EP-REMOVE ERROR MANAGEMENT PATCHES FROM VENPCCP AND VENPCC
+1 WRITE !,"Un-patch option has been disabled. Request terminated..."
QUIT
+2 QUIT
+3 ;
ELOG ; EP-PRINT ERROR LOG
+1 NEW BY,FR,TO,FLDS,DIC,POP
+2 SET BY="+PRINT GROUP,@TIMESTAMP"
SET (TO,FR)=",?"
SET FLDS="[VENE ERROR LIST"
SET DIC="^VEN(7.7,"
+3 DO EN1^DIP
+4 QUIT
+5 ;
BLOCK(TYPE) ; EP-BLOCK A CLINIC FOR REPAIRS
+1 IF '$LENGTH(TYPE)
QUIT
+2 NEW DIC,X,Y,DIE,DA,DR
+3 SET DIC("A")=$SELECT(TYPE=1:"Stop",1:"Resume")_" printing PCC+ forms at what clinic: "
+4 SET DIC="^VEN(7.95,"
SET DIC(0)="AEQ"
DO ^DIC
IF Y=-1
QUIT
+5 SET DIE=DIC
SET DA=+Y
SET DR="2.15////"_TYPE
+6 LOCK +^VEN(7.95,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.95,DA)
+7 DO ^XBFMK
+8 WRITE !,"PCC+ forms will "_$SELECT(TYPE:"not",1:"now")_" be printed at this clinic",!!
+9 QUIT
+10 ;
MAX ; EP-SET THE MAXIMUM NUMBER OF "z" FILES FOR A CLINIC
+1 NEW DIC,X,Y,DIE,DA,DR,MAX,A,B
+2 SET DIC("A")="Clinic name: "
+3 SET DIC="^VEN(7.95,"
SET DIC(0)="AEQ"
DO ^DIC
IF Y=-1
QUIT
+4 SET DA=+Y
SET B=$PIECE($GET(^VEN(7.95,DA,2)),U,14)
IF B=""
SET B=20
+5 SET A="Maximum number of 'z' files allowed for this clinic"
+6 SET MAX=$$DIR^XBDIR("N^0:999:0",A,B)
+7 IF MAX?1."^"
DO ^XBFMK
QUIT
+8 SET DIE=DIC
SET DR="2.14////^S X=MAX"
+9 LOCK +^VEN(7.95,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.95,DA)
+10 DO ^XBFMK
+11 WRITE !,"For this clinic, A maximum of ",MAX," 'z' files will be allowed in the print folder.",!!
+12 QUIT
+13 ;
CLN(TYPE) ; EP-TURN AUTO-CLEANUP ON/OFF
+1 NEW DIE,DA,DR,X,Y,%
+2 WRITE !,"Want to turn ",$SELECT(TYPE:"on",1:"off")," the auto cleanup feature for the PRINT folder"
+3 SET %=""
DO YN^DICN
IF %'=1
QUIT
+4 SET DA=$$CFG^VENPCCU
IF 'DA
QUIT
+5 SET DIE="^VEN(7.5,"
SET DR=".21////^S X=TYPE"
LOCK +^VEN(7.5,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.5,DA)
+6 DO ^XBFMK
+7 QUIT
+8 ;
CLNYES ; EP-TURN ON AUTO CLEANUP
+1 DO CLN(1)
QUIT
+2 ;
CLNNO ; EP-TURN OFF AUTO CLEANUP
+1 DO CLN(0)
QUIT
+2 ;
DV ; EP - DELETE A TEST VISIT, ASSOCIATED TEST V FILE ENTRIES, AND ASSOCIATED VEN QUEUE ENTRY
+1 DO GETPAT^APCDVDEL
+2 IF APCDPAT=""
WRITE !!,"No PATIENT selected!"
DO EOJ
QUIT
+3 DO GETVISIT^APCDVDEL
+4 IF APCDVSIT=""
WRITE !!,"No VISIT selected!"
DO EOJ
QUIT
+5 DO DSPLY^APCDVDEL
+6 DO DELETE^APCDVDEL
+7 NEW DA,DIK
SET DA=$ORDER(^VEN(7.2,"AV",APCDVSIT,0))
+8 ; CLEAN UP QUEUE FILE
IF DA
SET DIK="^VEN(7.2,"
DO ^DIK
EOJ DO EOJ^APCDVDEL
+1 QUIT
+2 ;
BLOCKON ; EP-BLOCK PCC+ DOCUMENT GENERATION FOR A SPECIFIC CLINIC
+1 DO BLOCK(1)
QUIT
+2 ;
BLOCKOFF ; EP-DON'T BLOCK PCC+ DOCUMENT GENERATION FOR A SPECIFIC CLINIC
+1 DO BLOCK(0)
QUIT
+2 ;
HE ; EP-ERROR HELPER
+1 NEW DIC,X,Y
+2 SET DIC="^VEN(7.71,"
SET DIC(0)="AEQM"
SET DIC("A")="Enter error name or number: "
DO ^DIC
IF Y=-1
QUIT
+3 SET BY="ERROR NUMBER="_+Y
SET FLDS="[VENE ERROR HELPER"
SET DHD="W ""PCC+ ERROR RESOLUTION"",!,""---------------------------"""
DO EN1^DIP
+4 QUIT
+5 ;
IP ; EP - RESET IP ADDRESSSES FOR THE PRINT SERVERS
+1 NEW CFIGIEN,DIC,DIE,DA,DR,X,Y,IP1,IP2,IP4,IP5
+2 SET DA=$$CFG^VENPCCU
SET X=$GET(^VEN(7.5,+DA,11))
+3 SET IP1=$PIECE(X,U)
IF '$LENGTH(X)
QUIT
+4 SET IP2=$PIECE(X,U,2)
IF '$LENGTH(IP2)
SET IP2=IP1
+5 SET IP4=$PIECE(X,U,4)
SET IP5=$PIECE(X,U,5)
+6 IF IP1=IP2
IF '$LENGTH(IP4)
WRITE !,"Both Print Servers already have the same IP address! Request denied..."
HANG 3
QUIT
+7 IF IP1=IP2
WRITE !,"Want to reactivate both print servers"
SET %=1
DO YN^DICN
IF %'=1
QUIT
SET DR="11.1////"_IP4_";11.2////"_IP5_";11.4///@;11.5///@"
DO IPDIE
QUIT
+8 SET DIR(0)="SX^1:Shut down Print Server #1;2:Shut down Print Server #2;3:Quit"
+9 SET DIR("A")="Select an action:"
+10 DO ^DIR
KILL DIR
+11 IF Y=1
SET DR="11.1////"_IP2_";11.4////"_IP1_";11.5////"_IP2
DO IPDIE
QUIT
+12 IF Y=2
SET DR="11.2////"_IP1_";11.4////"_IP1_";11.5////"_IP2
DO IPDIE
QUIT
+13 QUIT
+14 ;
IPDIE SET DIE=19707.5
+1 LOCK +^VEN(7.5,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.5,DA)
+2 DO KILLTASK^VENPCCP
+3 WRITE !,"Resetting the Print Server IP addresses. Please wait..."
HANG 5
+4 IF $$MSG^VENPCCMX(0)
+5 DO ^XBFMK
+6 QUIT
+7 ;