WV4PST ;HCIOFO/FT-WV*1*4 Post-Installation Routine ;1/4/99 16:36
;;1.0;WOMEN'S HEALTH;**4**;Sep 30, 1998
;
PAT4 ; Entry point for WV*1*4
S ZTDTH=$$HADD^XLFDT($H,"","","",120)
S ZTDESC="WV*1*4 data repair"
S ZTRTN="QUEUE^WV4PST",ZTIO=""
D ^%ZTLOAD
K ZTDESC,ZTDTH,ZTIO,ZTRTN
Q
QUEUE ;
D PATCH
D KILL
Q
PATCH ; Find WV entry in Package file. If none, create WV entry.
D FIND^DIC(9.4,"","","X","WV","","C","","","WVIEN","WVERR")
S WVDA=+$G(WVIEN("DILIST",2,1)) ;get File 9.4 ien
K WVIEN,WVERR
Q:WVDA ;quit if WV entry exists in Package file, fix not needed.
D PF ;create package file entry
D FIND^DIC(9.4,"","","X","WV","","C","","","WVIEN","WVERR")
S WVDA=+$G(WVIEN("DILIST",2,1)) ;get File 9.4 ien
K WVIEN,WVERR
Q:'WVDA
D BF ;Build file (#9.6) repair
D IF ;Install file (#9.7) repair
D VER ;create version multiple for WV entry
D BWGET ; Get Patch Application History (PAH) data values from
; File 9.4 BW entry for WV*1*3 & 4.
D BWDEL ; Kill PAH entry in File 9.4 BW entry for WV*1*3 & 4
Q
PF ; Create Package File entry for WV
K WV94
S WV94(9.4,"+1,",.01)="WOMEN'S HEALTH"
S WV94(9.4,"+1,",1)="WV"
S WV94(9.4,"+1,",2)="Tracks health issues specific to female patients."
S WV94(9.4,"+1,",13)="1.0"
D UPDATE^DIE("","WV94")
K WV94
Q
BF ; Fix package file link for WV*1*3 & 4 in BUILD file (#9.6)
; (i.e., change pointer to WV entry).
N WVBFIEN,WV96NAME
F WV96NAME="WV*1.0*3","WV*1.0*4" D
.D FIND^DIC(9.6,"","","X",WV96NAME,"","B","","","WVIEN","WVERR")
.S WVBFIEN=+$G(WVIEN("DILIST",2,1))
.K WVIEN,WVERR
.Q:'WVBFIEN
.K WVBF
.S WVBF(9.6,WVBFIEN_",",1)=WVDA ;Field #1 - Package File Link
.D UPDATE^DIE("","WVBF")
.K WVBF
.Q
Q
IF ; Fix package file link for WV*1*3 & 4 in INSTALL file (#9.7)
; (i.e., change pointer to WV entry).
F WV97NAME="WV*1.0*3","WV*1.0*4" D
.D FIND^DIC(9.7,"","","X",WV97NAME,"","B","","","WVIEN","WVERR")
.S WVIFIEN=+$G(WVIEN("DILIST",2,1))
.K WVIEN,WVERR
.Q:'WVIFIEN
.K WVIF
.S WVIF(9.7,WVIFIEN_",",1)=WVDA ;Field #1 - Package File Link
.D UPDATE^DIE("","WVIF")
.K WVIF
.Q
Q
VER ; Create VERSION multiple for WV entry
D FIND^DIC(9.7,"","","X","WOMEN'S HEALTH 1.0","","B","","","WVIEN","WVERR")
S WVIFIEN=+$G(WVIEN("DILIST",2,1))
K WVIEN,WVERR
S WVIB=$$GET1^DIQ(9.7,WVIFIEN,9,"I") ;Installed By
S WVICT=$$GET1^DIQ(9.7,WVIFIEN,17,"I") ;Install Complete Time
S:WVICT WVICT=$P(WVICT,".") ;date only
K WV94
S WV94(9.49,"+1,"_WVDA_",",.01)="1.0" ;version #
S WV94(9.49,"+1,"_WVDA_",",1)=2980928 ;date distributed
S WV94(9.49,"+1,"_WVDA_",",2)=WVICT ;install complete time
S WV94(9.49,"+1,"_WVDA_",",3)=WVIB ;installed by
D UPDATE^DIE("","WV94")
K WV94
Q
BWGET ; Get WV*1*3 & 4 PAH entry in Package file (#9.4) for BW
D FIND^DIC(9.4,"","","X","BW","","C","","","WVIEN","WVERR")
S WVBW=+$G(WVIEN("DILIST",2,1))
Q:'WVBW
K WVIEN,WVERR
D FIND^DIC(9.49,","_WVBW_",","","X","1.0","","","","","WVIEN","WVERR")
S WVBW1=+$G(WVIEN("DILIST",2,1))
Q:'WVBW1
F WVBW2=3,4 D
.S WVDA2=WVBW2
.K WVIEN,WVERR
.D FIND^DIC(9.4901,","_WVBW1_","_WVBW_",","","X",WVBW2,"","B","","","WVIEN","WVERR")
.S WVBW2=+$G(WVIEN("DILIST",2,1))
.Q:'WVBW2
.K WVPAH
.D GETS^DIQ(9.4901,WVBW2_","_WVBW1_","_WVBW_",","*","I","WVPAH","WVERR")
.D WVPAH
.Q
Q
WVPAH ; Create a PAH entry in File 9.4 WV entry for WV*1*3 & 4
; Use values from BW entry.
S WVIENS=$O(WVPAH(9.4901,"")) Q:WVIENS="" ;no WV*1*3/4 entry for BW
D FIND^DIC(9.49,","_WVDA_",","","X","1.0","","","","","WVIEN","WVERR")
S WVDA1=+$G(WVIEN("DILIST",2,1))
Q:'WVDA1
K WVIEN,WVERR
D FIND^DIC(9.4901,","_WVDA1_","_WVDA_",","","X",WVDA2,"","B","","","WVIEN","WVERR")
Q:+$G(WVIEN("DILIST",2,1)) ;PAH entry already exists
K WVPAT3
S WVPAT3(9.4901,"+1,"_WVDA1_","_WVDA_",",.01)=WVDA2
S WVPAT3(9.4901,"+1,"_WVDA1_","_WVDA_",",.02)=$G(WVPAH(9.4901,WVIENS,.02,"I"))
S WVPAT3(9.4901,"+1,"_WVDA1_","_WVDA_",",.03)=$G(WVPAH(9.4901,WVIENS,.03,"I"))
D UPDATE^DIE("","WVPAT3")
K WVPAT3
Q
BWDEL ; Delete erroneous BW version entry in Package file (#9.4).
Q:'$G(WVBW1)!'$G(WVBW)
N DA,DIK
S DA=WVBW1,DA(1)=WVBW
S DIK="^DIC(9.4,"_WVBW_",22,"
D ^DIK
Q
KILL ; Kill variables
K WV94,WV96NAME,WV97NAME,WVBF,WVBFIEN,WVBW,WVBW1,WVBW2,WVDA,WVDA1,WVDA2
K WVERR,WVIB,WVICT,WVIEN,WVIENS,WVIF,WVIFIEN,WVPAH,WVPAT3
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWV4PST 4379 printed Nov 22, 2024@17:56:24 Page 2
WV4PST ;HCIOFO/FT-WV*1*4 Post-Installation Routine ;1/4/99 16:36
+1 ;;1.0;WOMEN'S HEALTH;**4**;Sep 30, 1998
+2 ;
PAT4 ; Entry point for WV*1*4
+1 SET ZTDTH=$$HADD^XLFDT($HOROLOG,"","","",120)
+2 SET ZTDESC="WV*1*4 data repair"
+3 SET ZTRTN="QUEUE^WV4PST"
SET ZTIO=""
+4 DO ^%ZTLOAD
+5 KILL ZTDESC,ZTDTH,ZTIO,ZTRTN
+6 QUIT
QUEUE ;
+1 DO PATCH
+2 DO KILL
+3 QUIT
PATCH ; Find WV entry in Package file. If none, create WV entry.
+1 DO FIND^DIC(9.4,"","","X","WV","","C","","","WVIEN","WVERR")
+2 ;get File 9.4 ien
SET WVDA=+$GET(WVIEN("DILIST",2,1))
+3 KILL WVIEN,WVERR
+4 ;quit if WV entry exists in Package file, fix not needed.
if WVDA
QUIT
+5 ;create package file entry
DO PF
+6 DO FIND^DIC(9.4,"","","X","WV","","C","","","WVIEN","WVERR")
+7 ;get File 9.4 ien
SET WVDA=+$GET(WVIEN("DILIST",2,1))
+8 KILL WVIEN,WVERR
+9 if 'WVDA
QUIT
+10 ;Build file (#9.6) repair
DO BF
+11 ;Install file (#9.7) repair
DO IF
+12 ;create version multiple for WV entry
DO VER
+13 ; Get Patch Application History (PAH) data values from
DO BWGET
+14 ; File 9.4 BW entry for WV*1*3 & 4.
+15 ; Kill PAH entry in File 9.4 BW entry for WV*1*3 & 4
DO BWDEL
+16 QUIT
PF ; Create Package File entry for WV
+1 KILL WV94
+2 SET WV94(9.4,"+1,",.01)="WOMEN'S HEALTH"
+3 SET WV94(9.4,"+1,",1)="WV"
+4 SET WV94(9.4,"+1,",2)="Tracks health issues specific to female patients."
+5 SET WV94(9.4,"+1,",13)="1.0"
+6 DO UPDATE^DIE("","WV94")
+7 KILL WV94
+8 QUIT
BF ; Fix package file link for WV*1*3 & 4 in BUILD file (#9.6)
+1 ; (i.e., change pointer to WV entry).
+2 NEW WVBFIEN,WV96NAME
+3 FOR WV96NAME="WV*1.0*3","WV*1.0*4"
Begin DoDot:1
+4 DO FIND^DIC(9.6,"","","X",WV96NAME,"","B","","","WVIEN","WVERR")
+5 SET WVBFIEN=+$GET(WVIEN("DILIST",2,1))
+6 KILL WVIEN,WVERR
+7 if 'WVBFIEN
QUIT
+8 KILL WVBF
+9 ;Field #1 - Package File Link
SET WVBF(9.6,WVBFIEN_",",1)=WVDA
+10 DO UPDATE^DIE("","WVBF")
+11 KILL WVBF
+12 QUIT
End DoDot:1
+13 QUIT
IF ; Fix package file link for WV*1*3 & 4 in INSTALL file (#9.7)
+1 ; (i.e., change pointer to WV entry).
+2 FOR WV97NAME="WV*1.0*3","WV*1.0*4"
Begin DoDot:1
+3 DO FIND^DIC(9.7,"","","X",WV97NAME,"","B","","","WVIEN","WVERR")
+4 SET WVIFIEN=+$GET(WVIEN("DILIST",2,1))
+5 KILL WVIEN,WVERR
+6 if 'WVIFIEN
QUIT
+7 KILL WVIF
+8 ;Field #1 - Package File Link
SET WVIF(9.7,WVIFIEN_",",1)=WVDA
+9 DO UPDATE^DIE("","WVIF")
+10 KILL WVIF
+11 QUIT
End DoDot:1
+12 QUIT
VER ; Create VERSION multiple for WV entry
+1 DO FIND^DIC(9.7,"","","X","WOMEN'S HEALTH 1.0","","B","","","WVIEN","WVERR")
+2 SET WVIFIEN=+$GET(WVIEN("DILIST",2,1))
+3 KILL WVIEN,WVERR
+4 ;Installed By
SET WVIB=$$GET1^DIQ(9.7,WVIFIEN,9,"I")
+5 ;Install Complete Time
SET WVICT=$$GET1^DIQ(9.7,WVIFIEN,17,"I")
+6 ;date only
if WVICT
SET WVICT=$PIECE(WVICT,".")
+7 KILL WV94
+8 ;version #
SET WV94(9.49,"+1,"_WVDA_",",.01)="1.0"
+9 ;date distributed
SET WV94(9.49,"+1,"_WVDA_",",1)=2980928
+10 ;install complete time
SET WV94(9.49,"+1,"_WVDA_",",2)=WVICT
+11 ;installed by
SET WV94(9.49,"+1,"_WVDA_",",3)=WVIB
+12 DO UPDATE^DIE("","WV94")
+13 KILL WV94
+14 QUIT
BWGET ; Get WV*1*3 & 4 PAH entry in Package file (#9.4) for BW
+1 DO FIND^DIC(9.4,"","","X","BW","","C","","","WVIEN","WVERR")
+2 SET WVBW=+$GET(WVIEN("DILIST",2,1))
+3 if 'WVBW
QUIT
+4 KILL WVIEN,WVERR
+5 DO FIND^DIC(9.49,","_WVBW_",","","X","1.0","","","","","WVIEN","WVERR")
+6 SET WVBW1=+$GET(WVIEN("DILIST",2,1))
+7 if 'WVBW1
QUIT
+8 FOR WVBW2=3,4
Begin DoDot:1
+9 SET WVDA2=WVBW2
+10 KILL WVIEN,WVERR
+11 DO FIND^DIC(9.4901,","_WVBW1_","_WVBW_",","","X",WVBW2,"","B","","","WVIEN","WVERR")
+12 SET WVBW2=+$GET(WVIEN("DILIST",2,1))
+13 if 'WVBW2
QUIT
+14 KILL WVPAH
+15 DO GETS^DIQ(9.4901,WVBW2_","_WVBW1_","_WVBW_",","*","I","WVPAH","WVERR")
+16 DO WVPAH
+17 QUIT
End DoDot:1
+18 QUIT
WVPAH ; Create a PAH entry in File 9.4 WV entry for WV*1*3 & 4
+1 ; Use values from BW entry.
+2 ;no WV*1*3/4 entry for BW
SET WVIENS=$ORDER(WVPAH(9.4901,""))
if WVIENS=""
QUIT
+3 DO FIND^DIC(9.49,","_WVDA_",","","X","1.0","","","","","WVIEN","WVERR")
+4 SET WVDA1=+$GET(WVIEN("DILIST",2,1))
+5 if 'WVDA1
QUIT
+6 KILL WVIEN,WVERR
+7 DO FIND^DIC(9.4901,","_WVDA1_","_WVDA_",","","X",WVDA2,"","B","","","WVIEN","WVERR")
+8 ;PAH entry already exists
if +$GET(WVIEN("DILIST",2,1))
QUIT
+9 KILL WVPAT3
+10 SET WVPAT3(9.4901,"+1,"_WVDA1_","_WVDA_",",.01)=WVDA2
+11 SET WVPAT3(9.4901,"+1,"_WVDA1_","_WVDA_",",.02)=$GET(WVPAH(9.4901,WVIENS,.02,"I"))
+12 SET WVPAT3(9.4901,"+1,"_WVDA1_","_WVDA_",",.03)=$GET(WVPAH(9.4901,WVIENS,.03,"I"))
+13 DO UPDATE^DIE("","WVPAT3")
+14 KILL WVPAT3
+15 QUIT
BWDEL ; Delete erroneous BW version entry in Package file (#9.4).
+1 if '$GET(WVBW1)!'$GET(WVBW)
QUIT
+2 NEW DA,DIK
+3 SET DA=WVBW1
SET DA(1)=WVBW
+4 SET DIK="^DIC(9.4,"_WVBW_",22,"
+5 DO ^DIK
+6 QUIT
KILL ; Kill variables
+1 KILL WV94,WV96NAME,WV97NAME,WVBF,WVBFIEN,WVBW,WVBW1,WVBW2,WVDA,WVDA1,WVDA2
+2 KILL WVERR,WVIB,WVICT,WVIEN,WVIENS,WVIF,WVIFIEN,WVPAH,WVPAT3
+3 QUIT