YS130PS0 ;SLC/KCM - Patch 130 Post-Init Update Categories ; 1/25/2017
;;5.01;MENTAL HEALTH;**130**;Dec 30, 1994;Build 62
;
; External Reference ICR#
; ------------------ -----
; %ZOSV 10097
; DIE 2053
; DIK 10013
; DILF 2054
; XPDUTL 10141
;
Q
SHOCATS ; List out categories for inclusion in routine
N TEST,X,CAT,IEN,LIST
S TEST=0 F S TEST=$O(^YTT(601.71,TEST)) Q:'TEST D
. I $P($G(^YTT(601.71,TEST,2)),U,2)'="Y" QUIT ; active instrument?
. S X="",CAT=0 F S CAT=$O(^YTT(601.71,TEST,10,CAT)) Q:'CAT D
. . S IEN=+^YTT(601.71,TEST,10,CAT,0)
. . S X=X_$S($L(X):U,1:"")_$P(^YTT(601.97,IEN,0),U)
. I $L(X) S LIST($P(^YTT(601.71,TEST,0),U))=X
S X="" F S X=$O(LIST(X)) Q:'$L(X) W !," ;;"_X_U_LIST(X)
Q
SETCATS ; Set categories from CATLST into 601.71
; Don't run this install in the dev environment
N Y D GETENV^%ZOSV I $P(Y,U,4)="SPPNXT:VISTA" Q
;
N YSI,YSJ,YSX,YSNM,YSIEN,YSCATS,YSCAT,YSCNT
S YSCNT=0
F YSI=1:1 S YSX=$P($T(CATLST+YSI),";;",2,99) Q:YSX="zzzzz" D
. S YSNM=$P(YSX,U,1),YSCATS=$P(YSX,U,2,99)
. S YSIEN=$O(^YTT(601.71,"B",YSNM,0)) Q:'YSIEN
. D DELCATS(YSIEN)
. N FDA,FDAIEN,DIERR
. F YSJ=1:1:$L(YSCATS,U) D
. . S YSCAT=$P(YSCATS,U,YSJ) Q:'$L(YSCAT)
. . S YSCNT=YSCNT+1
. . S FDA(601.71101,"+"_YSJ_","_YSIEN_",",.01)=YSCAT
. Q:$D(FDA)<10
. D UPDATE^DIE("E","FDA","FDAIEN")
. I $D(DIERR) D MES^XPDUTL(YSNM_": "_$G(^TMP("DIERR",$J,1,"TEXT",1)))
. D CLEAN^DILF
D MES^XPDUTL("Instrument categories updated: "_YSCNT)
Q
DELCATS(YSIEN) ; Delete the categories for instrument YSIEN
I '$O(^YTT(601.71,YSIEN,10,0)) Q ; no child nodes
N DA,DIK
S DA=0,DA(1)=YSIEN,DIK="^YTT(601.71,"_DA(1)_",10,"
F S DA=$O(^YTT(601.71,YSIEN,10,DA)) Q:'DA D ^DIK
Q
CATLST ; Instrument Categories
;;AAQ-2^EBP
;;ACE^
;;AD8^Pain^Cognitive
;;AIMS^Psychosis
;;ASSIST-NIDA^Screening
;;ASSIST-WHOV3^Screening
;;ATQ^Depression^EBP
;;AUDC^Screening^Addiction-SUD
;;AUDIT^Addiction-SUD
;;BAI^Anxiety/PTSD
;;BAM-C^Addiction-SUD
;;BAM-IOP^Addiction-SUD
;;BAM-R^Addiction-SUD
;;BARTHEL INDEX^ADL/Func Status
;;BASIS-24^General Symptoms^Frequent MBCs
;;BASIS-24 PSYCHOSIS^Psychosis
;;BBHI-2^Pain / Health
;;BDI2^Depression
;;BHS^Suicide Prevention
;;BOMC^Cognitive
;;BPRS^Psychosis
;;BPRS-A^Psychosis
;;BRADEN SCALE^Screening
;;BRS^Recovery
;;BSI18^Suicide Prevention
;;BSS^
;;BUSS^General Symptoms
;;C-SSRS^Suicide Prevention^Screening
;;CAGE^Addiction-SUD^Screening
;;CCSA-DSM5^General Symptoms
;;CDR^Cognitive
;;CEMI^EBP
;;CES^Anxiety/PTSD
;;CESD^Depression
;;CIWA-AR-^Addiction-SUD
;;CMQ^
;;COPD^Pain / Health
;;COWS^Addiction-SUD
;;CSDD-RS^Depression
;;CSI^Couples/Family Func
;;CSI PARTNER VERSION^Couples/Family Func
;;CSI-4^Couples/Family Func
;;CSI-4 PARTNER VERSION^Couples/Family Func
;;D.BAS^Sleep
;;D.ERS^Anxiety/PTSD
;;EAT-26^
;;EPDS^Depression
;;ERS^
;;FAST^ADL/Func Status
;;FFMQ^EBP
;;FOCI^
;;FTND^Pain / Health
;;GAD-7^Anxiety/PTSD
;;GAI^Anxiety/PTSD
;;GDS^Depression
;;GDS DEMENTIA^Cognitive
;;GPCOG^Cognitive
;;HSI^Pain / Health
;;I9+C-SSRS^Suicide Prevention^Screening
;;IADL^ADL/Func Status
;;IJSS^Employment
;;IMRS^Recovery
;;ISI^Sleep
;;ISMI^Recovery
;;ISS-2^Frequent MBCs^Depression
;;KATZ-ADL-18PT^
;;KATZ-ADL-6PT^ADL/Func Status
;;MBMD^Personality
;;MCMI3^Personality
;;MCMI4^Personality
;;MHLA^Pain / Health
;;MHLB^Pain / Health
;;MHLC-C^Pain / Health
;;MHRM^Recovery
;;MHRM-10^
;;MINICOG^Cognitive
;;MISS^Anxiety/PTSD
;;MMPI-2-RF^Personality
;;MMPI2^Personality
;;MOCA^Cognitive
;;MOCA ALT 1^Cognitive
;;MOCA ALT 2^Cognitive
;;MORSE FALL SCALE^Screening
;;MPI-PAIN-INTRF^Pain / Health
;;NEO-PI-3^Personality
;;PAI^Personality
;;PC PTSD^Anxiety/PTSD
;;PC-PTSD-5^Anxiety/PTSD^Screening
;;PC-PTSD-5+I9^Anxiety/PTSD^Screening
;;PCL-5^Anxiety/PTSD
;;PCL-5 WEEKLY^Anxiety/PTSD^Frequent MBCs
;;PHQ-15^Pain / Health
;;PHQ-2^Depression^Screening
;;PHQ-2+I9^Suicide Prevention^Screening
;;PHQ9^Depression^Frequent MBCs
;;POQ^Pain / Health
;;PROMIS29^Frequent MBCs
;;PSOCQ^Pain / Health
;;PSS^Anxiety/PTSD
;;PSS-3^Suicide Prevention^Screening
;;PSS-3 2ND^Suicide Prevention^Screening
;;Q-LES-Q-SF^Quality of Life
;;QOLI^Quality of Life
;;RLS^Sleep
;;SBR^Suicide Prevention
;;SCL9R^
;;SF36^Pain / Health
;;SLUMS^Cognitive
;;SMEQ^Sleep
;;SNQ^Sleep
;;SSF^Suicide Prevention
;;STAI^Anxiety/PTSD
;;STMS^Cognitive
;;STOP^Sleep
;;SWEMWBS^Quality of Life
;;VR-12^Pain / Health
;;VRA^Recovery
;;WAI-SR^Recovery^Frequent MBCs
;;WEMWBS^Quality of Life
;;WHODAS 2^ADL/Func Status
;;WHODAS2.0-12^ADL/Func Status
;;WHOQOL BREF^Quality of Life
;;WHYMPI^Pain / Health
;;ZBI SCREEN^Couples/Family Func
;;ZBI SHORT^Couples/Family Func
;;ZUNG^Depression
;;zzzzz
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS130PS0 4972 printed Oct 16, 2024@18:12:55 Page 2
YS130PS0 ;SLC/KCM - Patch 130 Post-Init Update Categories ; 1/25/2017
+1 ;;5.01;MENTAL HEALTH;**130**;Dec 30, 1994;Build 62
+2 ;
+3 ; External Reference ICR#
+4 ; ------------------ -----
+5 ; %ZOSV 10097
+6 ; DIE 2053
+7 ; DIK 10013
+8 ; DILF 2054
+9 ; XPDUTL 10141
+10 ;
+11 QUIT
SHOCATS ; List out categories for inclusion in routine
+1 NEW TEST,X,CAT,IEN,LIST
+2 SET TEST=0
FOR
SET TEST=$ORDER(^YTT(601.71,TEST))
if 'TEST
QUIT
Begin DoDot:1
+3 ; active instrument?
IF $PIECE($GET(^YTT(601.71,TEST,2)),U,2)'="Y"
QUIT
+4 SET X=""
SET CAT=0
FOR
SET CAT=$ORDER(^YTT(601.71,TEST,10,CAT))
if 'CAT
QUIT
Begin DoDot:2
+5 SET IEN=+^YTT(601.71,TEST,10,CAT,0)
+6 SET X=X_$SELECT($LENGTH(X):U,1:"")_$PIECE(^YTT(601.97,IEN,0),U)
End DoDot:2
+7 IF $LENGTH(X)
SET LIST($PIECE(^YTT(601.71,TEST,0),U))=X
End DoDot:1
+8 SET X=""
FOR
SET X=$ORDER(LIST(X))
if '$LENGTH(X)
QUIT
WRITE !," ;;"_X_U_LIST(X)
+9 QUIT
SETCATS ; Set categories from CATLST into 601.71
+1 ; Don't run this install in the dev environment
+2 NEW Y
DO GETENV^%ZOSV
IF $PIECE(Y,U,4)="SPPNXT:VISTA"
QUIT
+3 ;
+4 NEW YSI,YSJ,YSX,YSNM,YSIEN,YSCATS,YSCAT,YSCNT
+5 SET YSCNT=0
+6 FOR YSI=1:1
SET YSX=$PIECE($TEXT(CATLST+YSI),";;",2,99)
if YSX="zzzzz"
QUIT
Begin DoDot:1
+7 SET YSNM=$PIECE(YSX,U,1)
SET YSCATS=$PIECE(YSX,U,2,99)
+8 SET YSIEN=$ORDER(^YTT(601.71,"B",YSNM,0))
if 'YSIEN
QUIT
+9 DO DELCATS(YSIEN)
+10 NEW FDA,FDAIEN,DIERR
+11 FOR YSJ=1:1:$LENGTH(YSCATS,U)
Begin DoDot:2
+12 SET YSCAT=$PIECE(YSCATS,U,YSJ)
if '$LENGTH(YSCAT)
QUIT
+13 SET YSCNT=YSCNT+1
+14 SET FDA(601.71101,"+"_YSJ_","_YSIEN_",",.01)=YSCAT
End DoDot:2
+15 if $DATA(FDA)<10
QUIT
+16 DO UPDATE^DIE("E","FDA","FDAIEN")
+17 IF $DATA(DIERR)
DO MES^XPDUTL(YSNM_": "_$GET(^TMP("DIERR",$JOB,1,"TEXT",1)))
+18 DO CLEAN^DILF
End DoDot:1
+19 DO MES^XPDUTL("Instrument categories updated: "_YSCNT)
+20 QUIT
DELCATS(YSIEN) ; Delete the categories for instrument YSIEN
+1 ; no child nodes
IF '$ORDER(^YTT(601.71,YSIEN,10,0))
QUIT
+2 NEW DA,DIK
+3 SET DA=0
SET DA(1)=YSIEN
SET DIK="^YTT(601.71,"_DA(1)_",10,"
+4 FOR
SET DA=$ORDER(^YTT(601.71,YSIEN,10,DA))
if 'DA
QUIT
DO ^DIK
+5 QUIT
CATLST ; Instrument Categories
+1 ;;AAQ-2^EBP
+2 ;;ACE^
+3 ;;AD8^Pain^Cognitive
+4 ;;AIMS^Psychosis
+5 ;;ASSIST-NIDA^Screening
+6 ;;ASSIST-WHOV3^Screening
+7 ;;ATQ^Depression^EBP
+8 ;;AUDC^Screening^Addiction-SUD
+9 ;;AUDIT^Addiction-SUD
+10 ;;BAI^Anxiety/PTSD
+11 ;;BAM-C^Addiction-SUD
+12 ;;BAM-IOP^Addiction-SUD
+13 ;;BAM-R^Addiction-SUD
+14 ;;BARTHEL INDEX^ADL/Func Status
+15 ;;BASIS-24^General Symptoms^Frequent MBCs
+16 ;;BASIS-24 PSYCHOSIS^Psychosis
+17 ;;BBHI-2^Pain / Health
+18 ;;BDI2^Depression
+19 ;;BHS^Suicide Prevention
+20 ;;BOMC^Cognitive
+21 ;;BPRS^Psychosis
+22 ;;BPRS-A^Psychosis
+23 ;;BRADEN SCALE^Screening
+24 ;;BRS^Recovery
+25 ;;BSI18^Suicide Prevention
+26 ;;BSS^
+27 ;;BUSS^General Symptoms
+28 ;;C-SSRS^Suicide Prevention^Screening
+29 ;;CAGE^Addiction-SUD^Screening
+30 ;;CCSA-DSM5^General Symptoms
+31 ;;CDR^Cognitive
+32 ;;CEMI^EBP
+33 ;;CES^Anxiety/PTSD
+34 ;;CESD^Depression
+35 ;;CIWA-AR-^Addiction-SUD
+36 ;;CMQ^
+37 ;;COPD^Pain / Health
+38 ;;COWS^Addiction-SUD
+39 ;;CSDD-RS^Depression
+40 ;;CSI^Couples/Family Func
+41 ;;CSI PARTNER VERSION^Couples/Family Func
+42 ;;CSI-4^Couples/Family Func
+43 ;;CSI-4 PARTNER VERSION^Couples/Family Func
+44 ;;D.BAS^Sleep
+45 ;;D.ERS^Anxiety/PTSD
+46 ;;EAT-26^
+47 ;;EPDS^Depression
+48 ;;ERS^
+49 ;;FAST^ADL/Func Status
+50 ;;FFMQ^EBP
+51 ;;FOCI^
+52 ;;FTND^Pain / Health
+53 ;;GAD-7^Anxiety/PTSD
+54 ;;GAI^Anxiety/PTSD
+55 ;;GDS^Depression
+56 ;;GDS DEMENTIA^Cognitive
+57 ;;GPCOG^Cognitive
+58 ;;HSI^Pain / Health
+59 ;;I9+C-SSRS^Suicide Prevention^Screening
+60 ;;IADL^ADL/Func Status
+61 ;;IJSS^Employment
+62 ;;IMRS^Recovery
+63 ;;ISI^Sleep
+64 ;;ISMI^Recovery
+65 ;;ISS-2^Frequent MBCs^Depression
+66 ;;KATZ-ADL-18PT^
+67 ;;KATZ-ADL-6PT^ADL/Func Status
+68 ;;MBMD^Personality
+69 ;;MCMI3^Personality
+70 ;;MCMI4^Personality
+71 ;;MHLA^Pain / Health
+72 ;;MHLB^Pain / Health
+73 ;;MHLC-C^Pain / Health
+74 ;;MHRM^Recovery
+75 ;;MHRM-10^
+76 ;;MINICOG^Cognitive
+77 ;;MISS^Anxiety/PTSD
+78 ;;MMPI-2-RF^Personality
+79 ;;MMPI2^Personality
+80 ;;MOCA^Cognitive
+81 ;;MOCA ALT 1^Cognitive
+82 ;;MOCA ALT 2^Cognitive
+83 ;;MORSE FALL SCALE^Screening
+84 ;;MPI-PAIN-INTRF^Pain / Health
+85 ;;NEO-PI-3^Personality
+86 ;;PAI^Personality
+87 ;;PC PTSD^Anxiety/PTSD
+88 ;;PC-PTSD-5^Anxiety/PTSD^Screening
+89 ;;PC-PTSD-5+I9^Anxiety/PTSD^Screening
+90 ;;PCL-5^Anxiety/PTSD
+91 ;;PCL-5 WEEKLY^Anxiety/PTSD^Frequent MBCs
+92 ;;PHQ-15^Pain / Health
+93 ;;PHQ-2^Depression^Screening
+94 ;;PHQ-2+I9^Suicide Prevention^Screening
+95 ;;PHQ9^Depression^Frequent MBCs
+96 ;;POQ^Pain / Health
+97 ;;PROMIS29^Frequent MBCs
+98 ;;PSOCQ^Pain / Health
+99 ;;PSS^Anxiety/PTSD
+100 ;;PSS-3^Suicide Prevention^Screening
+101 ;;PSS-3 2ND^Suicide Prevention^Screening
+102 ;;Q-LES-Q-SF^Quality of Life
+103 ;;QOLI^Quality of Life
+104 ;;RLS^Sleep
+105 ;;SBR^Suicide Prevention
+106 ;;SCL9R^
+107 ;;SF36^Pain / Health
+108 ;;SLUMS^Cognitive
+109 ;;SMEQ^Sleep
+110 ;;SNQ^Sleep
+111 ;;SSF^Suicide Prevention
+112 ;;STAI^Anxiety/PTSD
+113 ;;STMS^Cognitive
+114 ;;STOP^Sleep
+115 ;;SWEMWBS^Quality of Life
+116 ;;VR-12^Pain / Health
+117 ;;VRA^Recovery
+118 ;;WAI-SR^Recovery^Frequent MBCs
+119 ;;WEMWBS^Quality of Life
+120 ;;WHODAS 2^ADL/Func Status
+121 ;;WHODAS2.0-12^ADL/Func Status
+122 ;;WHOQOL BREF^Quality of Life
+123 ;;WHYMPI^Pain / Health
+124 ;;ZBI SCREEN^Couples/Family Func
+125 ;;ZBI SHORT^Couples/Family Func
+126 ;;ZUNG^Depression
+127 ;;zzzzz
+128 ;