Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XLFNAME5

XLFNAME5.m

Go to the documentation of this file.
  1. 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
  1. ;;8.0;KERNEL;**134**;Jul 10, 1995
  1. CONVERT ;Convert Names
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
  1. S XUNMSP="XLFNAME"
  1. ;
  1. D CINTRO
  1. S DIR(0)="YO",DIR("A")="Do you wish to continue"
  1. S DIR("?",1)=" Enter 'Y' to convert the Names in the New Person file"
  1. S DIR("?",2)=" to standard form, and to store the component parts of"
  1. S DIR("?")=" the Names in the new Name Components file."
  1. W ! D ^DIR K DIR Q:$D(DIRUT)!'Y
  1. ;
  1. ;Check if the conversion was already run.
  1. ;Determine which record to start with.
  1. S XUIEN=+$P($G(^XTMP(XUNMSP,0)),U,4)
  1. I XUIEN D Q:$D(DIRUT)
  1. . I $O(^VA(200,XUIEN)) D
  1. .. W !!,"It appears that the conversion has already been performed through"
  1. .. W !,"record #"_XUIEN_" in the New Person file."
  1. .. W !!,"Do you want to continue the conversion from after this point"
  1. .. W !,"or convert the entries from the beginning of the file."
  1. .. S DIR(0)="S^C:Continue the conversion after record #"_XUIEN_";S:Start again from the beginning of the file"
  1. .. S DIR("?",1)=" Enter 'C' to start the conversion and parsing process from the"
  1. .. S DIR("?",2)=" after record #"_XUIEN_" in the New Person file."
  1. .. S DIR("?",3)=" "
  1. .. S DIR("?",4)=" Enter 'B' to start the conversion and parsing process from the"
  1. .. S DIR("?",5)=" the beginning of the New Person file."
  1. .. S DIR("?",6)=" "
  1. .. S DIR("?",7)=" NOTE: There is no harm in running the conversion again from the"
  1. .. S DIR("?",8)=" beginning. However, if the conversion routine previously parsed a name"
  1. .. S DIR("?",9)=" into its component parts incorrectly, and you corrected those problems"
  1. .. S DIR("?",10)=" by manually editing the name components, your corrections will be lost"
  1. .. S DIR("?")=" if you run the conversion again."
  1. .. D ^DIR K DIR Q:$D(DIRUT)
  1. .. S:Y="S" XUIEN=0
  1. . E D
  1. .. W !!,"It appears that the conversion has already been performed on all entries"
  1. .. W !,"in the New person file.",!
  1. .. S DIR(0)="YO",DIR("A")="Do you want to run the conversion again"
  1. .. S DIR("?",1)=" Enter 'Y' if you wish to run the New Person Name conversion again."
  1. .. S DIR("?",2)=" "
  1. .. S DIR("?",3)=" NOTE: There is no harm in running the conversion again. However, if the"
  1. .. S DIR("?",4)=" conversion routine previously parsed a name into its component parts"
  1. .. S DIR("?",5)=" incorrectly, and you corrected those problems by manually editing the"
  1. .. S DIR("?",6)=" name components, your corrections will be lost if you run the conversion"
  1. .. S DIR("?")=" again."
  1. .. D ^DIR K DIR S:'Y DIRUT=1 Q:$D(DIRUT)
  1. .. S XUIEN=0
  1. ;
  1. D NEWPERS^XLFNAME3("CPR"_$E("K",'XUIEN),+XUIEN)
  1. S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by CONVERT~XLFNAME"
  1. Q
  1. ;
  1. CINTRO ;Print introductory comments
  1. ;;This routine will run the New Person Name Standardization conversion. It
  1. ;;will loop through the entries in the New Person file and:
  1. ;;
  1. ;; 1. Convert the Names (field #.01) in the New Person file to standard
  1. ;; form.
  1. ;;
  1. ;; 2. Parse each Name into its component parts and store those parts
  1. ;; in the new Name Components file (#20).
  1. ;;
  1. ;; 3. Establish a pointer from each New Person entry to the
  1. ;; corresponding entry in the Name Components that contains the
  1. ;; Name parts.
  1. ;;
  1. ;; 4. Record in ^XTMP all changes that were made, and any problems
  1. ;; or questionable assumptions that are encountered in
  1. ;; standardizing the name or parsing it into its component parts.
  1. ;;$$END
  1. N I,T F I=1:1 S T=$P($T(CINTRO+I),";;",2,999) Q:T="$$END" W !,T
  1. Q
  1. ;
  1. GENERATE ;Generate ^XTMP
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
  1. S XUNMSP="XLFNAME"
  1. ;
  1. D GINTRO
  1. S DIR(0)="YO",DIR("A")="Do you wish to continue"
  1. S DIR("?",1)=" Enter 'Y' to store information in ^XTMP about changes that"
  1. S DIR("?")=" will take place when the CONVERT^XLFNAME entry point is run."
  1. W ! D ^DIR K DIR Q:$D(DIRUT)!'Y
  1. ;
  1. ;Check if the conversion was already run.
  1. ;Determine which record to start with.
  1. I $P($G(^XTMP(XUNMSP,0)),U,4) D Q:$D(DIRUT)
  1. . W !!,"It appears that the conversion of New Person Names (routine CONVERT^XLFNAME)"
  1. . W !,"has already been run. If you continue, the information already stored in"
  1. . W !,"^XTMP about records that have been converted will be lost.",!
  1. . S DIR(0)="YO",DIR("A")="Are you sure you wish to continue"
  1. . S DIR("?")=" Enter 'Y' if you wish to replace the information already in ^XTMP."
  1. . D ^DIR K DIR S:'Y DIRUT=1
  1. ;
  1. D NEWPERS^XLFNAME3("KR")
  1. S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by GENERATE~XLFNAME"
  1. Q
  1. ;
  1. GINTRO ;Print introductory comments
  1. ;;This entry point loops through the records in the New Person file and
  1. ;;determines the standard form of each Name. It also tries to determine the
  1. ;;component parts of the name. If the standard form of the name is different
  1. ;;from the current form, or if any questionable assumptions need to made in
  1. ;;determining the component parts of the name, information about that name
  1. ;;is stored in ^XTMP("XLFNAME"). You can later print the information stored
  1. ;;in ^XTMP via the PRINT^XLFNAME entry point.
  1. ;;
  1. ;;NOTE: This entry point makes no changes to the NEW PERSON file or the new
  1. ;; NAME COMPONENTS file.
  1. ;;$$END
  1. N I,T F I=1:1 S T=$P($T(GINTRO+I),";;",2,999) Q:T="$$END" W !,T
  1. Q