Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDEC800P

SDEC800P.m

Go to the documentation of this file.
SDEC800P ;ALB/MGD - SD*5.3*800 Post Init Routine ; Oct 7, 2021@11:45
 ;;5.3;SCHEDULING;**800**;AUG 13, 1993;Build 23
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ; Reference to $$CREATE^XUSAP In ICR #4677
 ; Reference to ^XWB(8994 (REMOTE PROCEDURE) in ICR #4011
 D FIND
 D RPCNAMCHGS
 Q
 ;
FIND ;FIND THE IEN FOR "VS GUI NATIONAL"
 N SDECDA,SDECDA1
 D MES^XPDUTL("Updating SDEC SETTINGS file (#409.98)")
 S SDECDA=0,SDECDA=$O(^SDEC(409.98,"B","VS GUI NATIONAL",SDECDA)) G:$G(SDECDA)="" NOFIND
 D VERSION   ;update GUI version number and date
 D STOPCODES(SDECDA)
 Q
VERSION ;SET THE NEW VERSION UPDATE IN SDEC SETTING FILE #409.98 TO 1.7.15
 S DA=SDECDA,DIE=409.98,DR="2///1.7.15;3///"_DT D ^DIE  ;update VS GUI NATIONAL
 K DIE,DR,DA
 S SDECDA1=0,SDECDA1=$O(^SDEC(409.98,"B","VS GUI LOCAL",SDECDA1)) Q:$G(SDECDA1)=""    ;get DA for the VS GUI LOCAL
 S DA=SDECDA1,DIE=409.98,DR="2///1.7.15;3///"_DT D ^DIE  ;update VS GUI LOCAL
 K DIE,DR,DA
 Q
 ;
STOPCODES(SDECDA) ; VSE-1742; update the VVC STOP CODE multiple for VS GUI NATIONAL entry; add codes 648 and 679; delete code 225
 ; input - SDECDA: IEN of 409.98
 N FDA,SDERR,SDEC225
 S SDEC225=$O(^SDEC(409.98,SDECDA,3,"B",225,0))
 S FDA(409.987,SDEC225_","_SDECDA_",",.01)="@"
 D FILE^DIE("","FDA")
 K FDA,SDERR
 S FDA(409.987,"?+2,"_SDECDA_",",.01)=648
 S FDA(409.987,"?+3,"_SDECDA_",",.01)=679
 D UPDATE^DIE("","FDA",,"SDERR")
 I $D(SDERR("DIERR")) D BMES^XPDUTL("Error FILING VVC STOP CODE")
 Q
 ;
NOFIND ;"VS GUI NATIONAL" NOT FOUND
 D MES^XPDUTL("VS GUI NATIONAL not found in the SDEC SETTINGS file (#409.98)")
 Q
 ;
CRTPROXYUSR ;create a proxy user
 I '$O(^VA(200,"B","SDECPROXY,ACHERON",0)) D
 . NEW X,SDOPT
 . S SDOPT("SDECRPC")=1
 . S SDOPT("SDESRPC")=2
 . S X=$$CREATE^XUSAP("SDECPROXY,ACHERON","",.SDOPT) ;#ICR 4677
 Q
RPCNAMCHGS ; Change RPC names
 D NAMCHG1 ; Change RPC Name from SDES GET APPT to SDES GET APPT BY IEN
 D NAMCHG2 ; Change RPC Name from SDES SET APPT REQ CREATE to SDES CREATE APPT REQ
 D NAMCHG3 ; Change RPC Name from SDES SET APPT REQ UPDATE to SDES EDIT APPT REQ
 Q
NAMCHG1 ; Change RPC Name from SDES GET APPT to SDES GET APPT BY IEN
 N SDRPCN,SDRPCI
 S SDRPCN="SDES GET APPT"
 S SDRPCI=0
 S SDRPCI=$O(^XWB(8994,"B",SDRPCN,0)) I SDRPCI'>0 D MES^XPDUTL("RPC "_SDRPCN_" not found in REMOTE PROCEDURE file.") Q
 I '$D(^XWB(8994,SDRPCI,0)) D MES^XPDUTL("RPC "_SDRPCN_" not found in REMOTE PROCEDURE file.") Q
 D UPDNAM("SDES GET APPT BY IEN")
 Q
NAMCHG2 ; Change RPC Name from SDES SET APPT REQ CREATE to SDES CREATE APPT REQ
 N SDRPCN,SDRPCI
 S SDRPCN="SDES SET APPT REQ CREATE"
 S SDRPCI=0
 S SDRPCI=$O(^XWB(8994,"B",SDRPCN,0)) I SDRPCI'>0 D MES^XPDUTL("RPC "_SDRPCN_" not found in REMOTE PROCEDURE file.") Q
 I '$D(^XWB(8994,SDRPCI,0)) D MES^XPDUTL("RPC "_SDRPCN_" not found in REMOTE PROCEDURE file.") Q
 D UPDNAM("SDES CREATE APPT REQ")
 Q
NAMCHG3 ; Change RPC Name from SDES SET APPT REQ UPDATE to SDES EDIT APPT REQ
 N SDRPCN,SDRPCI
 S SDRPCN="SDES SET APPT REQ UPDATE"
 S SDRPCI=0
 S SDRPCI=$O(^XWB(8994,"B",SDRPCN,0)) I SDRPCI'>0 D MES^XPDUTL("RPC "_SDRPCN_" not found in REMOTE PROCEDURE file.") Q
 I '$D(^XWB(8994,SDRPCI,0)) D MES^XPDUTL("RPC "_SDRPCN_" not found in REMOTE PROCEDURE file.") Q
 D UPDNAM("SDES EDIT APPT REQ")
 Q
UPDNAM(SDNAME) ; Updating RPC name
 N SDERR,SDFDA,ERR
 S SDRPCI=SDRPCI_","
 S SDFDA(8994,SDRPCI,.01)=SDNAME
 D FILE^DIE("","SDFDA","ERR")
 I $D(ERR("DIERR")) D BMES^XPDUTL("    Error in renaming RPC "_SDRPCN_". Error is "_$G(SDERR("DIERR",1,"TEXT",1))) Q
 D BMES^XPDUTL(SDRPCN_" is renamed to "_SDNAME)
 Q