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

WEBGY00.m

Go to the documentation of this file.
WEBGY00 ;SLC/SRM - Post-init for patch WEBG*1.0*0 ;11/18/19  09:39
 ;;1.0;WEB VISTA REMOTE ACCESS MANAGEMENT;**0**;Jun 24, 2019;Build 15
 ;
POST    ; initiate post-init processes
 ;
 N RESULT,APCODE,APNAME,APCBT,APIP,APPORT,APPATH,APCONTEXT
 S APCODE="Dy5IYz(uTC|tYq|iJf2"
 S APNAME="WEBVRAM"
 S APCBT="S"
 S APIP=""
 S APPORT=-1
 S APPATH=""
 S APCONTEXT="WEBG WEBVRAM GUI"
 S RESULT=$$BSESETUP(APCODE,APNAME,APCBT,APIP,APPORT,APPATH,APCONTEXT)
 I '+RESULT D SHOWMSGB("***"_APNAME_" BSE SETUP FAILED: POST INSTALL *NOT* COMPLETED SUCCESSFULLY***")  Q
 D SHOWMSGB("=== POST INSTALL COMPLETED SUCCESSFULLY ===")
 Q
 ;
BSESETUP(APCODE,APNAME,APCBT,APIP,APPORT,APPATH,APCONTEXT) ;
 D SHOWMSG("REMOVING OLD "_APNAME_" ENTRY FROM 8994.5")
 I +$$DELBSE(APCODE,APNAME) D  Q $$SAVEBSE(APCODE,APNAME,APCBT,APIP,APPORT,APPATH,APCONTEXT)
 . D SHOWMSG("ADDING NEW "_APNAME_" ENTRY TO 8994.5")
 D SHOWMSG(APNAME_" SETUP *NOT* COMPLETED SUCCESSFULLY")
 Q 0
 ;
DELBSE(NAME,APNAME) ;
 D SHOWMSG("LOOKING FOR DUPLICATE "_APNAME_" ENTRY")
 N ERR,LIST
 D FIND^DIC(8994.5,"","@","X",NAME,"*","ACODE","","","LIST","ERR")
 I '+$D(LIST("DILIST",0)) D  Q 0
 . D SHOWMSG("ERROR LOOKING UP OLD "_APNAME_" ENTRY")
 . D SHOWMSG(ERR)
 I '+$P(LIST("DILIST",0),"^",1) D  Q 1
 . D SHOWMSG("NO OLD "_APNAME_" 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")
 . D SHOWMSG("REMOVED OLD "_APNAME_" ENTRY FROM 8994.5 ("_LIST("DILIST",2,I)_")")
 . I $D(ERR) D
 .. D SHOWMSG("ERROR DELETING OLD "_APNAME_" ENTRY")
 .. D SHOWMSG(ERR)
 Q 1
 ;
SAVEBSE(APCODE,APNAME,APCBT,APIP,APPORT,APPATH,APCONTEXT) ;
 N FDA,ERR,INDEX
 S FDA(8994.5,"+1,",.01)=APNAME
 S INDEX=$$OPTINDEX(APCONTEXT)
 I +$G(INDEX)'>0 D  Q 0
 . D SHOWMSG("COULD NOT FIND '"_APCONTEXT_"' OPTION:"_INDEX)
 S FDA(8994.5,"+1,",.02)=INDEX
 S FDA(8994.5,"+1,",.03)=APCODE
 S FDA(8994.51,"+2,+1,",.01)=APCBT
 S FDA(8994.51,"+2,+1,",.02)=APPORT
 S FDA(8994.51,"+2,+1,",.03)=APIP
 S FDA(8994.51,"+2,+1,",.04)=APPATH
 D SHOWMSG("WRITING TO REMOTE APPLICATION FILE (8994.5)")
 D UPDATE^DIE("","FDA","","ERR")
 I +$D(ERR) D  Q 0
 . D SHOWMSG(ERR)
 D SHOWMSG("REMOTE APPLICATION ENTRY SUCCESSFULLY ADDED")
 Q 1
 ;
OPTINDEX(ACONTEXT) ; Finds the IEN of the option for a context
 D SHOWMSG("LOOKING FOR '"_ACONTEXT_"':")
 N INDEX,ERR S INDEX=$$FIND1^DIC(19,"","X",ACONTEXT,"B","","ERR")
 I +$D(ERR) D  Q 0
 . D SHOWMSG("ERROR TRYING TO FIND OPTION")
 . D SHOWMSG(ERR)
 D SHOWMSG("FOUND OPTION")
 Q INDEX
 ;
SHOWMSG(MSG) ; Displays messages to the patch log and the user
 N TMSG
 S TMSG=MSG
 D MES^XPDUTL(.TMSG)
 Q
 ;
SHOWMSGB(MSG) ; Displays message with an extra blank line
 N TMSG
 S TMSG=MSG
 D BMES^XPDUTL(.TMSG)
 Q
 ;