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

LR132P.m

Go to the documentation of this file.
  1. LR132P ;DALISC/SED - LR*5.2*132 PATCH POST INIT ROUTINE
  1. ;;5.2;LAB SERVICE;**132**;Oct 20, 1996
  1. EN ; Updates for file 69.5 that will not work with KIDS
  1. ;First enter the protocal from file 101 and enter it into 69.5
  1. S LRPROT=$O(^ORD(101,"B","LREPI",0))
  1. I +LRPROT>0 D
  1. .K DD
  1. .S DIC="^LAB(69.4,",DIC(0)="L",(DINUM,X)=LRPROT
  1. .D FILE^DICN
  1. .S MSG="Adding Protocal '"_$P(^ORD(101,LRPROT,0),U,1)_"' to the "
  1. .S MSG=MSG_"Emerging Pathogen File (69.5)"
  1. .D BMES^XPDUTL(MSG) K MSG
  1. .F I=1:1:14 S $P(^LAB(69.5,I,0),U,7)=LRPROT,$P(^LAB(69.5,I,0),U,9)=I
  1. I +LRPROT'>0 D BMES^XPDUTL("Unable to add a Protocal to the Emerging Pathogen File (69.5)") G EXIT
  1. MAIL ;Add the report mail group to file 69.4
  1. S LRMAIL=$O(^XMB(3.8,"B","EPI-REPORT",0))
  1. S $P(^LAB(69.4,LRPROT,0),U,2)=$G(LRMAIL)
  1. S $P(^LAB(69.4,LRPROT,0),U,3)="32000"
  1. ICD9 ;Add the ICD9 codes to the file.
  1. D BMES^XPDUTL("********")
  1. D BMES^XPDUTL("**Updating Emerging Pathogen File (69.5) with ICD9 Codes**")
  1. ;LEISHMANIAS
  1. F ICD=0:1:9 S ICD9="085."_ICD_" ",INT=$O(^ICD9("AB",ICD9,0)) D
  1. .Q:+INT'>0
  1. .Q:'$D(^ICD9(INT,0))
  1. .S LRPATH=14 D SETIC
  1. ;MALARIA
  1. F ICD=0:1:9 S ICD9="084."_ICD_" ",INT=$O(^ICD9("AB",ICD9,0)) D
  1. .Q:+INT'>0
  1. .Q:'$D(^ICD9(INT,0))
  1. .S LRPATH=11 D SETIC
  1. ;DENGUE,JAKOB-CREUTZFELDT DIS,LEGIONELLA
  1. TST F ICD9="007.8 ","065.4 ","046.1 ","061. ","482.80 " S INT=$O(^ICD9("AB",ICD9,0)) D
  1. .Q:+INT'>0
  1. .Q:'$D(^ICD9(INT,0))
  1. .S LRPATH=$S(ICD9="007.8 ":9,ICD9="046.1 ":13,ICD9="482.80 ":7,1:12) D SETIC
  1. ;
  1. BUGS ;ADD THE BUGS TO FILE 69.5
  1. D BMES^XPDUTL("********")
  1. D BMES^XPDUTL("**Updating Emerging Pathogen File (69.5) with Etiology**")
  1. S BUG="" F S BUG=$O(^LAB(61.2,"B",BUG)) Q:BUG="" D
  1. .I BUG'["CANDIDA",BUG'["LEGIONELLA",BUG'["ENTEROCOCCUS" Q
  1. .S BUGI=$O(^LAB(61.2,"B",BUG,0)) Q:+BUGI'>0
  1. .S LRPATH=$S(BUG["ENTEROCOCCUS":1,BUG["LEGIONELLA":7,1:8) D SETBG
  1. ;
  1. NLT ;AUTO LINKS THE FILE 62.06 WITH FILE 64
  1. S MSG="I will auto link file '62.06 ANTIMICROBIAL SUSCEPIBILTY' to file '64 WKLD CODE."
  1. D BMES^XPDUTL(MSG)
  1. S LRANT=0 F S LRANT=$O(^LAB(62.06,LRANT)) Q:+LRANT'>0 D
  1. .S LRANM=$P(^LAB(62.06,LRANT,0),U,1),LRND=$P(^LAB(62.06,LRANT,0),U,4)
  1. .S LRNDM=""
  1. .I +LRND>0,$D(^DD(63.3,LRND,0)) S LRNDM=$P(^DD(63.3,LRND,0),U,1)
  1. .S DIC=64,DIC(0)="XMO",X=LRANM D ^DIC
  1. .I +Y<0&(LRNDM'="") S DIC=64,DIC(0)="XMO",X=LRNDM D ^DIC
  1. .S:+Y>0 MSG=LRANM_" <----Linked----> "_$P(Y,U,2)
  1. .S:+Y'>0 MSG=LRANM_" <----Not Linked----> "_"No Match Found"
  1. .D BMES^XPDUTL(MSG)
  1. .Q:+Y'>0
  1. .K DIC,DD,DR,DA,DIE
  1. .S ^LAB(62.06,LRANT,64)=""
  1. .S DIE=62.06,DA=LRANT,DR="64////"_+Y D ^DIE
  1. ;
  1. EXIT K LRPATH,BUG,BUGI,INT,X,Y,DIC,ICD9,DD,LRPROT,LRMAIL
  1. ;
  1. Q
  1. SETBG ;ADD THE ENTRY FOR ETIOLOGY
  1. Q:$D(^LAB(69.5,LRPATH,2,"B",BUGI))
  1. S MSG="Adding "_BUG_" into "_$P(^LAB(69.5,LRPATH,0),U,1)
  1. D BMES^XPDUTL(MSG)
  1. K DD
  1. S DIC="^LAB(69.5,"_LRPATH_",2,",DIC(0)="L",X=BUGI
  1. S DIC("P")=$P(^DD(69.5,3,0),U,2),DA(1)=LRPATH
  1. D FILE^DICN
  1. Q
  1. SETIC ;ADD THE ENTRY FOR ICD9
  1. Q:$D(^LAB(69.5,LRPATH,3,"B",INT))
  1. S MSG="Adding "_$P(^ICD9(INT,0),U,1)_" "_$P(^ICD9(INT,0),U,3)_" into "
  1. S MSG=MSG_$P(^LAB(69.5,LRPATH,0),U,1)
  1. D BMES^XPDUTL(MSG)
  1. K DD
  1. S DIC="^LAB(69.5,"_LRPATH_",3,",DIC(0)="L",X=INT
  1. S DIC("P")=$P(^DD(69.5,4,0),U,2),DA(1)=LRPATH
  1. D FILE^DICN
  1. Q