LREPIPI ;VA/DALOI/CKA - Local Pathogens Input;7/2/03
;;5.2;LAB SERVICE;**1030**;NOV 01, 1997
;;5.2;LAB SERVICE;**281**;Sep 27, 1994
; Reference to $$SITE^VASITE supported by IA #10112
; Reference to ^ORD(101 supported by IA #872
EN ;
S LRNO="",SITE=$P($$SITE^VASITE,U)
S DIR(0)="FO^3:30",DIR("A")="LOCAL PATHOGEN NAME",DIR("?")="Enter the name of the local pathogen [3-30 characters]. You may also enter part of the name for look up purposes."
S DIR("??")="^S D=""B"",DIC=""^LAB(69.5,"",DIC(0)=""EZ"",DIC(""S"")=""I Y>99"" D DQ^DICQ K DIC"
D ^DIR K DIR I $D(DIRUT) G EXIT
S LRX=Y
LKUP ;
S DIC="^LAB(69.5,",DIC("S")="I Y>99",DIC(0)="EMZ" D ^DIC K DIC S LREPIFN=+Y
I $G(LRDEL) Q
I Y="" D EXIT G EN
I $D(DTOUT) G NOU
I Y'<0 D FND
I Y<0 D ADD D EXIT G EN
G:$G(Y)["^"!($D(DTOUT)) NOU
G:LRNO EN D:LRY EDIT G EN
G EN
Q
;
ADD ;
S DIR(0)="Y",DIR("A")="Do you want to add this local pathogen",DIR("B")="YES" D ^DIR G:$D(DTOUT) NOU K DIR
I 'Y Q
S LRNUM=99
F S LRNUM1=$O(^LAB(69.5,LRNUM)) Q:'LRNUM1 S LRNUM=LRNUM+1
S LRDA=LRNUM+1
K DD,DO
S DIC="^LAB(69.5,"
S DIC(0)="L"
S DLAYGO=69.5
S DINUM=LRDA
S X=LRX_SITE
D FILE^DICN
I Y=-1 D NOU G EN
S $P(^LAB(69.5,LRDA,0),U,2)=0
S $P(^LAB(69.5,LRDA,0),U,9)=LRDA
S LRPROT=0,LRPROT=$O(^ORD(101,"B","LREPI",LRPROT))
S $P(^LAB(69.5,LRDA,0),U,7)=LRPROT
S LREPIFN=LRDA
EDIT S DA=LREPIFN
S DDSFILE="^LAB(69.5,"
S DR="[LREPI9]"
D ^DDS
K DDSFILE(1)
W !!
D EXIT
Q
EXIT K DA,DD,DDSFILE,DLAYGO,DIC,DIK,DINUM,DIR,DO,DR,DTOUT,DUOUT,L,LRDA,LRDEL,LRNO,LRNUM,LRNUM1,LREPIFN,LRPROT,LRX,LRXX,LRY,SITE,X,Y Q
FND W !,"This pathogen is already entered as a local pathogen.",!
S DIC="^LAB(69.5,",DA=+Y,DR="0:6;8:9" D EN^DIQ
S DIR(0)="Y",DIR("A")="Is this the correct one" D ^DIR K DIR
I 'Y S LRNO=1 W !! Q
YN1 S DIR(0)="Y",DIR("A")="Do you want to edit this local pathogen",DIR("B")="NO"
D ^DIR
K DIR
S LRY=Y
W !! Q
Q
NOU W !!,$C(7),?20,"NO UPDATING HAS OCCURRED!!!" K DIR G:$D(DTOUT) EXIT W !! G EN
DELETE ;DELETE LOCAL PATHOGEN
S LRDEL=1
D EN
I '$D(Y) G EXIT
S LRXX=Y
G:$D(DTOUT)!($D(DUOUT))!(Y="") EXIT
S DIC="^LAB(69.5,"
S DIC(0)="EMZ"
S DIC("S")="I $P(^(0),U,9)>99"
D ^DIC
K DIC
I Y=-1 W !,"NO MATCH FOUND." G DELETE
S LRY=Y
S DIR(0)="Y",DIR("A")="Do you really want to delete this pathogen"
D ^DIR
K DIR
G:$D(DTOUT)!($D(DUOUT)) EXIT
I 'Y G DELETE
I LRY>99 S DA=+LRY D KILL G DELETE
G DELETE
;
KILL S DIK="^LAB(69.5,"
D ^DIK
W !!,"Entry ",$P(LRY,U,2)," deleted."
K DIK
Q
INQUIRY S DIC="^LAB(69.5,",DIC("A")="Select Pathogen: ",DIC(0)="AEMQ" D ^DIC K DIC
I Y<0 K DIC,DA,D0,DR,Y Q
INQ1 S DIC="^LAB(69.5,",DA=+Y,DR="0:6" D EN^DIQ
D PAUSE^LREPIRS2
I $G(LRQUIT) K DIC,DA,D0,DR,LRQUIT,Y Q
S DR="8:9" D EN^DIQ
K DIC,DA,DO,DR,LRQUIT,Y
G INQUIRY
PRINT S L=0,DIC="^LAB(69.5,"
D EN1^DIP
Q
LREPIPI ;VA/DALOI/CKA - Local Pathogens Input;7/2/03
+1 ;;5.2;LAB SERVICE;**1030**;NOV 01, 1997
+2 ;;5.2;LAB SERVICE;**281**;Sep 27, 1994
+3 ; Reference to $$SITE^VASITE supported by IA #10112
+4 ; Reference to ^ORD(101 supported by IA #872
EN ;
+1 SET LRNO=""
SET SITE=$PIECE($$SITE^VASITE,U)
+2 SET DIR(0)="FO^3:30"
SET DIR("A")="LOCAL PATHOGEN NAME"
SET DIR("?")="Enter the name of the local pathogen [3-30 characters]. You may also enter part of the name for look up purposes."
+3 SET DIR("??")="^S D=""B"",DIC=""^LAB(69.5,"",DIC(0)=""EZ"",DIC(""S"")=""I Y>99"" D DQ^DICQ K DIC"
+4 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO EXIT
+5 SET LRX=Y
LKUP ;
+1 SET DIC="^LAB(69.5,"
SET DIC("S")="I Y>99"
SET DIC(0)="EMZ"
DO ^DIC
KILL DIC
SET LREPIFN=+Y
+2 IF $GET(LRDEL)
QUIT
+3 IF Y=""
DO EXIT
GOTO EN
+4 IF $DATA(DTOUT)
GOTO NOU
+5 IF Y'<0
DO FND
+6 IF Y<0
DO ADD
DO EXIT
GOTO EN
+7 IF $GET(Y)["^"!($DATA(DTOUT))
GOTO NOU
+8 IF LRNO
GOTO EN
IF LRY
DO EDIT
GOTO EN
+9 GOTO EN
+10 QUIT
+11 ;
ADD ;
+1 SET DIR(0)="Y"
SET DIR("A")="Do you want to add this local pathogen"
SET DIR("B")="YES"
DO ^DIR
IF $DATA(DTOUT)
GOTO NOU
KILL DIR
+2 IF 'Y
QUIT
+3 SET LRNUM=99
+4 FOR
SET LRNUM1=$ORDER(^LAB(69.5,LRNUM))
IF 'LRNUM1
QUIT
SET LRNUM=LRNUM+1
+5 SET LRDA=LRNUM+1
+6 KILL DD,DO
+7 SET DIC="^LAB(69.5,"
+8 SET DIC(0)="L"
+9 SET DLAYGO=69.5
+10 SET DINUM=LRDA
+11 SET X=LRX_SITE
+12 DO FILE^DICN
+13 IF Y=-1
DO NOU
GOTO EN
+14 SET $PIECE(^LAB(69.5,LRDA,0),U,2)=0
+15 SET $PIECE(^LAB(69.5,LRDA,0),U,9)=LRDA
+16 SET LRPROT=0
SET LRPROT=$ORDER(^ORD(101,"B","LREPI",LRPROT))
+17 SET $PIECE(^LAB(69.5,LRDA,0),U,7)=LRPROT
+18 SET LREPIFN=LRDA
EDIT SET DA=LREPIFN
+1 SET DDSFILE="^LAB(69.5,"
+2 SET DR="[LREPI9]"
+3 DO ^DDS
+4 KILL DDSFILE(1)
+5 WRITE !!
+6 DO EXIT
+7 QUIT
EXIT KILL DA,DD,DDSFILE,DLAYGO,DIC,DIK,DINUM,DIR,DO,DR,DTOUT,DUOUT,L,LRDA,LRDEL,LRNO,LRNUM,LRNUM1,LREPIFN,LRPROT,LRX,LRXX,LRY,SITE,X,Y
QUIT
FND WRITE !,"This pathogen is already entered as a local pathogen.",!
+1 SET DIC="^LAB(69.5,"
SET DA=+Y
SET DR="0:6;8:9"
DO EN^DIQ
+2 SET DIR(0)="Y"
SET DIR("A")="Is this the correct one"
DO ^DIR
KILL DIR
+3 IF 'Y
SET LRNO=1
WRITE !!
QUIT
YN1 SET DIR(0)="Y"
SET DIR("A")="Do you want to edit this local pathogen"
SET DIR("B")="NO"
+1 DO ^DIR
+2 KILL DIR
+3 SET LRY=Y
+4 WRITE !!
QUIT
+5 QUIT
NOU WRITE !!,$CHAR(7),?20,"NO UPDATING HAS OCCURRED!!!"
KILL DIR
IF $DATA(DTOUT)
GOTO EXIT
WRITE !!
GOTO EN
DELETE ;DELETE LOCAL PATHOGEN
+1 SET LRDEL=1
+2 DO EN
+3 IF '$DATA(Y)
GOTO EXIT
+4 SET LRXX=Y
+5 IF $DATA(DTOUT)!($DATA(DUOUT))!(Y="")
GOTO EXIT
+6 SET DIC="^LAB(69.5,"
+7 SET DIC(0)="EMZ"
+8 SET DIC("S")="I $P(^(0),U,9)>99"
+9 DO ^DIC
+10 KILL DIC
+11 IF Y=-1
WRITE !,"NO MATCH FOUND."
GOTO DELETE
+12 SET LRY=Y
+13 SET DIR(0)="Y"
SET DIR("A")="Do you really want to delete this pathogen"
+14 DO ^DIR
+15 KILL DIR
+16 IF $DATA(DTOUT)!($DATA(DUOUT))
GOTO EXIT
+17 IF 'Y
GOTO DELETE
+18 IF LRY>99
SET DA=+LRY
DO KILL
GOTO DELETE
+19 GOTO DELETE
+20 ;
KILL SET DIK="^LAB(69.5,"
+1 DO ^DIK
+2 WRITE !!,"Entry ",$PIECE(LRY,U,2)," deleted."
+3 KILL DIK
+4 QUIT
INQUIRY SET DIC="^LAB(69.5,"
SET DIC("A")="Select Pathogen: "
SET DIC(0)="AEMQ"
DO ^DIC
KILL DIC
+1 IF Y<0
KILL DIC,DA,D0,DR,Y
QUIT
INQ1 SET DIC="^LAB(69.5,"
SET DA=+Y
SET DR="0:6"
DO EN^DIQ
+1 DO PAUSE^LREPIRS2
+2 IF $GET(LRQUIT)
KILL DIC,DA,D0,DR,LRQUIT,Y
QUIT
+3 SET DR="8:9"
DO EN^DIQ
+4 KILL DIC,DA,DO,DR,LRQUIT,Y
+5 GOTO INQUIRY
PRINT SET L=0
SET DIC="^LAB(69.5,"
+1 DO EN1^DIP
+2 QUIT