LEX2039P ; ISL/KER - Pre/Post Install ; 09/02/2005
;;2.0;LEXICON UTILITY;**39**;Sep 23, 1996
;
; External References
; DBIA 10086 HOME^%ZIS
; DBIA 2052 $$GET1^DID
; DBIA 2055 PRD^DILFD
; DBIA 10014 EN^DIU2
; DBIA 10141 BMES^XPDUTL
; DBIA 10141 MES^XPDUTL
;
Q
;
POST ; LEX*2.0*39 Post-Install
N LEXEDT,LEXCHG,LEXSCHG S LEXEDT=$G(^LEXM(0,"CREATED"))
S LEXCHG=0 S:$D(^LEXM(80))!($D(^LEXM(80.1)))!($D(^LEXM(81)))!($D(^LEXM(81.2)))!($D(^LEXM(81.3))) LEXCHG=1
;
;-----------------------------
; Save Changes
D SCHG
;
;-----------------------------
; Load Data into Files
D LOAD
;
;-----------------------------
; Data Conversion
D CON
;
;-----------------------------
; Re-Index Files - N/A for LEX*2.0*39
; Do not use for Annual/Quarterly Updates, it disrupts the Protocol
; D RX
;
;-----------------------------
; Fire Protocol
D NOTIFY^LEXXGI
;
;-----------------------------
; Send a Install Message
D MSG
;
;-----------------------------
; Clean up and Quit
D KLEXM
Q
;
LOAD ; Load Data from ^LEXM into IC*/LEX Files
N LEXB,LEXBUILD,LEXCD,LEXIGHF,LEXLAST,LEXLREV D IMP^LEX2039
S U="^",LEXB=$G(^LEXM(0,"BUILD")) Q:LEXB="" Q:LEXBUILD=""
S LEXCD=0 S LEXCD=+($$CPD^LEX2039)
I LEXCD,LEXB=LEXBUILD D G LQ
. S X="Data for patch "_LEXBUILD_" has already been installed"
. W:'$D(XPDNM) !!,X D:$D(XPDNM) BMES^XPDUTL(X)
. S X="" W:'$D(XPDNM) ! D:$D(XPDNM) MES^XPDUTL(X)
D:'LEXCD&(LEXB=LEXBUILD) EN^LEXXGI
LQ ; Load Quit
D KLEXM
Q
;
MSG ; Send Installation Message to G.LEXICON
Q:+($G(DUZ))=0!($$NOTDEF^LEX2039($G(DUZ)))
D HOME^%ZIS N DIFROM,LEXLREV,LEXLAST,LEXBUILD,LEXIGHF
D IMP^LEX2039,POST^LEXXFI Q
;
SCHG ; Save Change File Changes
D MES^XPDUTL(" Updating Change File")
N LEXI,LEXFI,LEXFIL S LEXFI=0 F S LEXFI=$O(^LEXM(LEXFI)) Q:+LEXFI=0 D
. S LEXI=0 F S LEXI=$O(^LEXM(LEXFI,LEXI)) Q:+LEXI=0 D
. . N LEXCF,LEXIEN S LEXMUMPS=$G(^LEXM(LEXFI,LEXI)),LEXRT=$P(LEXMUMPS,"^",2)
. . S:LEXMUMPS["^LEX("!(LEXMUMPS["^LEXT(")!(LEXMUMPS["^LEXC(") LEXFIL=+($P(LEXRT,"(",2))
. . S:LEXMUMPS["^ICD9(" LEXFIL=80 S:LEXMUMPS["^ICD0(" LEXFIL=80.1 S:LEXMUMPS["^ICPT(" LEXFIL=81 S:LEXMUMPS["^DIC(81.3" LEXFIL=81.3
. . S:+LEXFIL>0 LEXSCHG(+LEXFIL,0)="" S LEXCF=+($P(LEXMUMPS,"LEXC(757.9,""AFIL"",",2))
. . S:$P(LEXCF,".",1)'="757"&("^80^80.1^81^81.3^"'[("^"_LEXCF_"^")) LEXCF=""
. . S LEXIEN=+($P(LEXMUMPS,("LEXC(757.9,""AFIL"","_+LEXCF_","),2))
. . I +LEXIEN>0&(+LEXCF)>0&("^80^80.1^81^81.3)"[LEXCF)&(+LEXFIL=757.9)&(LEXMUMPS["LEXC(757.9") D
. . . S LEXSCHG(+LEXFIL,LEXIEN)=LEXCF,LEXSCHG(757.9,"B",+LEXCF,LEXIEN)=""
. . S:$L(LEXMUMPS)&($L(LEXCF)) LEXCHGS(LEXCF)=""
Q
;
KLEXM ; Subscripted Kill of ^LEXM
N DA S DA=0 F S DA=$O(^LEXM(DA)) Q:+DA=0 K ^LEXM(DA)
K ^LEXM(0)
Q
;
PRE ; LEX*2.0*39 Pre-Install (N/A for patch 39)
Q
;
RX ; Reindex files (N/A for patch 39)
Q
N LEX,DA,DIK,TH,TM,TD
D BMES^XPDUTL(" Re-indexing NEW Versioned Text Cross-References")
;
D BMES^XPDUTL(" ICD-9 Diagnosis file #80") W !," "
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 "."
K ^ICD9("AB"),^ICD9("ACC"),^ICD9("ACT"),^ICD9("BA"),^ICD9("D"),^ICD9("AST"),^ICD9("ADS") S DIK="^ICD9(" D IXALL^DIK
;
D MES^XPDUTL(" ICD-9 Operations/Procedure file #80.1") W !," "
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 "."
K ^ICD0("AB"),^ICD0("ACT"),^ICD0("ADS"),^ICD0("AST"),^ICD0("BA"),^ICD0("D"),^ICD0("E") S DIK="^ICD0(" D IXALL^DIK
;
D MES^XPDUTL(" DRG file #80.2") W !," "
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 "."
K ^ICD("ADS"),^ICD("B") S DIK="^ICD(" D IXALL^DIK
;
D MES^XPDUTL(" CPT/HCPCS Procedure/Services file #81") W !," "
S (LEX,DA)=0 F S DA=$O(^ICPT(DA)) Q:+DA=0 D
. 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 "."
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
;
D MES^XPDUTL(" CPT Modifier file #81.3") W !," "
S (LEX,DA)=0 F S DA=$O(^DIC(81.3,DA)) Q:+DA=0 D
. 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 "."
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
Q
;
CON ; Conversion of data (Add LEXVDT to screens)
N IEN,DA,DIK
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)))"
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)))))"
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)))"
S ^LEX(757.3,4,1)="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
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)))"
S ^LEX(757.3,6,1)="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
S ^LEX(757.3,8,1)="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))"
S ^LEX(757.3,9,1)="I $L($$CPTONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
S ^LEX(757.3,10,1)="I $$SO^LEXU(Y,""DS4"",+($G(LEXVDT)))"
K ^LEX(757.3,"APPS"),^LEX(757.3,"AS"),^LEX(757.3,"B"),^LEX(757.3,"C"),^LEX(757.3,"D")
S IEN=0 F S IEN=$O(^LEX(757.3,IEN)) Q:+IEN'>0 S DA=+IEN,DIK="^LEX(757.3," D IX1^DIK
S NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"",+($G(LEXVDT)))"
S OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"")" D SW
S NEW="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPTONE^LEXU(+Y,+($G(LEXVDT)))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
S OLD="I $L($$ICDONE^LEXU(+Y))!($L($$CPTONE^LEXU(+Y)))!($L($$CPCONE^LEXU(+Y)))" D SW
S NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
S OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"")" D SW
S NEW="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
S OLD="I $$SO^LEXU(Y,""NAN/OMA"")" D SW
S NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
S OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"")" D SW
S NEW="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
S OLD="I $$SO^LEXU(Y,""NAN/OMA"")" D SW
S NEW="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))"
S OLD="I $L($$ICDONE^LEXU(+Y))" D SW
S NEW="I $L($$CPTONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
S OLD="I $L($$CPTONE^LEXU(+Y))!($L($$CPCONE^LEXU(+Y)))" D SW
S NEW="I $$SO^LEXU(Y,""DS4"",+($G(LEXVDT)))"
S OLD="I $$SO^LEXU(Y,""DS4"")" D SW
Q
SW ; Swap
N IEN S IEN=0 F S IEN=$O(^LEXT(757.2,IEN)) Q:+IEN=0 D
. I $G(^LEXT(757.2,IEN,6))=OLD S ^LEXT(757.2,IEN,6)=NEW
. N USR S USR=0 F S USR=$O(^LEXT(757.2,IEN,200,USR)) Q:+USR=0 D
. . I $G(^LEXT(757.2,IEN,200,USR,1))=OLD S ^LEXT(757.2,IEN,200,USR,1)=NEW
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEX2039P 7442 printed Nov 22, 2024@17:14:10 Page 2
LEX2039P ; ISL/KER - Pre/Post Install ; 09/02/2005
+1 ;;2.0;LEXICON UTILITY;**39**;Sep 23, 1996
+2 ;
+3 ; External References
+4 ; DBIA 10086 HOME^%ZIS
+5 ; DBIA 2052 $$GET1^DID
+6 ; DBIA 2055 PRD^DILFD
+7 ; DBIA 10014 EN^DIU2
+8 ; DBIA 10141 BMES^XPDUTL
+9 ; DBIA 10141 MES^XPDUTL
+10 ;
+11 QUIT
+12 ;
POST ; LEX*2.0*39 Post-Install
+1 NEW LEXEDT,LEXCHG,LEXSCHG
SET LEXEDT=$GET(^LEXM(0,"CREATED"))
+2 SET LEXCHG=0
if $DATA(^LEXM(80))!($DATA(^LEXM(80.1)))!($DATA(^LEXM(81)))!($DATA(^LEXM(81.2)))!($DATA(^LEXM(81.3)))
SET LEXCHG=1
+3 ;
+4 ;-----------------------------
+5 ; Save Changes
+6 DO SCHG
+7 ;
+8 ;-----------------------------
+9 ; Load Data into Files
+10 DO LOAD
+11 ;
+12 ;-----------------------------
+13 ; Data Conversion
+14 DO CON
+15 ;
+16 ;-----------------------------
+17 ; Re-Index Files - N/A for LEX*2.0*39
+18 ; Do not use for Annual/Quarterly Updates, it disrupts the Protocol
+19 ; D RX
+20 ;
+21 ;-----------------------------
+22 ; Fire Protocol
+23 DO NOTIFY^LEXXGI
+24 ;
+25 ;-----------------------------
+26 ; Send a Install Message
+27 DO MSG
+28 ;
+29 ;-----------------------------
+30 ; Clean up and Quit
+31 DO KLEXM
+32 QUIT
+33 ;
LOAD ; Load Data from ^LEXM into IC*/LEX Files
+1 NEW LEXB,LEXBUILD,LEXCD,LEXIGHF,LEXLAST,LEXLREV
DO IMP^LEX2039
+2 SET U="^"
SET LEXB=$GET(^LEXM(0,"BUILD"))
if LEXB=""
QUIT
if LEXBUILD=""
QUIT
+3 SET LEXCD=0
SET LEXCD=+($$CPD^LEX2039)
+4 IF LEXCD
IF LEXB=LEXBUILD
Begin DoDot:1
+5 SET X="Data for patch "_LEXBUILD_" has already been installed"
+6 if '$DATA(XPDNM)
WRITE !!,X
if $DATA(XPDNM)
DO BMES^XPDUTL(X)
+7 SET X=""
if '$DATA(XPDNM)
WRITE !
if $DATA(XPDNM)
DO MES^XPDUTL(X)
End DoDot:1
GOTO LQ
+8 if 'LEXCD&(LEXB=LEXBUILD)
DO EN^LEXXGI
LQ ; Load Quit
+1 DO KLEXM
+2 QUIT
+3 ;
MSG ; Send Installation Message to G.LEXICON
+1 if +($GET(DUZ))=0!($$NOTDEF^LEX2039($GET(DUZ)))
QUIT
+2 DO HOME^%ZIS
NEW DIFROM,LEXLREV,LEXLAST,LEXBUILD,LEXIGHF
+3 DO IMP^LEX2039
DO POST^LEXXFI
QUIT
+4 ;
SCHG ; Save Change File Changes
+1 DO MES^XPDUTL(" Updating Change File")
+2 NEW LEXI,LEXFI,LEXFIL
SET LEXFI=0
FOR
SET LEXFI=$ORDER(^LEXM(LEXFI))
if +LEXFI=0
QUIT
Begin DoDot:1
+3 SET LEXI=0
FOR
SET LEXI=$ORDER(^LEXM(LEXFI,LEXI))
if +LEXI=0
QUIT
Begin DoDot:2
+4 NEW LEXCF,LEXIEN
SET LEXMUMPS=$GET(^LEXM(LEXFI,LEXI))
SET LEXRT=$PIECE(LEXMUMPS,"^",2)
+5 if LEXMUMPS["^LEX("!(LEXMUMPS["^LEXT(")!(LEXMUMPS["^LEXC(")
SET LEXFIL=+($PIECE(LEXRT,"(",2))
+6 if LEXMUMPS["^ICD9("
SET LEXFIL=80
if LEXMUMPS["^ICD0("
SET LEXFIL=80.1
if LEXMUMPS["^ICPT("
SET LEXFIL=81
if LEXMUMPS["^DIC(81.3"
SET LEXFIL=81.3
+7 if +LEXFIL>0
SET LEXSCHG(+LEXFIL,0)=""
SET LEXCF=+($PIECE(LEXMUMPS,"LEXC(757.9,""AFIL"",",2))
+8 if $PIECE(LEXCF,".",1)'="757"&("^80^80.1^81^81.3^"'[("^"_LEXCF_"^"))
SET LEXCF=""
+9 SET LEXIEN=+($PIECE(LEXMUMPS,("LEXC(757.9,""AFIL"","_+LEXCF_","),2))
+10 IF +LEXIEN>0&(+LEXCF)>0&("^80^80.1^81^81.3)"[LEXCF)&(+LEXFIL=757.9)&(LEXMUMPS["LEXC(757.9")
Begin DoDot:3
+11 SET LEXSCHG(+LEXFIL,LEXIEN)=LEXCF
SET LEXSCHG(757.9,"B",+LEXCF,LEXIEN)=""
End DoDot:3
+12 if $LENGTH(LEXMUMPS)&($LENGTH(LEXCF))
SET LEXCHGS(LEXCF)=""
End DoDot:2
End DoDot:1
+13 QUIT
+14 ;
KLEXM ; Subscripted Kill of ^LEXM
+1 NEW DA
SET DA=0
FOR
SET DA=$ORDER(^LEXM(DA))
if +DA=0
QUIT
KILL ^LEXM(DA)
+2 KILL ^LEXM(0)
+3 QUIT
+4 ;
PRE ; LEX*2.0*39 Pre-Install (N/A for patch 39)
+1 QUIT
+2 ;
RX ; Reindex files (N/A for patch 39)
+1 QUIT
+2 NEW LEX,DA,DIK,TH,TM,TD
+3 DO BMES^XPDUTL(" Re-indexing NEW Versioned Text Cross-References")
+4 ;
+5 DO BMES^XPDUTL(" ICD-9 Diagnosis file #80")
WRITE !," "
+6 SET (LEX,DA)=0
FOR
SET DA=$ORDER(^ICD9(DA))
if +DA=0
QUIT
KILL ^ICD9(DA,66,"B"),^ICD9(DA,67,"B"),^ICD9(DA,68,"B")
SET LEX=+($GET(LEX))+1
if LEX#120=0
WRITE "."
+7 KILL ^ICD9("AB"),^ICD9("ACC"),^ICD9("ACT"),^ICD9("BA"),^ICD9("D"),^ICD9("AST"),^ICD9("ADS")
SET DIK="^ICD9("
DO IXALL^DIK
+8 ;
+9 DO MES^XPDUTL(" ICD-9 Operations/Procedure file #80.1")
WRITE !," "
+10 SET (LEX,DA)=0
FOR
SET DA=$ORDER(^ICD0(DA))
if +DA=0
QUIT
KILL ^ICD0(DA,66,"B"),^ICD0(DA,67,"B"),^ICD0(DA,68,"B")
SET LEX=+($GET(LEX))+1
if LEX#120=0
WRITE "."
+11 KILL ^ICD0("AB"),^ICD0("ACT"),^ICD0("ADS"),^ICD0("AST"),^ICD0("BA"),^ICD0("D"),^ICD0("E")
SET DIK="^ICD0("
DO IXALL^DIK
+12 ;
+13 DO MES^XPDUTL(" DRG file #80.2")
WRITE !," "
+14 SET (LEX,DA)=0
FOR
SET DA=$ORDER(^ICD(DA))
if +DA=0
QUIT
KILL ^ICD(DA,1,"B"),^ICD(DA,66,"B"),^ICD(DA,68,"B")
SET LEX=+($GET(LEX))+1
if LEX#120=0
WRITE "."
+15 KILL ^ICD("ADS"),^ICD("B")
SET DIK="^ICD("
DO IXALL^DIK
+16 ;
+17 DO MES^XPDUTL(" CPT/HCPCS Procedure/Services file #81")
WRITE !," "
+18 SET (LEX,DA)=0
FOR
SET DA=$ORDER(^ICPT(DA))
if +DA=0
QUIT
Begin DoDot:1
+19 KILL ^ICPT(DA,60,"B"),^ICPT(DA,61,"B"),^ICPT(DA,62,"B"),^ICPT(DA,"D","B")
SET LEX=+($GET(LEX))+1
if LEX#120=0
WRITE "."
End DoDot:1
+20 KILL ^ICPT("ACT"),^ICPT("ADS"),^ICPT("AST"),^ICPT("B"),^ICPT("BA"),^ICPT("C"),^ICPT("D"),^ICPT("E"),^ICPT("F")
SET DIK="^ICPT("
DO IXALL^DIK
+21 ;
+22 DO MES^XPDUTL(" CPT Modifier file #81.3")
WRITE !," "
+23 SET (LEX,DA)=0
FOR
SET DA=$ORDER(^DIC(81.3,DA))
if +DA=0
QUIT
Begin DoDot:1
+24 KILL ^DIC(81.3,DA,60,"B"),^DIC(81.3,DA,61,"B"),^DIC(81.3,DA,62,"B")
SET LEX=+($GET(LEX))+1
if LEX#120=0
WRITE "."
End DoDot:1
+25 KILL ^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")
SET DIK="^DIC(81.3,"
DO IXALL^DIK
+26 QUIT
+27 ;
CON ; Conversion of data (Add LEXVDT to screens)
+1 NEW IEN,DA,DIK
+2 SET ^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)))"
+3 SET ^LEX(757.3,2,1)="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPTONE^LEXU(+Y,+($G(LEXVDT)))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
+4 SET ^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)))"
+5 SET ^LEX(757.3,4,1)="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
+6 SET ^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)))"
+7 SET ^LEX(757.3,6,1)="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
+8 SET ^LEX(757.3,8,1)="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))"
+9 SET ^LEX(757.3,9,1)="I $L($$CPTONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
+10 SET ^LEX(757.3,10,1)="I $$SO^LEXU(Y,""DS4"",+($G(LEXVDT)))"
+11 KILL ^LEX(757.3,"APPS"),^LEX(757.3,"AS"),^LEX(757.3,"B"),^LEX(757.3,"C"),^LEX(757.3,"D")
+12 SET IEN=0
FOR
SET IEN=$ORDER(^LEX(757.3,IEN))
if +IEN'>0
QUIT
SET DA=+IEN
SET DIK="^LEX(757.3,"
DO IX1^DIK
+13 SET NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"",+($G(LEXVDT)))"
+14 SET OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC"")"
DO SW
+15 SET NEW="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPTONE^LEXU(+Y,+($G(LEXVDT)))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
+16 SET OLD="I $L($$ICDONE^LEXU(+Y))!($L($$CPTONE^LEXU(+Y)))!($L($$CPCONE^LEXU(+Y)))"
DO SW
+17 SET NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
+18 SET OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"")"
DO SW
+19 SET NEW="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
+20 SET OLD="I $$SO^LEXU(Y,""NAN/OMA"")"
DO SW
+21 SET NEW="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"",+($G(LEXVDT)))"
+22 SET OLD="I $$SC^LEXU(Y,""BEH/DIS;999/64/66/73/74/77/82/169/170/171;ICD/CPT/CPC/DS4"")"
DO SW
+23 SET NEW="I $$SO^LEXU(Y,""NAN/OMA"",+($G(LEXVDT)))"
+24 SET OLD="I $$SO^LEXU(Y,""NAN/OMA"")"
DO SW
+25 SET NEW="I $L($$ICDONE^LEXU(+Y,+($G(LEXVDT))))"
+26 SET OLD="I $L($$ICDONE^LEXU(+Y))"
DO SW
+27 SET NEW="I $L($$CPTONE^LEXU(+Y,+($G(LEXVDT))))!($L($$CPCONE^LEXU(+Y,+($G(LEXVDT)))))"
+28 SET OLD="I $L($$CPTONE^LEXU(+Y))!($L($$CPCONE^LEXU(+Y)))"
DO SW
+29 SET NEW="I $$SO^LEXU(Y,""DS4"",+($G(LEXVDT)))"
+30 SET OLD="I $$SO^LEXU(Y,""DS4"")"
DO SW
+31 QUIT
SW ; Swap
+1 NEW IEN
SET IEN=0
FOR
SET IEN=$ORDER(^LEXT(757.2,IEN))
if +IEN=0
QUIT
Begin DoDot:1
+2 IF $GET(^LEXT(757.2,IEN,6))=OLD
SET ^LEXT(757.2,IEN,6)=NEW
+3 NEW USR
SET USR=0
FOR
SET USR=$ORDER(^LEXT(757.2,IEN,200,USR))
if +USR=0
QUIT
Begin DoDot:2
+4 IF $GET(^LEXT(757.2,IEN,200,USR,1))=OLD
SET ^LEXT(757.2,IEN,200,USR,1)=NEW
End DoDot:2
End DoDot:1
+5 QUIT