ORY319 ;SLC/SLCOIFO-Pre and Post-init for patch OR*3*319 ; 9/15/09 8:02am
;;3.0;ORDER ENTRY/RESULTS REPORTING;**319**;Dec 17, 1997;Build 13
;
POST ; post-init process
N CPRSOPT,RPCIEN S CPRSOPT=$$CPRSOPT,RPCIEN=$$RPCIEN("ORVW FACLIST")
I '+$D(CPRSOPT) D Q
.W "CPRS option not found",!
.D NOTCOMP
I '+$D(RPCIEN) D Q
.W "RPC not found",!
.D NOTCOMP
;
I +$$RPCNOPT(CPRSOPT,RPCIEN) D Q
.W "RPC already in option",!
.D COMPLETE
W "Inserting RPC in option",!
I '$$INSERT(CPRSOPT,RPCIEN) D Q
.D NOTCOMP
D COMPLETE
Q
RPCNOPT(OPTIEN,RPCIEN) ;
Q $O(^DIC(19,OPTIEN,"RPC","B",RPCIEN,0))
;
INSERT(OPTIEN,RPCIEN) ;
N REC,ERR
S REC(19.05,"+1,"_OPTIEN_",",.01)=RPCIEN
D UPDATE^DIE("","REC","","ERR")
I +$D(ERR) D Q 0
.W "=== ERROR ===",!
.ZW ERR
Q 1
;
CPRSOPT() ;Finds the IEN of the "OR CPRS GUI CHART" option
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",!
.ZW ERR
W "Found option",!
Q INDEX
;
RPCIEN(RPCNAME) ; Returns the ICN of the given RPC name
W "Looking for RPC '"_RPCNAME_"'..."
N INDEX,ERR S INDEX=$$FIND1^DIC(8994,"","X",RPCNAME,"B","","ERR")
I +$D(ERR) D Q 0
.W "ERROR TRYING TO FIND RPC '"_RPCNAME_"'",!
.ZW ERR
W "Found RPC",!
Q INDEX
;
NOTCOMP ; Not Completed Message
W "Post-install NOT COMPLETED!"
Q
;
COMPLETE ; Completed Message
W "Post-install COMPLETED normally"
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY319 1531 printed Dec 13, 2024@02:41:23 Page 2
ORY319 ;SLC/SLCOIFO-Pre and Post-init for patch OR*3*319 ; 9/15/09 8:02am
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**319**;Dec 17, 1997;Build 13
+2 ;
POST ; post-init process
+1 NEW CPRSOPT,RPCIEN
SET CPRSOPT=$$CPRSOPT
SET RPCIEN=$$RPCIEN("ORVW FACLIST")
+2 IF '+$DATA(CPRSOPT)
Begin DoDot:1
+3 WRITE "CPRS option not found",!
+4 DO NOTCOMP
End DoDot:1
QUIT
+5 IF '+$DATA(RPCIEN)
Begin DoDot:1
+6 WRITE "RPC not found",!
+7 DO NOTCOMP
End DoDot:1
QUIT
+8 ;
+9 IF +$$RPCNOPT(CPRSOPT,RPCIEN)
Begin DoDot:1
+10 WRITE "RPC already in option",!
+11 DO COMPLETE
End DoDot:1
QUIT
+12 WRITE "Inserting RPC in option",!
+13 IF '$$INSERT(CPRSOPT,RPCIEN)
Begin DoDot:1
+14 DO NOTCOMP
End DoDot:1
QUIT
+15 DO COMPLETE
+16 QUIT
RPCNOPT(OPTIEN,RPCIEN) ;
+1 QUIT $ORDER(^DIC(19,OPTIEN,"RPC","B",RPCIEN,0))
+2 ;
INSERT(OPTIEN,RPCIEN) ;
+1 NEW REC,ERR
+2 SET REC(19.05,"+1,"_OPTIEN_",",.01)=RPCIEN
+3 DO UPDATE^DIE("","REC","","ERR")
+4 IF +$DATA(ERR)
Begin DoDot:1
+5 WRITE "=== ERROR ===",!
+6
*** ERROR ***
End DoDot:1
QUIT 0
+7 QUIT 1
+8 ;
CPRSOPT() ;Finds the IEN of the "OR CPRS GUI CHART" option
+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
*** ERROR ***
End DoDot:1
QUIT 0
+7 WRITE "Found option",!
+8 QUIT INDEX
+9 ;
RPCIEN(RPCNAME) ; Returns the ICN of the given RPC name
+1 WRITE "Looking for RPC '"_RPCNAME_"'..."
+2 NEW INDEX,ERR
SET INDEX=$$FIND1^DIC(8994,"","X",RPCNAME,"B","","ERR")
+3 IF +$DATA(ERR)
Begin DoDot:1
+4 WRITE "ERROR TRYING TO FIND RPC '"_RPCNAME_"'",!
+5
*** ERROR ***
End DoDot:1
QUIT 0
+6 WRITE "Found RPC",!
+7 QUIT INDEX
+8 ;
NOTCOMP ; Not Completed Message
+1 WRITE "Post-install NOT COMPLETED!"
+2 QUIT
+3 ;
COMPLETE ; Completed Message
+1 WRITE "Post-install COMPLETED normally"
+2 QUIT
+3 ;