YS233PST ;SLC/KCM - Patch 233 Post-init ; 12/10/2020
;;5.01;MENTAL HEALTH;**233**;Dec 30, 1994;Build 13
;
EDTDATE ; date used to update 601.71:18
;;3230609.1019
Q
PRE ; nothing necessary
Q
POST ; post-init
D INSTALLQ^YTXCHG("XCHGLST","YS233PST")
D NEWCAT("COVID")
D SETCAT("C19-YRS","COVID")
D SETCAT("EQ-5D-5L","COVID")
D SETCAT("FSS","COVID")
D SETCAT("MRC","COVID")
D SETCAT("PCFS","COVID")
N C19YRS,EQ5D5L
S C19YRS=$O(^YTT(601.71,"B","C19-YRS",0))
S EQ5D5L=$O(^YTT(601.71,"B","EQ-5D-5L",0))
I C19YRS D QTASK^YTSCOREV(C19YRS_"~2",$H)
I EQ5D5L D QTASK^YTSCOREV(EQ5D5L_"~2",$H)
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
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","YS233PST")
;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*233 C19-YRS^06/09/2023@11:22:53
;;YS*5.01*233 EQ-5D-5L^06/09/2023@14:02:21
;;YS*5.01*233 FSS^06/09/2023@17:07:54
;;YS*5.01*233 MRC^06/09/2023@17:08:27
;;YS*5.01*233 PCFS^06/09/2023@17:09:48
;;zzzzz
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS233PST 2071 printed Dec 13, 2024@02:12:48 Page 2
YS233PST ;SLC/KCM - Patch 233 Post-init ; 12/10/2020
+1 ;;5.01;MENTAL HEALTH;**233**;Dec 30, 1994;Build 13
+2 ;
EDTDATE ; date used to update 601.71:18
+1 ;;3230609.1019
+2 QUIT
PRE ; nothing necessary
+1 QUIT
POST ; post-init
+1 DO INSTALLQ^YTXCHG("XCHGLST","YS233PST")
+2 DO NEWCAT("COVID")
+3 DO SETCAT("C19-YRS","COVID")
+4 DO SETCAT("EQ-5D-5L","COVID")
+5 DO SETCAT("FSS","COVID")
+6 DO SETCAT("MRC","COVID")
+7 DO SETCAT("PCFS","COVID")
+8 NEW C19YRS,EQ5D5L
+9 SET C19YRS=$ORDER(^YTT(601.71,"B","C19-YRS",0))
+10 SET EQ5D5L=$ORDER(^YTT(601.71,"B","EQ-5D-5L",0))
+11 IF C19YRS
DO QTASK^YTSCOREV(C19YRS_"~2",$HOROLOG)
+12 IF EQ5D5L
DO QTASK^YTSCOREV(EQ5D5L_"~2",$HOROLOG)
+13 QUIT
+14 ;
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
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 ;I $$INCLUDE^YTXCHG(Y,"XCHGLST","YS233PST")
+6 ;Q
+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*233 C19-YRS^06/09/2023@11:22:53
+2 ;;YS*5.01*233 EQ-5D-5L^06/09/2023@14:02:21
+3 ;;YS*5.01*233 FSS^06/09/2023@17:07:54
+4 ;;YS*5.01*233 MRC^06/09/2023@17:08:27
+5 ;;YS*5.01*233 PCFS^06/09/2023@17:09:48
+6 ;;zzzzz