BVCONV1 ; IHS/ITSC/JDH - PCC CONVERSION PROCESS; [ 12/06/2002 10:05 AM ]
;;2.0;IHS V FILES 200 CONVERSION;;MAR 29, 2002
W !!,"Use PRECMP^BVCONV to call this routine." Q
;
EN ; EP PCC conversion routine
N X,BVCERR,POP,BVCEXP,BVCPRNM
S BVCQ=$D(^BVCONV(1,"VARS"))
S X=$ST($ST-1,"PLACE")
I 'BVCQ,X'["O+3^BVCONV" W !,"This routine must be called from the interface",!,"aborting" Q ;caller must be from the interface
S X=$ST($ST-1,"MCODE")
I 'BVCQ,X'["D EN^BVCONV1 ; run the conversion" W !,"This routine must be called from the interface",!,"aborting" Q ; caller must be this
D INIT
D CONV ; convert
; set PCC Conversion flag in ^AUTTSITE
D:'BVCERR!BVCPRCP POST
Q
Q
;
CONV ; convert PCC files to use file 200 vs 6 pointer.
N X
S X=$ST($ST-1,"PLACE")
I 'BVCQ,'BVCERR,X'["EN+8^BVCONV1" W !,"this is not a valid entry point",!,"aborting" Q ;caller must be from tag EN
S X=$ST($ST-1,"MCODE")
I 'BVCQ,'BVCERR,X'["D CONV ;" W !,"this is not a valid entry point",!,"aborting" Q ;convert" ; caller must be this ;TASSC/MFD changed X'= to X'[ to allow functioning with Cache
;
N BVCLPCT,BVCNUMB,BVCDA,BVCFLD,BVCP6,BVCPRNM,BVCP200,BVCNPNM,DA,DR,BVC
S BVC=1 ; required for the input transform of field .01 of file 9000010.06
S BVCNUMB=90000,X="ERR^BVCONV1",@^%ZOSF("TRAP")
;S BVCNUMB=9000010.08 ; TEST
F S BVCNUMB=$O(BVCONV(BVCNUMB)) Q:'BVCNUMB S BVCREC=BVCONV(BVCNUMB) D
.W !!,$S(BVCPRCP:"Checking",1:"Converting")_" file: "_BVCNUMB,!!
.S X=$P($G(^BVCONV1(BVCPRCP,BVCNUMB)),U,4,6)
.S BVCNUCT=+$P(X,U,2),BVCCVCT=+X,BVCGNCT=+$P(X,U,3) ;zero field counts
.S X=$G(^BVCONV1(BVCPRCP,BVCNUMB)) Q:X ;file is already converted
.S $P(^BVCONV1(BVCPRCP,BVCNUMB),U,3)=$H
.S BVCDA=+$P(X,U,2) ; starting record number
.S BVCROOT="^"_$P(BVCREC,U),BVCELMS=$P(BVCREC,U,2,99)
.I '$D(@$P(BVCROOT,"(")) Q
.; loop through target file
.F BVCLPCT=1:1 S BVCDA=$O(@(BVCROOT_BVCDA_")")) Q:'BVCDA D
..;
..W:'(BVCLPCT#500) "."
.. I 'BVCPRCP,'BVCLPCT#1000,$D(^%ZTSCH("RUN")) D
...S BVCP6=0 D ERROR("TASKMAN RE-SUTDOWN") D SMAN^ZTMKU,SSUB^ZTMKU ; keep Takman down
..S DA=BVCDA,DR=""
..I '$D(@(BVCROOT_BVCDA_",0)")) Q
..; get file elements to convert
..F BVCI=1:1 S BVCELM=$P(BVCELMS,U,BVCI) Q:'$L(BVCELM) D
...; create parse string. This may eliminate processing steps
...S BVCNODE=BVCROOT_BVCDA_","_$P(BVCELM,";",3)_")",BVCPCE=$P(BVCELM,";",4)
...S BVCDATA=$G(@BVCNODE),BVCP6=$P(BVCDATA,U,BVCPCE) ; file 6 pointer
...I 'BVCP6 D Q ; no entry. no conversion needed
....S BVCNUCT=BVCNUCT+1
...;get name for comparison.
...S BVCFLD=$P(BVCELM,";",2)
...S BVCCVCT=BVCCVCT+1,BVCP200=$$RESOLVE(BVCP6) ;get current field value and 200 ptr
...Q:'BVCP200 ; no file 200 pointer, no conversion - THIS SHOULD NEVER BE
...Q:BVCPRCP ; cheking compile only - do not change databAse.
...;I BVCELM S $P(@BVCNODE,U,BVCPCE)=BVCP200 ; set directly
...;E D ; set through fileman
...S DR=DR_$E(";",DR>0)_BVCFLD_$S(BVCFLD'=.01:"////",1:"///`")_BVCP200
..; record last ien used
..I DR S DIE=BVCNUMB D ^DIE I $D(Y) S BVCP200=BVCP6,(BVCPRNM,BVCNPNM)=$P($G(^DIC(16,+BVCP6,0)),U) D ERROR("NO CHANGE INPUT XFRM ERROR")
..;
..; record status
..S $P(^BVCONV1(BVCPRCP,BVCNUMB),U,2)=BVCDA
..S $P(^BVCONV1(BVCPRCP,BVCNUMB),U,4,6)=BVCCVCT_U_BVCNUCT_U_BVCGNCT
.; record completion of file
.S $P(^BVCONV1(BVCPRCP,BVCNUMB),U,1)=$H
Q
;
RESOLVE(BVCP6) ; convert from a file 6 to 200 pointer
; the navigations from file 2 to 200 must exit
; this tag verifies a file 200 entry is used
K BVCPRNM
S BVCFLG=0 ;use default flag 0 = NO 1 = YES
S BVCFLG1=1 ; do the checks
; defaults
S BVCP200=BVCDFDC
S BVCNPNM=BVCDFNM
;
; do not reprocess
S X=$G(^BVCONV(1,"CONV",BVCP6)) D:X
.S BVCP200=+X
.S BVCNPNM=$P(X,U,2)
.S BVCEXP=$P(X,U,3)
.S BVCFLG1=0
.I $L(BVCEXP) D ERROR(BVCEXP) S BVCFLG=1
;
I BVCFLG1 D
.S BVCPTR=$G(^DIC(16,+BVCP6,"A3"))
.I 'BVCPTR D
..D ERROR("No A16 XREF & A3 node") S BVCFLG=1
.E D
..S BVCPRNM=$P($G(^DIC(16,+BVCP6,0)),U)
..S BVCNP=$P($G(^VA(200,+BVCPTR,0)),U)
..I '$L(BVCNP) D ERROR("No file 200 entry") S BVCFLG=1 Q
..I '$D(^VA(200,"AK.PROVIDER",BVCNP,BVCPTR)) D ERROR("No AK.PROVIDER xref") S BVCFLG=1 ; no provider key or xref
..I BVCPRCP,BVCPRNM'=BVCNP D ERROR("Not same provider names") S BVCFLG=1
..S:'BVCFLG BVCP200=BVCPTR,BVCNPNM=BVCNP ; ok to use provider (not default)
S:BVCFLG BVCGNCT=BVCGNCT+1 ;default use count
S:BVCFLG1 $P(^BVCONV(1,"CONV",BVCP6),U,1,2)=BVCP200_U_$G(BVCPRNM)
Q BVCP200 ; use resolved pointer or user defined default
;
ERROR(BVCERTP) ; record an error
N DIC,DLAYGO,X,DD,DO,BVCORIG
S:BVCFLG1 $P(^BVCONV(1,"CONV",BVCP6),U,3)=BVCERTP
S BVCORIG=+$G(^DIC(16,+BVCP6,"A3"))
S DIC="^BVC(90098,",DIC(0)="L",DLAYGO=9003102,X=BVCERTP
S DIC("DR")=".02////"_+$G(BVCNUMB)_";.03////"_+$G(BVCDA)_";.04////"_+$G(BVCFLD)_";.05////"_+$G(BVCP6)_";.06////"_$S($L($G(BVCPRNM)):BVCPRNM,1:"NOT AVAILABLE")
S DIC("DR")=DIC("DR")_";.07////"_$G(BVCP200)_";.08////"_$S($L($G(BVCNPNM)):BVCNPNM,1:"NOT AVAILABLE")_";.09////"_$$HTE^XLFDT($H)_";1////"_BVCORIG D FILE^DICN
Q
;
ERR ; record an error
N X S BVCERR=BVCERR+1
S X=$$EC^%ZOSV
W !!,"An error has occured",!,X,!,"Aborting the conversion",!!
D ERROR(X) ;error
I BVCPRCP,BVCERR<11 G CONV
D ^%ZTER
D XMD^BVCONV(0) ; email abort message
Q
;
INIT ; initialize VARIABLES
N BVCSTRT
S BVCERR=0
; get variables from ^BVCONV
S I="" F S I=$O(^BVCONV(1,"VARS",I)) Q:I="" S @I=^(I) ; get variables from BVCONV routine
I BVCQ D ; reset device variables in jobbed process. IOP defined in ^BVCONV(1,"VARS",
.S ZTQUEUED=1
.D ^XBKVAR
.N %ZIS S:IOT="HFS" %ZIS("IOPAR")=IOPAR
.S %ZIS=0 D ^%ZIS
U IO W:$E(IOST,1,2)'="C-"!(ION="HFS") !!,"The conversion "_$S(BVCPRCP:"check ",1:"")_"started "_$$HTE^XLFDT($H)
S ^BVCONV1(BVCPRCP,0)="PCC file conversion "_$S(BVCPRCP:"check ",1:"")_"to use file 200 vs. 6 pointers"
S BVCERR=0
D ELEMLST^BVCONV(1) ; setup conversion table
S BVCSTRT=$P($G(^BVCONV1(BVCPRCP,"RUN TIMES")),U)
I 'BVCSTRT D
.N DIK,DA,BVCERCT
.W !,"Deleting FILE 200 ERROR FILE entries."
.S BVCERCT=$O(^BVC(90098,"A"),-1) F DA=1:1:BVCERCT W:'(DA#100) "." S DIK="^BVC(90098," D ^DIK
.S ^BVCONV1(BVCPRCP,"RUN TIMES")=$H
;default name
S BVCDFNM=$P($G(^VA(200,BVCDFDC,0)),U)
Q
;
POST ; execute after conversion
N BVCCVTM
S $P(^BVCONV1(BVCPRCP,"RUN TIMES"),U,2)=$H
S X=^BVCONV1(BVCPRCP,"RUN TIMES") S BVCCVTM=$$HDIFF^XLFDT($P(X,U,2),$P(X,U),2)
I BVCPRCP D
.S BVCCVTM=$J(BVCCVTM*5.5/3600,3,2)
.W !!,"The PCC conversion will take approximately "_BVCCVTM_" hours."
.D XMD^BVCONV(2,BVCCVTM) ; email of check completion
.K ^BVCONV(1)
E D
.S $P(^AUTTSITE(1,0),U,22)=1 ; FM is not used here because the uneditable field may be valued
.; send message of completion
.S BVCCVTM=$J(BVCCVTM/3600,3,2)
.D XMD^BVCONV(1,BVCCVTM) ; email completion message
.W !,"Converting Q-MAN to use file 200 vs 6"
.W !,"Q-MAN is "_$S($$AMQQ200:"",1:"NOT ")_"converted"
.W !!,"The conversion completed "_$$HTE^XLFDT($H)
.W !!,"The conversion ran for "_BVCCVTM_" hours."
.W !!,"Deleteing conversion routines.",!! D DELETE^BVCONV ; delete conversion routines
.; kill pcc run
.K ^BVCONV(1),^BVCHK(1)
D ^%ZISC
Q
;
AMQQ200() ; convert Q-man
N BVCFLG S BVCFLG=0
I ^AMQQ(1,203,4,1,1)["^DIC(16," D ; ok to convert
.D META^AMQQ200,DIE^AMQQ200 S BVCFLG=1
Q BVCFLG
;
BVCONV1 ; IHS/ITSC/JDH - PCC CONVERSION PROCESS; [ 12/06/2002 10:05 AM ]
+1 ;;2.0;IHS V FILES 200 CONVERSION;;MAR 29, 2002
+2 WRITE !!,"Use PRECMP^BVCONV to call this routine."
QUIT
+3 ;
EN ; EP PCC conversion routine
+1 NEW X,BVCERR,POP,BVCEXP,BVCPRNM
+2 SET BVCQ=$DATA(^BVCONV(1,"VARS"))
+3 SET X=$STACK($STACK-1,"PLACE")
+4 ;caller must be from the interface
IF 'BVCQ
IF X'["O+3^BVCONV"
WRITE !,"This routine must be called from the interface",!,"aborting"
QUIT
+5 SET X=$STACK($STACK-1,"MCODE")
+6 ; caller must be this
IF 'BVCQ
IF X'["D EN^BVCONV1 ; run the conversion"
WRITE !,"This routine must be called from the interface",!,"aborting"
QUIT
+7 DO INIT
+8 ; convert
DO CONV
+9 ; set PCC Conversion flag in ^AUTTSITE
+10 IF 'BVCERR!BVCPRCP
DO POST
+11 QUIT
+12 QUIT
+13 ;
CONV ; convert PCC files to use file 200 vs 6 pointer.
+1 NEW X
+2 SET X=$STACK($STACK-1,"PLACE")
+3 ;caller must be from tag EN
IF 'BVCQ
IF 'BVCERR
IF X'["EN+8^BVCONV1"
WRITE !,"this is not a valid entry point",!,"aborting"
QUIT
+4 SET X=$STACK($STACK-1,"MCODE")
+5 ;convert" ; caller must be this ;TASSC/MFD changed X'= to X'[ to allow functioning with Cache
IF 'BVCQ
IF 'BVCERR
IF X'["D CONV ;"
WRITE !,"this is not a valid entry point",!,"aborting"
QUIT
+6 ;
+7 NEW BVCLPCT,BVCNUMB,BVCDA,BVCFLD,BVCP6,BVCPRNM,BVCP200,BVCNPNM,DA,DR,BVC
+8 ; required for the input transform of field .01 of file 9000010.06
SET BVC=1
+9 SET BVCNUMB=90000
SET X="ERR^BVCONV1"
SET @^%ZOSF("TRAP")
+10 ;S BVCNUMB=9000010.08 ; TEST
+11 FOR
SET BVCNUMB=$ORDER(BVCONV(BVCNUMB))
IF 'BVCNUMB
QUIT
SET BVCREC=BVCONV(BVCNUMB)
Begin DoDot:1
+12 WRITE !!,$SELECT(BVCPRCP:"Checking",1:"Converting")_" file: "_BVCNUMB,!!
+13 SET X=$PIECE($GET(^BVCONV1(BVCPRCP,BVCNUMB)),U,4,6)
+14 ;zero field counts
SET BVCNUCT=+$PIECE(X,U,2)
SET BVCCVCT=+X
SET BVCGNCT=+$PIECE(X,U,3)
+15 ;file is already converted
SET X=$GET(^BVCONV1(BVCPRCP,BVCNUMB))
IF X
QUIT
+16 SET $PIECE(^BVCONV1(BVCPRCP,BVCNUMB),U,3)=$HOROLOG
+17 ; starting record number
SET BVCDA=+$PIECE(X,U,2)
+18 SET BVCROOT="^"_$PIECE(BVCREC,U)
SET BVCELMS=$PIECE(BVCREC,U,2,99)
+19 IF '$DATA(@$PIECE(BVCROOT,"("))
QUIT
+20 ; loop through target file
+21 FOR BVCLPCT=1:1
SET BVCDA=$ORDER(@(BVCROOT_BVCDA_")"))
IF 'BVCDA
QUIT
Begin DoDot:2
+22 ;
+23 IF '(BVCLPCT#500)
WRITE "."
+24 IF 'BVCPRCP
IF 'BVCLPCT#1000
IF $DATA(^%ZTSCH("RUN"))
Begin DoDot:3
+25 ; keep Takman down
SET BVCP6=0
DO ERROR("TASKMAN RE-SUTDOWN")
DO SMAN^ZTMKU
DO SSUB^ZTMKU
End DoDot:3
+26 SET DA=BVCDA
SET DR=""
+27 IF '$DATA(@(BVCROOT_BVCDA_",0)"))
QUIT
+28 ; get file elements to convert
+29 FOR BVCI=1:1
SET BVCELM=$PIECE(BVCELMS,U,BVCI)
IF '$LENGTH(BVCELM)
QUIT
Begin DoDot:3
+30 ; create parse string. This may eliminate processing steps
+31 SET BVCNODE=BVCROOT_BVCDA_","_$PIECE(BVCELM,";",3)_")"
SET BVCPCE=$PIECE(BVCELM,";",4)
+32 ; file 6 pointer
SET BVCDATA=$GET(@BVCNODE)
SET BVCP6=$PIECE(BVCDATA,U,BVCPCE)
+33 ; no entry. no conversion needed
IF 'BVCP6
Begin DoDot:4
+34 SET BVCNUCT=BVCNUCT+1
End DoDot:4
QUIT
+35 ;get name for comparison.
+36 SET BVCFLD=$PIECE(BVCELM,";",2)
+37 ;get current field value and 200 ptr
SET BVCCVCT=BVCCVCT+1
SET BVCP200=$$RESOLVE(BVCP6)
+38 ; no file 200 pointer, no conversion - THIS SHOULD NEVER BE
IF 'BVCP200
QUIT
+39 ; cheking compile only - do not change databAse.
IF BVCPRCP
QUIT
+40 ;I BVCELM S $P(@BVCNODE,U,BVCPCE)=BVCP200 ; set directly
+41 ;E D ; set through fileman
+42 SET DR=DR_$EXTRACT(";",DR>0)_BVCFLD_$SELECT(BVCFLD'=.01:"////",1:"///`")_BVCP200
End DoDot:3
+43 ; record last ien used
+44 IF DR
SET DIE=BVCNUMB
DO ^DIE
IF $DATA(Y)
SET BVCP200=BVCP6
SET (BVCPRNM,BVCNPNM)=$PIECE($GET(^DIC(16,+BVCP6,0)),U)
DO ERROR("NO CHANGE INPUT XFRM ERROR")
+45 ;
+46 ; record status
+47 SET $PIECE(^BVCONV1(BVCPRCP,BVCNUMB),U,2)=BVCDA
+48 SET $PIECE(^BVCONV1(BVCPRCP,BVCNUMB),U,4,6)=BVCCVCT_U_BVCNUCT_U_BVCGNCT
End DoDot:2
+49 ; record completion of file
+50 SET $PIECE(^BVCONV1(BVCPRCP,BVCNUMB),U,1)=$HOROLOG
End DoDot:1
+51 QUIT
+52 ;
RESOLVE(BVCP6) ; convert from a file 6 to 200 pointer
+1 ; the navigations from file 2 to 200 must exit
+2 ; this tag verifies a file 200 entry is used
+3 KILL BVCPRNM
+4 ;use default flag 0 = NO 1 = YES
SET BVCFLG=0
+5 ; do the checks
SET BVCFLG1=1
+6 ; defaults
+7 SET BVCP200=BVCDFDC
+8 SET BVCNPNM=BVCDFNM
+9 ;
+10 ; do not reprocess
+11 SET X=$GET(^BVCONV(1,"CONV",BVCP6))
IF X
Begin DoDot:1
+12 SET BVCP200=+X
+13 SET BVCNPNM=$PIECE(X,U,2)
+14 SET BVCEXP=$PIECE(X,U,3)
+15 SET BVCFLG1=0
+16 IF $LENGTH(BVCEXP)
DO ERROR(BVCEXP)
SET BVCFLG=1
End DoDot:1
+17 ;
+18 IF BVCFLG1
Begin DoDot:1
+19 SET BVCPTR=$GET(^DIC(16,+BVCP6,"A3"))
+20 IF 'BVCPTR
Begin DoDot:2
+21 DO ERROR("No A16 XREF & A3 node")
SET BVCFLG=1
End DoDot:2
+22 IF '$TEST
Begin DoDot:2
+23 SET BVCPRNM=$PIECE($GET(^DIC(16,+BVCP6,0)),U)
+24 SET BVCNP=$PIECE($GET(^VA(200,+BVCPTR,0)),U)
+25 IF '$LENGTH(BVCNP)
DO ERROR("No file 200 entry")
SET BVCFLG=1
QUIT
+26 ; no provider key or xref
IF '$DATA(^VA(200,"AK.PROVIDER",BVCNP,BVCPTR))
DO ERROR("No AK.PROVIDER xref")
SET BVCFLG=1
+27 IF BVCPRCP
IF BVCPRNM'=BVCNP
DO ERROR("Not same provider names")
SET BVCFLG=1
+28 ; ok to use provider (not default)
IF 'BVCFLG
SET BVCP200=BVCPTR
SET BVCNPNM=BVCNP
End DoDot:2
End DoDot:1
+29 ;default use count
IF BVCFLG
SET BVCGNCT=BVCGNCT+1
+30 IF BVCFLG1
SET $PIECE(^BVCONV(1,"CONV",BVCP6),U,1,2)=BVCP200_U_$GET(BVCPRNM)
+31 ; use resolved pointer or user defined default
QUIT BVCP200
+32 ;
ERROR(BVCERTP) ; record an error
+1 NEW DIC,DLAYGO,X,DD,DO,BVCORIG
+2 IF BVCFLG1
SET $PIECE(^BVCONV(1,"CONV",BVCP6),U,3)=BVCERTP
+3 SET BVCORIG=+$GET(^DIC(16,+BVCP6,"A3"))
+4 SET DIC="^BVC(90098,"
SET DIC(0)="L"
SET DLAYGO=9003102
SET X=BVCERTP
+5 SET DIC("DR")=".02////"_+$GET(BVCNUMB)_";.03////"_+$GET(BVCDA)_";.04////"_+$GET(BVCFLD)_";.05////"_+$GET(BVCP6)_";.06////"_$SELECT($LENGTH($GET(BVCPRNM)):BVCPRNM,1:"NOT AVAILABLE")
+6 SET DIC("DR")=DIC("DR")_";.07////"_$GET(BVCP200)_";.08////"_$SELECT($LENGTH($GET(BVCNPNM)):BVCNPNM,1:"NOT AVAILABLE")_";.09////"_$$HTE^XLFDT($HOROLOG)_";1////"_BVCORIG
DO FILE^DICN
+7 QUIT
+8 ;
ERR ; record an error
+1 NEW X
SET BVCERR=BVCERR+1
+2 SET X=$$EC^%ZOSV
+3 WRITE !!,"An error has occured",!,X,!,"Aborting the conversion",!!
+4 ;error
DO ERROR(X)
+5 IF BVCPRCP
IF BVCERR<11
GOTO CONV
+6 DO ^%ZTER
+7 ; email abort message
DO XMD^BVCONV(0)
+8 QUIT
+9 ;
INIT ; initialize VARIABLES
+1 NEW BVCSTRT
+2 SET BVCERR=0
+3 ; get variables from ^BVCONV
+4 ; get variables from BVCONV routine
SET I=""
FOR
SET I=$ORDER(^BVCONV(1,"VARS",I))
IF I=""
QUIT
SET @I=^(I)
+5 ; reset device variables in jobbed process. IOP defined in ^BVCONV(1,"VARS",
IF BVCQ
Begin DoDot:1
+6 SET ZTQUEUED=1
+7 DO ^XBKVAR
+8 NEW %ZIS
IF IOT="HFS"
SET %ZIS("IOPAR")=IOPAR
+9 SET %ZIS=0
DO ^%ZIS
End DoDot:1
+10 USE IO
IF $EXTRACT(IOST,1,2)'="C-"!(ION="HFS")
WRITE !!,"The conversion "_$SELECT(BVCPRCP:"check ",1:"")_"started "_$$HTE^XLFDT($HOROLOG)
+11 SET ^BVCONV1(BVCPRCP,0)="PCC file conversion "_$SELECT(BVCPRCP:"check ",1:"")_"to use file 200 vs. 6 pointers"
+12 SET BVCERR=0
+13 ; setup conversion table
DO ELEMLST^BVCONV(1)
+14 SET BVCSTRT=$PIECE($GET(^BVCONV1(BVCPRCP,"RUN TIMES")),U)
+15 IF 'BVCSTRT
Begin DoDot:1
+16 NEW DIK,DA,BVCERCT
+17 WRITE !,"Deleting FILE 200 ERROR FILE entries."
+18 SET BVCERCT=$ORDER(^BVC(90098,"A"),-1)
FOR DA=1:1:BVCERCT
IF '(DA#100)
WRITE "."
SET DIK="^BVC(90098,"
DO ^DIK
+19 SET ^BVCONV1(BVCPRCP,"RUN TIMES")=$HOROLOG
End DoDot:1
+20 ;default name
+21 SET BVCDFNM=$PIECE($GET(^VA(200,BVCDFDC,0)),U)
+22 QUIT
+23 ;
POST ; execute after conversion
+1 NEW BVCCVTM
+2 SET $PIECE(^BVCONV1(BVCPRCP,"RUN TIMES"),U,2)=$HOROLOG
+3 SET X=^BVCONV1(BVCPRCP,"RUN TIMES")
SET BVCCVTM=$$HDIFF^XLFDT($PIECE(X,U,2),$PIECE(X,U),2)
+4 IF BVCPRCP
Begin DoDot:1
+5 SET BVCCVTM=$JUSTIFY(BVCCVTM*5.5/3600,3,2)
+6 WRITE !!,"The PCC conversion will take approximately "_BVCCVTM_" hours."
+7 ; email of check completion
DO XMD^BVCONV(2,BVCCVTM)
+8 KILL ^BVCONV(1)
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 ; FM is not used here because the uneditable field may be valued
SET $PIECE(^AUTTSITE(1,0),U,22)=1
+11 ; send message of completion
+12 SET BVCCVTM=$JUSTIFY(BVCCVTM/3600,3,2)
+13 ; email completion message
DO XMD^BVCONV(1,BVCCVTM)
+14 WRITE !,"Converting Q-MAN to use file 200 vs 6"
+15 WRITE !,"Q-MAN is "_$SELECT($$AMQQ200:"",1:"NOT ")_"converted"
+16 WRITE !!,"The conversion completed "_$$HTE^XLFDT($HOROLOG)
+17 WRITE !!,"The conversion ran for "_BVCCVTM_" hours."
+18 ; delete conversion routines
WRITE !!,"Deleteing conversion routines.",!!
DO DELETE^BVCONV
+19 ; kill pcc run
+20 KILL ^BVCONV(1),^BVCHK(1)
End DoDot:1
+21 DO ^%ZISC
+22 QUIT
+23 ;
AMQQ200() ; convert Q-man
+1 NEW BVCFLG
SET BVCFLG=0
+2 ; ok to convert
IF ^AMQQ(1,203,4,1,1)["^DIC(16,"
Begin DoDot:1
+3 DO META^AMQQ200
DO DIE^AMQQ200
SET BVCFLG=1
End DoDot:1
+4 QUIT BVCFLG
+5 ;