YS60POST ; HIOFO/hrubovcak,FT - PATCH YS*5.01*60 post-init. ;8/8/12 4:07pm
;;5.01;MENTAL HEALTH;**60**;Dec 30, 1994;Build 47
; post-init to delete FileMan files
;Reference to EN^DIU2 supported by DBIA #10014
;Reference to XPDUTL APIs supported by DBIA #10141
;Reference to XLFDT APIs supported by DBIA #10103
;
EN ;
D DELFLS,DDMOD,FX60193
Q
;
DELFLS ; files to be deleted
; # ; name ; storage global
;602;MENTAL HEALTH SITE PARAMETERS;^YSA(602,
;605;MH TEXT;^YTX(
;624;JOB BANK;^YSG("JOB",
;627.99;DSM CONVERSION;^YSD(627.99,
;628;YSEXPERT;^YS(628,
;
D MES^XPDUTL("File deletion started "_$$NOW)
; delete DD's, sub-files first
K DIU
; MENTAL HEALTH SITE PARAMETERS (#602)
F DIU=602.01,602.015 S DIU(0)="DET" D EN^DIU2
S DIU=602,DIU(0)="DET" D EN^DIU2
; MH TEXT (#605)
S DIU=605.01,DIU(0)="DET" D EN^DIU2
S DIU=605,DIU(0)="ET" D EN^DIU2 ; leave data to prevent <PROTECT> error
; JOB BANK (#624)
S DIU=624,DIU(0)="DET" D EN^DIU2
; DSM CONVERSION (#627.99)
F DIU=627.99103,627.9901,627.99111,627.99 S DIU(0)="DET" D EN^DIU2
; YSEXPERT (#628)
F DIU=628.232,628.23,628.02,628 S DIU(0)="DET" D EN^DIU2
;
; delete any ^YSG("ERR") data
N J,C S J="",C=0
F S J=$O(^YSG("ERR",J)) Q:J="" S C=C+1 ; count entries
K ^YSG("ERR") D MES^XPDUTL("Deleted "_$FN(C,",")_" entr"_$S(C'=1:"ies",1:"y")_" from ^YSG(""ERR"")")
;
; 605;MH TEXT;^YTX(
; delete ^YTX data, prevent <PROTECT> error
; don't touch ^YTX(614.501,0)="MH INSTRUMENT EXCHANGE LOG^614.501"
S J="" F S J=$O(^YTX(J)) Q:(J="")!(J>600) K ^YTX(J)
;
D MES^XPDUTL("File deletion finished "_$$NOW)
;
K DIU
Q
;
DDMOD ; modify DD access
;
D MES^XPDUTL("Updating DD access "_$$NOW)
N J,YSF,YSLN,X
F YSLN=1:1 S X=$P($T(DDLST+YSLN),";;",2),YSF=$P(X,U) Q:'YSF D
.Q:'$$VFILE^DILFD(YSF) ; does the file exist?
.N YSECURTY,YSDDERR
.F J="DD","RD","WR","DEL","LAYGO","AUDIT" S YSECURTY(J)="@"
.D FILESEC^DDMOD(YSF,.YSECURTY,"YSDDERR")
.D MES^XPDUTL("Updated the DD for file #"_YSF)
;
Q
;
FX60193 ; strip control chars. in W-P field in file #601.93
D MES^XPDUTL("Checking entries in file 601.93 "_$$NOW)
D AL60193^YTRPWRP
D MES^XPDUTL("Done checking file 601.93 "_$$NOW)
Q
;
; now, external format
NOW() Q $$FMTE^XLFDT($$NOW^XLFDT)
;
DDLST ; list of data dictionaries to have security updated
;;90^MEDICAL RECORD
;;99^PT. TEXT
;;615^MH CLINICAL FILE
;;600.7^CRISIS NOTE DISPLAY
;;617^MH WAIT LIST
;;618^MENTAL HEALTH CENSUS
;;618.2^MENTAL HEALTH TEAM
;;618.4^MENTAL HEALTH INPT
;;620^PROBLEM
;;625^INDICATOR
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYS60POST 2605 printed Nov 22, 2024@17:22:58 Page 2
YS60POST ; HIOFO/hrubovcak,FT - PATCH YS*5.01*60 post-init. ;8/8/12 4:07pm
+1 ;;5.01;MENTAL HEALTH;**60**;Dec 30, 1994;Build 47
+2 ; post-init to delete FileMan files
+3 ;Reference to EN^DIU2 supported by DBIA #10014
+4 ;Reference to XPDUTL APIs supported by DBIA #10141
+5 ;Reference to XLFDT APIs supported by DBIA #10103
+6 ;
EN ;
+1 DO DELFLS
DO DDMOD
DO FX60193
+2 QUIT
+3 ;
DELFLS ; files to be deleted
+1 ; # ; name ; storage global
+2 ;602;MENTAL HEALTH SITE PARAMETERS;^YSA(602,
+3 ;605;MH TEXT;^YTX(
+4 ;624;JOB BANK;^YSG("JOB",
+5 ;627.99;DSM CONVERSION;^YSD(627.99,
+6 ;628;YSEXPERT;^YS(628,
+7 ;
+8 DO MES^XPDUTL("File deletion started "_$$NOW)
+9 ; delete DD's, sub-files first
+10 KILL DIU
+11 ; MENTAL HEALTH SITE PARAMETERS (#602)
+12 FOR DIU=602.01,602.015
SET DIU(0)="DET"
DO EN^DIU2
+13 SET DIU=602
SET DIU(0)="DET"
DO EN^DIU2
+14 ; MH TEXT (#605)
+15 SET DIU=605.01
SET DIU(0)="DET"
DO EN^DIU2
+16 ; leave data to prevent <PROTECT> error
SET DIU=605
SET DIU(0)="ET"
DO EN^DIU2
+17 ; JOB BANK (#624)
+18 SET DIU=624
SET DIU(0)="DET"
DO EN^DIU2
+19 ; DSM CONVERSION (#627.99)
+20 FOR DIU=627.99103,627.9901,627.99111,627.99
SET DIU(0)="DET"
DO EN^DIU2
+21 ; YSEXPERT (#628)
+22 FOR DIU=628.232,628.23,628.02,628
SET DIU(0)="DET"
DO EN^DIU2
+23 ;
+24 ; delete any ^YSG("ERR") data
+25 NEW J,C
SET J=""
SET C=0
+26 ; count entries
FOR
SET J=$ORDER(^YSG("ERR",J))
if J=""
QUIT
SET C=C+1
+27 KILL ^YSG("ERR")
DO MES^XPDUTL("Deleted "_$FNUMBER(C,",")_" entr"_$SELECT(C'=1:"ies",1:"y")_" from ^YSG(""ERR"")")
+28 ;
+29 ; 605;MH TEXT;^YTX(
+30 ; delete ^YTX data, prevent <PROTECT> error
+31 ; don't touch ^YTX(614.501,0)="MH INSTRUMENT EXCHANGE LOG^614.501"
+32 SET J=""
FOR
SET J=$ORDER(^YTX(J))
if (J="")!(J>600)
QUIT
KILL ^YTX(J)
+33 ;
+34 DO MES^XPDUTL("File deletion finished "_$$NOW)
+35 ;
+36 KILL DIU
+37 QUIT
+38 ;
DDMOD ; modify DD access
+1 ;
+2 DO MES^XPDUTL("Updating DD access "_$$NOW)
+3 NEW J,YSF,YSLN,X
+4 FOR YSLN=1:1
SET X=$PIECE($TEXT(DDLST+YSLN),";;",2)
SET YSF=$PIECE(X,U)
if 'YSF
QUIT
Begin DoDot:1
+5 ; does the file exist?
if '$$VFILE^DILFD(YSF)
QUIT
+6 NEW YSECURTY,YSDDERR
+7 FOR J="DD","RD","WR","DEL","LAYGO","AUDIT"
SET YSECURTY(J)="@"
+8 DO FILESEC^DDMOD(YSF,.YSECURTY,"YSDDERR")
+9 DO MES^XPDUTL("Updated the DD for file #"_YSF)
End DoDot:1
+10 ;
+11 QUIT
+12 ;
FX60193 ; strip control chars. in W-P field in file #601.93
+1 DO MES^XPDUTL("Checking entries in file 601.93 "_$$NOW)
+2 DO AL60193^YTRPWRP
+3 DO MES^XPDUTL("Done checking file 601.93 "_$$NOW)
+4 QUIT
+5 ;
+6 ; now, external format
NOW() QUIT $$FMTE^XLFDT($$NOW^XLFDT)
+1 ;
DDLST ; list of data dictionaries to have security updated
+1 ;;90^MEDICAL RECORD
+2 ;;99^PT. TEXT
+3 ;;615^MH CLINICAL FILE
+4 ;;600.7^CRISIS NOTE DISPLAY
+5 ;;617^MH WAIT LIST
+6 ;;618^MENTAL HEALTH CENSUS
+7 ;;618.2^MENTAL HEALTH TEAM
+8 ;;618.4^MENTAL HEALTH INPT
+9 ;;620^PROBLEM
+10 ;;625^INDICATOR
+11 ;