YS182PST ;SLC/KCM - Patch 182 Post-init ; 12/10/2020
;;5.01;MENTAL HEALTH;**182**;Dec 30, 1994;Build 13
;
EDTDATE ; date used to update 601.71:18
;;3210713.2053
Q
PRE ; nothing necessary
Q
POST ; post-init
D FIXCTNT
D INSTALLQ^YTXCHG("XCHGLST","YS182PST")
; need to set all the categories...
D NEWCTG("CAT/CAD")
D SETCAT("CAT-ADHD","CAT/CAD")
D SETCAT("CAT-ANX","CAT/CAD")
D SETCAT("CAT-DEP","CAT/CAD")
D SETCAT("CAT-MANIA-HYPOMANIA","CAT/CAD")
D SETCAT("CAT-PSY-C","CAT/CAD")
D SETCAT("CAT-PSY-S","CAT/CAD")
D SETCAT("CAT-PTSD","CAT/CAD")
D SETCAT("CAT-SDOH","CAT/CAD")
D SETCAT("CAT-SS","CAT/CAD")
D SETCAT("CAT-SUD","CAT/CAD")
D SETCAT("CAD-MDD","CAT/CAD")
D SETCAT("CAT-ANX","Anxiety/PTSD")
D SETCAT("CAT-DEP","Depression")
D SETCAT("CAT-PSY-C","Psychosis")
D SETCAT("CAT-PSY-S","Psychosis")
D SETCAT("CAT-PTSD","Anxiety/PTSD")
D SETCAT("CAT-SS","Suicide Prevention")
D SETCAT("CAT-SUD","Addiction-SUD")
D SETCAT("CAD-MDD","Depression")
Q
NEWCTG(CTGNM) ; add a new category name
I $O(^YTT(601.97,"B",CTGNM,0))>0 QUIT
N REC
S REC(.01)=CTGNM
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
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","YS182PST")
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
ENTRIES ; New MHA instruments^Exchange Entry Date
;;YS*5.01*182 NEW CAT TESTS^07/14/2021@00:00:23
;;zzzzz
;
FIXCTNT ; Remove old content entries before instrument install
I $P($G(^YTT(601.76,8681,0)),U,2)=271 QUIT ; already fixed
N IEN
F IEN=8681:1:8692 D
. I +$P($G(^YTT(601.76,IEN,0)),U,2)<271 QUIT
. I +$P($G(^YTT(601.76,IEN,0)),U,2)>282 QUIT
. D FMDEL^YTXCHGU(601.76,IEN)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS182PST 2573 printed Dec 13, 2024@02:12:35 Page 2
YS182PST ;SLC/KCM - Patch 182 Post-init ; 12/10/2020
+1 ;;5.01;MENTAL HEALTH;**182**;Dec 30, 1994;Build 13
+2 ;
EDTDATE ; date used to update 601.71:18
+1 ;;3210713.2053
+2 QUIT
PRE ; nothing necessary
+1 QUIT
POST ; post-init
+1 DO FIXCTNT
+2 DO INSTALLQ^YTXCHG("XCHGLST","YS182PST")
+3 ; need to set all the categories...
+4 DO NEWCTG("CAT/CAD")
+5 DO SETCAT("CAT-ADHD","CAT/CAD")
+6 DO SETCAT("CAT-ANX","CAT/CAD")
+7 DO SETCAT("CAT-DEP","CAT/CAD")
+8 DO SETCAT("CAT-MANIA-HYPOMANIA","CAT/CAD")
+9 DO SETCAT("CAT-PSY-C","CAT/CAD")
+10 DO SETCAT("CAT-PSY-S","CAT/CAD")
+11 DO SETCAT("CAT-PTSD","CAT/CAD")
+12 DO SETCAT("CAT-SDOH","CAT/CAD")
+13 DO SETCAT("CAT-SS","CAT/CAD")
+14 DO SETCAT("CAT-SUD","CAT/CAD")
+15 DO SETCAT("CAD-MDD","CAT/CAD")
+16 DO SETCAT("CAT-ANX","Anxiety/PTSD")
+17 DO SETCAT("CAT-DEP","Depression")
+18 DO SETCAT("CAT-PSY-C","Psychosis")
+19 DO SETCAT("CAT-PSY-S","Psychosis")
+20 DO SETCAT("CAT-PTSD","Anxiety/PTSD")
+21 DO SETCAT("CAT-SS","Suicide Prevention")
+22 DO SETCAT("CAT-SUD","Addiction-SUD")
+23 DO SETCAT("CAD-MDD","Depression")
+24 QUIT
NEWCTG(CTGNM) ; add a new category name
+1 IF $ORDER(^YTT(601.97,"B",CTGNM,0))>0
QUIT
+2 NEW REC
+3 SET REC(.01)=CTGNM
+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
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","YS182PST")
+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
ENTRIES ; New MHA instruments^Exchange Entry Date
+1 ;;YS*5.01*182 NEW CAT TESTS^07/14/2021@00:00:23
+2 ;;zzzzz
+3 ;
FIXCTNT ; Remove old content entries before instrument install
+1 ; already fixed
IF $PIECE($GET(^YTT(601.76,8681,0)),U,2)=271
QUIT
+2 NEW IEN
+3 FOR IEN=8681:1:8692
Begin DoDot:1
+4 IF +$PIECE($GET(^YTT(601.76,IEN,0)),U,2)<271
QUIT
+5 IF +$PIECE($GET(^YTT(601.76,IEN,0)),U,2)>282
QUIT
+6 DO FMDEL^YTXCHGU(601.76,IEN)
End DoDot:1
+7 QUIT