- YS199PST ;BAL/KTL - Patch 199 Post-init ; 01/27/2022
- ;;5.01;MENTAL HEALTH;**199**;Dec 30, 1994;Build 18
- ;
- ; Reference to EN^XPAR in ICR #2263
- ; Reference to GETLST^XPAR in ICR #2263
- ; Reference to XLFSTR in ICR #10104
- Q
- EDTDATE ; date used to update 601.71:18
- ;;3220127.2029
- Q
- PRE ; nothing necessary
- Q
- POST ; post-init
- D INSTALLQ^YTXCHG("XCHGLST","YS199PST")
- D UPDTST("BARTHEL INDEX")
- D UPDTST("BASIS-24 PSYCHOSIS")
- D UPDTST("BBHI-2")
- D UPDTST("BPRS-A")
- D UPDTST("C-SSRS")
- D UPDTST("I9+C-SSRS")
- D UPDTST("PSS-3")
- D UPDTST("PSS-3 2ND")
- D UPDTST("WHODAS2.0-12")
- D CATS4CAT
- D UPDURL
- Q
- ;
- UPDTST(NAME) ; Update Date Edited
- N IEN,REC
- S IEN=$O(^YTT(601.71,"B",NAME,0)) Q:'IEN
- S REC(18)=$P($T(EDTDATE+1),";;",2)
- D FMUPD^YTXCHGU(601.71,.REC,IEN)
- Q
- ;
- CATS4CAT ; Add categories for new CAT's
- D SETCAT("CAD-PTSD-DX","CAT/CAD")
- D SETCAT("CAD-PTSD-DX","Anxiety/PTSD")
- D SETCAT("CAT-PTSD-E","CAT/CAD")
- D SETCAT("CAT-PTSD-E","Anxiety/PTSD")
- 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
- ;
- SCREEN ; line to put in DATA SCREEN of KIDS build
- ; $$INCLUDE^YTXCHG(Y,"TAG","RTN") calls TAG^RTN to get an array of
- ; instrument exchange entries to include in the build. It sets Y
- ; to true if the entry should be included.
- ;
- I $$INCLUDE^YTXCHG(Y,"XCHGLST","YS199PST")
- Q
- ;
- 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
- 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("YS199-TOOLS",0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"MH Backup Tools Menu"
- M ^XTMP("YS199-TOOLS","XPAR")=^TMP($J,"XPAR")
- S SPEC("/home?")="/home/a/?",SPEC("/home/?")="/home/a/?" ;In case URL entered home/?
- 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
- ENTRIES ; New MHA instruments^Exchange Entry Date
- ;;YS*5.01*199 UPDATES^01/27/2022@09:02:19
- ;;YS*5.01*199 CAT PTSD^02/28/2022@16:15:18
- ;;zzzzz
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS199PST 3065 printed Mar 13, 2025@21:17:22 Page 2
- YS199PST ;BAL/KTL - Patch 199 Post-init ; 01/27/2022
- +1 ;;5.01;MENTAL HEALTH;**199**;Dec 30, 1994;Build 18
- +2 ;
- +3 ; Reference to EN^XPAR in ICR #2263
- +4 ; Reference to GETLST^XPAR in ICR #2263
- +5 ; Reference to XLFSTR in ICR #10104
- +6 QUIT
- EDTDATE ; date used to update 601.71:18
- +1 ;;3220127.2029
- +2 QUIT
- PRE ; nothing necessary
- +1 QUIT
- POST ; post-init
- +1 DO INSTALLQ^YTXCHG("XCHGLST","YS199PST")
- +2 DO UPDTST("BARTHEL INDEX")
- +3 DO UPDTST("BASIS-24 PSYCHOSIS")
- +4 DO UPDTST("BBHI-2")
- +5 DO UPDTST("BPRS-A")
- +6 DO UPDTST("C-SSRS")
- +7 DO UPDTST("I9+C-SSRS")
- +8 DO UPDTST("PSS-3")
- +9 DO UPDTST("PSS-3 2ND")
- +10 DO UPDTST("WHODAS2.0-12")
- +11 DO CATS4CAT
- +12 DO UPDURL
- +13 QUIT
- +14 ;
- UPDTST(NAME) ; Update Date Edited
- +1 NEW IEN,REC
- +2 SET IEN=$ORDER(^YTT(601.71,"B",NAME,0))
- if 'IEN
- QUIT
- +3 SET REC(18)=$PIECE($TEXT(EDTDATE+1),";;",2)
- +4 DO FMUPD^YTXCHGU(601.71,.REC,IEN)
- +5 QUIT
- +6 ;
- CATS4CAT ; Add categories for new CAT's
- +1 DO SETCAT("CAD-PTSD-DX","CAT/CAD")
- +2 DO SETCAT("CAD-PTSD-DX","Anxiety/PTSD")
- +3 DO SETCAT("CAT-PTSD-E","CAT/CAD")
- +4 DO SETCAT("CAT-PTSD-E","Anxiety/PTSD")
- +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
- +12 ;
- SCREEN ; line to put in DATA SCREEN of KIDS build
- +1 ; $$INCLUDE^YTXCHG(Y,"TAG","RTN") calls TAG^RTN to get an array of
- +2 ; instrument exchange entries to include in the build. It sets Y
- +3 ; to true if the entry should be included.
- +4 ;
- +5 IF $$INCLUDE^YTXCHG(Y,"XCHGLST","YS199PST")
- +6 QUIT
- +7 ;
- 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
- 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("YS199-TOOLS",0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"MH Backup Tools Menu"
- +7 MERGE ^XTMP("YS199-TOOLS","XPAR")=^TMP($JOB,"XPAR")
- +8 ;In case URL entered home/?
- SET SPEC("/home?")="/home/a/?"
- SET SPEC("/home/?")="/home/a/?"
- +9 SET ENT=""
- FOR
- SET ENT=$ORDER(^TMP($JOB,"XPAR",ENT))
- if ENT=""
- QUIT
- Begin DoDot:1
- +10 SET INST=0
- FOR
- SET INST=$ORDER(^TMP($JOB,"XPAR",ENT,INST))
- if +INST=0
- QUIT
- Begin DoDot:2
- +11 SET VAL=^TMP($JOB,"XPAR",ENT,INST)
- +12 IF (VAL["mha.domain.ext/app/home?"!(VAL["mha.domain.ext/app/home/?"))
- Begin DoDot:3
- +13 SET TITL=$PIECE(VAL,"=")
- SET CMD=$PIECE(VAL,"=",2,99)
- +14 SET CMD=$$REPLACE^XLFSTR(CMD,.SPEC)
- +15 SET NEWVAL=TITL_"="_CMD
- +16 DO BMES^XPDUTL("Updating "_CMD_" for "_ENT)
- +17 DO EN^XPAR(ENT,PARM,INST,NEWVAL,.ERR)
- End DoDot:3
- End DoDot:2
- End DoDot:1
- +18 KILL ^TMP($JOB,"XPAR")
- +19 QUIT
- ENTRIES ; New MHA instruments^Exchange Entry Date
- +1 ;;YS*5.01*199 UPDATES^01/27/2022@09:02:19
- +2 ;;YS*5.01*199 CAT PTSD^02/28/2022@16:15:18
- +3 ;;zzzzz