XLFNAME5 ;SFISC/MKO-INTERACTIVE OPTION TO CONVERT NAMES ;11:32 AM 28 Jan 2000 [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1007**;APR 1, 2003
;;8.0;KERNEL;**134**;Jul 10, 1995
CONVERT ;Convert Names
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
S XUNMSP="XLFNAME"
;
D CINTRO
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 store the component parts of"
S DIR("?")=" the Names in the new 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"
.. S DIR("?",6)=" name components, your corrections will be lost if you run the conversion"
.. S DIR("?")=" again."
.. D ^DIR K DIR S:'Y DIRUT=1 Q:$D(DIRUT)
.. S XUIEN=0
;
D NEWPERS^XLFNAME3("CPR"_$E("K",'XUIEN),+XUIEN)
S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by CONVERT~XLFNAME"
Q
;
CINTRO ;Print introductory comments
;;This routine will run the New Person Name Standardization conversion. It
;;will loop through the entries in the New Person file and:
;;
;; 1. Convert the Names (field #.01) in the New Person file to standard
;; form.
;;
;; 2. Parse each Name into its component parts and store those parts
;; in the new Name Components file (#20).
;;
;; 3. Establish a pointer from each New Person entry to the
;; corresponding entry in the Name Components that contains the
;; Name parts.
;;
;; 4. Record in ^XTMP all changes that were made, and any problems
;; or questionable assumptions that are encountered in
;; standardizing the name or parsing it into its component parts.
;;$$END
N I,T F I=1:1 S T=$P($T(CINTRO+I),";;",2,999) Q:T="$$END" W !,T
Q
;
GENERATE ;Generate ^XTMP
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
S XUNMSP="XLFNAME"
;
D GINTRO
S DIR(0)="YO",DIR("A")="Do you wish to continue"
S DIR("?",1)=" Enter 'Y' to store information in ^XTMP about changes that"
S DIR("?")=" will take place when the CONVERT^XLFNAME entry point is run."
W ! D ^DIR K DIR Q:$D(DIRUT)!'Y
;
;Check if the conversion was already run.
;Determine which record to start with.
I $P($G(^XTMP(XUNMSP,0)),U,4) D Q:$D(DIRUT)
. W !!,"It appears that the conversion of New Person Names (routine CONVERT^XLFNAME)"
. W !,"has already been run. If you continue, the information already stored in"
. W !,"^XTMP about records that have been converted will be lost.",!
. S DIR(0)="YO",DIR("A")="Are you sure you wish to continue"
. S DIR("?")=" Enter 'Y' if you wish to replace the information already in ^XTMP."
. D ^DIR K DIR S:'Y DIRUT=1
;
D NEWPERS^XLFNAME3("KR")
S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by GENERATE~XLFNAME"
Q
;
GINTRO ;Print introductory comments
;;This entry point loops through the records in the New Person file and
;;determines the standard form of each Name. It also tries to determine the
;;component parts of the name. If the standard form of the name is different
;;from the current form, or if any questionable assumptions need to made in
;;determining the component parts of the name, information about that name
;;is stored in ^XTMP("XLFNAME"). You can later print the information stored
;;in ^XTMP via the PRINT^XLFNAME entry point.
;;
;;NOTE: This entry point makes no changes to the NEW PERSON file or the new
;; NAME COMPONENTS file.
;;$$END
N I,T F I=1:1 S T=$P($T(GINTRO+I),";;",2,999) Q:T="$$END" W !,T
Q
XLFNAME5 ;SFISC/MKO-INTERACTIVE OPTION TO CONVERT NAMES ;11:32 AM 28 Jan 2000 [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1007**;APR 1, 2003
+2 ;;8.0;KERNEL;**134**;Jul 10, 1995
CONVERT ;Convert Names
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
+2 SET XUNMSP="XLFNAME"
+3 ;
+4 DO CINTRO
+5 SET DIR(0)="YO"
SET DIR("A")="Do you wish to continue"
+6 SET DIR("?",1)=" Enter 'Y' to convert the Names in the New Person file"
+7 SET DIR("?",2)=" to standard form, and to store the component parts of"
+8 SET DIR("?")=" the Names in the new Name Components file."
+9 WRITE !
DO ^DIR
KILL DIR
IF $DATA(DIRUT)!'Y
QUIT
+10 ;
+11 ;Check if the conversion was already run.
+12 ;Determine which record to start with.
+13 SET XUIEN=+$PIECE($GET(^XTMP(XUNMSP,0)),U,4)
+14 IF XUIEN
Begin DoDot:1
+15 IF $ORDER(^VA(200,XUIEN))
Begin DoDot:2
+16 WRITE !!,"It appears that the conversion has already been performed through"
+17 WRITE !,"record #"_XUIEN_" in the New Person file."
+18 WRITE !!,"Do you want to continue the conversion from after this point"
+19 WRITE !,"or convert the entries from the beginning of the file."
+20 SET DIR(0)="S^C:Continue the conversion after record #"_XUIEN_";S:Start again from the beginning of the file"
+21 SET DIR("?",1)=" Enter 'C' to start the conversion and parsing process from the"
+22 SET DIR("?",2)=" after record #"_XUIEN_" in the New Person file."
+23 SET DIR("?",3)=" "
+24 SET DIR("?",4)=" Enter 'B' to start the conversion and parsing process from the"
+25 SET DIR("?",5)=" the beginning of the New Person file."
+26 SET DIR("?",6)=" "
+27 SET DIR("?",7)=" NOTE: There is no harm in running the conversion again from the"
+28 SET DIR("?",8)=" beginning. However, if the conversion routine previously parsed a name"
+29 SET DIR("?",9)=" into its component parts incorrectly, and you corrected those problems"
+30 SET DIR("?",10)=" by manually editing the name components, your corrections will be lost"
+31 SET DIR("?")=" if you run the conversion again."
+32 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
QUIT
+33 IF Y="S"
SET XUIEN=0
End DoDot:2
+34 IF '$TEST
Begin DoDot:2
+35 WRITE !!,"It appears that the conversion has already been performed on all entries"
+36 WRITE !,"in the New person file.",!
+37 SET DIR(0)="YO"
SET DIR("A")="Do you want to run the conversion again"
+38 SET DIR("?",1)=" Enter 'Y' if you wish to run the New Person Name conversion again."
+39 SET DIR("?",2)=" "
+40 SET DIR("?",3)=" NOTE: There is no harm in running the conversion again. However, if the"
+41 SET DIR("?",4)=" conversion routine previously parsed a name into its component parts"
+42 SET DIR("?",5)=" incorrectly, and you corrected those problems by manually editing the"
+43 SET DIR("?",6)=" name components, your corrections will be lost if you run the conversion"
+44 SET DIR("?")=" again."
+45 DO ^DIR
KILL DIR
IF 'Y
SET DIRUT=1
IF $DATA(DIRUT)
QUIT
+46 SET XUIEN=0
End DoDot:2
End DoDot:1
IF $DATA(DIRUT)
QUIT
+47 ;
+48 DO NEWPERS^XLFNAME3("CPR"_$EXTRACT("K",'XUIEN),+XUIEN)
+49 IF $DATA(^XTMP(XUNMSP,0))#2
SET $PIECE(^(0),U,3)="Created by CONVERT~XLFNAME"
+50 QUIT
+51 ;
CINTRO ;Print introductory comments
+1 ;;This routine will run the New Person Name Standardization conversion. It
+2 ;;will loop through the entries in the New Person file and:
+3 ;;
+4 ;; 1. Convert the Names (field #.01) in the New Person file to standard
+5 ;; form.
+6 ;;
+7 ;; 2. Parse each Name into its component parts and store those parts
+8 ;; in the new Name Components file (#20).
+9 ;;
+10 ;; 3. Establish a pointer from each New Person entry to the
+11 ;; corresponding entry in the Name Components that contains the
+12 ;; Name parts.
+13 ;;
+14 ;; 4. Record in ^XTMP all changes that were made, and any problems
+15 ;; or questionable assumptions that are encountered in
+16 ;; standardizing the name or parsing it into its component parts.
+17 ;;$$END
+18 NEW I,T
FOR I=1:1
SET T=$PIECE($TEXT(CINTRO+I),";;",2,999)
IF T="$$END"
QUIT
WRITE !,T
+19 QUIT
+20 ;
GENERATE ;Generate ^XTMP
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
+2 SET XUNMSP="XLFNAME"
+3 ;
+4 DO GINTRO
+5 SET DIR(0)="YO"
SET DIR("A")="Do you wish to continue"
+6 SET DIR("?",1)=" Enter 'Y' to store information in ^XTMP about changes that"
+7 SET DIR("?")=" will take place when the CONVERT^XLFNAME entry point is run."
+8 WRITE !
DO ^DIR
KILL DIR
IF $DATA(DIRUT)!'Y
QUIT
+9 ;
+10 ;Check if the conversion was already run.
+11 ;Determine which record to start with.
+12 IF $PIECE($GET(^XTMP(XUNMSP,0)),U,4)
Begin DoDot:1
+13 WRITE !!,"It appears that the conversion of New Person Names (routine CONVERT^XLFNAME)"
+14 WRITE !,"has already been run. If you continue, the information already stored in"
+15 WRITE !,"^XTMP about records that have been converted will be lost.",!
+16 SET DIR(0)="YO"
SET DIR("A")="Are you sure you wish to continue"
+17 SET DIR("?")=" Enter 'Y' if you wish to replace the information already in ^XTMP."
+18 DO ^DIR
KILL DIR
IF 'Y
SET DIRUT=1
End DoDot:1
IF $DATA(DIRUT)
QUIT
+19 ;
+20 DO NEWPERS^XLFNAME3("KR")
+21 IF $DATA(^XTMP(XUNMSP,0))#2
SET $PIECE(^(0),U,3)="Created by GENERATE~XLFNAME"
+22 QUIT
+23 ;
GINTRO ;Print introductory comments
+1 ;;This entry point loops through the records in the New Person file and
+2 ;;determines the standard form of each Name. It also tries to determine the
+3 ;;component parts of the name. If the standard form of the name is different
+4 ;;from the current form, or if any questionable assumptions need to made in
+5 ;;determining the component parts of the name, information about that name
+6 ;;is stored in ^XTMP("XLFNAME"). You can later print the information stored
+7 ;;in ^XTMP via the PRINT^XLFNAME entry point.
+8 ;;
+9 ;;NOTE: This entry point makes no changes to the NEW PERSON file or the new
+10 ;; NAME COMPONENTS file.
+11 ;;$$END
+12 NEW I,T
FOR I=1:1
SET T=$PIECE($TEXT(GINTRO+I),";;",2,999)
IF T="$$END"
QUIT
WRITE !,T
+13 QUIT