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

LEX2073B.m

Go to the documentation of this file.
LEX2073B ;ISL/KER - LEX*2.0*73 Post-Install - Data ;01/03/2011
 ;;2.0;LEXICON UTILITY;**73**;Sep 23, 1996;Build 10
 ;               
 ; External Global Variables
 ;    None
 ;               
 ; External References
 ;    FILE^DIE            ICR   2053
 ;    ^DIK                ICR  10013
 ;    IX1^DIK             ICR  10013
 ;    BMES^XPDUTL         ICR  10141
 ;    MES^XPDUTL          ICR  10141
 ;               
 Q
EN ;
 N DA,DIK,LEX,LEXCA,LEXCAE,LEXCC,LEXCT,LEXEX,LEXFD,LEXFM,LEXFOR,LEXID,LEXIEN,LEXIN,LEXIS,LEXLIM,LEXMA,LEXN0,LEXND,LEXOR,LEXSI,LEXSR,LEXSRC,LEXSRE,LEXSRN,LEXTGT,LEXTO
 D BMES^XPDUTL(" Updating Title 38 Terminology"),BEG
 D MES^XPDUTL("   Adding Mixed Case Title 38 Expressions")
 D EN^LEX2073C,EN^LEX2073D,EN^LEX2073E,EN^LEX2073F,EN^LEX2073G
 D MES^XPDUTL("   Adding Inactive Title 38 Codes (historical)")
 D EN^LEX2073H,EN^LEX2073I,EN^LEX2073J,EN^LEX2073K,END,SC
 Q
BEG ; Mapping Definitions file 757.32
 D MES^XPDUTL("   Installing Title 38 Mapping Definition")
 N DA,DIK,LEXID,LEXIEN,LEXL,LEXT S LEXID="ASCD",LEXIEN=$O(^LEX(757.32,"B",LEXID,0)) I +LEXIEN>0 S DA=+LEXIEN,DIK="^LEX(757.32," D ^DIK
 S LEXID="ASCD",LEXIEN=2,DA=2 I $D(^LEX(757.32,+LEXIEN,0)) S DA=+LEXIEN,DIK="^LEX(757.32," D ^DIK
 S ^LEX(757.32,LEXIEN,0)="ASCD^ICD Diagnosis to Title 38 Disabilities"
 S ^LEX(757.32,LEXIEN,1,0)="^757.322^2^2^3110104^^^"
 S ^LEX(757.32,LEXIEN,1,1,0)="Map ICD-9-CM Service Connected Diagnosis to Title 38 Disabilities for the"
 S ^LEX(757.32,LEXIEN,1,2,0)="Automated Service Connected Designation (ASCD) project"
 S ^LEX(757.32,LEXIEN,2)="1^17"
 S DA=+LEXIEN,DIK="^LEX(757.32," D IX1^DIK S (LEXL,LEXT)="",LEXIEN=0
 F  S LEXIEN=$O(^LEX(757.32,LEXIEN)) Q:+LEXIEN'>0  S LEXL=LEXIEN,LEXT=+($G(LEXT))+1
 S $P(^LEX(757.32,0),"^",3)=LEXL,$P(^LEX(757.32,0),"^",4)=LEXT
 Q
