YS208PST ;SLC/KCM - Patch 208 Post-init ; Jun 03, 2022@16:21
;;5.01;MENTAL HEALTH;**208**;Dec 30, 1994;Build 23
;
EDTDATE ; date used to update 601.71:18
;;3221018.1315
Q
PRE ; nothing necessary
Q
POST ; post-init
D INSTALLQ^YTXCHG("XCHGLST","YS208PST")
D SETCAT("GASS","Psychosis") ; <-- KCM -- double check this
D UPDURL
Q
;
NEWCAT(CATNM) ; add new category
I $D(^YTT(601.97,"B",CATNM)) QUIT ; already there
N REC
S REC(.01)=CATNM
D FMADD^YTXCHGU(601.97,.REC)
Q
SETCAT(TEST,CATNM) ; add CATegory to TEST if not already there
N CAT
I TEST'=+TEST S TEST=$O(^YTT(601.71,"B",TEST,0)) QUIT:'TEST
S CAT=$O(^YTT(601.97,"B",CATNM,0)) QUIT:'CAT
I $D(^YTT(601.71,TEST,10,"B",CAT))=10 QUIT ; already there
;
N YTFDA,YTIEN,DIERR
S YTFDA(601.71101,"+1,"_TEST_",",.01)=CATNM
D UPDATE^DIE("E","YTFDA","YTIEN")
I $D(DIERR) D MES^XPDUTL(CATNM_": "_$G(^TMP("DIERR",$J,1,"TEXT",1)))
D CLEAN^DILF
Q
DELCAT(TEST,CATNM) ; remove category from test if it is there
N CAT,DIK,DA
I TEST'=+TEST S TEST=$O(^YTT(601.71,"B",TEST,0)) QUIT:'TEST
S CAT=$O(^YTT(601.97,"B",CATNM,0)) QUIT:'CAT
S DA=$O(^YTT(601.71,TEST,10,"B",CAT,0)) Q:'DA
S DA(1)=TEST
S DIK="^YTT(601.71,"_TEST_",10,"
D ^DIK
Q
;
UPDURL ; Update GUI TOOLS URL for MHA Web
N LIST,PARM,ERR,ENT,INST,VAL,TITL,CMD,SPEC,NEWVAL
K ^TMP($J,"XPAR")
S LIST=$NA(^TMP($J,"XPAR"))
S PARM="ORWT TOOLS MENU"
D ENVAL^XPAR(LIST,PARM,"",.ERR,1)
S ^XTMP("YS208-TOOLS",0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"MH Backup Tools Menu"
M ^XTMP("YS208-TOOLS","XPAR")=^TMP($J,"XPAR")
S SPEC("/home?")="/home/b/?",SPEC("/home/?")="/home/b/?" ;In case URL entered home/? Patch 208
S SPEC("/home/a/?")="/home/b/?" ;Patch 204 to 208
S ENT="" F S ENT=$O(^TMP($J,"XPAR",ENT)) Q:ENT="" D
. S INST=0 F S INST=$O(^TMP($J,"XPAR",ENT,INST)) Q:+INST=0 D
.. S VAL=^TMP($J,"XPAR",ENT,INST)
.. I (VAL["mha.domain.ext/app/home?"!(VAL["mha.domain.ext/app/home/")) D
... S TITL=$P(VAL,"="),CMD=$P(VAL,"=",2,99)
... S CMD=$$REPLACE^XLFSTR(CMD,.SPEC)
... S NEWVAL=TITL_"="_CMD
... D BMES^XPDUTL("Updating "_CMD_" for "_ENT)
... D EN^XPAR(ENT,PARM,INST,NEWVAL,.ERR)
K ^TMP($J,"XPAR")
Q
; DATA SCREEN: I $$INCLUDE^YTXCHG(Y,"XCHGLST","YS208PST")
;
XCHGLST(ARRAY) ; return array of instrument exchange entries
; ARRAY(cnt,1)=instrument exchange entry name
; ARRAY(cnt,2)=instrument exchange entry creation date
;
N I,X
F I=1:1 S X=$P($T(ENTRIES+I),";;",2,99) Q:X="zzzzz" D
. S ARRAY(I,1)=$P(X,U)
. S ARRAY(I,2)=$P(X,U,2)
Q
ENTRIES ; New MHA instruments ^ Exchange Entry Date
;;YS*5.01*208 FAST UPD STEP1^01/10/2023@17:07:35
;;YS*5.01*208 FAST UPD STEP2^01/10/2023@15:00:52
;;YS*5.01*208 GASS^10/20/2022@00:10:04
;;zzzzz
;
; -- moved to 218
;;YS*5.01*208 PROMIS10^10/19/2022@23:33:47
; D SETCAT("PROMIS10","Quality of Life")
;;YS*5.01*208 MIOS+B-IPF^11/03/2022@00:07:13
;;YS*5.01*208 SBAF^10/18/2022@18:30:36
;;YS*5.01*208 HIT-6^11/03/2022@00:08:48
;;YS*5.01*208 MIDAS^11/03/2022@00:08:13
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS208PST 3049 printed Nov 22, 2024@17:22:43 Page 2
YS208PST ;SLC/KCM - Patch 208 Post-init ; Jun 03, 2022@16:21
+1 ;;5.01;MENTAL HEALTH;**208**;Dec 30, 1994;Build 23
+2 ;
EDTDATE ; date used to update 601.71:18
+1 ;;3221018.1315
+2 QUIT
PRE ; nothing necessary
+1 QUIT
POST ; post-init
+1 DO INSTALLQ^YTXCHG("XCHGLST","YS208PST")
+2 ; <-- KCM -- double check this
DO SETCAT("GASS","Psychosis")
+3 DO UPDURL
+4 QUIT
+5 ;
NEWCAT(CATNM) ; add new category
+1 ; already there
IF $DATA(^YTT(601.97,"B",CATNM))
QUIT
+2 NEW REC
+3 SET REC(.01)=CATNM
+4 DO FMADD^YTXCHGU(601.97,.REC)
+5 QUIT
SETCAT(TEST,CATNM) ; add CATegory to TEST if not already there
+1 NEW CAT
+2 IF TEST'=+TEST
SET TEST=$ORDER(^YTT(601.71,"B",TEST,0))
if 'TEST
QUIT
+3 SET CAT=$ORDER(^YTT(601.97,"B",CATNM,0))
if 'CAT
QUIT
+4 ; already there
IF $DATA(^YTT(601.71,TEST,10,"B",CAT))=10
QUIT
+5 ;
+6 NEW YTFDA,YTIEN,DIERR
+7 SET YTFDA(601.71101,"+1,"_TEST_",",.01)=CATNM
+8 DO UPDATE^DIE("E","YTFDA","YTIEN")
+9 IF $DATA(DIERR)
DO MES^XPDUTL(CATNM_": "_$GET(^TMP("DIERR",$JOB,1,"TEXT",1)))
+10 DO CLEAN^DILF
+11 QUIT
DELCAT(TEST,CATNM) ; remove category from test if it is there
+1 NEW CAT,DIK,DA
+2 IF TEST'=+TEST
SET TEST=$ORDER(^YTT(601.71,"B",TEST,0))
if 'TEST
QUIT
+3 SET CAT=$ORDER(^YTT(601.97,"B",CATNM,0))
if 'CAT
QUIT
+4 SET DA=$ORDER(^YTT(601.71,TEST,10,"B",CAT,0))
if 'DA
QUIT
+5 SET DA(1)=TEST
+6 SET DIK="^YTT(601.71,"_TEST_",10,"
+7 DO ^DIK
+8 QUIT
+9 ;
UPDURL ; Update GUI TOOLS URL for MHA Web
+1 NEW LIST,PARM,ERR,ENT,INST,VAL,TITL,CMD,SPEC,NEWVAL
+2 KILL ^TMP($JOB,"XPAR")
+3 SET LIST=$NAME(^TMP($JOB,"XPAR"))
+4 SET PARM="ORWT TOOLS MENU"
+5 DO ENVAL^XPAR(LIST,PARM,"",.ERR,1)
+6 SET ^XTMP("YS208-TOOLS",0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"MH Backup Tools Menu"
+7 MERGE ^XTMP("YS208-TOOLS","XPAR")=^TMP($JOB,"XPAR")
+8 ;In case URL entered home/? Patch 208
SET SPEC("/home?")="/home/b/?"
SET SPEC("/home/?")="/home/b/?"
+9 ;Patch 204 to 208
SET SPEC("/home/a/?")="/home/b/?"
+10 SET ENT=""
FOR
SET ENT=$ORDER(^TMP($JOB,"XPAR",ENT))
if ENT=""
QUIT
Begin DoDot:1
+11 SET INST=0
FOR
SET INST=$ORDER(^TMP($JOB,"XPAR",ENT,INST))
if +INST=0
QUIT
Begin DoDot:2
+12 SET VAL=^TMP($JOB,"XPAR",ENT,INST)
+13 IF (VAL["mha.domain.ext/app/home?"!(VAL["mha.domain.ext/app/home/"))
Begin DoDot:3
+14 SET TITL=$PIECE(VAL,"=")
SET CMD=$PIECE(VAL,"=",2,99)
+15 SET CMD=$$REPLACE^XLFSTR(CMD,.SPEC)
+16 SET NEWVAL=TITL_"="_CMD
+17 DO BMES^XPDUTL("Updating "_CMD_" for "_ENT)
+18 DO EN^XPAR(ENT,PARM,INST,NEWVAL,.ERR)
End DoDot:3
End DoDot:2
End DoDot:1
+19 KILL ^TMP($JOB,"XPAR")
+20 QUIT
+21 ; DATA SCREEN: I $$INCLUDE^YTXCHG(Y,"XCHGLST","YS208PST")
+22 ;
XCHGLST(ARRAY) ; return array of instrument exchange entries
+1 ; ARRAY(cnt,1)=instrument exchange entry name
+2 ; ARRAY(cnt,2)=instrument exchange entry creation date
+3 ;
+4 NEW I,X
+5 FOR I=1:1
SET X=$PIECE($TEXT(ENTRIES+I),";;",2,99)
if X="zzzzz"
QUIT
Begin DoDot:1
+6 SET ARRAY(I,1)=$PIECE(X,U)
+7 SET ARRAY(I,2)=$PIECE(X,U,2)
End DoDot:1
+8 QUIT
ENTRIES ; New MHA instruments ^ Exchange Entry Date
+1 ;;YS*5.01*208 FAST UPD STEP1^01/10/2023@17:07:35
+2 ;;YS*5.01*208 FAST UPD STEP2^01/10/2023@15:00:52
+3 ;;YS*5.01*208 GASS^10/20/2022@00:10:04
+4 ;;zzzzz
+5 ;
+6 ; -- moved to 218
+7 ;;YS*5.01*208 PROMIS10^10/19/2022@23:33:47
+8 ; D SETCAT("PROMIS10","Quality of Life")
+9 ;;YS*5.01*208 MIOS+B-IPF^11/03/2022@00:07:13
+10 ;;YS*5.01*208 SBAF^10/18/2022@18:30:36
+11 ;;YS*5.01*208 HIT-6^11/03/2022@00:08:48
+12 ;;YS*5.01*208 MIDAS^11/03/2022@00:08:13
+13 QUIT