source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LREPIPI.m@ 1604

Last change on this file since 1604 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1LREPIPI ;DALOI/CKA - Local Pathogens Input;7/2/03
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
5EN ;
6 S LRNO="",SITE=$P($$SITE^VASITE,U)
7 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."
8 S DIR("??")="^S D=""B"",DIC=""^LAB(69.5,"",DIC(0)=""EZ"",DIC(""S"")=""I Y>99"" D DQ^DICQ K DIC"
9 D ^DIR K DIR I $D(DIRUT) G EXIT
10 S LRX=Y
11LKUP ;
12 S DIC="^LAB(69.5,",DIC("S")="I Y>99",DIC(0)="EMZ" D ^DIC K DIC S LREPIFN=+Y
13 I $G(LRDEL) Q
14 I Y="" D EXIT G EN
15 I $D(DTOUT) G NOU
16 I Y'<0 D FND
17 I Y<0 D ADD D EXIT G EN
18 G:$G(Y)["^"!($D(DTOUT)) NOU
19 G:LRNO EN D:LRY EDIT G EN
20 G EN
21 Q
22 ;
23ADD ;
24 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
25 I 'Y Q
26 S LRNUM=99
27 F S LRNUM1=$O(^LAB(69.5,LRNUM)) Q:'LRNUM1 S LRNUM=LRNUM+1
28 S LRDA=LRNUM+1
29 K DD,DO
30 S DIC="^LAB(69.5,"
31 S DIC(0)="L"
32 S DLAYGO=69.5
33 S DINUM=LRDA
34 S X=LRX_SITE
35 D FILE^DICN
36 I Y=-1 D NOU G EN
37 S $P(^LAB(69.5,LRDA,0),U,2)=0
38 S $P(^LAB(69.5,LRDA,0),U,9)=LRDA
39 S LRPROT=0,LRPROT=$O(^ORD(101,"B","LREPI",LRPROT))
40 S $P(^LAB(69.5,LRDA,0),U,7)=LRPROT
41 S LREPIFN=LRDA
42EDIT S DA=LREPIFN
43 S DDSFILE="^LAB(69.5,"
44 S DR="[LREPI9]"
45 D ^DDS
46 K DDSFILE(1)
47 W !!
48 D EXIT
49 Q
50EXIT 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
51FND W !,"This pathogen is already entered as a local pathogen.",!
52 S DIC="^LAB(69.5,",DA=+Y,DR="0:6;8:9" D EN^DIQ
53 S DIR(0)="Y",DIR("A")="Is this the correct one" D ^DIR K DIR
54 I 'Y S LRNO=1 W !! Q
55YN1 S DIR(0)="Y",DIR("A")="Do you want to edit this local pathogen",DIR("B")="NO"
56 D ^DIR
57 K DIR
58 S LRY=Y
59 W !! Q
60 Q
61NOU W !!,$C(7),?20,"NO UPDATING HAS OCCURRED!!!" K DIR G:$D(DTOUT) EXIT W !! G EN
62DELETE ;DELETE LOCAL PATHOGEN
63 S LRDEL=1
64 D EN
65 I '$D(Y) G EXIT
66 S LRXX=Y
67 G:$D(DTOUT)!($D(DUOUT))!(Y="") EXIT
68 S DIC="^LAB(69.5,"
69 S DIC(0)="EMZ"
70 S DIC("S")="I $P(^(0),U,9)>99"
71 D ^DIC
72 K DIC
73 I Y=-1 W !,"NO MATCH FOUND." G DELETE
74 S LRY=Y
75 S DIR(0)="Y",DIR("A")="Do you really want to delete this pathogen"
76 D ^DIR
77 K DIR
78 G:$D(DTOUT)!($D(DUOUT)) EXIT
79 I 'Y G DELETE
80 I LRY>99 S DA=+LRY D KILL G DELETE
81 G DELETE
82 ;
83KILL S DIK="^LAB(69.5,"
84 D ^DIK
85 W !!,"Entry ",$P(LRY,U,2)," deleted."
86 K DIK
87 Q
88INQUIRY S DIC="^LAB(69.5,",DIC("A")="Select Pathogen: ",DIC(0)="AEMQ" D ^DIC K DIC
89 I Y<0 K DIC,DA,D0,DR,Y Q
90INQ1 S DIC="^LAB(69.5,",DA=+Y,DR="0:6" D EN^DIQ
91 D PAUSE^LREPIRS2
92 I $G(LRQUIT) K DIC,DA,D0,DR,LRQUIT,Y Q
93 S DR="8:9" D EN^DIQ
94 K DIC,DA,DO,DR,LRQUIT,Y
95 G INQUIRY
96PRINT S L=0,DIC="^LAB(69.5,"
97 D EN1^DIP
98 Q
Note: See TracBrowser for help on using the repository browser.