END ; Mapping Order
 D MES^XPDUTL("   Calculating Title 38 Mapping Order")
 N LEX,LEXCT,LEXFM,LEXFOR,LEXIEN,LEXIN,LEXLIM,LEXMA,LEXN0,LEXOR,LEXSRC,LEXTGT,LEXTO S LEXIEN=0,LEXLIM=12788,LEXSRC=""
 F  S LEXSRC=$O(^LEX(757.33,"ASRC","ASCD",LEXSRC)) Q:'$L(LEXSRC)  D
 . N LEX,LEXTGT K LEX S LEXTGT="" F  S LEXTGT=$O(^LEX(757.33,"ASRC","ASCD",LEXSRC,LEXTGT)) Q:'$L(LEXTGT)  D
 . . N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(^LEX(757.33,"ASRC","ASCD",LEXSRC,LEXTGT,LEXIEN)) Q:+LEXIEN'>0  D
 . . . N LEXCT,LEXFM,LEXFOR,LEXIN,LEXMA,LEXN0,LEXOR,LEXTO Q:+LEXIEN<LEXLIM  S LEXN0=$G(^LEX(757.33,+LEXIEN,0)) Q:$P(LEXN0,"^",4)'=2
 . . . S LEXFM=$P(LEXN0,"^",2) Q:'$L(LEXFM)  S LEXTO=$P(LEXN0,"^",3) Q:'$L(LEXTO)  S LEXMA=$P(LEXN0,"^",5) Q:'$L(LEXMA)
 . . . S LEXOR=$S(+LEXMA=0:2,+LEXMA>0:1,1:"") Q:'$L(LEXOR)  S LEXCT=+($O(LEX(" "),-1))+1,LEX(0)=LEXCT
 . . . S LEX(LEXCT)=LEXFM_"^"_LEXTO_"^"_LEXMA_"^"_LEXIEN,LEX("O",+LEXOR,LEXTO,LEXCT,LEXIEN)=""
 . I $D(LEX) D
 . . N LEXCT,LEXFOR,LEXIEN,LEXIN,LEXMA,LEXOR,LEXTO S LEXOR=0 F LEXMA=1,2 D
 . . . N LEXCT,LEXTO S LEXCT=0,LEXTO="" F  S LEXTO=$O(LEX("O",LEXMA,LEXTO)) Q:'$L(LEXTO)  D
 . . . . N LEXIN S LEXIN=0 F  S LEXIN=$O(LEX("O",LEXMA,LEXTO,LEXIN)) Q:+LEXIN'>0  D
 . . . . . N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(LEX("O",LEXMA,LEXTO,LEXIN,LEXIEN)) Q:+LEXIEN'>0  D
 . . . . . . N LEXFOR S LEXCT=LEXCT+1,LEXOR=LEXOR+1,LEXFOR=$P($G(^LEX(757.33,+LEXIEN,3)),"^",1) Q:+LEXFOR'>0  Q:+LEXOR'>0
 . . . . . . S:LEXFOR'=LEXOR $P(^LEX(757.33,+LEXIEN,3),"^",1)=LEXOR
 Q
SC ; Source and Categories
 N DA,DIK,LEXCA,LEXCAE,LEXCC,LEXEX,LEXFD,LEXIS,LEXND,LEXSI,LEXSR,LEXSRE,LEXSRN S LEXCC=0,LEXCA=497 Q:'$D(^LEX(757.13,LEXCA,0))
 S LEXCAE="Service Connected Diagnosis",LEXSR=4 Q:'$D(^LEX(757.14,LEXSR,0))  S LEXSRE="ASCD",LEXSRN="Automated Service Connected Designation"
 D MES^XPDUTL("   Adding Source and Source Category")
 S LEXSI=0 F  S LEXSI=$O(^LEX(757.02,"ASRC","SCC",LEXSI)) Q:+LEXSI'>0  D
 . N LEXND,LEXEX,DA,DIK,LEXFD,LEXIS S LEXND=$G(^LEX(757.02,+LEXSI,0)) Q:$P(LEXND,U,3)'=17
 . S LEXEX=+LEXND Q:'$D(^LEX(757.01,+LEXEX,0))  Q:'$D(^LEX(757.01,+LEXEX,1))
 . S DA=LEXEX,DIK="^LEX(757.01,"
 . K LEXFD S LEXIS=LEXEX_",",LEXFD(757.01,LEXIS,15)=$G(LEXCA),LEXFD(757.01,LEXIS,16)=$G(LEXSR)
 . D FILE^DIE("","LEXFD") S DA=LEXEX,DIK="^LEX(757.01," D IX1^DIK
 . S LEXCC=LEXCC+1
 Q