XU8343S ;BPOIFO/DW-CONVERSION OF NEW PERSON FILE ENTRIES ;10:39 AM 10 Mar 2000
;;8.0;KERNEL;**343**;Jul 10, 1995
; Modified from XLFNAME3 by MKO.
NEWPERS(XUFLAG,XUIEN) ;Convert New Person file names
;In: XUFLAG [ "C" : Update Name Components file (#20) and pointer
; [ "K" : Kill ^XTMP("XLFNAME") up front
; [ "P" : Update New Person Names
; [ "R" : Record changes/problems in ^XTMP
; XUIEN = ien of last record converted;
; conversion will begin with the next record
;
N XUCNT,XUDEG,XUF,XUIENL,XUIENS,XUMSG,XUNAM,XUNMSP,XUNODEGT,XUNOTRIG
N XUNOSIGT,XUPVAL,XUSTOP,XPDIDTOT,I,XUT,XUINV,XUIN
S XUFLAG=$G(XUFLAG)_"M35"
S (XUNOTRIG,XUNOSIGT,XUNODEGT)=1
S XUNMSP="XUNAME",XUCNT=0
;
K:XUFLAG["K" ^XTMP(XUNMSP)
S:XUFLAG["R" $P(^XTMP(XUNMSP,0),U,1,2)=$$FMADD^XLFDT(DT,90)_"^"_DT
;
;Loop through New Person file
I '$D(ZTQUEUED),'$D(XPDNM) D
. W !!," NOTE: To cancel this process, type '^' at any time."
. W !," Please wait..."
;
S XUIEN=+$G(XUIEN)
;
;Get XPDIDTOT = total number of entries to convert
I XUFLAG["P" D
. I 'XUIEN S XPDIDTOT=$P($G(^VA(200,0)),U,4) Q:XPDIDTOT>0
. S XUMSG=" Obtaining number of entries to convert. Please wait..."
. I '$D(XPDNM) W !,XUMSG
. E D MES^XPDUTL(XUMSG)
. K XUMSG
. S I=XUIEN,XPDIDTOT=0
. F S I=$O(^VA(200,I)) Q:'I S:$P($G(^(I,0)),U)]"" XPDIDTOT=XPDIDTOT+1
. S:'XUIEN $P(^VA(200,0),U,4)=XPDIDTOT
;
S XUMSG=" Converting New Person Names..."
I '$D(XPDNM) W !,XUMSG
E D MES^XPDUTL(XUMSG)
K XUMSG
;
S XUSTOP=0
F S XUIEN=$O(^VA(200,XUIEN)) Q:'XUIEN D D STPCHK Q:XUSTOP
. S XUNAM=$P($G(^VA(200,XUIEN,0)),U)
. S:XUNAM'="" XUCNT=XUCNT+1
. I XUNAM=""!$D(^VA(200,XUIEN,-9))!(XUNAM?1"MERGING INTO".E) Q
. S XUIENS=XUIEN_","
. ;
. S XUPVAL=$P($G(^VA(200,XUIEN,3.1)),U)
. S XUDEG=$P($G(^VA(200,XUIEN,3.1)),U,6)
. ;
. ;Process .01 field of file 200
. S XUF=$S(XUNAM="POSTMASTER"&(XUIEN=.5):$TR(XUFLAG,"R"),1:XUFLAG)
. D UPDATE(XUF,200,XUIENS,.01,XUNAM,10.1,XUPVAL,XUNMSP,XUDEG) K XUF
. ;
. ;Remember this ien if entries are being converted
. I XUFLAG["P",XUFLAG["R" S $P(^XTMP(XUNMSP,0),U,4)=XUIEN
;
S XUMSG(1)=$S(XUSTOP:" Process cancelled.",1:" DONE!")
S XUMSG(2)=" Number of records processed: "_XUCNT
S:XUCNT XUMSG(3)=" Entry number last processed: "_$G(XUIENL)
I '$D(XPDNM) W ! F I=1:1:3 W:$D(XUMSG(I))#2 !,XUMSG(I)
E D MES^XPDUTL(.XUMSG)
;
S XUT(1)=$G(XUCNT)
S XUT(2)=$G(XUIENL)
S XUT(3)=$G(XPDIDTOT)
S XUT(4)=$G(XUSTOP)
D NOTICE^XU8343R(.XUT)
;
D REPORT^XU8343R
;
Q
;
STPCHK ;Every 200 records, check whether to stop
S XUIENL=XUIEN
D:'(XUCNT#200)
. I $D(ZTQUEUED),$$S^%ZTLOAD S (ZTSTOP,XUSTOP)=1 Q
. I '$D(ZTQUEUED),'$D(XPDNM) W "." I $$STOP S XUSTOP=1 Q
. I '$D(ZTQUEUED),$D(XPDNM) D UPDATE^XPDID(XUCNT)
Q
;
UPDATE(XUFLAG,XUFIL,XUIENS,XUFLD,XUNAM,XUPTR,XUPVAL,XUNMSP,XUDEG) ;Process name field
N XUAUD,XUDA,XUFDA,XUMAX,XUMSG,XUORIG,DIERR,XUOLD,XUNAME,XUCHG
S XUFLAG=$G(XUFLAG)
S XUOLD=XUNAM
I '$G(XUNOTRIG) N XUNOTRIG S XUNOTRIG=1
;
;Get maximum length of standard name
S XUMAX=+$P(XUFLAG,"M",2,999)
;
;Standardize/parse name; Record uncertainties in ^XTMP
;Have name components before standardization
S XUNAME=$$FORMAT^XLFNAME7(.XUNAM,3,XUMAX,,,.XUAUD,0,2)
;
S XUCHG=$$CHANGED(.XUAUD,XUNAME)
;
I XUCHG'=0 D RCD(XUNAME,XUCHG,XUNMSP,XUIENS,XUOLD)
;
;Update file #20 and pointer to file #20
I XUFLAG["C",$G(XUCHG)=1 D
. S:$D(XUDEG)#2 XUNAM("DEGREE")=XUDEG
. D UPDCOMP^XLFNAME2(XUFIL,XUIENS,XUFLD,.XUNAM,XUPTR,.XUPVAL)
;
;Update source name if different
I XUFLAG["P",$G(XUCHG)=1 D
. S XUFDA(XUFIL,XUIENS,XUFLD)=XUNAME
. D FILE^DIE("","XUFDA","XUMSG") K DIERR,XUMSG
Q
;
RCD(XUNAME,XUCHG,XUNMSP,XUIENS,XUOLD) ;Record changes & problems
;XUOLD = Name before conversion
;XUNAME = Name after conversion
;
S XUNAME=$G(XUNAME),XUIENS=$G(XUIENS),XUOLD=$G(XUOLD)
;
;Do not record if no change was made
Q:$G(XUCHG)=0
;
N XUSUB
S XUSUB="REST"
S XUCHG=$G(XUCHG)
;
;If name is changed
I XUCHG=1 S XUSUB="CHANGED"
;If name could not be converted
I XUCHG=2 S XUSUB="UNCHANGED"
;
;Get IEN from XUIENS
S XUINV=$P(XUIENS,",")
;
S ^XTMP(XUNMSP,XUSUB,XUINV,"OLD")=XUOLD
S ^XTMP(XUNMSP,XUSUB,XUINV,"NEW")=XUNAME
Q
;
STOP() ;Check whether to stop
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
;R Y#1:0 Q:Y="" 0
;F R *X:0 E Q
R Y:0 Q:Y="" 0
S Y=$E(Y,1,1)
Q:Y'=U 0
S DIR(0)="Y",DIR("A")="Are you sure you want to stop",DIR("B")="NO"
S:XUFLAG["P" DIR("?")="If you stop a conversion, you can continue later where you left off."
W ! D ^DIR
Q Y=1
;
POST ;The Post-Install entry point (run conversion)
N XUIEN,XUNMSP
S XUNMSP="XUNAME"
S XUIEN=+$P($G(^XTMP(XUNMSP,0)),U,4)
D NEWPERS("CPR"_$E("K",'XUIEN),+XUIEN)
I $D(^XTMP(XUNMSP,0))#2,XUIEN'=+$P(^XTMP(XUNMSP,0),U,4) S $P(^XTMP(XUNMSP,0),U,3)="Created by POST~XU8343P (Post Install Conversion of XU*8.0*343)"
Q
;
CHANGED(XUAUD,XUNAME) ;Decide if the name is convertible.
; RESULT: 2 if the name is not convertible
; 1 if the name is convertible
; 0 if the name is not changed
N XUR
S XUR=1
I $G(XUAUD)=0 Q 0
I $G(XUAUD)=2 Q 2
;
S XUNAME=$G(XUNAME)
I $L(XUNAME)>35!($L(XUNAME)<3)!($L(XUNAME,",")'=2)!(XUNAME'?1.E1","1.E) Q 2
Q XUR
;
CONVERT ;Convert Names
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
I $G(XUNMSP)="" S XUNMSP="XUNAME"
;
W !,"This routine will run the New Person Name Standardization conversion."
W !!,"It will loop through the entries in the New Person file, convert "
W !,"the Name field (#.01) of the New Person file to standard form, and"
W !,"update the corresponding Name Component entries of converted names."
;
S DIR(0)="YO",DIR("A")="Do you wish to continue"
S DIR("?",1)=" Enter 'Y' to convert the Names in the New Person file"
S DIR("?",2)=" to standard form, and to update the corresponding"
S DIR("?")=" entries of changed Names in the Name Components file."
W ! D ^DIR K DIR Q:$D(DIRUT)!'Y
;
;Check if the conversion was already run.
;Determine which record to start with.
S XUIEN=+$P($G(^XTMP(XUNMSP,0)),U,4)
I XUIEN D Q:$D(DIRUT)
. I $O(^VA(200,XUIEN)) D
.. W !!,"It appears that the conversion has already been performed through"
.. W !,"record #"_XUIEN_" in the New Person file."
.. W !!,"Do you want to continue the conversion from after this point"
.. W !,"or convert the entries from the beginning of the file."
.. S DIR(0)="S^C:Continue the conversion after record #"_XUIEN_";S:Start again from the beginning of the file"
.. S DIR("?",1)=" Enter 'C' to start the conversion and parsing process from the"
.. S DIR("?",2)=" after record #"_XUIEN_" in the New Person file."
.. S DIR("?",3)=" "
.. S DIR("?",4)=" Enter 'B' to start the conversion and parsing process from the"
.. S DIR("?",5)=" the beginning of the New Person file."
.. S DIR("?",6)=" "
.. S DIR("?",7)=" NOTE: There is no harm in running the conversion again from the"
.. S DIR("?",8)=" beginning. However, if the conversion routine previously parsed a name"
.. S DIR("?",9)=" into its component parts incorrectly, and you corrected those problems"
.. S DIR("?",10)=" by manually editing the name components, your corrections will be lost"
.. S DIR("?")=" if you run the conversion again."
.. D ^DIR K DIR Q:$D(DIRUT)
.. S:Y="S" XUIEN=0
. E D
.. W !!,"It appears that the conversion has already been performed on all entries"
.. W !,"in the New person file.",!
.. S DIR(0)="YO",DIR("A")="Do you want to run the conversion again"
.. S DIR("?",1)=" Enter 'Y' if you wish to run the New Person Name conversion again."
.. S DIR("?",2)=" "
.. S DIR("?",3)=" NOTE: There is no harm in running the conversion again. However, if the"
.. S DIR("?",4)=" conversion routine previously parsed a name into its component parts"
.. S DIR("?",5)=" incorrectly, and you corrected those problems by manually editing the"
.. D ^DIR K DIR S:'Y DIRUT=1 Q:$D(DIRUT)
.. S XUIEN=0
;
D NEWPERS^XU8343S("CPR"_$E("K",'XUIEN),+XUIEN)
S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by CONVERT~XU8343S"
Q
XU8343S ;BPOIFO/DW-CONVERSION OF NEW PERSON FILE ENTRIES ;10:39 AM 10 Mar 2000
+1 ;;8.0;KERNEL;**343**;Jul 10, 1995
+2 ; Modified from XLFNAME3 by MKO.
NEWPERS(XUFLAG,XUIEN) ;Convert New Person file names
+1 ;In: XUFLAG [ "C" : Update Name Components file (#20) and pointer
+2 ; [ "K" : Kill ^XTMP("XLFNAME") up front
+3 ; [ "P" : Update New Person Names
+4 ; [ "R" : Record changes/problems in ^XTMP
+5 ; XUIEN = ien of last record converted;
+6 ; conversion will begin with the next record
+7 ;
+8 NEW XUCNT,XUDEG,XUF,XUIENL,XUIENS,XUMSG,XUNAM,XUNMSP,XUNODEGT,XUNOTRIG
+9 NEW XUNOSIGT,XUPVAL,XUSTOP,XPDIDTOT,I,XUT,XUINV,XUIN
+10 SET XUFLAG=$GET(XUFLAG)_"M35"
+11 SET (XUNOTRIG,XUNOSIGT,XUNODEGT)=1
+12 SET XUNMSP="XUNAME"
SET XUCNT=0
+13 ;
+14 IF XUFLAG["K"
KILL ^XTMP(XUNMSP)
+15 IF XUFLAG["R"
SET $PIECE(^XTMP(XUNMSP,0),U,1,2)=$$FMADD^XLFDT(DT,90)_"^"_DT
+16 ;
+17 ;Loop through New Person file
+18 IF '$DATA(ZTQUEUED)
IF '$DATA(XPDNM)
Begin DoDot:1
+19 WRITE !!," NOTE: To cancel this process, type '^' at any time."
+20 WRITE !," Please wait..."
End DoDot:1
+21 ;
+22 SET XUIEN=+$GET(XUIEN)
+23 ;
+24 ;Get XPDIDTOT = total number of entries to convert
+25 IF XUFLAG["P"
Begin DoDot:1
+26 IF 'XUIEN
SET XPDIDTOT=$PIECE($GET(^VA(200,0)),U,4)
IF XPDIDTOT>0
QUIT
+27 SET XUMSG=" Obtaining number of entries to convert. Please wait..."
+28 IF '$DATA(XPDNM)
WRITE !,XUMSG
+29 IF '$TEST
DO MES^XPDUTL(XUMSG)
+30 KILL XUMSG
+31 SET I=XUIEN
SET XPDIDTOT=0
+32 FOR
SET I=$ORDER(^VA(200,I))
IF 'I
QUIT
IF $PIECE($GET(^(I,0)),U)]""
SET XPDIDTOT=XPDIDTOT+1
+33 IF 'XUIEN
SET $PIECE(^VA(200,0),U,4)=XPDIDTOT
End DoDot:1
+34 ;
+35 SET XUMSG=" Converting New Person Names..."
+36 IF '$DATA(XPDNM)
WRITE !,XUMSG
+37 IF '$TEST
DO MES^XPDUTL(XUMSG)
+38 KILL XUMSG
+39 ;
+40 SET XUSTOP=0
+41 FOR
SET XUIEN=$ORDER(^VA(200,XUIEN))
IF 'XUIEN
QUIT
Begin DoDot:1
+42 SET XUNAM=$PIECE($GET(^VA(200,XUIEN,0)),U)
+43 IF XUNAM'=""
SET XUCNT=XUCNT+1
+44 IF XUNAM=""!$DATA(^VA(200,XUIEN,-9))!(XUNAM?1"MERGING INTO".E)
QUIT
+45 SET XUIENS=XUIEN_","
+46 ;
+47 SET XUPVAL=$PIECE($GET(^VA(200,XUIEN,3.1)),U)
+48 SET XUDEG=$PIECE($GET(^VA(200,XUIEN,3.1)),U,6)
+49 ;
+50 ;Process .01 field of file 200
+51 SET XUF=$SELECT(XUNAM="POSTMASTER"&(XUIEN=.5):$TRANSLATE(XUFLAG,"R"),1:XUFLAG)
+52 DO UPDATE(XUF,200,XUIENS,.01,XUNAM,10.1,XUPVAL,XUNMSP,XUDEG)
KILL XUF
+53 ;
+54 ;Remember this ien if entries are being converted
+55 IF XUFLAG["P"
IF XUFLAG["R"
SET $PIECE(^XTMP(XUNMSP,0),U,4)=XUIEN
End DoDot:1
DO STPCHK
IF XUSTOP
QUIT
+56 ;
+57 SET XUMSG(1)=$SELECT(XUSTOP:" Process cancelled.",1:" DONE!")
+58 SET XUMSG(2)=" Number of records processed: "_XUCNT
+59 IF XUCNT
SET XUMSG(3)=" Entry number last processed: "_$GET(XUIENL)
+60 IF '$DATA(XPDNM)
WRITE !
FOR I=1:1:3
IF $DATA(XUMSG(I))#2
WRITE !,XUMSG(I)
+61 IF '$TEST
DO MES^XPDUTL(.XUMSG)
+62 ;
+63 SET XUT(1)=$GET(XUCNT)
+64 SET XUT(2)=$GET(XUIENL)
+65 SET XUT(3)=$GET(XPDIDTOT)
+66 SET XUT(4)=$GET(XUSTOP)
+67 DO NOTICE^XU8343R(.XUT)
+68 ;
+69 DO REPORT^XU8343R
+70 ;
+71 QUIT
+72 ;
STPCHK ;Every 200 records, check whether to stop
+1 SET XUIENL=XUIEN
+2 IF '(XUCNT#200)
Begin DoDot:1
+3 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET (ZTSTOP,XUSTOP)=1
QUIT
+4 IF '$DATA(ZTQUEUED)
IF '$DATA(XPDNM)
WRITE "."
IF $$STOP
SET XUSTOP=1
QUIT
+5 IF '$DATA(ZTQUEUED)
IF $DATA(XPDNM)
DO UPDATE^XPDID(XUCNT)
End DoDot:1
+6 QUIT
+7 ;
UPDATE(XUFLAG,XUFIL,XUIENS,XUFLD,XUNAM,XUPTR,XUPVAL,XUNMSP,XUDEG) ;Process name field
+1 NEW XUAUD,XUDA,XUFDA,XUMAX,XUMSG,XUORIG,DIERR,XUOLD,XUNAME,XUCHG
+2 SET XUFLAG=$GET(XUFLAG)
+3 SET XUOLD=XUNAM
+4 IF '$GET(XUNOTRIG)
NEW XUNOTRIG
SET XUNOTRIG=1
+5 ;
+6 ;Get maximum length of standard name
+7 SET XUMAX=+$PIECE(XUFLAG,"M",2,999)
+8 ;
+9 ;Standardize/parse name; Record uncertainties in ^XTMP
+10 ;Have name components before standardization
+11 SET XUNAME=$$FORMAT^XLFNAME7(.XUNAM,3,XUMAX,,,.XUAUD,0,2)
+12 ;
+13 SET XUCHG=$$CHANGED(.XUAUD,XUNAME)
+14 ;
+15 IF XUCHG'=0
DO RCD(XUNAME,XUCHG,XUNMSP,XUIENS,XUOLD)
+16 ;
+17 ;Update file #20 and pointer to file #20
+18 IF XUFLAG["C"
IF $GET(XUCHG)=1
Begin DoDot:1
+19 IF $DATA(XUDEG)#2
SET XUNAM("DEGREE")=XUDEG
+20 DO UPDCOMP^XLFNAME2(XUFIL,XUIENS,XUFLD,.XUNAM,XUPTR,.XUPVAL)
End DoDot:1
+21 ;
+22 ;Update source name if different
+23 IF XUFLAG["P"
IF $GET(XUCHG)=1
Begin DoDot:1
+24 SET XUFDA(XUFIL,XUIENS,XUFLD)=XUNAME
+25 DO FILE^DIE("","XUFDA","XUMSG")
KILL DIERR,XUMSG
End DoDot:1
+26 QUIT
+27 ;
RCD(XUNAME,XUCHG,XUNMSP,XUIENS,XUOLD) ;Record changes & problems
+1 ;XUOLD = Name before conversion
+2 ;XUNAME = Name after conversion
+3 ;
+4 SET XUNAME=$GET(XUNAME)
SET XUIENS=$GET(XUIENS)
SET XUOLD=$GET(XUOLD)
+5 ;
+6 ;Do not record if no change was made
+7 IF $GET(XUCHG)=0
QUIT
+8 ;
+9 NEW XUSUB
+10 SET XUSUB="REST"
+11 SET XUCHG=$GET(XUCHG)
+12 ;
+13 ;If name is changed
+14 IF XUCHG=1
SET XUSUB="CHANGED"
+15 ;If name could not be converted
+16 IF XUCHG=2
SET XUSUB="UNCHANGED"
+17 ;
+18 ;Get IEN from XUIENS
+19 SET XUINV=$PIECE(XUIENS,",")
+20 ;
+21 SET ^XTMP(XUNMSP,XUSUB,XUINV,"OLD")=XUOLD
+22 SET ^XTMP(XUNMSP,XUSUB,XUINV,"NEW")=XUNAME
+23 QUIT
+24 ;
STOP() ;Check whether to stop
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+2 ;R Y#1:0 Q:Y="" 0
+3 ;F R *X:0 E Q
+4 READ Y:0
IF Y=""
QUIT 0
+5 SET Y=$EXTRACT(Y,1,1)
+6 IF Y'=U
QUIT 0
+7 SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to stop"
SET DIR("B")="NO"
+8 IF XUFLAG["P"
SET DIR("?")="If you stop a conversion, you can continue later where you left off."
+9 WRITE !
DO ^DIR
+10 QUIT Y=1
+11 ;
POST ;The Post-Install entry point (run conversion)
+1 NEW XUIEN,XUNMSP
+2 SET XUNMSP="XUNAME"
+3 SET XUIEN=+$PIECE($GET(^XTMP(XUNMSP,0)),U,4)
+4 DO NEWPERS("CPR"_$EXTRACT("K",'XUIEN),+XUIEN)
+5 IF $DATA(^XTMP(XUNMSP,0))#2
IF XUIEN'=+$PIECE(^XTMP(XUNMSP,0),U,4)
SET $PIECE(^XTMP(XUNMSP,0),U,3)="Created by POST~XU8343P (Post Install Conversion of XU*8.0*343)"
+6 QUIT
+7 ;
CHANGED(XUAUD,XUNAME) ;Decide if the name is convertible.
+1 ; RESULT: 2 if the name is not convertible
+2 ; 1 if the name is convertible
+3 ; 0 if the name is not changed
+4 NEW XUR
+5 SET XUR=1
+6 IF $GET(XUAUD)=0
QUIT 0
+7 IF $GET(XUAUD)=2
QUIT 2
+8 ;
+9 SET XUNAME=$GET(XUNAME)
+10 IF $LENGTH(XUNAME)>35!($LENGTH(XUNAME)<3)!($LENGTH(XUNAME,",")'=2)!(XUNAME'?1.E1","1.E)
QUIT 2
+11 QUIT XUR
+12 ;
CONVERT ;Convert Names
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
+2 IF $GET(XUNMSP)=""
SET XUNMSP="XUNAME"
+3 ;
+4 WRITE !,"This routine will run the New Person Name Standardization conversion."
+5 WRITE !!,"It will loop through the entries in the New Person file, convert "
+6 WRITE !,"the Name field (#.01) of the New Person file to standard form, and"
+7 WRITE !,"update the corresponding Name Component entries of converted names."
+8 ;
+9 SET DIR(0)="YO"
SET DIR("A")="Do you wish to continue"
+10 SET DIR("?",1)=" Enter 'Y' to convert the Names in the New Person file"
+11 SET DIR("?",2)=" to standard form, and to update the corresponding"
+12 SET DIR("?")=" entries of changed Names in the Name Components file."
+13 WRITE !
DO ^DIR
KILL DIR
IF $DATA(DIRUT)!'Y
QUIT
+14 ;
+15 ;Check if the conversion was already run.
+16 ;Determine which record to start with.
+17 SET XUIEN=+$PIECE($GET(^XTMP(XUNMSP,0)),U,4)
+18 IF XUIEN
Begin DoDot:1
+19 IF $ORDER(^VA(200,XUIEN))
Begin DoDot:2
+20 WRITE !!,"It appears that the conversion has already been performed through"
+21 WRITE !,"record #"_XUIEN_" in the New Person file."
+22 WRITE !!,"Do you want to continue the conversion from after this point"
+23 WRITE !,"or convert the entries from the beginning of the file."
+24 SET DIR(0)="S^C:Continue the conversion after record #"_XUIEN_";S:Start again from the beginning of the file"
+25 SET DIR("?",1)=" Enter 'C' to start the conversion and parsing process from the"
+26 SET DIR("?",2)=" after record #"_XUIEN_" in the New Person file."
+27 SET DIR("?",3)=" "
+28 SET DIR("?",4)=" Enter 'B' to start the conversion and parsing process from the"
+29 SET DIR("?",5)=" the beginning of the New Person file."
+30 SET DIR("?",6)=" "
+31 SET DIR("?",7)=" NOTE: There is no harm in running the conversion again from the"
+32 SET DIR("?",8)=" beginning. However, if the conversion routine previously parsed a name"
+33 SET DIR("?",9)=" into its component parts incorrectly, and you corrected those problems"
+34 SET DIR("?",10)=" by manually editing the name components, your corrections will be lost"
+35 SET DIR("?")=" if you run the conversion again."
+36 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
QUIT
+37 IF Y="S"
SET XUIEN=0
End DoDot:2
+38 IF '$TEST
Begin DoDot:2
+39 WRITE !!,"It appears that the conversion has already been performed on all entries"
+40 WRITE !,"in the New person file.",!
+41 SET DIR(0)="YO"
SET DIR("A")="Do you want to run the conversion again"
+42 SET DIR("?",1)=" Enter 'Y' if you wish to run the New Person Name conversion again."
+43 SET DIR("?",2)=" "
+44 SET DIR("?",3)=" NOTE: There is no harm in running the conversion again. However, if the"
+45 SET DIR("?",4)=" conversion routine previously parsed a name into its component parts"
+46 SET DIR("?",5)=" incorrectly, and you corrected those problems by manually editing the"
+47 DO ^DIR
KILL DIR
IF 'Y
SET DIRUT=1
IF $DATA(DIRUT)
QUIT
+48 SET XUIEN=0
End DoDot:2
End DoDot:1
IF $DATA(DIRUT)
QUIT
+49 ;
+50 DO NEWPERS^XU8343S("CPR"_$EXTRACT("K",'XUIEN),+XUIEN)
+51 IF $DATA(^XTMP(XUNMSP,0))#2
SET $PIECE(^(0),U,3)="Created by CONVERT~XU8343S"
+52 QUIT