YS223PST ;SLC/KCM - Patch 223 Post-init ; 12/10/2020
;;5.01;MENTAL HEALTH;**223**;Dec 30, 1994;Build 22
;
Q
PRE ; nothing necessary
Q
POST ; post-init
D ADDRPC("YTQRCRD DLL")
D SETURL
D SETPROPS
Q
;
SETURL ; set the CPRS DLL URL for this environment
N SITE,PREFIX,VERSION,URL
S SITE=$$STA^XUAF4($$KSP^XUPARAM("INST")),VERSION=""
S PREFIX=$S($$PROD^XUPROD:"",1:"test.")
S URL="https://"_PREFIX_"mha.domain.ext/"_VERSION_"assignment/cprs/"_SITE_"/"
D EN^XPAR("SYS","YSCPRS DLL URL",1,URL)
Q
SETPROPS ; save the current CPRS DLL properties to allow switching
N WNDNM,WNDVER,WEBNM,WEBVER
S WNDNM=$$GET^XPAR("SYS","YSCPRS DLL SAVE",1)
; save name of Windows DLL if first-time install
I '$L(WNDNM) D
. S WNDNM=$$GET^XPAR("SYS","YS MHA_A DLL NAME")
. ; if this account is already set to web DLL (unlikely) --
. I $E(WNDNM,1,12)="YS_MHA_A_WEB" S WNDNM="YS_MHA_A_XE10.dll"
. D EN^XPAR("SYS","YSCPRS DLL SAVE",1,WNDNM)
; save version of Windows DLL if first-time install
S WNDVER=$$GET^XPAR("SYS","YSCPRS DLL SAVE",2)
I '$L(WNDVER) D
. N VERDATA,YS
. S YS("YSB")="YS BROKER1"
. D VERSRV^YTQAPI7(.VERDATA,.YS)
. S WNDVER=$G(VERDATA(3))
. ; if this account already has web DLL version (unlikely) --
. I WNDVER="1.0.5.14" S WNDVER="1.0.5.12" ; assuming CPRS 32b or 32c
. D EN^XPAR("SYS","YSCPRS DLL SAVE",2,WNDVER)
; set the default web DLL name if first-time install
S WEBNM=$$GET^XPAR("SYS","YSCPRS DLL SAVE",3)
I '$L(WEBNM) D EN^XPAR("SYS","YSCPRS DLL SAVE",3,"YS_MHA_A_WEB.dll")
; set the default web DLL version if first-time install
S WEBVER=$$GET^XPAR("SYS","YSCPRS DLL SAVE",4)
I '$L(WEBVER) D EN^XPAR("SYS","YSCPRS DLL SAVE",4,"1.0.5.14")
Q
ADDRPC(YTRPC) ; Add RPC to YS BROKER1
N YTOPT,YTIEN,YTERR,YTFDA
S YTOPT=$$LKOPT^XPDMENU("YS BROKER1") QUIT:'YTOPT
S YTIEN=$$FIND1^DIC(19.05,","_YTOPT_",","B",YTRPC,"","","YTERR") QUIT:YTIEN
I $D(YTERR) D MES^XPDUTL("Find RPC: "_$G(YTERR("DIERR",1,"TEXT",1))) QUIT
S YTFDA(19.05,"+1,"_YTOPT_",",.01)=YTRPC
D UPDATE^DIE("E","YTFDA","","YTERR")
I $D(YTERR) D MES^XPDUTL("Add RPC: "_$G(YTERR("DIERR",1,"TEXT",1)))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS223PST 2152 printed Nov 22, 2024@17:22:48 Page 2
YS223PST ;SLC/KCM - Patch 223 Post-init ; 12/10/2020
+1 ;;5.01;MENTAL HEALTH;**223**;Dec 30, 1994;Build 22
+2 ;
+3 QUIT
PRE ; nothing necessary
+1 QUIT
POST ; post-init
+1 DO ADDRPC("YTQRCRD DLL")
+2 DO SETURL
+3 DO SETPROPS
+4 QUIT
+5 ;
SETURL ; set the CPRS DLL URL for this environment
+1 NEW SITE,PREFIX,VERSION,URL
+2 SET SITE=$$STA^XUAF4($$KSP^XUPARAM("INST"))
SET VERSION=""
+3 SET PREFIX=$SELECT($$PROD^XUPROD:"",1:"test.")
+4 SET URL="https://"_PREFIX_"mha.domain.ext/"_VERSION_"assignment/cprs/"_SITE_"/"
+5 DO EN^XPAR("SYS","YSCPRS DLL URL",1,URL)
+6 QUIT
SETPROPS ; save the current CPRS DLL properties to allow switching
+1 NEW WNDNM,WNDVER,WEBNM,WEBVER
+2 SET WNDNM=$$GET^XPAR("SYS","YSCPRS DLL SAVE",1)
+3 ; save name of Windows DLL if first-time install
+4 IF '$LENGTH(WNDNM)
Begin DoDot:1
+5 SET WNDNM=$$GET^XPAR("SYS","YS MHA_A DLL NAME")
+6 ; if this account is already set to web DLL (unlikely) --
+7 IF $EXTRACT(WNDNM,1,12)="YS_MHA_A_WEB"
SET WNDNM="YS_MHA_A_XE10.dll"
+8 DO EN^XPAR("SYS","YSCPRS DLL SAVE",1,WNDNM)
End DoDot:1
+9 ; save version of Windows DLL if first-time install
+10 SET WNDVER=$$GET^XPAR("SYS","YSCPRS DLL SAVE",2)
+11 IF '$LENGTH(WNDVER)
Begin DoDot:1
+12 NEW VERDATA,YS
+13 SET YS("YSB")="YS BROKER1"
+14 DO VERSRV^YTQAPI7(.VERDATA,.YS)
+15 SET WNDVER=$GET(VERDATA(3))
+16 ; if this account already has web DLL version (unlikely) --
+17 ; assuming CPRS 32b or 32c
IF WNDVER="1.0.5.14"
SET WNDVER="1.0.5.12"
+18 DO EN^XPAR("SYS","YSCPRS DLL SAVE",2,WNDVER)
End DoDot:1
+19 ; set the default web DLL name if first-time install
+20 SET WEBNM=$$GET^XPAR("SYS","YSCPRS DLL SAVE",3)
+21 IF '$LENGTH(WEBNM)
DO EN^XPAR("SYS","YSCPRS DLL SAVE",3,"YS_MHA_A_WEB.dll")
+22 ; set the default web DLL version if first-time install
+23 SET WEBVER=$$GET^XPAR("SYS","YSCPRS DLL SAVE",4)
+24 IF '$LENGTH(WEBVER)
DO EN^XPAR("SYS","YSCPRS DLL SAVE",4,"1.0.5.14")
+25 QUIT
ADDRPC(YTRPC) ; Add RPC to YS BROKER1
+1 NEW YTOPT,YTIEN,YTERR,YTFDA
+2 SET YTOPT=$$LKOPT^XPDMENU("YS BROKER1")
if 'YTOPT
QUIT
+3 SET YTIEN=$$FIND1^DIC(19.05,","_YTOPT_",","B",YTRPC,"","","YTERR")
if YTIEN
QUIT
+4 IF $DATA(YTERR)
DO MES^XPDUTL("Find RPC: "_$GET(YTERR("DIERR",1,"TEXT",1)))
QUIT
+5 SET YTFDA(19.05,"+1,"_YTOPT_",",.01)=YTRPC
+6 DO UPDATE^DIE("E","YTFDA","","YTERR")
+7 IF $DATA(YTERR)
DO MES^XPDUTL("Add RPC: "_$GET(YTERR("DIERR",1,"TEXT",1)))
+8 QUIT