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

LRMIBUG.m

Go to the documentation of this file.
  1. LRMIBUG ;DALOI/JMC- DISPLAY ORGANISMS ;07/15/09 10:38
  1. ;;5.2;LAB SERVICE;**318,321,339,350,536**;Sep 27, 1994;Build 18
  1. ;
  1. ; Reference to ^DIE global supported by ICR #5002
  1. ;
  1. BUGS ;
  1. Q:$G(LREND)
  1. N LR1PASS,LRBG,LRBI,LRBG1
  1. D KVAR^VADPT
  1. S LR1PASS=1
  1. I '$D(^LR(LRDFN,"MI",LRIDT,3,"B")) D SETBINDX^LRMIBUG(LRDFN,LRIDT,3)
  1. F D BUGIN Q:Y<1 S LRBG1=Y(0) D:$P(Y,U,3)&($P(LRPARAM,U,14))&($P($G(^LRO(68,LRAA,0)),U,16)) ETIO^LRCAPV1 D BUGGER,BUGOUT
  1. D BUGOUT
  1. ;
  1. Q
  1. ;
  1. ;
  1. BUGIN ;
  1. S DIC=DIE_DA_",3,",LRODA=DA,LRODIE=DIE,DA(1)=DA,DA(2)=LRDFN
  1. S DIC(0)="AEFLMOQZ"
  1. S DIC("S")="I 1 Q:$D(^LR(DA(2),""MI"",DA(1),3,+X)) Q:'$D(^LAB(61.2,+X,0)) I $L($P(^(0),U,5)),""PVRBFM""[$P(^(0),U,5)"
  1. S:'$D(@(DIC_"0)")) ^(0)="^63.3PA" S LRSPEC=$P(^LR(LRDFN,"MI",LRIDT,0),U,5)
  1. W ! S LRBG=0
  1. F S LRBG=$O(^LR(LRDFN,"MI",DA,3,LRBG)) Q:LRBG<1 S LRBUG=+^(LRBG,0) K DIC("B") S:LRBG=1&LR1PASS DIC("B")=$P(^LAB(61.2,+^LR(LRDFN,"MI",DA,3,1,0),0),U) W !?2,LRBG,?5,$P(^LAB(61.2,LRBUG,0),U)
  1. S DLAYGO=63 D ^DIC
  1. K DIC("B"),DIC("S"),DLAYGO
  1. S LR1PASS=0
  1. Q
  1. ;
  1. ;
  1. BUGGER ;
  1. S LRNB=$S($L($P(^LAB(61.2,+LRBG1,0),U,4)):$P(^(0),U,4),1:LRMIDEF),LRBI=$P(^(0),U,5)
  1. N LRTHISDA
  1. S DIE=DIC,DA=+Y,LRTHISDA=DA D TEMP,^DIE,DELINT I '$D(Y) Q
  1. ;
  1. ;added for LR*5.2*536
  1. ;If the session times out while entering organism and/or sensitivity
  1. ;(antibiotic) results, the results are not filed into the LAB DATA
  1. ;(#63) file. The root cause is that TR^DIED sets variable DTOUT to
  1. ;"^" if a timeout occurs during the execution of an input template.
  1. ;RE+1^DIED then invokes "I $D(DTOUT) K DQ,DG G QY^DIE1" which causes
  1. ;the DIE* logic to not file the results. Further tracing was not
  1. ;performed in the DIE* code.
  1. ;
  1. ;$G(DTOUT) = session possibly timed out without DTOUT set to "^"
  1. ;$G(DTOUT)="^" = session timed out while entering organism and/or
  1. ; sensitivities
  1. ;
  1. I $G(DTOUT)!($G(DTOUT)="^") D Q
  1. . W !!,"**** WARNING ****"
  1. . W !,"Your session has timed out. Organism and/or antibiotic"
  1. . W !,"results need to be re-entered."
  1. . W !,"Verify all results on this accession are correct."
  1. . N DIR
  1. . S DIR(0)="E"
  1. . S DIR("A")="Press enter to continue"
  1. . D ^DIR
  1. . D BUGOUT
  1. . F D BUGIN Q:Y<1 D
  1. . . S LRBG1=Y(0)
  1. . . D:$P(Y,U,3)&($P(LRPARAM,U,14))&($P($G(^LRO(68,LRAA,0)),U,16)) ETIO^LRCAPV1
  1. . . D BUGGER,BUGOUT
  1. ;end of LR*5.2*536 changes
  1. W !,"Any other antibiotics" S %=2 D YN^DICN I %'=1 Q
  1. I '$L(LRMIOTH) S DR="S Y=200;2.0000001:200",DR(2,63.32)=.01 D ^DIE Q
  1. K DR
  1. S LRNB=LRMIOTH D TEMP F J=1:1 S K=$P(DR,";",J) Q:+K'=K!(K>2)!'$L(K)
  1. S (DR,DR(1,63.3))=$P(DR,";",J,245)
  1. D ^DIE
  1. Q
  1. ;
  1. ;
  1. TEMP ;
  1. S LRNB=+$O(^DIE("B",$S($L(LRNB):LRNB,1:0),0))
  1. I LRNB,$D(^DIE(LRNB,"DR",3,63.3)) S (DR,DR(1,63.3))=^(63.3),J=0 F I=0:0 S J=$O(^DIE(LRNB,"DR",3,63.3,J)) Q:J<1 S DR(1,63.3,J)=^(J)
  1. I 'LRNB!('$D(^DIE(LRNB,"DR",3,63.3))) S DR=$S(($L(LRBI)&("MFBVRP"[LRBI)):".01;1;2",1:".01;1;2:195")
  1. Q
  1. ;
  1. ;
  1. BUGOUT ;
  1. S (DIE,DIC)=LRODIE,DA=LRODA,DA(1)=LRDFN K DR(1,63.3)
  1. Q
  1. ;
  1. ;
  1. DELINT ; If a Result is (1st piece) deleted in ^LR(LRDFN,"MI",LRIDT,3
  1. ; the associated Interpretation (2nd piece) should be deleted
  1. ; as well. If S^S^ exists, and the Result is deleted, ^S^ Interpretation remains.
  1. ; This process will clean up the remaining Interpretation
  1. Q:'LRDFN!('LRIDT)!('LRTHISDA)
  1. N LRXX
  1. S LRXX=2 ;This node bumps in fractions exp. 2.001 2.00234
  1. F S LRXX=$O(^LR(LRDFN,"MI",LRIDT,3,LRTHISDA,LRXX)) Q:'LRXX!(LRXX'<3) D
  1. . I $P(^LR(LRDFN,"MI",LRIDT,3,LRTHISDA,LRXX),U)="" S $P(^LR(LRDFN,"MI",LRIDT,3,LRTHISDA,LRXX),U,2)=""
  1. Q
  1. ;
  1. ;
  1. SETBINDX(LRDFN,LRIDT,LRNODE) ; Set "B" x-ref if "B" x-ref doesn't exist on #.01 field.
  1. N DA,DIC,DIE,DIK,DLAYGO,DR,X,Y
  1. S DA(1)=LRIDT,DA(2)=LRDFN
  1. S DIK="^LR("_LRDFN_",""MI"","_LRIDT_","_LRNODE_","
  1. S DIK(1)=".01^B"
  1. D ENALL^DIK
  1. Q