VistA-WorldVistAEHR/r/LAB_SERVICE-LR-LS/LREPILK.m

48 lines
1.9 KiB
Mathematica

LREPILK ;DALLAS/SED - NLT LINKING UTILITY ; 101098
;;5.2;LAB SERVICE;**132,175**;Sep 27, 1994
;This routine assists the user in linking file 62.02 'ANTIMICROBIAL'
;to file 64 'WRKLOAD'
;
HD W @IOF,"This option will allow you to link file '62.06 ANTIMICROBIAL "
W !,"SUSCEPTIBILITY' file with file '64 WKLD CODE."
Q
EN F D HD K DIR,DIRUT S DIR(0)="S^A:AUTO;M:MANUAL;S:SEMI-AUTO",DIR("??")="LREPILK^D HD^LREPILK" D ^DIR Q:$D(DIRUT) D @Y
EXIT K DIC,DIE,DR,LRANT,LRANM,LRND,LRNDM,DIR,DIRUT,DIDEL,DA,DUOUT,LRQ,Y,X
Q
A S LRANT=0 F S LRANT=$O(^LAB(62.06,LRANT)) Q:+LRANT'>0 D
.I +$G(^LAB(62.06,LRANT,64))>0&($D(^LAM(+$G(^LAB(62.06,LRANT,64)),0))) D LNKED Q
.S LRANM=$P(^LAB(62.06,LRANT,0),U,1),LRND=$P(^LAB(62.06,LRANT,0),U,4)
.S LRNDM=""
.I +LRND>0,$D(^DD(63.3,LRND,0)) S LRNDM=$P(^DD(63.3,LRND,0),U,1)
.S DIC=64,DIC(0)="XMO",X=LRANM D ^DIC
.I +Y<0&(LRNDM'="") S DIC=64,DIC(0)="XMO",X=LRNDM D ^DIC
.W:+Y>0 !,LRANM,?30,"<----Linked---->",?50,$P(Y,U,2)
.W:+Y'>0 !,LRANM,?30,"<----Not Linked---->",?50,"No Match Found"
.Q:+Y'>0
.K DIC,DD,DR,DA,DIE
.S DIE=62.06,DA=LRANT,DR="64////"_+Y D ^DIE
Q
LNKED ;DISPLAY LINKED INFO
S LRANM=$P(^LAB(62.06,LRANT,0),U,1),LRNLT=+$G(^LAB(62.06,LRANT,64))
Q:'$D(^LAM(LRNLT,0))
W !,LRANM,?30,"<----Linked---->",?50,$P(^LAM(LRNLT,0),U)
Q
M ;MANUALLY SELECTION AND ENTRY
F K DIC S DIC="62.06",DIC(0)="AEQM" D ^DIC Q:+Y<0!($D(DUOUT)) S:+Y>0 LRANT=+Y D SET
Q
SET K DIC,DD,DR,DA,DIE
S DIE=62.06,DA=LRANT,DR="64//" D ^DIE
Q
S S (LRQ,LRANT)=0 F S LRANT=$O(^LAB(62.06,LRANT)) Q:+LRANT'>0!(LRQ) D
.Q:+$G(^LAB(62.06,LRANT,64))>0
.S LRANM=$P(^LAB(62.06,LRANT,0),U,1),LRND=$P(^LAB(62.06,LRANT,0),U,4)
.S LRNDM=""
.I +LRND>0,$D(^DD(63.3,LRND,0)) S LRNDM=$P(^DD(63.3,LRND,0),U,1)
.W @IOF,!,LRANM,?15,LRNDM
.D SET
.S DIR(0)="YA",DIR("A")="Continue ",DIR("B")="YES" D ^DIR S:Y'="1" LRQ=1
Q
REM ;REMOVE ENTRIES
S LRANT=0 F S LRANT=$O(^LAB(62.06,LRANT)) Q:+LRANT'>0 K ^LAB(62.06,LRANT,64)
Q