VENPCCQ8 ; IHS/OIT/GIS - BUILD VALIDATION ROUTINE ; [ 03/05/09 4:34 PM ]
;;2.6;PCC+;**1,4,5**;APR 03, 2012;Build 24
;
;
; VALIDATE PCC+ GUI INSTALLATION ; CAN ONLY BE RUN AFTER FULL KIDS INSTALL HAS BEEN COMPLETED ;
;
;
CSC261 ; EP - VALIDATE PCC+ 2.6 PATCH 1: WCM GUI
N %
S %="PCC+*2.6*1" D VALIDATE(%)
Q
;
VALIDATE(BIEN,MODE,OK,ERR) ; EP - VALIDATE WCM CONTENT
I $G(BIEN),$G(MODE)
E S ERR=1 Q
N X,Y,Z,%,RTN,FIEN,RPC
S OK=0,ERR=0
;
RTN W !,"Checking required ROUTINES..."
S RTN="",OK=0
F S RTN=$O(^XPD(9.6,BIEN,"KRN",9.8,"NM","B",RTN)) Q:RTN="" D
. X ("I $L($T(^"_RTN_"))")
. E W !?5,U,RTN," is missing!" S OK=1,ERR=1
. Q
I 'OK D
. W " < All ROUTINES installed"
. I $L($T(^VENCS265)) D
.. W !,"ROUTINE checksum verification..."
.. D CSUM^VENCS265(.OK)
.. I OK S ERR=1,OK=0 W !?5,"Integrity check violation!!" Q
.. W " < All ROUTINES passed"
.. Q
I $$STOP S OK=2 Q
I MODE'=2 G FILE ; BYPASS DATA ENTRY RTN CHECK IF WCM USED IN EHR OR DEKTOP MODE
;
FILE W !,"Checking required FILES..."
S FIEN=0,OK=0
F S FIEN=$O(^XPD(9.6,BIEN,4,"B",FIEN)) Q:'FIEN D
. I $D(^DD(FIEN,0)) Q
. W !?5,"File ",FIEN," is missing!"
. S OK=1,ERR=1
. Q
I 'OK W " < All FILES present"
I $P($G(^VEN(7.14,5,0)),U,2)'=15.64 D ; IHS/OIT/GIS 2/6/2012
. I OK W !
. W " < The VEN EHP ASQ QUESTIONNAIRE file has not been updated!"
. S OK=1,ERR=1
. Q
I $$STOP S OK=2 Q
;
MEAS W !,"Checking MEASUREMENT TYPES..."
D BADASQP ; CLEAN OUT CORRUPTED MEASUREMENT TYPE ASQP
S OK=0
S %="AFGLMPS"
F I=1:1:$L(%) D ; ASQ MEASUREMENT VERIFICATION AND VALIDATION TAG
. S X=$E(%,I)
. S Y=$O(^AUTTMSR("B",("ASQ"_X),0))
. I 'Y S OK=1,ERR=1 W !?5,"Measurement type ASQ"_X_" is missing!" Q
. I X="M" S ^AUTTMSR(Y,12)="I X'?1.2N K X" Q
. S ^AUTTMSR(Y,12)="D ASQX^VENPCCQ"
. Q
I 'OK W " < All MEASUREMENT TYPES present"
I $$STOP S OK=2 Q
;
KEY W !,"Checking SECURITY KEYS..."
S KEY="",OK=0
F S KEY=$O(^XPD(9.6,BIEN,"KRN",19.1,"NM","B",KEY)) Q:KEY="" D
. I $O(^DIC(19.1,"B",KEY,0)) Q
. W !?5,"The key ",KEY," is missing!"
. S OK=1,ERR=1
. Q
I 'OK W " < All KEYS present"
E S ERR=1
I $$STOP S OK=2 Q
;
OPT W !,"Checking OPTIONS..."
S OPT="",OK=0
F S OPT=$O(^XPD(9.6,BIEN,"KRN",19,"NM","B",OPT)) Q:OPT="" D
. I $O(^DIC(19,"B",OPT,0)) Q
. W !?5,"The option ",OPT," is missing!"
. S OK=1,ERR=1
. Q
I MODE=2 G KEY
S BOIEN=$O(^DIC(19,"B","VEN RPC",0))
I 'BOIEN S ERR=1,OK=1,ERR=1 W !?5,"The broker option 'VEN RPC' is missing"
I 'OK W " < All OPTIONS present"
I $$STOP S OK=2 Q
;
RPC W !,"Checking REMOTE PROCEDURE CALLS..."
N RIEN
S RPC="",OK=0
F S RPC=$O(^XPD(9.6,BIEN,"KRN",8994,"NM","B",RPC)) Q:RPC="" D
. S RIEN=$O(^XWB(8994,"B",RPC,0))
. I 'RIEN D Q
.. W !?5,"The RPC ",RPC," is missing!"
.. S OK=1,ERR=1
.. Q
. I 'BOIEN S OK=1 Q
. I $O(^DIC(19,BOIEN,"RPC","B",RIEN,0)) Q
. D BOR(BOIEN,RIEN,RPC,.OK) ; REGISTER THE RPC IN BROKER OPTION 'VEN RPC'
. Q
I 'OK,MODE=1 D CIABMX^VENPCCQ7(.OK) ; CHECK THE RPC FOR BMX 4.0
I OK S ERR=1
I 'OK W " < All RPCs present and registered"
I 'BOIEN W !?5,"Because broker option 'VEN RPC' is missing. No RPCs can be registered."
I $$STOP S OK=2 Q
I MODE'=2 G CSCX
;
DIE W !,"Checking INPUT TEMPLATES: "
S OK=0
S X="APCD WC (ADD)^APCD WC (MOD)",Z=0
F PCE=1:1:$L(X,U) D
. S Y=$P(X,U,PCE)
. S %=$O(^DIE("B",Y,0))
. I '% W !?5,"The input template ",Y," is missing!" S OK=1 Q
. S Y=$NA(^DIE(%,"ROU"))
. S @Y="^VENPCCQB" ; SET COMPLIED INPUT TEMPLATE NODE
. Q
I OK S OK=0,ERR=1
E W " < All required INPUT TEMPLATES present"
I $$STOP S OK=2 Q
;
MN W !,"Checking DATA ENTRY MNEMONICS: "
I '$O(^APCDTKW("B","WCE",0)) W !?10,"The data entry mnemonic 'WCE' is missing!" S ERR=1
E W " < All required MNEMONICS present"
I $$STOP S OK=2 Q
Q
;
CSCX ; FINISH UP
I $G(ERR) W !!,"The Well Child GUI validation process detected at least one problem",! S X="Please take corrective action and reinstall this patch." G EXITMSG
I $G(OK)=2 W !!,"The validation process was terminated prematurely!",!,"Please complete the validation at a later time"
I '$G(OK),'$G(ERR)
E I $$STOP Q
SUCCESS S X="Congratulations! The Well Child GUI module has been VALIDATED"
EXITMSG D BOX(X)
Q
;
BOX(X) ; EP - HIGHLIGHT TEXT INSIDE A * BOX
I $G(X)="" Q
I $L(X)>73 Q
N Y,Z,%
S %=$L(X)+1
S Y="",$P(Y," ",%)="",Z="",$P(Z,"*",%+6)=""
S X="* "_X_" *",Y="* "_Y_" *"
W !!!,Z,!,Y,!,X,!,Y,!,Z,!!
Q
;
BMX(OK) N %,BIEN,X,Y,Z,STG
S OK=0
W !!,"Checking BMX.NET..."
I '$L($T(^BMXEHR)) D Q
. W !!,"Uh oh!..."
. W !,"The BMX.NET Broker package (Ver 3.0 or higher) has not been installed."
. W !,"Well Child Module GUI installation aborted!!!"
. W !,"Install the BMX.NET Broker package now, and then rerun this KIDS build"
. S OK=1,ERR=1
. Q
I 'OK W " < Broker installed"
BMXSCH W !,"Checking BMX SCHEMAS..."
S OK=0
I '$O(^BMXADO("B","VEN CF VISIT LIST",0)) S OK=1,ERR=1 W !?5,"The schema 'VEN CF VISIT LIST' is missing!!"
E W " < All BMX SCHEMAS are present"
Q
;
BROKER ; EP - IF USING DESKTOP, CONFIGURE THE BROKER
W !!,"The BMX Broker must be running continuously to enable the WCM desktop"
W !?5,"You must start the BMX Broker each time the RPMS server is re-booted"
W !?5,"The BMXNet Management menu has options to START and STOP the BMX Broker"
BMXMON W !!,"Checking BMX PORT MONITOR..." ; IF USING DESKTOP VERSION, LISTENER MUST BE REGISTERED AND STARTED
I '$O(^BMXMON(0)) D Q
. W !!,"Currently, there are no ports assigned to the BMX MONITOR"
. W !?5,"Please assign a port number for this namespace"
PORT . S DIR(0)="NO^1:63999:0",DIR("A")="Port number" KILL DA D ^DIR KILL DIR
. I 'Y D Q
.. W !!,"The WCM will not be functional without an active BMX Monitor port"
.. W !,"Use the EDIT option on the BMXNet Management menu to register a port"
.. W !,"Use the STRT option on the BMXNet Management menu to activate a port"
.. Q
. Q
S BIEN=0,STG=""
F S BIEN=$O(^BMXMON(BIEN)) Q:'BIEN D
. S Z=+$G(^BMXMON(BIEN,0)) I 'Z Q
. I STG'="" S STG=STG_", "
. S STG=STG_Z
. Q
I STG["," W !!,"The following ports have been assigned to BMX: ",!?5
E W !!,"The following port has been assigned to BMX: "
W STG
W !,"Use the STRT option on the BMXNet Management menu to activate a port"
Q
;
STOP() W !,"<>" ; EP - WAIT
R %:DTIME
I %?1."^" Q 1
W $C(13)," ",$C(13)
Q 0
;
SBMX ; EP - OPTION: VEN WCM START OR STOP BROKER
N %,%Y,X,Y,Z,DIR,PORT
S DIR(0)="NO^5000:99999:",DIR("A")="Enter BMX port",DIR("B")="9200"
D ^DIR I Y'>1 Q
S PORT=+Y
BSTART I $$SEMAPHOR^BMXMON(PORT,"LOCK") D S %=$$STOP Q ; START THE BROKER
. S %=1
. W !!,"Want to start the BMX broker listener now"
. D YN^DICN I %'=1 Q
. W !!
. D STRT^BMXMON(PORT)
. Q
BSTOP ; STOP THE BROKER
W !!,"The BMX broker listener is currently running on port "_PORT,!," Want to stop it" ; STOP THE BROKER
S %=1
D YN^DICN I %'=1 Q
W !!
D STOP^BMXMON(PORT)
I $$STOP
Q
;
HDR ; EP - OPTION HEADER
W !?10,"WCM GUI Management"
W !,"----------------------------------------------------------",!!
Q
;
BOR(BOIEN,RIEN,RPC,OK) ; EP - REGISTER A WCM RPC IN THE BROKER OPTION VEN RPC
I $G(BOIEN),$G(RIEN),$G(RPC)'=""
E Q
N X,Y,Z,DIC,DIE,DA,DR,DLAYGO,%
S DA(1)=BOIEN
S DIC="^DIC(19,"_DA(1)_",""RPC"","
S (DIC("P"),DLAYGO)=19.05
S X="`"_RIEN,DIC(0)="LO"
D ^DIC
I Y=-1 W !?5,"RPC '",RPC,"' is not registered in broker option VEN RPC" S OK=1,ERR=1
D ^XBFMK
Q
;
BADASQP ; EP - FIX SITES THAT HAD ALPHA VERSION OF 2.6 WITH CORRUPT ASQP
N %
N DIC,DIE,DA,DR,X,Y,Z,DLAYGO,TYPE,IEN,CODE
S (DIC,DIE,DLAYGO)=9999999.07,DIC(0)="LO",DA="",IEN=""
F S DA=$O(^AUTTMSR("B","ASQP",DA)) Q:'DA D
. S TYPE=$P($G(^AUTTMSR(DA,0)),U,2) I TYPE="" Q
. I TYPE="ASQ - PROBLEM SOLVING" S IEN=DA Q
. I TYPE="ASQ PROBLEM SOLVING" D Q ; DEACTIVATE THE BAD MEASUREMENT
.. S TYPE="ZSQ",CODE="00"
.. S DR=".01////^S X=TYPE;.02////^S X=TYPE;.03////^S X=CODE;.04////^S X=1"
.. L +^AUTTMSR(DA):1 I D ^DIE L -^AUTTMSR(DA)
.. Q
. Q
I IEN D ^XBFMK Q ; THE GOOD MEASUREMENT IS ALREADY IN THERE SO QUIT
; NEED TO REGISTER THE GOOD MEASUREMENT
S X="ASQP",TYPE="ASQ - PROBLEM SOLVING",CODE=64
D ^DIC I Y=-1 Q
S DA=+Y,DR=".02////^S X=TYPE;.03////^S X=CODE"
L +^AUTTMSR(DA):1 I D ^DIE L -^AUTTMSR(DA)
D ^XBFMK
Q
;
BOPT(OK) ; EP - PLACE BROKER OPTION ON PRIMARY MENU OR ASSIGN IT TO INDIVIDUAL PROVIDER AS A SECONDARY MENU
S OK=0
N DIK,X,Y,Z,%,OIEN
S OIEN=$O(^DIC(19,"B","VEN RPC",0))
I 'OIEN W !!,"Unable to find VEN RPC in the OPTION file!",!! Q
W !,"A user must have broker option VEN RPC to use the Well Child Module!!!"
W !!?5,"1. Add VEN RPC option to the Primay Menu(s) of WCM users (recommended)"
W !?5,"2. Assign VEN RPC to individual users as a seconday menu option"
W !?5,"3. Quit"
S DIR(0)="NO^1:3:",DIR("A")="Your choice" D ^DIR K DIR
I Y=1 D BOPT1(OIEN,.OK) Q
I Y=2 D BOPT2(OIEN,.OK)
Q
;
BOPT1(OIEN,OK) ; ADD VEN RPC TO PRIMARY MENU(S)
N DIC,DA,X,Y,Z,%,MORE,RIEN,DA,DR,DLAYGO,PIEN,DO,GBL
S MORE=0
LOOP1 I 'MORE S DIC("A")="Enter a primary menu assigned to WCM users: ",MORE=1
E S DIC("A")="Enter another primary menu assigned to WCM users: "
S DIC="^DIC(19,",DIC(0)="AEQM"
D ^DIC I Y=-1 D ^XBFMK Q
K DIC("A"),DO,DO(2)
S (D0,DA(1))=+Y,DIC="^DIC(19,"_DA(1)_",10,",DIC(0)="LO",X="`"_OIEN,(DLAYGO,DIC("P"))=19.01
D ^DIC I Y=-1 W !?5,"Unable to add VEN RPC to this primary menu" S OK=1 Q
I $P(Y,U,3)="" W !?5,"VEN RPC has already been added to this menu",! G LOOP1
S GBL=$NA(^DIC(19,DA(1),10,+Y))
S $P(@GBL@(0),U,2)="WCM"
W !?5,"ADDED",!
G LOOP1
;
BOPT2(OIEN,OK) ; ADD VEN RPC TO PRIMARY MENU(S)
N DIC,DA,X,Y,Z,%,MORE,RIEN,DA,DR,DLAYGO,PIEN,DO,GBL
S MORE=0
LOOP2 I 'MORE S DIC("A")="Enter a WCM user: ",MORE=1
E S DIC("A")="Enter another WCM user: "
S DIC="^VA(200,",DIC(0)="AEQM"
D ^DIC I Y=-1 D ^XBFMK Q
K DIC("A"),DO,DO(2)
S (D0,DA(1))=+Y,DIC="^VA(200,"_DA(1)_",203,",DIC(0)="LO",X="`"_OIEN,(DLAYGO,DIC("P"))=200.03
D ^DIC I Y=-1 W !?5,"Unable to assign this secondary menu option to the user" S OK=1 Q
I $P(Y,U,3)="" W !?5,"VEN RPC has already been assigned to the user",! G LOOP2
S GBL=$NA(^DIC(19,DA(1),10,+Y))
S $P(@GBL@(0),U,2)="VENR"
W !?5,"VEN RPC has been assigned as a secondary menu to this user",!
G LOOP2
;
VENPCCQ8 ; IHS/OIT/GIS - BUILD VALIDATION ROUTINE ; [ 03/05/09 4:34 PM ]
+1 ;;2.6;PCC+;**1,4,5**;APR 03, 2012;Build 24
+2 ;
+3 ;
+4 ; VALIDATE PCC+ GUI INSTALLATION ; CAN ONLY BE RUN AFTER FULL KIDS INSTALL HAS BEEN COMPLETED ;
+5 ;
+6 ;
CSC261 ; EP - VALIDATE PCC+ 2.6 PATCH 1: WCM GUI
+1 NEW %
+2 SET %="PCC+*2.6*1"
DO VALIDATE(%)
+3 QUIT
+4 ;
VALIDATE(BIEN,MODE,OK,ERR) ; EP - VALIDATE WCM CONTENT
+1 IF $GET(BIEN)
IF $GET(MODE)
+2 IF '$TEST
SET ERR=1
QUIT
+3 NEW X,Y,Z,%,RTN,FIEN,RPC
+4 SET OK=0
SET ERR=0
+5 ;
RTN WRITE !,"Checking required ROUTINES..."
+1 SET RTN=""
SET OK=0
+2 FOR
SET RTN=$ORDER(^XPD(9.6,BIEN,"KRN",9.8,"NM","B",RTN))
IF RTN=""
QUIT
Begin DoDot:1
+3 XECUTE ("I $L($T(^"_RTN_"))")
+4 IF '$TEST
WRITE !?5,U,RTN," is missing!"
SET OK=1
SET ERR=1
+5 QUIT
End DoDot:1
+6 IF 'OK
Begin DoDot:1
+7 WRITE " < All ROUTINES installed"
+8 IF $LENGTH($TEXT(^VENCS265))
Begin DoDot:2
+9 WRITE !,"ROUTINE checksum verification..."
+10 DO CSUM^VENCS265(.OK)
+11 IF OK
SET ERR=1
SET OK=0
WRITE !?5,"Integrity check violation!!"
QUIT
+12 WRITE " < All ROUTINES passed"
+13 QUIT
End DoDot:2
End DoDot:1
+14 IF $$STOP
SET OK=2
QUIT
+15 ; BYPASS DATA ENTRY RTN CHECK IF WCM USED IN EHR OR DEKTOP MODE
IF MODE'=2
GOTO FILE
+16 ;
FILE WRITE !,"Checking required FILES..."
+1 SET FIEN=0
SET OK=0
+2 FOR
SET FIEN=$ORDER(^XPD(9.6,BIEN,4,"B",FIEN))
IF 'FIEN
QUIT
Begin DoDot:1
+3 IF $DATA(^DD(FIEN,0))
QUIT
+4 WRITE !?5,"File ",FIEN," is missing!"
+5 SET OK=1
SET ERR=1
+6 QUIT
End DoDot:1
+7 IF 'OK
WRITE " < All FILES present"
+8 ; IHS/OIT/GIS 2/6/2012
IF $PIECE($GET(^VEN(7.14,5,0)),U,2)'=15.64
Begin DoDot:1
+9 IF OK
WRITE !
+10 WRITE " < The VEN EHP ASQ QUESTIONNAIRE file has not been updated!"
+11 SET OK=1
SET ERR=1
+12 QUIT
End DoDot:1
+13 IF $$STOP
SET OK=2
QUIT
+14 ;
MEAS WRITE !,"Checking MEASUREMENT TYPES..."
+1 ; CLEAN OUT CORRUPTED MEASUREMENT TYPE ASQP
DO BADASQP
+2 SET OK=0
+3 SET %="AFGLMPS"
+4 ; ASQ MEASUREMENT VERIFICATION AND VALIDATION TAG
FOR I=1:1:$LENGTH(%)
Begin DoDot:1
+5 SET X=$EXTRACT(%,I)
+6 SET Y=$ORDER(^AUTTMSR("B",("ASQ"_X),0))
+7 IF 'Y
SET OK=1
SET ERR=1
WRITE !?5,"Measurement type ASQ"_X_" is missing!"
QUIT
+8 IF X="M"
SET ^AUTTMSR(Y,12)="I X'?1.2N K X"
QUIT
+9 SET ^AUTTMSR(Y,12)="D ASQX^VENPCCQ"
+10 QUIT
End DoDot:1
+11 IF 'OK
WRITE " < All MEASUREMENT TYPES present"
+12 IF $$STOP
SET OK=2
QUIT
+13 ;
KEY WRITE !,"Checking SECURITY KEYS..."
+1 SET KEY=""
SET OK=0
+2 FOR
SET KEY=$ORDER(^XPD(9.6,BIEN,"KRN",19.1,"NM","B",KEY))
IF KEY=""
QUIT
Begin DoDot:1
+3 IF $ORDER(^DIC(19.1,"B",KEY,0))
QUIT
+4 WRITE !?5,"The key ",KEY," is missing!"
+5 SET OK=1
SET ERR=1
+6 QUIT
End DoDot:1
+7 IF 'OK
WRITE " < All KEYS present"
+8 IF '$TEST
SET ERR=1
+9 IF $$STOP
SET OK=2
QUIT
+10 ;
OPT WRITE !,"Checking OPTIONS..."
+1 SET OPT=""
SET OK=0
+2 FOR
SET OPT=$ORDER(^XPD(9.6,BIEN,"KRN",19,"NM","B",OPT))
IF OPT=""
QUIT
Begin DoDot:1
+3 IF $ORDER(^DIC(19,"B",OPT,0))
QUIT
+4 WRITE !?5,"The option ",OPT," is missing!"
+5 SET OK=1
SET ERR=1
+6 QUIT
End DoDot:1
+7 IF MODE=2
GOTO KEY
+8 SET BOIEN=$ORDER(^DIC(19,"B","VEN RPC",0))
+9 IF 'BOIEN
SET ERR=1
SET OK=1
SET ERR=1
WRITE !?5,"The broker option 'VEN RPC' is missing"
+10 IF 'OK
WRITE " < All OPTIONS present"
+11 IF $$STOP
SET OK=2
QUIT
+12 ;
RPC WRITE !,"Checking REMOTE PROCEDURE CALLS..."
+1 NEW RIEN
+2 SET RPC=""
SET OK=0
+3 FOR
SET RPC=$ORDER(^XPD(9.6,BIEN,"KRN",8994,"NM","B",RPC))
IF RPC=""
QUIT
Begin DoDot:1
+4 SET RIEN=$ORDER(^XWB(8994,"B",RPC,0))
+5 IF 'RIEN
Begin DoDot:2
+6 WRITE !?5,"The RPC ",RPC," is missing!"
+7 SET OK=1
SET ERR=1
+8 QUIT
End DoDot:2
QUIT
+9 IF 'BOIEN
SET OK=1
QUIT
+10 IF $ORDER(^DIC(19,BOIEN,"RPC","B",RIEN,0))
QUIT
+11 ; REGISTER THE RPC IN BROKER OPTION 'VEN RPC'
DO BOR(BOIEN,RIEN,RPC,.OK)
+12 QUIT
End DoDot:1
+13 ; CHECK THE RPC FOR BMX 4.0
IF 'OK
IF MODE=1
DO CIABMX^VENPCCQ7(.OK)
+14 IF OK
SET ERR=1
+15 IF 'OK
WRITE " < All RPCs present and registered"
+16 IF 'BOIEN
WRITE !?5,"Because broker option 'VEN RPC' is missing. No RPCs can be registered."
+17 IF $$STOP
SET OK=2
QUIT
+18 IF MODE'=2
GOTO CSCX
+19 ;
DIE WRITE !,"Checking INPUT TEMPLATES: "
+1 SET OK=0
+2 SET X="APCD WC (ADD)^APCD WC (MOD)"
SET Z=0
+3 FOR PCE=1:1:$LENGTH(X,U)
Begin DoDot:1
+4 SET Y=$PIECE(X,U,PCE)
+5 SET %=$ORDER(^DIE("B",Y,0))
+6 IF '%
WRITE !?5,"The input template ",Y," is missing!"
SET OK=1
QUIT
+7 SET Y=$NAME(^DIE(%,"ROU"))
+8 ; SET COMPLIED INPUT TEMPLATE NODE
SET @Y="^VENPCCQB"
+9 QUIT
End DoDot:1
+10 IF OK
SET OK=0
SET ERR=1
+11 IF '$TEST
WRITE " < All required INPUT TEMPLATES present"
+12 IF $$STOP
SET OK=2
QUIT
+13 ;
MN WRITE !,"Checking DATA ENTRY MNEMONICS: "
+1 IF '$ORDER(^APCDTKW("B","WCE",0))
WRITE !?10,"The data entry mnemonic 'WCE' is missing!"
SET ERR=1
+2 IF '$TEST
WRITE " < All required MNEMONICS present"
+3 IF $$STOP
SET OK=2
QUIT
+4 QUIT
+5 ;
CSCX ; FINISH UP
+1 IF $GET(ERR)
WRITE !!,"The Well Child GUI validation process detected at least one problem",!
SET X="Please take corrective action and reinstall this patch."
GOTO EXITMSG
+2 IF $GET(OK)=2
WRITE !!,"The validation process was terminated prematurely!",!,"Please complete the validation at a later time"
+3 IF '$GET(OK)
IF '$GET(ERR)
+4 IF '$TEST
IF $$STOP
QUIT
SUCCESS SET X="Congratulations! The Well Child GUI module has been VALIDATED"
EXITMSG DO BOX(X)
+1 QUIT
+2 ;
BOX(X) ; EP - HIGHLIGHT TEXT INSIDE A * BOX
+1 IF $GET(X)=""
QUIT
+2 IF $LENGTH(X)>73
QUIT
+3 NEW Y,Z,%
+4 SET %=$LENGTH(X)+1
+5 SET Y=""
SET $PIECE(Y," ",%)=""
SET Z=""
SET $PIECE(Z,"*",%+6)=""
+6 SET X="* "_X_" *"
SET Y="* "_Y_" *"
+7 WRITE !!!,Z,!,Y,!,X,!,Y,!,Z,!!
+8 QUIT
+9 ;
BMX(OK) NEW %,BIEN,X,Y,Z,STG
+1 SET OK=0
+2 WRITE !!,"Checking BMX.NET..."
+3 IF '$LENGTH($TEXT(^BMXEHR))
Begin DoDot:1
+4 WRITE !!,"Uh oh!..."
+5 WRITE !,"The BMX.NET Broker package (Ver 3.0 or higher) has not been installed."
+6 WRITE !,"Well Child Module GUI installation aborted!!!"
+7 WRITE !,"Install the BMX.NET Broker package now, and then rerun this KIDS build"
+8 SET OK=1
SET ERR=1
+9 QUIT
End DoDot:1
QUIT
+10 IF 'OK
WRITE " < Broker installed"
BMXSCH WRITE !,"Checking BMX SCHEMAS..."
+1 SET OK=0
+2 IF '$ORDER(^BMXADO("B","VEN CF VISIT LIST",0))
SET OK=1
SET ERR=1
WRITE !?5,"The schema 'VEN CF VISIT LIST' is missing!!"
+3 IF '$TEST
WRITE " < All BMX SCHEMAS are present"
+4 QUIT
+5 ;
BROKER ; EP - IF USING DESKTOP, CONFIGURE THE BROKER
+1 WRITE !!,"The BMX Broker must be running continuously to enable the WCM desktop"
+2 WRITE !?5,"You must start the BMX Broker each time the RPMS server is re-booted"
+3 WRITE !?5,"The BMXNet Management menu has options to START and STOP the BMX Broker"
BMXMON ; IF USING DESKTOP VERSION, LISTENER MUST BE REGISTERED AND STARTED
WRITE !!,"Checking BMX PORT MONITOR..."
+1 IF '$ORDER(^BMXMON(0))
Begin DoDot:1
+2 WRITE !!,"Currently, there are no ports assigned to the BMX MONITOR"
+3 WRITE !?5,"Please assign a port number for this namespace"
PORT SET DIR(0)="NO^1:63999:0"
SET DIR("A")="Port number"
KILL DA
DO ^DIR
KILL DIR
+1 IF 'Y
Begin DoDot:2
+2 WRITE !!,"The WCM will not be functional without an active BMX Monitor port"
+3 WRITE !,"Use the EDIT option on the BMXNet Management menu to register a port"
+4 WRITE !,"Use the STRT option on the BMXNet Management menu to activate a port"
+5 QUIT
End DoDot:2
QUIT
+6 QUIT
End DoDot:1
QUIT
+7 SET BIEN=0
SET STG=""
+8 FOR
SET BIEN=$ORDER(^BMXMON(BIEN))
IF 'BIEN
QUIT
Begin DoDot:1
+9 SET Z=+$GET(^BMXMON(BIEN,0))
IF 'Z
QUIT
+10 IF STG'=""
SET STG=STG_", "
+11 SET STG=STG_Z
+12 QUIT
End DoDot:1
+13 IF STG[","
WRITE !!,"The following ports have been assigned to BMX: ",!?5
+14 IF '$TEST
WRITE !!,"The following port has been assigned to BMX: "
+15 WRITE STG
+16 WRITE !,"Use the STRT option on the BMXNet Management menu to activate a port"
+17 QUIT
+18 ;
STOP() ; EP - WAIT
WRITE !,"<>"
+1 READ %:DTIME
+2 IF %?1."^"
QUIT 1
+3 WRITE $CHAR(13)," ",$CHAR(13)
+4 QUIT 0
+5 ;
SBMX ; EP - OPTION: VEN WCM START OR STOP BROKER
+1 NEW %,%Y,X,Y,Z,DIR,PORT
+2 SET DIR(0)="NO^5000:99999:"
SET DIR("A")="Enter BMX port"
SET DIR("B")="9200"
+3 DO ^DIR
IF Y'>1
QUIT
+4 SET PORT=+Y
BSTART ; START THE BROKER
IF $$SEMAPHOR^BMXMON(PORT,"LOCK")
Begin DoDot:1
+1 SET %=1
+2 WRITE !!,"Want to start the BMX broker listener now"
+3 DO YN^DICN
IF %'=1
QUIT
+4 WRITE !!
+5 DO STRT^BMXMON(PORT)
+6 QUIT
End DoDot:1
SET %=$$STOP
QUIT
BSTOP ; STOP THE BROKER
+1 ; STOP THE BROKER
WRITE !!,"The BMX broker listener is currently running on port "_PORT,!," Want to stop it"
+2 SET %=1
+3 DO YN^DICN
IF %'=1
QUIT
+4 WRITE !!
+5 DO STOP^BMXMON(PORT)
+6 IF $$STOP
+7 QUIT
+8 ;
HDR ; EP - OPTION HEADER
+1 WRITE !?10,"WCM GUI Management"
+2 WRITE !,"----------------------------------------------------------",!!
+3 QUIT
+4 ;
BOR(BOIEN,RIEN,RPC,OK) ; EP - REGISTER A WCM RPC IN THE BROKER OPTION VEN RPC
+1 IF $GET(BOIEN)
IF $GET(RIEN)
IF $GET(RPC)'=""
+2 IF '$TEST
QUIT
+3 NEW X,Y,Z,DIC,DIE,DA,DR,DLAYGO,%
+4 SET DA(1)=BOIEN
+5 SET DIC="^DIC(19,"_DA(1)_",""RPC"","
+6 SET (DIC("P"),DLAYGO)=19.05
+7 SET X="`"_RIEN
SET DIC(0)="LO"
+8 DO ^DIC
+9 IF Y=-1
WRITE !?5,"RPC '",RPC,"' is not registered in broker option VEN RPC"
SET OK=1
SET ERR=1
+10 DO ^XBFMK
+11 QUIT
+12 ;
BADASQP ; EP - FIX SITES THAT HAD ALPHA VERSION OF 2.6 WITH CORRUPT ASQP
+1 NEW %
+2 NEW DIC,DIE,DA,DR,X,Y,Z,DLAYGO,TYPE,IEN,CODE
+3 SET (DIC,DIE,DLAYGO)=9999999.07
SET DIC(0)="LO"
SET DA=""
SET IEN=""
+4 FOR
SET DA=$ORDER(^AUTTMSR("B","ASQP",DA))
IF 'DA
QUIT
Begin DoDot:1
+5 SET TYPE=$PIECE($GET(^AUTTMSR(DA,0)),U,2)
IF TYPE=""
QUIT
+6 IF TYPE="ASQ - PROBLEM SOLVING"
SET IEN=DA
QUIT
+7 ; DEACTIVATE THE BAD MEASUREMENT
IF TYPE="ASQ PROBLEM SOLVING"
Begin DoDot:2
+8 SET TYPE="ZSQ"
SET CODE="00"
+9 SET DR=".01////^S X=TYPE;.02////^S X=TYPE;.03////^S X=CODE;.04////^S X=1"
+10 LOCK +^AUTTMSR(DA):1
IF $TEST
DO ^DIE
LOCK -^AUTTMSR(DA)
+11 QUIT
End DoDot:2
QUIT
+12 QUIT
End DoDot:1
+13 ; THE GOOD MEASUREMENT IS ALREADY IN THERE SO QUIT
IF IEN
DO ^XBFMK
QUIT
+14 ; NEED TO REGISTER THE GOOD MEASUREMENT
+15 SET X="ASQP"
SET TYPE="ASQ - PROBLEM SOLVING"
SET CODE=64
+16 DO ^DIC
IF Y=-1
QUIT
+17 SET DA=+Y
SET DR=".02////^S X=TYPE;.03////^S X=CODE"
+18 LOCK +^AUTTMSR(DA):1
IF $TEST
DO ^DIE
LOCK -^AUTTMSR(DA)
+19 DO ^XBFMK
+20 QUIT
+21 ;
BOPT(OK) ; EP - PLACE BROKER OPTION ON PRIMARY MENU OR ASSIGN IT TO INDIVIDUAL PROVIDER AS A SECONDARY MENU
+1 SET OK=0
+2 NEW DIK,X,Y,Z,%,OIEN
+3 SET OIEN=$ORDER(^DIC(19,"B","VEN RPC",0))
+4 IF 'OIEN
WRITE !!,"Unable to find VEN RPC in the OPTION file!",!!
QUIT
+5 WRITE !,"A user must have broker option VEN RPC to use the Well Child Module!!!"
+6 WRITE !!?5,"1. Add VEN RPC option to the Primay Menu(s) of WCM users (recommended)"
+7 WRITE !?5,"2. Assign VEN RPC to individual users as a seconday menu option"
+8 WRITE !?5,"3. Quit"
+9 SET DIR(0)="NO^1:3:"
SET DIR("A")="Your choice"
DO ^DIR
KILL DIR
+10 IF Y=1
DO BOPT1(OIEN,.OK)
QUIT
+11 IF Y=2
DO BOPT2(OIEN,.OK)
+12 QUIT
+13 ;
BOPT1(OIEN,OK) ; ADD VEN RPC TO PRIMARY MENU(S)
+1 NEW DIC,DA,X,Y,Z,%,MORE,RIEN,DA,DR,DLAYGO,PIEN,DO,GBL
+2 SET MORE=0
LOOP1 IF 'MORE
SET DIC("A")="Enter a primary menu assigned to WCM users: "
SET MORE=1
+1 IF '$TEST
SET DIC("A")="Enter another primary menu assigned to WCM users: "
+2 SET DIC="^DIC(19,"
SET DIC(0)="AEQM"
+3 DO ^DIC
IF Y=-1
DO ^XBFMK
QUIT
+4 KILL DIC("A"),DO,DO(2)
+5 SET (D0,DA(1))=+Y
SET DIC="^DIC(19,"_DA(1)_",10,"
SET DIC(0)="LO"
SET X="`"_OIEN
SET (DLAYGO,DIC("P"))=19.01
+6 DO ^DIC
IF Y=-1
WRITE !?5,"Unable to add VEN RPC to this primary menu"
SET OK=1
QUIT
+7 IF $PIECE(Y,U,3)=""
WRITE !?5,"VEN RPC has already been added to this menu",!
GOTO LOOP1
+8 SET GBL=$NAME(^DIC(19,DA(1),10,+Y))
+9 SET $PIECE(@GBL@(0),U,2)="WCM"
+10 WRITE !?5,"ADDED",!
+11 GOTO LOOP1
+12 ;
BOPT2(OIEN,OK) ; ADD VEN RPC TO PRIMARY MENU(S)
+1 NEW DIC,DA,X,Y,Z,%,MORE,RIEN,DA,DR,DLAYGO,PIEN,DO,GBL
+2 SET MORE=0
LOOP2 IF 'MORE
SET DIC("A")="Enter a WCM user: "
SET MORE=1
+1 IF '$TEST
SET DIC("A")="Enter another WCM user: "
+2 SET DIC="^VA(200,"
SET DIC(0)="AEQM"
+3 DO ^DIC
IF Y=-1
DO ^XBFMK
QUIT
+4 KILL DIC("A"),DO,DO(2)
+5 SET (D0,DA(1))=+Y
SET DIC="^VA(200,"_DA(1)_",203,"
SET DIC(0)="LO"
SET X="`"_OIEN
SET (DLAYGO,DIC("P"))=200.03
+6 DO ^DIC
IF Y=-1
WRITE !?5,"Unable to assign this secondary menu option to the user"
SET OK=1
QUIT
+7 IF $PIECE(Y,U,3)=""
WRITE !?5,"VEN RPC has already been assigned to the user",!
GOTO LOOP2
+8 SET GBL=$NAME(^DIC(19,DA(1),10,+Y))
+9 SET $PIECE(@GBL@(0),U,2)="VENR"
+10 WRITE !?5,"VEN RPC has been assigned as a secondary menu to this user",!
+11 GOTO LOOP2
+12 ;