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

LRLNC63B.m

Go to the documentation of this file.
  1. LRLNC63B ;DALOI/FHS-HISTORICAL LOINC MAPPING MODIFIER ;01/30/2001 15:19
  1. ;;5.2;LAB SERVICE;**279**;Sep 27, 1994
  1. EN ;
  1. K DIR W @IOF
  1. W !!,$$CJ^XLFSTR("This option will allow you to manage how specific DataNames",80)
  1. W !,$$CJ^XLFSTR("will be mapped to LOINC Codes for historical data.",80)
  1. W !!,$$LJ^XLFSTR("You are able to override file definitions to correct past LOINC mappings.",80)
  1. W !,$$LJ^XLFSTR("Select the CH subsripted test, indicate the suffix to be used.",80)
  1. W !,$$LJ^XLFSTR("You can indicate if this suffix should override previous LOINC Mapping.",80),!
  1. W !,$$LJ^XLFSTR("This option will REMAP your entire database.",80),!!
  1. W !,$$LJ^XLFSTR("This option should only be run on weekends after hours.",80),!
  1. S DIR(0)="Y",DIR("A")=" Do you wish to continue "
  1. D ^DIR Q:$G(Y)'=1
  1. K ^XTMP("LRLNC63",2),^XTMP("LRLNC63","LST"),^TMP("LR",$J),^TMP("LRLNC63",$J),LRCNT,LROX
  1. SELECT ;Indicate which DATANAMES LOINC definition to be changed.
  1. K LRMOD,LRY,NODE
  1. S LRY=1
  1. F W !! Q:$G(LRY)<1 D
  1. . K DIR,X
  1. . W !,$$CJ^XLFSTR("Selection can be a 'CH' Atomic or Panel test.",80),!
  1. . S DIR("?")="Selection can be an Atomic or Panel test."
  1. . S DIR("?",1)="Only those tests with a Result code will be stored."
  1. . S DIR(0)="PO^60:EMZ",DIR("S")="I $P(^(0),U,4)=""CH"""
  1. . S DIR("A")="Select test you want to modify mapping"
  1. . D ^DIR
  1. . S LRY=Y Q:Y<1
  1. . S LRYY=$P($P(Y(0),U,5),";",2)_U_LRY
  1. . D EXPAND
  1. ;
  1. DISPLAY ;Show what has been recorded
  1. K DIRUT,LRY
  1. I '$O(^TMP("LRLNC63",$J,0)) W !?5,"Nothing was selected, Process Aborted",! Q
  1. W @IOF
  1. W !,$$CJ^XLFSTR("Here is a list of what you have selected.",80)
  1. W !,$$CJ^XLFSTR("[O] indicates override current mapping.",80),!
  1. D
  1. . D ^%ZIS Q:POP
  1. . U IO
  1. . N DIR
  1. . S DIR="E"
  1. . S NODE="^TMP(""LRLNC63"","_$J_",0)" F S NODE=$Q(@NODE) Q:$S(NODE="":1,$QS(NODE,2)'=$J:1,1:0) D Q:$D(DIRUT)
  1. . . I $Y>(IOSL-3) D
  1. . . . I $E(IOST,1.2)="C-" D ^DIR Q:$D(DIRUT)
  1. . . . W @IOF
  1. . . . W !,"Here is a list of what you have selected."
  1. . . . W !,"[O] indicates override current mapping.",!
  1. . . D SHO
  1. . W:$E(IOST,1)="P" @IOF
  1. . D ^%ZISC
  1. CHK ;
  1. ; K ^TMP("LR",$J)
  1. W !
  1. I $D(DIRUT) S DIR(0)="Y",DIR("A")=" Do you want to STOP" D ^DIR G:$G(Y)=1 END
  1. K DIR S DIR(0)="YO",DIR("A")="You wish to add more" D ^DIR I $G(Y)=1 G SELECT
  1. I $G(Y)=U G END
  1. ;
  1. W !
  1. S DIR("A")=" Do you want to delete an entry" D ^DIR G END:$G(Y)=U
  1. I $G(Y)=1 D EDIT G DISPLAY
  1. I $O(^TMP("LRLNC63",$J,0)) D
  1. . S LRMOD=1,ZTSAVE("LRMOD")=""
  1. . S NODE="^TMP(""LRLNC63"",0)"
  1. . F S NODE=$Q(@NODE) Q:$S($QS(NODE,2)'=$J:1,1:0) D
  1. . . S ^XTMP("LRLNC63",2,$QS(NODE,5))=@NODE
  1. FIRE ;Run the mapping tasking function
  1. D QUE^LRLNC63
  1. Q
  1. END ;
  1. K DIRUT
  1. K ^XTMP("LRLNC63",2)
  1. Q
  1. SHO ;
  1. N LRX,LRXY
  1. S LRX=@NODE
  1. W !,$QS(NODE,3)_" "_$S($P(LRX,U,6):"[O]",1:" "),?7,$E($P(LRX,U,3),1,30),?40,$E($P(LRX,U,4),1,25),?70,"/ ",$P(LRX,U,5)
  1. ;S LRXY=$QS(NODE,1)_" "_$P(LRX,U,3)_" - "_$P(LRX,U,4)_" / "_$P(LRX,U,5)_" "_$S($P(LRX,U,6):"Override Yes",1:"")
  1. ;W !,LRXY
  1. Q
  1. EDIT ;
  1. K DIR,DIRUT
  1. S DIR("A")="Delete this entry"
  1. S DIR(0)="NO^1:"_LRCNT D ^DIR
  1. Q:$D(DIRUT)
  1. S LRY=Y I '$D(^TMP("LRLNC63",$J,Y)) W !?5,Y_" Entry not Valid",! G EDIT
  1. S NODE="^TMP(""LRLNC63"","_$J_","_Y_",0)"
  1. S NODE=$Q(@NODE) I $QS(NODE,2)'=$J W !?5,Y_" Entry not Valid",! G EDIT
  1. D SHO
  1. S DIR(0)="YO" D ^DIR Q:$D(DIRUT)
  1. I $G(Y)=1 K ^TMP("LRLNC63",$J,LRY)
  1. G EDIT
  1. Q
  1. EXPAND ;If panel test expand to get parts
  1. K ^TMP("LR",$J) S LRCFL=""
  1. K DIR,LRTEST,LRX,T1
  1. S LRTEST(+LRY)=+LRY_U_^LAB(60,+LRY,0),T1=+LRY
  1. S LRNX=0
  1. D EX1^LREXPD
  1. S DIR(0)="PO^64.2:EMZ",DIR("A")=" Select Suffix Code"
  1. D ^DIR Q:Y<1
  1. S LRSUF=$P(Y(0),U)_U_$P($P(Y(0),U,2),".",2)
  1. K DIR S DIR(0)="YO",DIR("A")="Override previous LOINC mapping"
  1. D ^DIR I Y=1 S LRSUF=LRSUF_U_1
  1. I $O(^TMP("LR",$J,"TMP",0)) D
  1. . S LRN=0 F S LRN=$O(^TMP("LR",$J,"TMP",LRN)) Q:LRN<1 S LRNX=^(LRN) D
  1. . . Q:'$P($G(^LAB(60,LRNX,64)),U,2)
  1. . . S LRCNT=$G(LRCNT)+1
  1. . . S ^TMP("LRLNC63",$J,LRCNT,$P(^LAB(60,LRNX,0),U),LRN)=LRN_U_+LRNX_U_$P(^(0),U)_U_LRSUF
  1. Q