ORY274 ;SLC/SLCOIFO-Pre and Post-init for patch OR*3*274 ;09/27/07 13:44
;;3.0;ORDER ENTRY/RESULTS REPORTING;**274**;Dec 17, 1997;Build 20
;
PRE ; initiate pre-init processes
D PEOMRPT
Q
;
PEOMRPT ;Remove new & changed reports from OE/RR REPORTS file (101.24)
N ORI,ORVIT
S ORVIT=0
I $P($G(^ORD(101.24,1032,0)),"^",1)="ORRPW ALLERGIES ADV" D
. S ORVIT=1,DA=1032,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1032,0)="ORRPW ALLERGIES ADV",^ORD(101.24,"B","ORRPW ALLERGIES ADV",1032)=""
I $P($G(^ORD(101.24,1100,0)),"^",1)="ORRPW ORDERS CURRENT" D
. S ORVIT=1,DA=1100,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1100,0)="ORRPW ORDERS CURRENT",^ORD(101.24,"B","ORRPW ORDERS CURRENT",1100)=""
I $P($G(^ORD(101.24,1079,0)),"^",1)="ORRPW PHARMACY ALL OUT" D
. S ORVIT=1,DA=1079,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1079,0)="ORRPW PHARMACY ALL OUT",^ORD(101.24,"B","ORRPW PHARMACY ALL OUT",1079)=""
I $P($G(^ORD(101.24,48,0)),"^",1)="ORRP SURGERIES" D
. S ORVIT=1,DA=48,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,48,0)="ORRP SURGERIES",^ORD(101.24,"B","ORRP SURGERIES",48)=""
I $P($G(^ORD(101.24,1137,0)),"^",1)="ORRPW DOD ALLERGIES ADV" D
. S ORVIT=1,DA=1137,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1137,0)="ORRPW DOD ALLERGIES ADV",^ORD(101.24,"B","ORRPW DOD ALLERGIES ADV",1137)=""
I $P($G(^ORD(101.24,1551,0)),"^",1)="ORRPW HDR ALLERGIES" D
. S ORVIT=1,DA=1551,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1551,0)="ORRPW HDR ALLERGIES",^ORD(101.24,"B","ORRPW HDR ALLERGIES",1551)=""
I $P($G(^ORD(101.24,1553,0)),"^",1)="ORRPW HDR PHARMACY OUT" D
. S ORVIT=1,DA=1553,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1553,0)="ORRPW HDR PHARMACY OUT",^ORD(101.24,"B","ORRPW HDR PHARMACY OUT",1553)=""
I $P($G(^ORD(101.24,1105,0)),"^",1)="ORRPW DOD PHARM ALL OUT" D
. S ORVIT=1,DA=1105,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1105,0)="ORRPW DOD PHARM ALL OUT",^ORD(101.24,"B","ORRPW DOD PHARM ALL OUT",1105)=""
I $P($G(^ORD(101.24,1078,0)),"^",1)="ORRPW PHARMACY ACT OUT" D
. S ORVIT=1,DA=1078,DIK="^ORD(101.24," D ^DIK
. S ^ORD(101.24,1078,0)="ORRPW PHARMACY ACT OUT",^ORD(101.24,"B","ORRPW PHARMACY ACT OUT",1078)=""
Q
POST ; initiate post-init processes
;
N RESULT
S RESULT=$$BSESETUP
I '+RESULT W "***BSE SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***",! Q
S RESULT=$$DETSETUP
I '+RESULT W "***DETAIL SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***",! Q
W "=== POST INSTALL COMPLETED SUCCESSFULLY ==="
Q
;
BSESETUP() ;
N NAME S NAME=".w387LyM\4E-t7g*SgPl"
W !,"REMOVING OLD BSE V/W ENTRY",!
I +$$DELBSE(NAME) D Q $$SAVEBSE(NAME)
.W "ADDING NEW BSE V/W ENTRY",!
W "V/W BSE SETUP *NOT* COMPLETED SUCCESSFULLY",!
Q 0
;
DETSETUP() ;
Q 1
;
DELBSE(NAME) ;
W "LOOKING FOR OLD 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 BSE ENTRY:"_LIST("DILIST",2,I),!
.I $D(ERR) D
..W "ERROR LOOKING UP OLD V/W ENTRY",!
..W ERR
Q 1
;
SAVEBSE(NAME) ;
N FDA,ERR,INDEX
S FDA(8994.5,"+1,",.01)="VISTAWEB"
S INDEX=$$CPRSOPT
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)=NAME
S FDA(8994.51,"+2,+1,",.01)="H"
S FDA(8994.51,"+2,+1,",.02)="12181"
S FDA(8994.51,"+2,+1,",.03)="10.2.48.11"
S FDA(8994.51,"+2,+1,",.04)="/resolve.do"
W "WRITING TO (BSE) REMOTE APPLICATION FILE",!
D UPDATE^DIE("","FDA","","ERR")
I +$D(ERR) D Q 0
.W ERR
W "VISTAWEB ENTRY SUCCESSFULLY ADDED",!
Q 1
;
CPRSOPT() ;Finds the IEN of the option for "OR CPRS GUI CHART"
N OPTNAME S OPTNAME="OR CPRS GUI CHART"
W "LOOKING FOR '"_OPTNAME_"'",!
N INDEX,ERR S INDEX=$$FIND1^DIC(19,"","X",OPTNAME,"B","","ERR")
I +$D(ERR) D Q 0
.W "ERROR TRYING TO FIND OPTION",!
.W ERR
W "FOUND OPTION",!
Q INDEX
;
ORY274 ;SLC/SLCOIFO-Pre and Post-init for patch OR*3*274 ;09/27/07 13:44
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**274**;Dec 17, 1997;Build 20
+2 ;
PRE ; initiate pre-init processes
+1 DO PEOMRPT
+2 QUIT
+3 ;
PEOMRPT ;Remove new & changed reports from OE/RR REPORTS file (101.24)
+1 NEW ORI,ORVIT
+2 SET ORVIT=0
+3 IF $PIECE($GET(^ORD(101.24,1032,0)),"^",1)="ORRPW ALLERGIES ADV"
Begin DoDot:1
+4 SET ORVIT=1
SET DA=1032
SET DIK="^ORD(101.24,"
DO ^DIK
+5 SET ^ORD(101.24,1032,0)="ORRPW ALLERGIES ADV"
SET ^ORD(101.24,"B","ORRPW ALLERGIES ADV",1032)=""
End DoDot:1
+6 IF $PIECE($GET(^ORD(101.24,1100,0)),"^",1)="ORRPW ORDERS CURRENT"
Begin DoDot:1
+7 SET ORVIT=1
SET DA=1100
SET DIK="^ORD(101.24,"
DO ^DIK
+8 SET ^ORD(101.24,1100,0)="ORRPW ORDERS CURRENT"
SET ^ORD(101.24,"B","ORRPW ORDERS CURRENT",1100)=""
End DoDot:1
+9 IF $PIECE($GET(^ORD(101.24,1079,0)),"^",1)="ORRPW PHARMACY ALL OUT"
Begin DoDot:1
+10 SET ORVIT=1
SET DA=1079
SET DIK="^ORD(101.24,"
DO ^DIK
+11 SET ^ORD(101.24,1079,0)="ORRPW PHARMACY ALL OUT"
SET ^ORD(101.24,"B","ORRPW PHARMACY ALL OUT",1079)=""
End DoDot:1
+12 IF $PIECE($GET(^ORD(101.24,48,0)),"^",1)="ORRP SURGERIES"
Begin DoDot:1
+13 SET ORVIT=1
SET DA=48
SET DIK="^ORD(101.24,"
DO ^DIK
+14 SET ^ORD(101.24,48,0)="ORRP SURGERIES"
SET ^ORD(101.24,"B","ORRP SURGERIES",48)=""
End DoDot:1
+15 IF $PIECE($GET(^ORD(101.24,1137,0)),"^",1)="ORRPW DOD ALLERGIES ADV"
Begin DoDot:1
+16 SET ORVIT=1
SET DA=1137
SET DIK="^ORD(101.24,"
DO ^DIK
+17 SET ^ORD(101.24,1137,0)="ORRPW DOD ALLERGIES ADV"
SET ^ORD(101.24,"B","ORRPW DOD ALLERGIES ADV",1137)=""
End DoDot:1
+18 IF $PIECE($GET(^ORD(101.24,1551,0)),"^",1)="ORRPW HDR ALLERGIES"
Begin DoDot:1
+19 SET ORVIT=1
SET DA=1551
SET DIK="^ORD(101.24,"
DO ^DIK
+20 SET ^ORD(101.24,1551,0)="ORRPW HDR ALLERGIES"
SET ^ORD(101.24,"B","ORRPW HDR ALLERGIES",1551)=""
End DoDot:1
+21 IF $PIECE($GET(^ORD(101.24,1553,0)),"^",1)="ORRPW HDR PHARMACY OUT"
Begin DoDot:1
+22 SET ORVIT=1
SET DA=1553
SET DIK="^ORD(101.24,"
DO ^DIK
+23 SET ^ORD(101.24,1553,0)="ORRPW HDR PHARMACY OUT"
SET ^ORD(101.24,"B","ORRPW HDR PHARMACY OUT",1553)=""
End DoDot:1
+24 IF $PIECE($GET(^ORD(101.24,1105,0)),"^",1)="ORRPW DOD PHARM ALL OUT"
Begin DoDot:1
+25 SET ORVIT=1
SET DA=1105
SET DIK="^ORD(101.24,"
DO ^DIK
+26 SET ^ORD(101.24,1105,0)="ORRPW DOD PHARM ALL OUT"
SET ^ORD(101.24,"B","ORRPW DOD PHARM ALL OUT",1105)=""
End DoDot:1
+27 IF $PIECE($GET(^ORD(101.24,1078,0)),"^",1)="ORRPW PHARMACY ACT OUT"
Begin DoDot:1
+28 SET ORVIT=1
SET DA=1078
SET DIK="^ORD(101.24,"
DO ^DIK
+29 SET ^ORD(101.24,1078,0)="ORRPW PHARMACY ACT OUT"
SET ^ORD(101.24,"B","ORRPW PHARMACY ACT OUT",1078)=""
End DoDot:1
+30 QUIT
POST ; initiate post-init processes
+1 ;
+2 NEW RESULT
+3 SET RESULT=$$BSESETUP
+4 IF '+RESULT
WRITE "***BSE SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***",!
QUIT
+5 SET RESULT=$$DETSETUP
+6 IF '+RESULT
WRITE "***DETAIL SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***",!
QUIT
+7 WRITE "=== POST INSTALL COMPLETED SUCCESSFULLY ==="
+8 QUIT
+9 ;
BSESETUP() ;
+1 NEW NAME
SET NAME=".w387LyM\4E-t7g*SgPl"
+2 WRITE !,"REMOVING OLD BSE V/W ENTRY",!
+3 IF +$$DELBSE(NAME)
Begin DoDot:1
+4 WRITE "ADDING NEW BSE V/W ENTRY",!
End DoDot:1
QUIT $$SAVEBSE(NAME)
+5 WRITE "V/W BSE SETUP *NOT* COMPLETED SUCCESSFULLY",!
+6 QUIT 0
+7 ;
DETSETUP() ;
+1 QUIT 1
+2 ;
DELBSE(NAME) ;
+1 WRITE "LOOKING FOR OLD 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 BSE ENTRY:"_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(NAME) ;
+1 NEW FDA,ERR,INDEX
+2 SET FDA(8994.5,"+1,",.01)="VISTAWEB"
+3 SET INDEX=$$CPRSOPT
+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)=NAME
+8 SET FDA(8994.51,"+2,+1,",.01)="H"
+9 SET FDA(8994.51,"+2,+1,",.02)="12181"
+10 SET FDA(8994.51,"+2,+1,",.03)="10.2.48.11"
+11 SET FDA(8994.51,"+2,+1,",.04)="/resolve.do"
+12 WRITE "WRITING TO (BSE) REMOTE APPLICATION FILE",!
+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() ;Finds the IEN of the option for "OR CPRS GUI CHART"
+1 NEW OPTNAME
SET OPTNAME="OR CPRS GUI CHART"
+2 WRITE "LOOKING FOR '"_OPTNAME_"'",!
+3 NEW INDEX,ERR
SET INDEX=$$FIND1^DIC(19,"","X",OPTNAME,"B","","ERR")
+4 IF +$DATA(ERR)
Begin DoDot:1
+5 WRITE "ERROR TRYING TO FIND OPTION",!
+6 WRITE ERR
End DoDot:1
QUIT 0
+7 WRITE "FOUND OPTION",!
+8 QUIT INDEX
+9 ;