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

LR210.m

Go to the documentation of this file.
  1. LR210 ;DALISC/FHS - LR*5.2*210 PATCH ENVIRONMENT CHECK ROUTINE
  1. ;;5.2T8;LR;**1018**;Oct 27, 2004
  1. ;;5.2;LAB SERVICE;**210**;Sep 27, 1994
  1. EN ;
  1. Q:'$G(XPDENV)
  1. L +^LAM:15 I '$T D BMES^XPDUTL($$CJ^XLFSTR(" Unable to successfully lock the ^LAM global. ",80)) S XPDQUIT=2
  1. L +^LRO(69,"AA"):15 I '$T D BMES^XPDUTL($$CJ^XLFSTR(" Unable to successfully lock the ^LRO(69,AA) global. ",80)) S XPDQUIT=2
  1. I '$D(^LAM(0))#2 D BMES^XPDUTL($$CJ^XLFSTR("There is no WKLD CODE file.",80)) S XPDQUIT=2
  1. ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018 ALPHA ONLY??
  1. ;I $$VERSION^XPDUTL("ICPT")'="6.0" D BMES^XPDUTL($$CJ^XLFSTR("You must install ICPT V6.0 Package first.",80)) S XPDQUIT=2
  1. ;----- END IHS MODIFICATIONS
  1. I '$O(^LAM(0)) D BMES^XPDUTL($$CJ^XLFSTR("There is no data in your WKLD CODE file.",80)) S XPDQUIT=2
  1. I $S('$G(IOM):1,'$G(IOSL):1,$G(U)'="^":1,1:0) D BMES^XPDUTL($$CJ^XLFSTR("Terminal Device in not defined.",80)) S XPDQUIT=2
  1. I $S('$G(DUZ):1,$D(DUZ)[0:1,$D(DUZ(0))[0:1,1:0) D BMES^XPDUTL($$CJ^XLFSTR("Please Log in to set local DUZ... variables.",80)) S XPDQUIT=2
  1. I '$D(^VA(200,$G(DUZ),0))#2 D BMES^XPDUTL($$CJ^XLFSTR("You are not a valid user on this system.",80)) S XPDQUIT=2
  1. I +$G(^LAM("VR"))'>5.1 D BMES^XPDUTL($$CJ^XLFSTR("You must have LAB V5.2 or greater Installed.",80)) S XPDQUIT=2
  1. I $G(XPDQUIT) D BMES^XPDUTL($$CJ^XLFSTR("Install environment check FAILED.",80)) L -^LRO(69,"AA"),-^LAM
  1. I '$G(XPDQUIT) D BMES^XPDUTL($$CJ^XLFSTR("Environment Check is Ok ---",80))
  1. Q
  1. PRE ;AFTER USER COMMITS ROUTINE KIDS INSTALL"
  1. Q:'$D(XPDNM)
  1. S:$D(^LAM(0))#2 $P(^LAM(0),U,3)=2225
  1. I $D(^LAB(64.81,0))#2 S X=$P(^(0),U,1,2) K ^LAB(64.81) S ^LAB(64.81,0)=X
  1. S X="TRAP^LR210",@^%ZOSF("TRAP")
  1. D BMES^XPDUTL($$CJ^XLFSTR("** Pre Install Step Complete **",80))
  1. Q
  1. POST ;Post cleanup
  1. N $ESTACK,$ETRAP
  1. S $ETRAP="D ERROR^LR210"
  1. K ^XTMP("LR","NLT")
  1. S ^XTMP("LR","NLT")="LR*5.2*210 Spelling errors"
  1. S ^XTMP("LR","NLT",0)=$$FMADD^XLFDT(DT,7)_U_$$NOW^XLFDT_U_DUZ
  1. D BMES^XPDUTL($$CJ^XLFSTR("Correcting Duplicates or Spelling Errors",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR("Names that begin with 'X*' have codes that are incorrect.",80))
  1. ;
  1. N DIC,DA
  1. S LR81=0,LRFILE=64,LRERFILE="^XTMP(""LR"",""NLT"")"
  1. F S LR81=$O(^LAB(64.81,LR81)) Q:LR81<1 D
  1. . S LRNODE=$G(^LAB(64.81,LR81,0)) Q:LRNODE=""
  1. . S LRLKNM=$P(LRNODE,U),LRNAME=$S($L($P(LRNODE,U,8)):$P(LRNODE,U,8),1:LRLKNM)
  1. . S LRLKCODE=$P(LRNODE,U,2),LRCODE=$P(LRNODE,U,3)
  1. . S LRCK=$S(LRLKCODE:1,LRCODE:1,$L(LRLKNM):1,1:0) Q:'LRCK
  1. . W:$G(LRDBUG) !,LRLKNM,?30,LRNAME,!,LRLKCODE,?30,LRCODE
  1. . K DIC,DA S DIC="^LAM(",DIC(0)="ZOXMN"
  1. . S LRCK=0,X=LRLKCODE,DIC("S")="I $P(^(0),U)="""_LRLKNM_"""" D ^DIC
  1. . I Y<1 D PURG Q
  1. . I Y>0 S LRDA=+Y W ! D
  1. . . I LRLKNM'=LRNAME D
  1. . . . D BMES^XPDUTL($$CJ^XLFSTR("Correcting Spelling of entry ^(LAM,"_LRDA_") from ",80))
  1. . . . D BMES^XPDUTL($$CJ^XLFSTR(LRLKNM_" to "_LRNAME,80))
  1. . . . S LRFD=.01,LRDATA=$E(LRNAME,1,60),DA=LRDA
  1. . . . S LRCK=$$FILE(LRDA,LRFILE,LRFD,LRDATA,LRERFILE)
  1. . . . I LRCK D BMES^XPDUTL($$CJ^XLFSTR("*** An "_$P(LRCK,U,2)_" error has occured ***",80)) D Q
  1. . . . . S $P(^LAB(64.81,LR81,0),U,9)=$E(LRCK,1,19)
  1. . . . D BMES^XPDUTL($$CJ^XLFSTR("Name change successful",80))
  1. . . I LRLKCODE'=LRCODE D
  1. . . . D BMES^XPDUTL($$CJ^XLFSTR("Correcting NLT Code of entry ^LAM("_LRDA_") from ",80))
  1. . . . D BMES^XPDUTL($$CJ^XLFSTR(LRLKCODE_" to "_LRCODE,80))
  1. . . . S LRFD=1,LRDATA=LRCODE,DA=LRDA
  1. . . . S LRCK=$$FILE(LRDA,LRFILE,LRFD,LRDATA,LRERFILE)
  1. . . . I LRCK D BMES^XPDUTL($$CJ^XLFSTR("*** An "_$P(LRCK,U,2)_" error has occured ***",80)) D Q
  1. . . . . S $P(^LAB(64.81,LR81,0),U,9)=$E(LRCK,1,19)
  1. . . . D BMES^XPDUTL($$CJ^XLFSTR("NLT Code change successful",80))
  1. . . I '$G(LRCK),$G(LR81) D PURG
  1. D BMES^XPDUTL($$CJ^XLFSTR("Spelling/Code Numbers update is complete.",80))
  1. ENPOS ;NLT CODE UPGRADE POST INSTALL ROUTINE KIDS INSTALL"
  1. ;
  1. I '$O(^LAB(64.81,0)) D BMES^XPDUTL($$CJ^XLFSTR("Database Upgrade Completed Successfully",80)) K ^XTMP("LR","NLT") G MSG
  1. W ! D BMES^XPDUTL($$CJ^XLFSTR(" ****************************** ",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR(" Database Upgrade is Incomplete - Use FM to print upgrade errors",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR("stored in the LAB NLT/CPT CODES (#64.81) file.",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR(" ****************************** ",80)) W !
  1. MSG D BMES^XPDUTL($$CJ^XLFSTR("Use 'Workload code list option [LRCAPD] for a full listing of",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR("ALL NLT Codes used in Laboratory Test File (#60).",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR("You can also use the [Edit or Print WKLD CODES] option for a listing",80))
  1. D BMES^XPDUTL($$CJ^XLFSTR("of linked CPT linked NLT codes.",80))
  1. S I=0 F S I=$O(^LAM(I)) Q:I<1 I $O(^LAM(I,4,0)) D
  1. . S II=0 F S II=$O(^LAM(I,4,II)) Q:II<1 D
  1. . . I $P($G(^LAM(I,4,II,0)),U,2)="CPT",'$P(^(0),U,3) S $P(^(0),U,3)=2980301
  1. D BMES^XPDUTL($$CJ^XLFSTR("** Post install completed **",80))
  1. END S:$D(^LAM(0))#2 $P(^(0),U,3)=99999 S $P(^LAB(69.9,1,"VSIT"),U)=1
  1. L -^LAB(69,"AA"),-^LAM Q
  1. ERROR D END,UNWIND^%ZTER
  1. Q
  1. PURG ;
  1. N DIK,DA
  1. S DIK="^LAB(64.81,",DA=LR81 D ^DIK K DIK
  1. Q
  1. FILE(DA,FILE,FIELD,DATA,ERR) ;
  1. ; Utility call to FILE^DIE database call. Can be used to update uneditable fields.
  1. ;DA= to the IEN of the node to update
  1. ;FILE = The file number containing the DA
  1. ;FIELD = Set to the field number of the file
  1. ;DATA = Is equal to the new value of the FIELD
  1. ;ERR (Optional) = The global to store any errors from the FILE^DIE
  1. ;ERROR is returned - I successful = 0 Failure = 1~_error text
  1. ; there maybe more that one error but only the first is reported
  1. N LRROOT
  1. I '+DA!('$L(FILE))!('FIELD)!(DATA="") Q "1~Calling error"
  1. S LRROOT(FILE,+DA_",",FIELD)=DATA
  1. D FILE^DIE("","LRROOT",ERR)
  1. S ERROR=0 I $D(DIERR),ERR]"" S ERROR="1~"_$TR(@ERR@("DIERR",1,"TEXT",1),"^","~")
  1. Q ERROR