BWPATCH2 ;IHS/ANMC/MWR - UTIL: MOSTLY PATIENT DATA [ 01/23/97 4:37 PM ];15-Feb-2003 22:03;PLS
;;2.0;WOMEN'S HEALTH;**2,8**;JAN 21, 1997
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
;; PATCH ROUTINE TO FIX "AOPEN" XREF IN ^BWNOT( GLOBAL
;; (BW NOTIFICATION FILE).
;
;----------
START ;EP
D INIT
D MAIN
D EOJ
Q
;
;----------
INIT ;EP - Initialization.
D SETVARS^BWUTL5
S IOP=$I D ^%ZIS
S BWPTITL="v2.0 PATCH PROGRAM"
Q
;
;----------
MAIN ;EP - Main program.
D TITLE^BWUTL5(BWPTITL)
D TEXT1
W !!," Do you wish to apply the patch and reindex the data now?"
S DIR("?")=" Enter YES to apply the patch, enter NO to abort."
S DIR(0)="Y",DIR("A")=" Enter Yes or No"
D ^DIR W !
I $D(DIRUT)!(Y<1) D NOCHANGE Q
;
D TITLE^BWUTL5(BWPTITL)
I '$D(^DD(9002086.4))!('$D(^BWNOT(0))) D TEXT2,NOCHANGE Q
;
;---> Correct xref logic in ^DD.
N BWY
S BWY="I ""o""[$P(^BWNOT(DA,0),U,14) S ^BWNOT(""AOPEN"",X,DA)="""""
S ^DD(9002086.4,.02,1,1,1)=BWY
S BWY="K ^BWNOT(""AOPEN"",X,DA)"
S ^DD(9002086.4,.02,1,1,2)=BWY
;
;---> Reindex AOPEN xref.
K ^BWNOT("AOPEN")
S BWINC=$J(($P(^BWNOT(0),U,4))/50,0,0) S:BWINC<1 BWINC=1
W !!?14,"Reindexing..."
W !!!?14,"0% 50% 100%"
W !?14,"----------------------------------------------------"
W !?14,"["
N I,Y S BWIEN=0,BWCOUNT=0
F I=1:1 S BWIEN=$O(^BWNOT(BWIEN)) Q:'BWIEN D
.I '(I#BWINC)&(BWCOUNT<51) W "=" S BWCOUNT=BWCOUNT+1
.S Y=^BWNOT(BWIEN,0)
.Q:"o"'[$P(Y,U,14)
.S ^BWNOT("AOPEN",$P(Y,U,2),BWIEN)=""
I BWCOUNT<50 F I=1:1:50-BWCOUNT W "="
W "]"
W !!!!?14,"Patch applied successfully! Job complete.",!!
D DIRZ^BWUTL3
Q
;
;----------
EOJ ;EP - End of job.
D KILLALL^BWUTL8 K BWINC
Q
;
;----------
TEXT1 ;EP
;;This routine will correct an error in the crossreference logic
;;in the data dictionary for Women's Health Notifications. It will
;;then reindex the "AOPEN" crossreference on field .02 of the
;;BW NOTIFICATIONS File #9002086.4.
;;
;;NO user/programmer action is required. The program will present a
;;progress bar 0%-100% during the job, which may take several minutes.
;;
S BWTAB=5,BWLINL="TEXT1" D PRINTX
Q
;
;----------
TEXT2 ;EP
;;The BW NOTIFICATIONS File does not appear to be loaded on this
;;system. Please contact your Women's Health support person or
;;Mike Remillard at (907)696-7472."
;;
S BWTAB=5,BWLINL="TEXT2" D PRINTX
Q
;
;----------
NOCHANGE ;EP
W !?25,"NO CHANGES MADE!" D DIRZ^BWUTL3
Q
;
;----------
PRINTX ;EP
N I,T,X S T="" F I=1:1:BWTAB S T=T_" "
F I=1:1 S X=$T(@BWLINL+I) Q:X'[";;" W !,T,$P(X,";;",2)
Q
BWPATCH2 ;IHS/ANMC/MWR - UTIL: MOSTLY PATIENT DATA [ 01/23/97 4:37 PM ];15-Feb-2003 22:03;PLS
+1 ;;2.0;WOMEN'S HEALTH;**2,8**;JAN 21, 1997
+2 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
+3 ;; PATCH ROUTINE TO FIX "AOPEN" XREF IN ^BWNOT( GLOBAL
+4 ;; (BW NOTIFICATION FILE).
+5 ;
+6 ;----------
START ;EP
+1 DO INIT
+2 DO MAIN
+3 DO EOJ
+4 QUIT
+5 ;
+6 ;----------
INIT ;EP - Initialization.
+1 DO SETVARS^BWUTL5
+2 SET IOP=$IO
DO ^%ZIS
+3 SET BWPTITL="v2.0 PATCH PROGRAM"
+4 QUIT
+5 ;
+6 ;----------
MAIN ;EP - Main program.
+1 DO TITLE^BWUTL5(BWPTITL)
+2 DO TEXT1
+3 WRITE !!," Do you wish to apply the patch and reindex the data now?"
+4 SET DIR("?")=" Enter YES to apply the patch, enter NO to abort."
+5 SET DIR(0)="Y"
SET DIR("A")=" Enter Yes or No"
+6 DO ^DIR
WRITE !
+7 IF $DATA(DIRUT)!(Y<1)
DO NOCHANGE
QUIT
+8 ;
+9 DO TITLE^BWUTL5(BWPTITL)
+10 IF '$DATA(^DD(9002086.4))!('$DATA(^BWNOT(0)))
DO TEXT2
DO NOCHANGE
QUIT
+11 ;
+12 ;---> Correct xref logic in ^DD.
+13 NEW BWY
+14 SET BWY="I ""o""[$P(^BWNOT(DA,0),U,14) S ^BWNOT(""AOPEN"",X,DA)="""""
+15 SET ^DD(9002086.4,.02,1,1,1)=BWY
+16 SET BWY="K ^BWNOT(""AOPEN"",X,DA)"
+17 SET ^DD(9002086.4,.02,1,1,2)=BWY
+18 ;
+19 ;---> Reindex AOPEN xref.
+20 KILL ^BWNOT("AOPEN")
+21 SET BWINC=$JUSTIFY(($PIECE(^BWNOT(0),U,4))/50,0,0)
IF BWINC<1
SET BWINC=1
+22 WRITE !!?14,"Reindexing..."
+23 WRITE !!!?14,"0% 50% 100%"
+24 WRITE !?14,"----------------------------------------------------"
+25 WRITE !?14,"["
+26 NEW I,Y
SET BWIEN=0
SET BWCOUNT=0
+27 FOR I=1:1
SET BWIEN=$ORDER(^BWNOT(BWIEN))
IF 'BWIEN
QUIT
Begin DoDot:1
+28 IF '(I#BWINC)&(BWCOUNT<51)
WRITE "="
SET BWCOUNT=BWCOUNT+1
+29 SET Y=^BWNOT(BWIEN,0)
+30 IF "o"'[$PIECE(Y,U,14)
QUIT
+31 SET ^BWNOT("AOPEN",$PIECE(Y,U,2),BWIEN)=""
End DoDot:1
+32 IF BWCOUNT<50
FOR I=1:1:50-BWCOUNT
WRITE "="
+33 WRITE "]"
+34 WRITE !!!!?14,"Patch applied successfully! Job complete.",!!
+35 DO DIRZ^BWUTL3
+36 QUIT
+37 ;
+38 ;----------
EOJ ;EP - End of job.
+1 DO KILLALL^BWUTL8
KILL BWINC
+2 QUIT
+3 ;
+4 ;----------
TEXT1 ;EP
+1 ;;This routine will correct an error in the crossreference logic
+2 ;;in the data dictionary for Women's Health Notifications. It will
+3 ;;then reindex the "AOPEN" crossreference on field .02 of the
+4 ;;BW NOTIFICATIONS File #9002086.4.
+5 ;;
+6 ;;NO user/programmer action is required. The program will present a
+7 ;;progress bar 0%-100% during the job, which may take several minutes.
+8 ;;
+9 SET BWTAB=5
SET BWLINL="TEXT1"
DO PRINTX
+10 QUIT
+11 ;
+12 ;----------
TEXT2 ;EP
+1 ;;The BW NOTIFICATIONS File does not appear to be loaded on this
+2 ;;system. Please contact your Women's Health support person or
+3 ;;Mike Remillard at (907)696-7472."
+4 ;;
+5 SET BWTAB=5
SET BWLINL="TEXT2"
DO PRINTX
+6 QUIT
+7 ;
+8 ;----------
NOCHANGE ;EP
+1 WRITE !?25,"NO CHANGES MADE!"
DO DIRZ^BWUTL3
+2 QUIT
+3 ;
+4 ;----------
PRINTX ;EP
+1 NEW I,T,X
SET T=""
FOR I=1:1:BWTAB
SET T=T_" "
+2 FOR I=1:1
SET X=$TEXT(@BWLINL+I)
IF X'[";;"
QUIT
WRITE !,T,$PIECE(X,";;",2)
+3 QUIT