source: FOIAVistA/trunk/r/LEXICON_UTILITY-LEX-GMPT/LEX2039P.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 7.1 KB
Line 
1LEX2039P ; ISL/KER - Pre/Post Install ; 09/02/2005
2 ;;2.0;LEXICON UTILITY;**39**;Sep 23, 1996
3 ;
4 ; External References
5 ; DBIA 10086 HOME^%ZIS
6 ; DBIA 2052 $$GET1^DID
7 ; DBIA 2055 PRD^DILFD
8 ; DBIA 10014 EN^DIU2
9 ; DBIA 10141 BMES^XPDUTL
10 ; DBIA 10141 MES^XPDUTL
11 ;
12 Q
13 ;
14POST ; LEX*2.0*39 Post-Install
15 N LEXEDT,LEXCHG,LEXSCHG S LEXEDT=$G(^LEXM(0,"CREATED"))
16 S LEXCHG=0 S:$D(^LEXM(80))!($D(^LEXM(80.1)))!($D(^LEXM(81)))!($D(^LEXM(81.2)))!($D(^LEXM(81.3))) LEXCHG=1
17 ;
18 ;-----------------------------
19 ; Save Changes
20 D SCHG
21 ;
22 ;-----------------------------
23 ; Load Data into Files
24 D LOAD
25 ;
26 ;-----------------------------
27 ; Data Conversion
28 D CON
29 ;
30 ;-----------------------------
31 ; Re-Index Files - N/A for LEX*2.0*39
32 ; Do not use for Annual/Quarterly Updates, it disrupts the Protocol
33 ; D RX
34 ;
35 ;-----------------------------
36 ; Fire Protocol
37 D NOTIFY^LEXXGI
38 ;
39 ;-----------------------------
40 ; Send a Install Message
41 D MSG
42 ;
43 ;-----------------------------
44 ; Clean up and Quit
45 D KLEXM
46 Q
47 ;
48LOAD ; Load Data from ^LEXM into IC*/LEX Files
49 N LEXB,LEXBUILD,LEXCD,LEXIGHF,LEXLAST,LEXLREV D IMP^LEX2039
50 S U="^",LEXB=$G(^LEXM(0,"BUILD")) Q:LEXB="" Q:LEXBUILD=""
51 S LEXCD=0 S LEXCD=+($$CPD^LEX2039)
52 I LEXCD,LEXB=LEXBUILD D G LQ
53 . S X="Data for patch "_LEXBUILD_" has already been installed"
54 . W:'$D(XPDNM) !!,X D:$D(XPDNM) BMES^XPDUTL(X)
55 . S X="" W:'$D(XPDNM) ! D:$D(XPDNM) MES^XPDUTL(X)
56 D:'LEXCD&(LEXB=LEXBUILD) EN^LEXXGI
57LQ ; Load Quit
58 D KLEXM
59 Q
60 ;
61MSG ; Send Installation Message to G.LEXICON
62 Q:+($G(DUZ))=0!($$NOTDEF^LEX2039($G(DUZ)))
63 D HOME^%ZIS N DIFROM,LEXLREV,LEXLAST,LEXBUILD,LEXIGHF
64 D IMP^LEX2039,POST^LEXXFI Q
65 ;
66SCHG ; Save Change File Changes
67 D MES^XPDUTL(" Updating Change File")
68 N LEXI,LEXFI,LEXFIL S LEXFI=0 F S LEXFI=$O(^LEXM(LEXFI)) Q:+LEXFI=0 D
69 . S LEXI=0 F S LEXI=$O(^LEXM(LEXFI,LEXI)) Q:+LEXI=0 D
70 . . N LEXCF,LEXIEN S LEXMUMPS=$G(^LEXM(LEXFI,LEXI)),LEXRT=$P(LEXMUMPS,"^",2)
71 . . S:LEXMUMPS["^LEX("!(LEXMUMPS["^LEXT(")!(LEXMUMPS["^LEXC(") LEXFIL=+($P(LEXRT,"(",2))
72 . . S:LEXMUMPS["^ICD9(" LEXFIL=80 S:LEXMUMPS["^ICD0(" LEXFIL=80.1 S:LEXMUMPS["^ICPT(" LEXFIL=81 S:LEXMUMPS["^DIC(81.3" LEXFIL=81.3
73 . . S:+LEXFIL>0 LEXSCHG(+LEXFIL,0)="" S LEXCF=+($P(LEXMUMPS,"LEXC(757.9,""AFIL"",",2))
74 . . S:$P(LEXCF,".",1)'="757"&("^80^80.1^81^81.3^"'[("^"_LEXCF_"^")) LEXCF=""
75 . . S LEXIEN=+($P(LEXMUMPS,("LEXC(757.9,""AFIL"","_+LEXCF_","),2))
76 . . I +LEXIEN>0&(+LEXCF)>0&("^80^80.1^81^81.3)"[LEXCF)&(+LEXFIL=757.9)&(LEXMUMPS["LEXC(757.9") D
77 . . . S LEXSCHG(+LEXFIL,LEXIEN)=LEXCF,LEXSCHG(757.9,"B",+LEXCF,LEXIEN)=""
78 . . S:$L(LEXMUMPS)&($L(LEXCF)) LEXCHGS(LEXCF)=""
79 Q
80 ;
81KLEXM ; Subscripted Kill of ^LEXM
82 N DA S DA=0 F S DA=$O(^LEXM(DA)) Q:+DA=0 K ^LEXM(DA)
83 K ^LEXM(0)
84 Q
85 ;
86PRE ; LEX*2.0*39 Pre-Install (N/A for patch 39)
87 Q
88 ;
89RX ; Reindex files (N/A for patch 39)
90 Q
91 N LEX,DA,DIK,TH,TM,TD
92 D BMES^XPDUTL(" Re-indexing NEW Versioned Text Cross-References")
93 ;
94 D BMES^XPDUTL(" ICD-9 Diagnosis file #80") W !," "
95 S (LEX,DA)=0 F S DA=$O(^ICD9(DA)) Q:+DA=0 K ^ICD9(DA,66,"B"),^ICD9(DA,67,"B"),^ICD9(DA,68,"B") S LEX=+($G(LEX))+1 W:LEX#120=0 "."
96 K ^ICD9("AB"),^ICD9("ACC"),^ICD9("ACT"),^ICD9("BA"),^ICD9("D"),^ICD9("AST"),^ICD9("ADS") S DIK="^ICD9(" D IXALL^DIK
97 ;
98 D MES^XPDUTL(" ICD-9 Operations/Procedure file #80.1") W !," "
99 S (LEX,DA)=0 F S DA=$O(^ICD0(DA)) Q:+DA=0 K ^ICD0(DA,66,"B"),^ICD0(DA,67,"B"),^ICD0(DA,68,"B") S LEX=+($G(LEX))+1 W:LEX#120=0 "."
100 K ^ICD0("AB"),^ICD0("ACT"),^ICD0("ADS"),^ICD0("AST"),^ICD0("BA"),^ICD0("D"),^ICD0("E") S DIK="^ICD0(" D IXALL^DIK
101 ;
102 D MES^XPDUTL(" DRG file #80.2") W !," "
103 S (LEX,DA)=0 F S DA=$O(^ICD(DA)) Q:+DA=0 K ^ICD(DA,1,"B"),^ICD(DA,66,"B"),^ICD(DA,68,"B") S LEX=+($G(LEX))+1 W:LEX#120=0 "."
104 K ^ICD("ADS"),^ICD("B") S DIK="^ICD(" D IXALL^DIK
105 ;
106 D MES^XPDUTL(" CPT/HCPCS Procedure/Services file #81") W !," "
107 S (LEX,DA)=0 F S DA=$O(^ICPT(DA)) Q:+DA=0 D
108 . K ^ICPT(DA,60,"B"),^ICPT(DA,61,"B"),^ICPT(DA,62,"B"),^ICPT(DA,"D","B") S LEX=+($G(LEX))+1 W:LEX#120=0 "."
109 K ^ICPT("ACT"),^ICPT("ADS"),^ICPT("AST"),^ICPT("B"),^ICPT("BA"),^ICPT("C"),^ICPT("D"),^ICPT("E"),^ICPT("F") S DIK="^ICPT(" D IXALL^DIK
110 ;
111 D MES^XPDUTL(" CPT Modifier file #81.3") W !," "
112 S (LEX,DA)=0 F S DA=$O(^DIC(81.3,DA)) Q:+DA=0 D
113 . K ^DIC(81.3,DA,60,"B"),^DIC(81.3,DA,61,"B"),^DIC(81.3,DA,62,"B") S LEX=+($G(LEX))+1 W:LEX#120=0 "."
114 K ^DIC(81.3,"ACT"),^DIC(81.3,"ADS"),^DIC(81.3,"AST"),^DIC(81.3,"B"),^DIC(81.3,"BA"),^DIC(81.3,"C"),^DIC(81.3,"D"),^DIC(81.3,"M") S DIK="^DIC(81.3," D IXALL^DIK
115 Q
116 ;
117CON ; Conversion of data (Add LEXVDT to screens)
118 N IEN,DA,DIK
119 S ^LEX(757.3,1,1)="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"",+($G(LEXVDT)))"
120 S ^LEX(757.3,2,1)="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPTONE^LEXU(+Y,+($G(LEXVDT)))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
121 S ^LEX(757.3,3,1)="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
122 S ^LEX(757.3,4,1)="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
123 S ^LEX(757.3,5,1)="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
124 S ^LEX(757.3,6,1)="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
125 S ^LEX(757.3,8,1)="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))"
126 S ^LEX(757.3,9,1)="I $L($$CPTONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
127 S ^LEX(757.3,10,1)="I $$SO^LEXU(Y,""DS4"",+($G(LEXVDT)))"
128 K ^LEX(757.3,"APPS"),^LEX(757.3,"AS"),^LEX(757.3,"B"),^LEX(757.3,"C"),^LEX(757.3,"D")
129 S IEN=0 F S IEN=$O(^LEX(757.3,IEN)) Q:+IEN'>0 S DA=+IEN,DIK="^LEX(757.3," D IX1^DIK
130 S NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"",+($G(LEXVDT)))"
131 S OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"")" D SW
132 S NEW="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPTONE^LEXU(+Y,+($G(LEXVDT)))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
133 S OLD="I $L($$ICDONE^LEXU(+Y))!($L($$CPTONE^LEXU(+Y)))!($L($$CPCONE^LEXU(+Y)))" D SW
134 S NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
135 S OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"")" D SW
136 S NEW="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
137 S OLD="I $$SO^LEXU(Y,""NAN/OMA"")" D SW
138 S NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
139 S OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"")" D SW
140 S NEW="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
141 S OLD="I $$SO^LEXU(Y,""NAN/OMA"")" D SW
142 S NEW="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))"
143 S OLD="I $L($$ICDONE^LEXU(+Y))" D SW
144 S NEW="I $L($$CPTONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
145 S OLD="I $L($$CPTONE^LEXU(+Y))!($L($$CPCONE^LEXU(+Y)))" D SW
146 S NEW="I $$SO^LEXU(Y,""DS4"",+($G(LEXVDT)))"
147 S OLD="I $$SO^LEXU(Y,""DS4"")" D SW
148 Q
149SW ; Swap
150 N IEN S IEN=0 F S IEN=$O(^LEXT(757.2,IEN)) Q:+IEN=0 D
151 . I $G(^LEXT(757.2,IEN,6))=OLD S ^LEXT(757.2,IEN,6)=NEW
152 . N USR S USR=0 F S USR=$O(^LEXT(757.2,IEN,200,USR)) Q:+USR=0 D
153 . . I $G(^LEXT(757.2,IEN,200,USR,1))=OLD S ^LEXT(757.2,IEN,200,USR,1)=NEW
154 Q
Note: See TracBrowser for help on using the repository browser.