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

LR463ETI.m

Go to the documentation of this file.
LR463ETI ;LEIDOS/TCK - PRE INSTALL ROUTINE FOR LR*5.2*463 ; 4/25/16 10:48am
 ;;5.2;LAB SERVICE;**463**;NOV 7, 2015;Build 77
 ;
EN ;
 ;ADD NEW ENTRIES TO THE ETIOLGY FILE, (#61.2)
 N XX,LRFDA,NME,SNMD,ID,GRP,WKLD,ARRAY,IEN,STOP
 S (LRFDA,NME,SNMD,ID,GRP,WKLD,XX,IEN)="",STOP=0
 ;Build array of new Etiolgy names
 S ARRAY("CRE",1)="KLEBSIELLA PNEUMONIAE, CARBAPENEM RESISTANT (CRE)"
 S ARRAY("CRE",2)="KLEBSIELLA OXYTOCA, CARBAPENEM RESISTANT (CRE)"
 S ARRAY("CRE",3)="ESCHERICHIA COLI, CARBAPENEM RESISTANT (CRE)"
 S ARRAY("CRE",4)="ENTEROBACTER CLOACAE, CARBAPENEM RESISTANT (CRE)"
 S ARRAY("CRE",5)="ENTEROBACTER SPP, CARBAPENEM RESISTANT (CRE)"
 ;Check if new Etilogy already exists in file 61.2
 F  S XX=$O(ARRAY("CRE",XX)) Q:XX=""  D
 .S NME=ARRAY("CRE",XX)
 .S NAME=$E(NME,1,30)
 .I $D(^LAB(61.2,"B",NAME)) D  Q
 ..S IEN="",IEN=$O(^LAB(61.2,"B",NAME,IEN))
 ..S ^TMP($J,"ETI","OLD",IEN)=NME
 .I '$D(^LAB(61.2,"B",NAME)) D
 ..D ADD(NME,.IEN)
 D DISPLAY
 Q
 ;
ADD(NME,IEN) ;
 N LRFIL,LRFDA
 S LRFIL=61.2
 ;Stub new record in 61.2 -- name only
 S X=NME,DIC(0)="L",DIC="^LAB(61.2,",LRFMERTS=1
 D FILE^DICN S IEN=+Y
 ;Update NODE 0 FIELDS
 K DLAYGO
 S LRFIL=61.2,LRIEN=IEN_","
 S TMPFDA(1,LRFIL,LRIEN,2)=""
 S TMPFDA(1,LRFIL,LRIEN,4)="B"
 S TMPFDA(1,LRFIL,LRIEN,1.6)="ENTEROBACTERIACEAE"
 D UPDATE^DIE("","TMPFDA(1)","LRIENS","LRMSG")
 K LRFIL,LRIEN,TMPFDA
 S ^TMP($J,"ETI","NEW",IEN)=NME
 Q
 ;
DISPLAY ;
 W !!
 I $D(^TMP($J,"ETI")) M ETIARY=^TMP($J,"ETI")
 I $D(ETIARY("NEW")) D
 .W !,"The following Etiology entries were added to the Etiology file: "
 .W !
 .S I="" F  S I=$O(ETIARY("NEW",I)) Q:I=""  D
 ..S NAME=ETIARY("NEW",I)
 ..W !,I_"    "_NAME
 I $D(ETIARY("OLD")) D
 .W !,"The following Etiology items were found in the Etiology file: "
 .S I="" F  S I=$O(ETIARY("OLD",I)) Q:I=""  D
 ..S NAME=ETIARY("OLD",I)
 ..W !,I_"   "_NAME
END ;
 K DIC,I,LRFMERTS,LRMULT,N,NAME,WKLIEN,X,Y,ETIARY,^TMP("ETI")
 Q
 ;