source: FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XLFNAME5.m@ 1645

Last change on this file since 1645 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 5.2 KB
Line 
1XLFNAME5 ;SFISC/MKO-INTERACTIVE OPTION TO CONVERT NAMES ;11:32 AM 28 Jan 2000
2 ;;8.0;KERNEL;**134**;Jul 10, 1995
3CONVERT ;Convert Names
4 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
5 S XUNMSP="XLFNAME"
6 ;
7 D CINTRO
8 S DIR(0)="YO",DIR("A")="Do you wish to continue"
9 S DIR("?",1)=" Enter 'Y' to convert the Names in the New Person file"
10 S DIR("?",2)=" to standard form, and to store the component parts of"
11 S DIR("?")=" the Names in the new Name Components file."
12 W ! D ^DIR K DIR Q:$D(DIRUT)!'Y
13 ;
14 ;Check if the conversion was already run.
15 ;Determine which record to start with.
16 S XUIEN=+$P($G(^XTMP(XUNMSP,0)),U,4)
17 I XUIEN D Q:$D(DIRUT)
18 . I $O(^VA(200,XUIEN)) D
19 .. W !!,"It appears that the conversion has already been performed through"
20 .. W !,"record #"_XUIEN_" in the New Person file."
21 .. W !!,"Do you want to continue the conversion from after this point"
22 .. W !,"or convert the entries from the beginning of the file."
23 .. S DIR(0)="S^C:Continue the conversion after record #"_XUIEN_";S:Start again from the beginning of the file"
24 .. S DIR("?",1)=" Enter 'C' to start the conversion and parsing process from the"
25 .. S DIR("?",2)=" after record #"_XUIEN_" in the New Person file."
26 .. S DIR("?",3)=" "
27 .. S DIR("?",4)=" Enter 'B' to start the conversion and parsing process from the"
28 .. S DIR("?",5)=" the beginning of the New Person file."
29 .. S DIR("?",6)=" "
30 .. S DIR("?",7)=" NOTE: There is no harm in running the conversion again from the"
31 .. S DIR("?",8)=" beginning. However, if the conversion routine previously parsed a name"
32 .. S DIR("?",9)=" into its component parts incorrectly, and you corrected those problems"
33 .. S DIR("?",10)=" by manually editing the name components, your corrections will be lost"
34 .. S DIR("?")=" if you run the conversion again."
35 .. D ^DIR K DIR Q:$D(DIRUT)
36 .. S:Y="S" XUIEN=0
37 . E D
38 .. W !!,"It appears that the conversion has already been performed on all entries"
39 .. W !,"in the New person file.",!
40 .. S DIR(0)="YO",DIR("A")="Do you want to run the conversion again"
41 .. S DIR("?",1)=" Enter 'Y' if you wish to run the New Person Name conversion again."
42 .. S DIR("?",2)=" "
43 .. S DIR("?",3)=" NOTE: There is no harm in running the conversion again. However, if the"
44 .. S DIR("?",4)=" conversion routine previously parsed a name into its component parts"
45 .. S DIR("?",5)=" incorrectly, and you corrected those problems by manually editing the"
46 .. S DIR("?",6)=" name components, your corrections will be lost if you run the conversion"
47 .. S DIR("?")=" again."
48 .. D ^DIR K DIR S:'Y DIRUT=1 Q:$D(DIRUT)
49 .. S XUIEN=0
50 ;
51 D NEWPERS^XLFNAME3("CPR"_$E("K",'XUIEN),+XUIEN)
52 S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by CONVERT~XLFNAME"
53 Q
54 ;
55CINTRO ;Print introductory comments
56 ;;This routine will run the New Person Name Standardization conversion. It
57 ;;will loop through the entries in the New Person file and:
58 ;;
59 ;; 1. Convert the Names (field #.01) in the New Person file to standard
60 ;; form.
61 ;;
62 ;; 2. Parse each Name into its component parts and store those parts
63 ;; in the new Name Components file (#20).
64 ;;
65 ;; 3. Establish a pointer from each New Person entry to the
66 ;; corresponding entry in the Name Components that contains the
67 ;; Name parts.
68 ;;
69 ;; 4. Record in ^XTMP all changes that were made, and any problems
70 ;; or questionable assumptions that are encountered in
71 ;; standardizing the name or parsing it into its component parts.
72 ;;$$END
73 N I,T F I=1:1 S T=$P($T(CINTRO+I),";;",2,999) Q:T="$$END" W !,T
74 Q
75 ;
76GENERATE ;Generate ^XTMP
77 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,XUIEN,XUNMSP,X,Y
78 S XUNMSP="XLFNAME"
79 ;
80 D GINTRO
81 S DIR(0)="YO",DIR("A")="Do you wish to continue"
82 S DIR("?",1)=" Enter 'Y' to store information in ^XTMP about changes that"
83 S DIR("?")=" will take place when the CONVERT^XLFNAME entry point is run."
84 W ! D ^DIR K DIR Q:$D(DIRUT)!'Y
85 ;
86 ;Check if the conversion was already run.
87 ;Determine which record to start with.
88 I $P($G(^XTMP(XUNMSP,0)),U,4) D Q:$D(DIRUT)
89 . W !!,"It appears that the conversion of New Person Names (routine CONVERT^XLFNAME)"
90 . W !,"has already been run. If you continue, the information already stored in"
91 . W !,"^XTMP about records that have been converted will be lost.",!
92 . S DIR(0)="YO",DIR("A")="Are you sure you wish to continue"
93 . S DIR("?")=" Enter 'Y' if you wish to replace the information already in ^XTMP."
94 . D ^DIR K DIR S:'Y DIRUT=1
95 ;
96 D NEWPERS^XLFNAME3("KR")
97 S:$D(^XTMP(XUNMSP,0))#2 $P(^(0),U,3)="Created by GENERATE~XLFNAME"
98 Q
99 ;
100GINTRO ;Print introductory comments
101 ;;This entry point loops through the records in the New Person file and
102 ;;determines the standard form of each Name. It also tries to determine the
103 ;;component parts of the name. If the standard form of the name is different
104 ;;from the current form, or if any questionable assumptions need to made in
105 ;;determining the component parts of the name, information about that name
106 ;;is stored in ^XTMP("XLFNAME"). You can later print the information stored
107 ;;in ^XTMP via the PRINT^XLFNAME entry point.
108 ;;
109 ;;NOTE: This entry point makes no changes to the NEW PERSON file or the new
110 ;; NAME COMPONENTS file.
111 ;;$$END
112 N I,T F I=1:1 S T=$P($T(GINTRO+I),";;",2,999) Q:T="$$END" W !,T
113 Q
Note: See TracBrowser for help on using the repository browser.