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

LR334PO.m

Go to the documentation of this file.
  1. LR334PO ;DALOI/FHS/RSH - LR*5.2*334 PATCH POST INSTALL ROUTINE;31-AUG-2001
  1. ;;5.2;LAB SERVICE;**334**;Sep 27, 1994;Build 12
  1. PRE ;
  1. ;$$HTE^XLFDT supported by DBIA #10103
  1. ;$$HTFE^XLFDT supported by DBIA #10103
  1. ;$$NOW^XLFDT supported by DBIA #10103
  1. ;$$CJ^XLFSTR supported by DBIA #10104
  1. ;^XMD supported by DBIA #10070
  1. ;$$PATCH^XPDUTL supported by DBIA #10141
  1. ;BMES^XPDUTL supported by DBIA #10141
  1. ;SETUP^XQALERT supported by DBIA $10081
  1. ;FILE^DIE supported by DBIA #10018
  1. ;GETS^DIQ supported by DBIA #2056
  1. ;EN^DIU2 supported by DBIA #10014
  1. ;$$SITE^VASITE supported by DBIA #10112
  1. ;$$FMTE^XLFDT supported by DBIA #10103
  1. ;$$THE^XLFDT supported by DBIA #10103
  1. ;$$HTFM^XLFDT supported by DBIA #10103
  1. Q:'$D(XPDNM)
  1. VENDOR ;Save the vender pointer name into the VENDOR field.
  1. N LRI,LRVEN
  1. S LRI=0 F S LRI=$O(^LAB(64.2,LRI)) Q:LRI<1 S LRVEN=$P($G(^(LRI,0)),U,14) I LRVEN D
  1. . S LRVEN=$P($G(^LAB(64.3,+LRVEN,0)),U)
  1. . I $L(LRVEN) S $P(^LAB(64.2,LRI,2),U,2)=LRVEN
  1. I '$D(^XTMP("LRNLT642")) D
  1. . N LRLAST
  1. . S LRLAST=$O(^LAB(64.2,99999),-1)
  1. . S ^XTMP("LRNLT642",.01)=LRLAST
  1. . S ^XTMP("LRNLT642",0)=$$HTFM^XLFDT($H+90,1)_"^"_DT_"^ LAB(64.2 Save"
  1. . M ^XTMP("LRNLT642",1)=^LAB(64.2)
  1. Q
  1. EN1 ;Find and correct existing spelling or duplicate numbers errors.
  1. N DA,DIC,DIK,DIU,X,Y,DIRUT,DTOUT,DUOUT
  1. REINDEX ;Reindex LAM to fire new x-refs
  1. L +^LAM:999 I '$T G EN1
  1. D
  1. . N DIK
  1. . S DIK="^LAM(" D IXALL^DIK
  1. . S $P(^LAM(0),U,3)=99999
  1. K ^XTMP("LRNLTERR","LR334") S ^XTMP("LRNLTERR",0)=$$HTFM^XLFDT($H+90,1)_"^"_DT_"^LR52 334 Error Messages"
  1. K ^XTMP("LRNLT","LR334")
  1. S ^XTMP("LRNLT",0)=$$HTFM^XLFDT($H+90,1)_"^"_DT_"^LR52 334 Messages"
  1. N DA,DIK,LRIEN,LRN0,LRN1,LRFILE
  1. D POST,ALERT^LR334POA
  1. Q
  1. ;
  1. CHK N DIC,X,Y
  1. K LRFDA,LRANS,LRNAMX,LRNUMX,LRNAMY,LRNUMY
  1. S DIC(0)="ZNMO",(LRNAMX,LRNAMY,X)=$P(LRN0,U)
  1. I $G(LRFILE)=64 D
  1. . S DIC=64,(LRNUMY,LRNUMX)=$P(LRN0,U,2)
  1. . S DIC("S")="I $P(^(0),U,2)=LRNUMX"
  1. . D ^DIC I Y<1 D DEL Q
  1. . W:$G(LRDBUG) !,Y_" ( "_LRFILE
  1. . S LRIENS=+Y_","
  1. . I $L($P(LRN0,U,8)) D
  1. . . S LRNAMY=$P(LRN0,U,8)
  1. . . S LRFDA(LRFILE,LRIENS,.01)=LRNAMY
  1. . I $P(LRN0,U,3) D
  1. . . S LRNUMY=$P(LRN0,U,3)
  1. . . Q:$O(^LAM("C",LRNUMY_" ",0))
  1. . . S LRFDA(LRFILE,LRIENS,1)=LRNUMY
  1. I $G(LRFILE)=64.2 D
  1. . N DIC
  1. . S (LRNAMX,LRNAMY,X)=$P(LRN0,U)
  1. . S DIC=64.2,LRNUMX=$P(LRN1,U,2)
  1. . S DIC("S")="I $P(^(0),U,2)=LRNUMX"
  1. . D ^DIC I Y<1 D DEL Q
  1. . S LRIENS=+Y_","
  1. . I $L($P(LRN0,U,8)) D
  1. . . S LRNAMY=$P(LRN0,U,8)
  1. . . S LRFDA(LRFILE,LRIENS,.01)=LRNAMY
  1. . I $P(LRN1,U,3) D
  1. . . S LRNUMY=$P(LRN1,U,3)
  1. . . S LRFDA(LRFILE,LRIENS,1)=LRNUMY
  1. . I $L($P(LRN1,U,7)) D
  1. . . S LRSYN=$P(LRN1,U,7),LRSYNIEN=$O(^LAB(64.2,+LRIENS,1,"B",LRSYN,0))
  1. . . Q:'LRSYNIEN
  1. . . S LRFDA(64.23,LRSYNIEN_","_LRIENS,.01)="@"
  1. . W:$G(LRDBUG) !,Y_" ( "_LRFILE
  1. I $D(LRFDA) D SET
  1. Q
  1. SET ;
  1. D FILE^DIE("KS","LRFDA","LRANS")
  1. I '$D(LRANS) W:$G(LRDBUG) !,"Okay" D Q
  1. . D WRT,DEL
  1. Q ; EDIT ERRORS are left in ^LAB(64.81)
  1. ;
  1. DEL ;
  1. N DA,DIK
  1. S DA=LRIEN,DIK="^LAB(64.81," D ^DIK
  1. Q
  1. ERR ;
  1. W !,LRIEN_" ( "_LRFILE_" ERROR"
  1. Q
  1. WRT ;
  1. D SCR(LRNUMX_" "_LRNAMX)
  1. D SCR("Was changed to: "_LRNUMY_" "_LRNAMY)
  1. Q
  1. POST ;TRANSPORT FILE 64.81 INTO FILE 64 IF REQUIRED
  1. N LRREC,LRREC9
  1. K ^XTMP("LRNLT","LR334") D
  1. . S ^XTMP("LRNLT",0)=$$HTFM^XLFDT($H+90,1)_U_DT_U_"LR334 Added NLT Codes List"
  1. . S ^XTMP("LRNLT","LR334",0)=""
  1. ;D DSS W !
  1. P1 F L +^LAM:10 Q:$T D BMES^LR334("Attempting to Lock ^LAM Global.")
  1. S (LRLAST64,LRNEXT)=$O(^LAM(99999),-1)
  1. S:LRNEXT<1 (LRLAST64,LRNEXT)=0
  1. S $P(^LAM(0),U,3)=LRNEXT
  1. S LRN=$O(^XTMP("LRNLT642",1,99999),-1)
  1. S (LRADD,LRCHG,LRDOT)=0
  1. D SCR("==========================")
  1. D SCR("List of WKLD CODES added to ^LAM (#64)")
  1. D SCR(" ")
  1. S LRNEXT=0,LRIEN=50
  1. F S LRNEXT=$O(^LAB(64.81,LRIEN,2,LRNEXT)) Q:LRNEXT<1 D
  1. . K LRFDA,LROUT,LRAR1,LRSIXT4
  1. . S LRDOT=$G(LRDOT)+1 I LRDOT#50=0 W ". "
  1. . S LRREC=^LAB(64.81,LRIEN,2,LRNEXT,0),LRERR=0
  1. . S LRREC9=+$G(^LAB(64.81,LRIEN,2,LRNEXT,9))
  1. . I $G(LRDBUG) W !,LRREC_" "
  1. . S LRTRIEN=$P(LRREC,U)
  1. . I $S($P(LRREC,U,2)["~":1,$P($P(LRREC,U,3),".",2):1,1:0) D KREC Q
  1. . D CMP
  1. . Q:LRERR
  1. . I LRCHG D CHGNM
  1. . I LRADD D GNDE
  1. . I $S($G(LROUT(42,"DIERR")):0,$G(LROUT(45,"DIERR")):0,1:1) D KREC
  1. . K LROUT
  1. S $P(^LAM(0),U,3)=99999
  1. D:'$G(LRDBUG) MAIL^LR334POA
  1. KIL K LRADD,LRANS,LRAR1,LRBEG,LRCHG,LRCNT,LRCODE,LRCTR,LRDOT,LREND
  1. K LRENODE,LRERR,LRFDA,LRFILE,LRFLD,LRFLE,LRFNAM,LRI,LRIEN,LRIENS
  1. K LRMLT,LRN,LRN0,LRN1,LRNAMX,LRNAMY,LRNEXT,LRNIEN,LRNODE,LRNUM
  1. K LRNUMX,LRNUMY,LRNX,LROUT,LRPROCNM,LRREC,LRSC,LRSCR,LRSEQ,LRSIXT4
  1. K LRSUBFLE,LRSYN,LRSYNIEN,LRTRIEN,LRVAL,LRVR,X,Y
  1. Q
  1. CHGNM ; CHANGE THE PROCEDURE NAME IN THE RECORD
  1. K LRFDA
  1. S LRFDA(42,64,LRCHG_",",.01)=LRPROCNM
  1. D FILE^DIE("K","LRFDA(42)","LROUT(42)")
  1. I $G(LROUT(42,"DIERR")) D
  1. . S LRERR=1
  1. . S LRENODE="LROUT(42,""DIERR"")"
  1. . D ERMSG
  1. I '$G(LROUT(42,"DIERR")) D SCR(LRCODE_"|"_LRPROCNM_"|"_"**Procedure Name Changed**")
  1. K LRFDA(42),LRPROCNM
  1. Q
  1. CMP ; COMPARE FOUND CODES AND PROCEDURE NAMES
  1. N DIC,X,Y,ANS
  1. S (LRADD,LRCHG,LRERR)=0
  1. S LRCODE=$P(LRREC,U,3),LRPROCNM=$P(LRREC,U,2)
  1. S Y=+$$FIND1^DIC(64,"","XO",LRCODE_" ","C","","ANS")
  1. I Y<1 D
  1. . S LRADD=1,LRN=$G(LRN)+1
  1. . D SCR(LRCODE_"|"_LRPROCNM_"|")
  1. I Y>1,$G(LRREC9) D
  1. . I $D(^LAM(+Y,0)),$G(^LAM(+Y,9))<1 S $P(^LAM(+Y,9),U)=LRREC9
  1. Q
  1. SCR(LRMSG) ;Store message in ^XTMP("LRNLT" Global
  1. S LRSCR=$G(^XTMP("LRNLT","LR334",1,0))+1,^(0)=LRSCR
  1. S ^XTMP("LRNLT","LR334",1,LRSCR)=LRSCR_"|"_LRMSG
  1. Q
  1. SETUP ; SETS UP THE FDA ARRAY TO ADD A NODE
  1. F S LRNODE=$Q(@LRNODE) Q:LRNODE="" D
  1. . S LRFLE=$QS(LRNODE,1)
  1. . S LRFLD=$QS(LRNODE,3)
  1. . I LRFLE=64.8117 D
  1. . . S LRSUBFLE=64
  1. . . I LRFLD=1 S LRFLD=.01
  1. . . I LRFLD>1 S LRFLD=LRFLD-1
  1. . . S LRIENS="+"_LRTRIEN_","
  1. . I LRFLE'=64.8117 D
  1. . .; CONSTRUCT THE SUBFILE NUMBER FOR FILE 64 FROM 64.81
  1. . . S LRBEG=$P(LRFLE,"8117")
  1. . . S LREND=$P(LRFLE,"8117",2)
  1. . . S LRSUBFLE=LRBEG_"0"_LREND
  1. . . I LRFLD=.01 S LRSEQ=LRSEQ+1
  1. . . S LRIENS="+"_LRSEQ_","_"+"_LRTRIEN_","
  1. . S LRVAL=@LRNODE
  1. . S LRFDA(45,LRSUBFLE,LRIENS,LRFLD)=LRVAL
  1. . ;W !,"LRFDA(45,"_LRSUBFLE_","_LRIENS_LRFLD_")="_LRVAL
  1. K LRAR1
  1. Q
  1. GNDE ; RETRIEVES NODES FROM THE TRANSPORT MULTIPLE
  1. S LRMLT="",LRCTR=1
  1. D GETS^DIQ(64.8117,LRTRIEN_","_LRIEN_",",LRMLT_"*","INZ","LRAR1")
  1. S LRNODE="LRAR1(64.8117_LRMLT)"
  1. D SETUP
  1. I $D(^LAB(64.81,50,2,LRTRIEN,1,0)) S LRNUM=$P(^LAB(64.81,50,2,LRTRIEN,1,0),U,4),LRSEQ=LRNUM+1
  1. E I '$D(^LAB(64.81,50,2,LRTRIEN,1,0)) S LRSEQ=2
  1. S LRMLT=18
  1. D GETS^DIQ(64.8117,LRTRIEN_","_LRIEN_",",LRMLT_"*","INZ","LRAR1")
  1. S LRNODE="LRAR1(64.8117_LRMLT)"
  1. D SETUP
  1. S LRMLT=19,LRSEQ=1
  1. D GETS^DIQ(64.8117,LRTRIEN_","_LRIEN_",",LRMLT_"*","INZ","LRAR1")
  1. S LRNODE="LRAR1(64.8117_LRMLT)"
  1. D SETUP
  1. D AREC I $G(LRDBUG) W !,"NEW IEN=",$G(LRSIXT4(LRTRIEN))
  1. K LRSIXT4,LRFDA(45)
  1. Q
  1. AREC ; ADDS ENTRIES FROM THE TRANSPORT MULTIPLE TO FILE 64
  1. D UPDATE^DIE("","LRFDA(45)","LRSIXT4","LROUT(45)")
  1. I $G(LROUT(45,"DIERR")) D
  1. . S LRENODE="LROUT(45,""DIERR"")"
  1. . D ERMSG
  1. K LRFDA(45)
  1. Q
  1. ERMSG ;STUFF THE TEMP GLOBAL WITH ANY ERROR MESSAGES
  1. S LRN=$G(^XTMP("LRNLT642",1,0))+1
  1. S ^XTMP("LRNLT642",1,LRN,0)="|"_LRTRIEN_"|"_LRCODE_"|"_LRPROCNM_"|ERR"
  1. F S LRENODE=$Q(@LRENODE) Q:LRENODE="" D
  1. . S LRN=LRN+1
  1. . S ^XTMP("LRNLT642",1,LRN,0)="|"_LRENODE_"|="_@LRENODE
  1. S ^XTMP("LRNLT642",1,0)=LRN
  1. S LRERR=1
  1. K LRENODE
  1. Q
  1. KREC ; DELETES THE RECORD FROM THE FILE
  1. Q:$G(LRDBUG)
  1. N DA,DIK
  1. S DA(1)=LRIEN,DA=LRTRIEN
  1. S DIK="^LAB(64.81,"_DA(1)_",2," D ^DIK
  1. Q
  1. DSS ;Update WKLD CODE file , DSS Feeder Key (#14) field to 'Yes"
  1. ;for those NLT codes used for AP professional services
  1. D BMES^LR334("Updating DSS Feeder Key for AP NLT Codes")
  1. N ERR,FDA,IEN,LST,OUT,NODE,X
  1. S NODE="^LAB(64.81,""AC"")"
  1. F S NODE=$Q(@NODE) Q:$QS(NODE,2)'="AC" D
  1. . S X=$P($$GET1^DIQ(64.8117,$QS(NODE,5)_","_$QS(NODE,4)_",",2,"I","ERR"),".")
  1. . Q:'X
  1. . K OUT,ERR
  1. . D FIND^DIC(64,"","@;1","M",X,"","C","","","OUT","ERR")
  1. . Q:$D(ERR)
  1. . S LST=0 F S LST=$O(OUT("DILIST",2,LST)) Q:'LST D
  1. . . S IEN=$G(OUT("DILIST",2,LST))
  1. . . Q:'($D(^LAM(IEN,0))#2)
  1. . . K FDA,ERR S FDA(1,64,IEN_",",14)=1
  1. . . D FILE^DIE("","FDA(1)","ERR")
  1. . . I $D(ERR) W !,$C(7),ERR
  1. . . W "*"
  1. D BMES^LR334("Update DSS AP Feeder Key Complete")
  1. Q