YS217PST ;BAL/KTL - Patch 217 Post-init ; 07/15/2022
;;5.01;MENTAL HEALTH;**217**;Dec 30, 1994;Build 12
;
; 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
;;3221117.2029
Q
PRE ; nothing necessary
Q
POST ; post-init
N OLD,NEW
S OLD="ASRS",NEW="ASRS-6" D CHGNM(OLD,NEW)
D INSTALLQ^YTXCHG("XCHGLST","YS217PST")
D FIXCESD
D NEWCAT("Eating/Nutrition")
D SETCAT("EDE-Q","Eating/Nutrition")
D SETCAT("CIA","Eating/Nutrition")
D DELCAT("AD8","Pain")
D SETCAT("AD8","Pain / Health")
D SETCAT("NUDESC","Cognitive/Learning")
D SETCAT("SIP-AD-30","Addiction-SUD")
D SETCAT("SIP-AD-START","Addiction-SUD")
D SETCAT("SWEMWBS","Quality of Life")
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
;
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
FIXCESD ; fix the missing scoring scale for CESD
I $D(^YTT(601.87,1180,0)) QUIT ; already there
N REC,IEN
S IEN=1180
S REC(.01)=IEN
S REC(1)=96
S REC(2)=1
S REC(3)="Total"
S REC(4)="Total"
D FMADD^YTXCHGU(601.87,.REC,.IEN)
Q
;
CHGNM(OLD,NEW) ; Change test name
N REC,IEN
S IEN=$O(^YTT(601.71,"B",OLD,0))
I 'IEN QUIT ; already updated
S REC(.01)=NEW
S REC(18)=$P($T(EDTDATE+1),";;",2)
D FMUPD^YTXCHGU(601.71,.REC,IEN)
K REC,IEN
S IEN=$O(^YTT(601,"B",OLD,0))
I 'IEN QUIT
S REC(.01)=NEW
D FMUPD^YTXCHGU(601,.REC,IEN)
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","YS217PST")
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*217 CIA^11/17/2022@09:43:30
;;YS*5.01*217 EDE-Q^11/17/2022@09:43:52
;;YS*5.01*217 ASRS-6^11/17/2022@09:44:14
;;zzzzz
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS217PST 3199 printed Nov 22, 2024@17:22:45 Page 2
YS217PST ;BAL/KTL - Patch 217 Post-init ; 07/15/2022
+1 ;;5.01;MENTAL HEALTH;**217**;Dec 30, 1994;Build 12
+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 ;;3221117.2029
+2 QUIT
PRE ; nothing necessary
+1 QUIT
POST ; post-init
+1 NEW OLD,NEW
+2 SET OLD="ASRS"
SET NEW="ASRS-6"
DO CHGNM(OLD,NEW)
+3 DO INSTALLQ^YTXCHG("XCHGLST","YS217PST")
+4 DO FIXCESD
+5 DO NEWCAT("Eating/Nutrition")
+6 DO SETCAT("EDE-Q","Eating/Nutrition")
+7 DO SETCAT("CIA","Eating/Nutrition")
+8 DO DELCAT("AD8","Pain")
+9 DO SETCAT("AD8","Pain / Health")
+10 DO SETCAT("NUDESC","Cognitive/Learning")
+11 DO SETCAT("SIP-AD-30","Addiction-SUD")
+12 DO SETCAT("SIP-AD-START","Addiction-SUD")
+13 DO SETCAT("SWEMWBS","Quality of Life")
+14 QUIT
+15 ;
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 ;
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
FIXCESD ; fix the missing scoring scale for CESD
+1 ; already there
IF $DATA(^YTT(601.87,1180,0))
QUIT
+2 NEW REC,IEN
+3 SET IEN=1180
+4 SET REC(.01)=IEN
+5 SET REC(1)=96
+6 SET REC(2)=1
+7 SET REC(3)="Total"
+8 SET REC(4)="Total"
+9 DO FMADD^YTXCHGU(601.87,.REC,.IEN)
+10 QUIT
+11 ;
CHGNM(OLD,NEW) ; Change test name
+1 NEW REC,IEN
+2 SET IEN=$ORDER(^YTT(601.71,"B",OLD,0))
+3 ; already updated
IF 'IEN
QUIT
+4 SET REC(.01)=NEW
+5 SET REC(18)=$PIECE($TEXT(EDTDATE+1),";;",2)
+6 DO FMUPD^YTXCHGU(601.71,.REC,IEN)
+7 KILL REC,IEN
+8 SET IEN=$ORDER(^YTT(601,"B",OLD,0))
+9 IF 'IEN
QUIT
+10 SET REC(.01)=NEW
+11 DO FMUPD^YTXCHGU(601,.REC,IEN)
+12 QUIT
+13 ;
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","YS217PST")
+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*217 CIA^11/17/2022@09:43:30
+2 ;;YS*5.01*217 EDE-Q^11/17/2022@09:43:52
+3 ;;YS*5.01*217 ASRS-6^11/17/2022@09:44:14
+4 ;;zzzzz
+5 ;
+6 QUIT