SDES954P ;ALB/JDJ - SD*5.3*954 Post Init Routine ; Aug 31, 2026
;;5.3;SCHEDULING;**954**;AUG 13, 1993;Build 4
;;Per VHA Directive 6402, this routine should not be modified
;
Q
;
POST ; Post-Installation Entry Point
;
D NEWRPCS
Q
;
NEWRPCS ; Post-Installation Process for adding new RPCs to SDESRPC context
N ADDERROR,ERRORS,OPTIONIEN,RPCNAME,RPCTEXT
;
; Retrieve IEN for SDESRPC Option
;
S OPTIONIEN=$O(^DIC(19,"B","SDESRPC",0))
I 'OPTIONIEN D Q
. D MES^XPDUTL("")
. D MES^XPDUTL("** There has been an issue identifying the SDESRPC Option.")
. D MES^XPDUTL(" This patch may need to be re-installed at a later time.")
;
;;; Update OPTION (#19) file
;
D MES^XPDUTL("")
D MES^XPDUTL(">>> Updating the SDESRPC option.")
D MES^XPDUTL("")
;
; Attempt to add new RPC(s) to SDESRPC option
;
S (ADDERROR,ERRORS)=0
F RPCTEXT=1:1 S RPCNAME=$P($T(ADD+RPCTEXT),";;",2) Q:RPCNAME="QUIT" D
. D ADDRPC(.ADDERROR,OPTIONIEN,RPCNAME)
. I ADDERROR S ERRORS=1
;
I ERRORS D Q
. D MES^XPDUTL("")
. D MES^XPDUTL(" *** The issues referenced above need to be addressed. ***")
;
D MES^XPDUTL("")
D MES^XPDUTL(">>> Updates to the SDESRPC have completed successfully. <<<")
;
ADDRPC(ADDERROR,OPTIONIEN,RPCNAME) ;Add RPC(s) to the SDESRPC Option
N FDA,FDAERR,RPCIEN
S ADDERROR=0
;
; Verify that the RPC is valid
;
I '$D(^XWB(8994,"B",RPCNAME)) D Q
. S ADDERROR=1
. D MES^XPDUTL("")
. D MES^XPDUTL("** RPC "_RPCNAME_" does not exist in file #8994 and cannot be added")
. D MES^XPDUTL(" to the SDESRPC Option.")
;
S RPCIEN=$O(^XWB(8994,"B",RPCNAME,0))
I 'RPCIEN D Q
. S ADDERROR=1
. D MES^XPDUTL("")
. D MES^XPDUTL("** There has been an issue identifying the "_RPCNAME_" RPC.")
. D MES^XPDUTL(" This patch may need to be re-installed at a later time.")
;
; Attempt to register the RPC to the SDESRPC context
;
I $D(^DIC(19,OPTIONIEN,"RPC","B",RPCIEN)) D Q
. D MES^XPDUTL("")
. D MES^XPDUTL("** RPC "_RPCNAME_" is already registered to SDESRPC.")
;
S ADDERROR=0
S FDA(19.05,"+1,"_OPTIONIEN_",",.01)=RPCIEN
D UPDATE^DIE(,"FDA",,"FDAERR") K FDA
;
I $D(FDAERR) D Q
. S ADDERROR=1
. D MES^XPDUTL("")
. D MES^XPDUTL("** There was an issue adding RPC "_RPCNAME_" to the")
. D MES^XPDUTL(" SDESRPC context. It may need to be added manually.")
. D MES^XPDUTL(" Additional Error Text: "_$G(FDAERR("DIERR",1,"PARAM","IENS")))
. D MES^XPDUTL(" "_$G(FDAERR("DIERR",1,"TEXT",1))_".")
;
D MES^XPDUTL("")
D MES^XPDUTL(">> RPC "_RPCNAME_" has been successfully registered to SDESRPC.")
Q
;
ADD ; codes to added to SDESRPC context - ;;rpc name
;;SDES2 GET PATIENT REG 2
;;QUIT
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES954P 2741 printed Oct 28, 2026@01:50:39 Page 2
SDES954P ;ALB/JDJ - SD*5.3*954 Post Init Routine ; Aug 31, 2026
+1 ;;5.3;SCHEDULING;**954**;AUG 13, 1993;Build 4
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
+5 ;
POST ; Post-Installation Entry Point
+1 ;
+2 DO NEWRPCS
+3 QUIT
+4 ;
NEWRPCS ; Post-Installation Process for adding new RPCs to SDESRPC context
+1 NEW ADDERROR,ERRORS,OPTIONIEN,RPCNAME,RPCTEXT
+2 ;
+3 ; Retrieve IEN for SDESRPC Option
+4 ;
+5 SET OPTIONIEN=$ORDER(^DIC(19,"B","SDESRPC",0))
+6 IF 'OPTIONIEN
Begin DoDot:1
+7 DO MES^XPDUTL("")
+8 DO MES^XPDUTL("** There has been an issue identifying the SDESRPC Option.")
+9 DO MES^XPDUTL(" This patch may need to be re-installed at a later time.")
End DoDot:1
QUIT
+10 ;
+11 ;;; Update OPTION (#19) file
+12 ;
+13 DO MES^XPDUTL("")
+14 DO MES^XPDUTL(">>> Updating the SDESRPC option.")
+15 DO MES^XPDUTL("")
+16 ;
+17 ; Attempt to add new RPC(s) to SDESRPC option
+18 ;
+19 SET (ADDERROR,ERRORS)=0
+20 FOR RPCTEXT=1:1
SET RPCNAME=$PIECE($TEXT(ADD+RPCTEXT),";;",2)
if RPCNAME="QUIT"
QUIT
Begin DoDot:1
+21 DO ADDRPC(.ADDERROR,OPTIONIEN,RPCNAME)
+22 IF ADDERROR
SET ERRORS=1
End DoDot:1
+23 ;
+24 IF ERRORS
Begin DoDot:1
+25 DO MES^XPDUTL("")
+26 DO MES^XPDUTL(" *** The issues referenced above need to be addressed. ***")
End DoDot:1
QUIT
+27 ;
+28 DO MES^XPDUTL("")
+29 DO MES^XPDUTL(">>> Updates to the SDESRPC have completed successfully. <<<")
+30 ;
ADDRPC(ADDERROR,OPTIONIEN,RPCNAME) ;Add RPC(s) to the SDESRPC Option
+1 NEW FDA,FDAERR,RPCIEN
+2 SET ADDERROR=0
+3 ;
+4 ; Verify that the RPC is valid
+5 ;
+6 IF '$DATA(^XWB(8994,"B",RPCNAME))
Begin DoDot:1
+7 SET ADDERROR=1
+8 DO MES^XPDUTL("")
+9 DO MES^XPDUTL("** RPC "_RPCNAME_" does not exist in file #8994 and cannot be added")
+10 DO MES^XPDUTL(" to the SDESRPC Option.")
End DoDot:1
QUIT
+11 ;
+12 SET RPCIEN=$ORDER(^XWB(8994,"B",RPCNAME,0))
+13 IF 'RPCIEN
Begin DoDot:1
+14 SET ADDERROR=1
+15 DO MES^XPDUTL("")
+16 DO MES^XPDUTL("** There has been an issue identifying the "_RPCNAME_" RPC.")
+17 DO MES^XPDUTL(" This patch may need to be re-installed at a later time.")
End DoDot:1
QUIT
+18 ;
+19 ; Attempt to register the RPC to the SDESRPC context
+20 ;
+21 IF $DATA(^DIC(19,OPTIONIEN,"RPC","B",RPCIEN))
Begin DoDot:1
+22 DO MES^XPDUTL("")
+23 DO MES^XPDUTL("** RPC "_RPCNAME_" is already registered to SDESRPC.")
End DoDot:1
QUIT
+24 ;
+25 SET ADDERROR=0
+26 SET FDA(19.05,"+1,"_OPTIONIEN_",",.01)=RPCIEN
+27 DO UPDATE^DIE(,"FDA",,"FDAERR")
KILL FDA
+28 ;
+29 IF $DATA(FDAERR)
Begin DoDot:1
+30 SET ADDERROR=1
+31 DO MES^XPDUTL("")
+32 DO MES^XPDUTL("** There was an issue adding RPC "_RPCNAME_" to the")
+33 DO MES^XPDUTL(" SDESRPC context. It may need to be added manually.")
+34 DO MES^XPDUTL(" Additional Error Text: "_$GET(FDAERR("DIERR",1,"PARAM","IENS")))
+35 DO MES^XPDUTL(" "_$GET(FDAERR("DIERR",1,"TEXT",1))_".")
End DoDot:1
QUIT
+36 ;
+37 DO MES^XPDUTL("")
+38 DO MES^XPDUTL(">> RPC "_RPCNAME_" has been successfully registered to SDESRPC.")
+39 QUIT
+40 ;
ADD ; codes to added to SDESRPC context - ;;rpc name
+1 ;;SDES2 GET PATIENT REG 2
+2 ;;QUIT
+3 ;