YS173PST ;SLC/KCM - Patch 173 Post-init ; 12/10/2020
;;5.01;MENTAL HEALTH;**173**;Dec 30, 1994;Build 10
;
EDTDATE ; date used to update 601.71:18
;;3210210.1454
Q
PRE ; nothing necessary
Q
POST ; post-init
D INSTALLQ^YTXCHG("XCHGLST","YS173PST")
D SETCAT("PROMIS29 V2.1","Frequent MBCs")
D SETCAT("PROMIS29+2 V2.1","Frequent MBCs")
D DROPTST("PHQ-2+I9")
D DROPTST("PC-PTSD-5+I9")
D DROPTST("I9+C-SSRS")
D DROPTST("PROMIS29")
D SETDTR("C-SSRS",0) ; set to not restartable
Q
;
DROPTST(NAME) ; Change OPERATIONAL to dropped
N IEN,REC
S IEN=$O(^YTT(601.71,"B",NAME,0)) Q:'IEN
S REC(10)="D"
S REC(18)=$P($T(EDTDATE+1),";;",2)
D FMUPD^YTXCHGU(601.71,.REC,IEN)
Q
SETDTR(NAME,DAYS) ; Set DAYS TO RESTART for NAME
N IEN,REC
S IEN=$O(^YTT(601.71,"B",NAME,0)) Q:'IEN
S REC(27)=DAYS
S REC(18)=$P($T(EDTDATE+1),";;",2)
D FMUPD^YTXCHGU(601.71,.REC,IEN)
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
;
;
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*173 PROMIS29^02/10/2021@16:00:06
;;YS*5.01*173 AD8^02/19/2021@18:26:41
;;zzzzz
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS173PST 1797 printed Dec 13, 2024@02:12:32 Page 2
YS173PST ;SLC/KCM - Patch 173 Post-init ; 12/10/2020
+1 ;;5.01;MENTAL HEALTH;**173**;Dec 30, 1994;Build 10
+2 ;
EDTDATE ; date used to update 601.71:18
+1 ;;3210210.1454
+2 QUIT
PRE ; nothing necessary
+1 QUIT
POST ; post-init
+1 DO INSTALLQ^YTXCHG("XCHGLST","YS173PST")
+2 DO SETCAT("PROMIS29 V2.1","Frequent MBCs")
+3 DO SETCAT("PROMIS29+2 V2.1","Frequent MBCs")
+4 DO DROPTST("PHQ-2+I9")
+5 DO DROPTST("PC-PTSD-5+I9")
+6 DO DROPTST("I9+C-SSRS")
+7 DO DROPTST("PROMIS29")
+8 ; set to not restartable
DO SETDTR("C-SSRS",0)
+9 QUIT
+10 ;
DROPTST(NAME) ; Change OPERATIONAL to dropped
+1 NEW IEN,REC
+2 SET IEN=$ORDER(^YTT(601.71,"B",NAME,0))
if 'IEN
QUIT
+3 SET REC(10)="D"
+4 SET REC(18)=$PIECE($TEXT(EDTDATE+1),";;",2)
+5 DO FMUPD^YTXCHGU(601.71,.REC,IEN)
+6 QUIT
SETDTR(NAME,DAYS) ; Set DAYS TO RESTART for NAME
+1 NEW IEN,REC
+2 SET IEN=$ORDER(^YTT(601.71,"B",NAME,0))
if 'IEN
QUIT
+3 SET REC(27)=DAYS
+4 SET REC(18)=$PIECE($TEXT(EDTDATE+1),";;",2)
+5 DO FMUPD^YTXCHGU(601.71,.REC,IEN)
+6 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 ;
+13 ;
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*173 PROMIS29^02/10/2021@16:00:06
+2 ;;YS*5.01*173 AD8^02/19/2021@18:26:41
+3 ;;zzzzz