source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRLNCDEL.m@ 1398

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1LRLNCDEL ; DALOI/CA/FHS - UNMAP LAB TESTS TO LOINC CODES OR DELETE LOINC MAPPINGS ;1-OCT-1998
2 ;;5.2;LAB SERVICE;**232,278**;Sep 27,1994
3 ;Reference to ^DD supported by IA 10154
4 ;=================================================================
5 ; Ask VistA test to unmap-Lookup in Lab Test file #60
6START ;entry point from option LR LOINC MAPPING
7 S LREND=0 D TEST
8 I $G(LREND) G EXIT
9 W @IOF,!! D SPEC
10 I $G(LREND) D EXIT G START
11 D UNMAP
12 D EXIT
13 G START
14EXIT ;
15 K DA,DIC,DIE,DINUM,DIR,DIRUT,DR,DTOUT,I,LRCODE,LRDATA,LREND,LRLNC,LRLNC0,LRLOINC,LRELEC,LRIEN,LRNLT,LRSPEC,LRSPECL,LRSPECN,LRTIME,LRTEST,LRUNITS,S,Y
16 K LRNLTN,LRNLTNM,LRASPECT
17 K D,D0,DD,DO,DLAYGO,LRLNCNAM,LRNO,LROUT,X
18 QUIT
19TEST W !!
20 N DIR,Y,X,LROUT,LRERR,DA,DIC,DIE,DR
21 S DIR(0)="PO^60:QENMZ,",DIR("A")="VistA Lab Test to delete/unmap to LOINC "
22 S DIR("?")="Select Lab test you wish to delete/unmap to a LOINC Code"
23 D ^DIR K DIR
24 I $D(DIRUT) K DIRUT S LREND=1 Q
25 S LRIEN=+Y,LRTEST=$P(Y,U,2)
26 ;Check for RESULT NLT CODE and if not one let enter
27 L +^LAB(60,LRIEN):2 I '$T W !?4,"Locked by another user" H 5 G TEST
28 I '$P($G(^LAB(60,LRIEN,64)),U,2) D I $D(DUOUT)!($D(DTOUT)) S LREND=1 Q
29 . W !!,"There is not a RESULT NLT CODE for "_LRTEST,".",!
30 . W !,"You must select one now to continue with the mapping of this test!",!
31 . K DIE,DR,DA S DA=LRIEN,DIE="^LAB(60,",DR=64.1
32 . D ^DIE
33 . L -^LAB(60,LRIEN)
34 . I $D(DUOUT)!($D(DTOUT)) Q
35 . S DIC=DIE,DR=0 W !! W ?5,"IEN: [",DA,"] ",$P(^LAB(60,LRIEN,0),U) S S=$Y D EN^LRDIQ W !
36 L -^LAB(60,LRIEN)
37 S LRNLT=$P($G(^LAB(60,LRIEN,64)),U,2)
38 I 'LRNLT G TEST
39 D GETS^DIQ(64,LRNLT_",",".01;1","E","LROUT","LRERR")
40 S LRNLTNM=$G(LROUT(64,LRNLT_",",.01,"E"))
41 S LRNLTN=$G(LROUT(64,LRNLT_",",1,"E"))
42 Q
43SPEC ; Ask Specimen- Lookup in Specimen multiple in Lab Test file #60
44 N DIR,DIRUT
45 S DIR(0)="PO^61:ENQNZ",LREND=0
46 S DIR("S")="I $P(^(0),U,9),$P(^(0),U,10)"
47 S DIR("?")="Enter a TOPOGRAPHY having a LEDI HL7 code defined."
48 S DIR("A")="Specimen Source: "
49 D ^DIR I $D(DIRUT) S LREND=1 Q
50 S LRSPEC=+Y,LRSPECN=$P(Y,U,2)
51 S LRELEC=$P(Y(0),U,9),LRASPECT=$P(Y(0),U,10)
52 D GETS^DIQ(64.061,LRELEC_",",1,"E","LROUT","LRERR")
53 S LRSPECL=$G(LROUT(64.061,LRELEC_",",1,"E"))
54 I '$L(LRSPECL) W !?5,LRSPECN_" has a broken pointer" S LREND=1
55 Q
56UNMAP ;Check to see if already mapped to a LOINC code
57 N DA,DIC,DIK,DIR,DIRUT,DR
58 S DIR(0)="PO^64:EQNZM",DIR("S")="I $P($P(^(0),U,2),""."")="_$P(LRNLTN,".")
59 S DIR("B")=$P(LRNLTN,".")
60 D ^DIR I $D(DIRUT) S LREND=1 Q
61 S LRNLT=+Y
62 L +^LAM(LRNLT,5):1 I '$T W !,"Another user is editing this record",! H 5 Q
63 I '$D(^LAM(LRNLT,5,LRSPEC,1,LRASPECT)) D G INDEX60
64 . N LROUT
65 . D GETS^DIQ(64.061,LRASPECT_",",.01,"E","LROUT")
66 . W $C(7)
67 . W !!!?5,"Lab Test: "_LRTEST_" / "_LRSPECL_" is NOT mapped to "
68 . W !,"WKLD CODE: "_$P(Y,U,2)_" Time Aspect of: "_$G(LROUT(64.061,LRASPECT_",",.01,"E"))
69DIS ;Show the data
70 K DA,DIC,DIK,DIR,DR
71 S DA(2)=LRNLT,DA(1)=LRSPEC,DA=LRASPECT,DIC="^LAM("_DA(2)_",5,"_DA(1)_",1,"
72 S S=0,DR="0:99"
73 W !!,LRSPECN,!
74 D EN^DIQ
75 S DIR(0)="Y",DIR("A")="Are You - SURE- you want to delete this mapping"
76 D ^DIR I $G(Y)'=1 L -^LAM(LRNLT,5) Q
77 S DIK=DIC D ^DIK
78INDEX60 ;Stores LOINC code in Laboratory Test file (#60) so know what tests are mapped.
79 K DIE,DA,DR S DA=LRSPEC,DA(1)=LRIEN,DIE="^LAB(60,"_DA(1)_",1,",DR="95.3///@" D ^DIE
80 ;S ^LAB(60,LRIEN,1,LRSPEC,95.3)=LRCODE
81 L -^LAM(LRNLT,5)
82 Q
83SHOWPRE ;DISPLAY LOINC CODE ALREADY MAPPED TO NLT
84 S LRLNC=$P($G(^LAM(LRNLT,5,LRSPEC,1,LRTIME,1)),U)
85 W !!,"This test and specimen is mapped to:"
86 W !,"LOINC code: ",LRLNC," ",$G(^LAB(95.3,+LRLNC,80))
87 W !!
88 S DIR(0)="Y",DIR("A")="Are you sure you want to delete this mapping"
89 S DIR("?")="If you enter yes, the current LOINC code mapping will be deleted."
90 D ^DIR K DIR
91 Q
Note: See TracBrowser for help on using the repository browser.