WEBVY15 ;SLC/SLCOIFO-Pre and Post-init for patch WEBV*1*15 ;07/08/08 13:54
;;1.0;VISTAWEB;**15**;;Build 3
;
POST ; initiate post-init processes
;
N RESULT,APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT
S APCODE="/lv-q(U|KizwE79@Z8'"
S APNAME="VISTAWEB-FW"
S APIP="127.0.0.1"
S APPORT=19989
S APPATH="/resolve.do"
S APCONTEXT="OR CPRS GUI CHART"
S RESULT=$$BSESETUP(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT)
I '+RESULT W "***V/W BSE SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***",! Q
W "=== POST INSTALL COMPLETED SUCCESSFULLY ==="
Q
;
BSESETUP(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT) ;
W !,"REMOVING OLD V/W ENTRY FROM 8994.5",!
I +$$DELBSE(APCODE) D Q $$SAVEBSE(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT)
.W "ADDING NEW V/W ENTRY TO 8994.5",!
W "V/W SETUP *NOT* COMPLETED SUCCESSFULLY",!
Q 0
;
DELBSE(NAME) ;
W "LOOKING FOR DUPLICATE V/W ENTRY",!
N ERR,LIST
D FIND^DIC(8994.5,"","@","X",NAME,"*","ACODE","","","LIST","ERR")
I '+$D(LIST("DILIST",0)) D Q 0
.W "ERROR LOOKING UP OLD V/W ENTRY",!
.W ERR
I '+$P(LIST("DILIST",0),"^",1) D Q 1
.W "NO OLD V/W ENTRIES FOUND",!
N I,FDA S I=0
F S I=$O(LIST("DILIST",2,I)) Q:'I D
.K FDA S FDA(8994.5,LIST("DILIST",2,I)_",",.01)="@"
.D FILE^DIE("","FDA","ERR")
.W "REMOVED OLD V/W ENTRY FROM 8994.5 ("_LIST("DILIST",2,I),")",!
.I $D(ERR) D
..W "ERROR LOOKING UP OLD V/W ENTRY",!
..W ERR
Q 1
;
SAVEBSE(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT) ;
N FDA,ERR,INDEX
S FDA(8994.5,"+1,",.01)=APNAME
S INDEX=$$CPRSOPT(APCONTEXT)
I +$G(INDEX)'>0 D Q 0
.W "COULD NOT FIND CPRS OPTION:"_INDEX,!
S FDA(8994.5,"+1,",.02)=INDEX
S FDA(8994.5,"+1,",.03)=APCODE
S FDA(8994.51,"+2,+1,",.01)="H"
S FDA(8994.51,"+2,+1,",.02)=APPORT
S FDA(8994.51,"+2,+1,",.03)=APIP
S FDA(8994.51,"+2,+1,",.04)=APPATH
W "WRITING TO REMOTE APPLICATION FILE (8994.5)",!
D UPDATE^DIE("","FDA","","ERR")
I +$D(ERR) D Q 0
.W ERR
W "VISTAWEB ENTRY SUCCESSFULLY ADDED",!
Q 1
;
CPRSOPT(ACONTEXT) ;Finds the IEN of the option for a context
W "LOOKING FOR '"_ACONTEXT_"':"
N INDEX,ERR S INDEX=$$FIND1^DIC(19,"","X",ACONTEXT,"B","","ERR")
I +$D(ERR) D Q 0
.W "ERROR TRYING TO FIND OPTION",!
.W ERR
W "FOUND OPTION",!
Q INDEX
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWEBVY15 2279 printed Nov 22, 2024@17:55:22 Page 2
WEBVY15 ;SLC/SLCOIFO-Pre and Post-init for patch WEBV*1*15 ;07/08/08 13:54
+1 ;;1.0;VISTAWEB;**15**;;Build 3
+2 ;
POST ; initiate post-init processes
+1 ;
+2 NEW RESULT,APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT
+3 SET APCODE="/lv-q(U|KizwE79@Z8'"
+4 SET APNAME="VISTAWEB-FW"
+5 SET APIP="127.0.0.1"
+6 SET APPORT=19989
+7 SET APPATH="/resolve.do"
+8 SET APCONTEXT="OR CPRS GUI CHART"
+9 SET RESULT=$$BSESETUP(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT)
+10 IF '+RESULT
WRITE "***V/W BSE SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***",!
QUIT
+11 WRITE "=== POST INSTALL COMPLETED SUCCESSFULLY ==="
+12 QUIT
+13 ;
BSESETUP(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT) ;
+1 WRITE !,"REMOVING OLD V/W ENTRY FROM 8994.5",!
+2 IF +$$DELBSE(APCODE)
Begin DoDot:1
+3 WRITE "ADDING NEW V/W ENTRY TO 8994.5",!
End DoDot:1
QUIT $$SAVEBSE(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT)
+4 WRITE "V/W SETUP *NOT* COMPLETED SUCCESSFULLY",!
+5 QUIT 0
+6 ;
DELBSE(NAME) ;
+1 WRITE "LOOKING FOR DUPLICATE V/W ENTRY",!
+2 NEW ERR,LIST
+3 DO FIND^DIC(8994.5,"","@","X",NAME,"*","ACODE","","","LIST","ERR")
+4 IF '+$DATA(LIST("DILIST",0))
Begin DoDot:1
+5 WRITE "ERROR LOOKING UP OLD V/W ENTRY",!
+6 WRITE ERR
End DoDot:1
QUIT 0
+7 IF '+$PIECE(LIST("DILIST",0),"^",1)
Begin DoDot:1
+8 WRITE "NO OLD V/W ENTRIES FOUND",!
End DoDot:1
QUIT 1
+9 NEW I,FDA
SET I=0
+10 FOR
SET I=$ORDER(LIST("DILIST",2,I))
if 'I
QUIT
Begin DoDot:1
+11 KILL FDA
SET FDA(8994.5,LIST("DILIST",2,I)_",",.01)="@"
+12 DO FILE^DIE("","FDA","ERR")
+13 WRITE "REMOVED OLD V/W ENTRY FROM 8994.5 ("_LIST("DILIST",2,I),")",!
+14 IF $DATA(ERR)
Begin DoDot:2
+15 WRITE "ERROR LOOKING UP OLD V/W ENTRY",!
+16 WRITE ERR
End DoDot:2
End DoDot:1
+17 QUIT 1
+18 ;
SAVEBSE(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT) ;
+1 NEW FDA,ERR,INDEX
+2 SET FDA(8994.5,"+1,",.01)=APNAME
+3 SET INDEX=$$CPRSOPT(APCONTEXT)
+4 IF +$GET(INDEX)'>0
Begin DoDot:1
+5 WRITE "COULD NOT FIND CPRS OPTION:"_INDEX,!
End DoDot:1
QUIT 0
+6 SET FDA(8994.5,"+1,",.02)=INDEX
+7 SET FDA(8994.5,"+1,",.03)=APCODE
+8 SET FDA(8994.51,"+2,+1,",.01)="H"
+9 SET FDA(8994.51,"+2,+1,",.02)=APPORT
+10 SET FDA(8994.51,"+2,+1,",.03)=APIP
+11 SET FDA(8994.51,"+2,+1,",.04)=APPATH
+12 WRITE "WRITING TO REMOTE APPLICATION FILE (8994.5)",!
+13 DO UPDATE^DIE("","FDA","","ERR")
+14 IF +$DATA(ERR)
Begin DoDot:1
+15 WRITE ERR
End DoDot:1
QUIT 0
+16 WRITE "VISTAWEB ENTRY SUCCESSFULLY ADDED",!
+17 QUIT 1
+18 ;
CPRSOPT(ACONTEXT) ;Finds the IEN of the option for a context
+1 WRITE "LOOKING FOR '"_ACONTEXT_"':"
+2 NEW INDEX,ERR
SET INDEX=$$FIND1^DIC(19,"","X",ACONTEXT,"B","","ERR")
+3 IF +$DATA(ERR)
Begin DoDot:1
+4 WRITE "ERROR TRYING TO FIND OPTION",!
+5 WRITE ERR
End DoDot:1
QUIT 0
+6 WRITE "FOUND OPTION",!
+7 QUIT INDEX
+8 ;