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

BLRSGNS3.m

Go to the documentation of this file.
BLRSGNS3 ; IHS/MSC/MKK - Delete Order even though in SiGN or SYmptom Process (Continued) ; 02-Nov-2015 13:45 ; MKK
 ;;5.2;LR;**1035,1037**;NOV 1, 1997;Build 4
 ;
 ; Code moved from BLRSGNSP becuase BLRSGNSP became too large
 ;
EEP ; Ersatz EP
 D EEP^BLRGMENU
 Q
 ;
ERRMSG(MSG,ERRFRTN) ; EP - Errors occurred during FILE^DIE call
 NEW LRCNT,LRMTXT,MESSAGE,NOWDTIME,ORDERNUM,TAB,WOTARR1,WOTARR2,WOTVAR
 NEW IENS     ; IHS/MSC/MKK - LR*5.2*1037
 ;
 S TAB=$J("",10)
 ;
 S MSG=$G(MSG,"FileMan Error")    ; IHS/MSC/MKK - LR*5.2*1037 - Make sure MSG variable exists
 S ERRFRTN=$G(ERRFRTN,"BLRSGNSP") ; Set "ERRor From RouTiNe" Variable
 ;
 S MESSAGE="FileMan DBS call failed in routine "_ERRFRTN_"."
 ;
 S LRMTXT(1)=MSG_" Issue in routine "_ERRFRTN_"."
 S LRMTXT(2)=" "
 S LRMTXT(3)="The following debugging information is provided to assist"
 S LRMTXT(4)="support staff in resolving issue during accessioning."
 ;
 S LRMTXT(5)=" "
 S LRCNT=5
 ;
 S LRCNT=LRCNT+1,LRMTXT(LRCNT)="     DUZ="_$G(DUZ)
 S LRCNT=LRCNT+1,LRMTXT(LRCNT)="     DUZ(2)="_$G(DUZ(2))
 S LRCNT=LRCNT+1,LRMTXT(LRCNT)=" "
 ;
 ; Store Arrays
 F WOTARR1="ERRS","FDA","FDAIEN","LR68","LRAA","LRAD","LRAN","LRDFN","LRDIE","LRSS","LRTSTS","LRUNQ","LRWLC","XQY","XQY0" D
 . S X=$G(@WOTARR1)
 . Q:X=""     ; IHS/MSC/MKK - LR*5.2*1037 - Don't do anything if the variable doesn't exist
 . ;
 . I X'="" S LRCNT=LRCNT+1,LRMTXT(LRCNT)=WOTARR1_"="_X
 . S WOTARR2=WOTARR1
 . F  S WOTARR2=$Q(@WOTARR2) Q:WOTARR2=""  S LRCNT=LRCNT+1,LRMTXT(LRCNT)=WOTARR2_"="_@WOTARR2
 ;
 ; Create ORDERNUM variable, if possible.
 S IENS=+$G(LRORT)_","_+$G(LRSP)_","_+$G(LRODT)_","   ; IHS/MSC/MKK - LR*5.2*1037
 S ORDERNUM=$$GET1^DIQ(69.01,$P(IENS,",",2,3),"ORDER #")
 ;
 ; Store variables
 F WOTVAR="DFN","IENS","LRORD","LRODT","LRSP","ORDERNUM","PROBSTR","SNOMED","DESCPROB","ICDCODE","ICDDESC" D
 . Q:$G(@WOTARR1)=""    ; IHS/MSC/MKK - LR*5.2*1037 - Don't do anything if the variable doesn't exist
 . ;
 . S LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_WOTVAR_"="_$G(@WOTVAR)
 ;
 F WOTVAR="LRASTEST","LRNEWTST","ORIGPN","ORIGSN","ORIGICDP","ORIGICDI" D
 . Q:$G(@WOTARR1)=""    ; IHS/MSC/MKK - LR*5.2*1037 - Don't do anything if the variable doesn't exist
 . ;
 . S LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_WOTVAR_"="_$G(@WOTVAR)
 ;
 I $L($G(INDIC)) S WOTVAR="INDIC",LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_WOTVAR_"="_$G(@WOTVAR)
 ;
 ; Store the $STACK as well
 S CONTXT=$STACK(-1)
 F LOOP=0:1:CONTXT  D
 . S LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_"$STACK("_LOOP_",1,CONTEXT LEVEL)="_LOOP
 . S LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_"$STACK("_LOOP_",2,CONTEXT TYPE)="_$STACK(LOOP)
 . S LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_"$STACK("_LOOP_",3,CURRENT PLACE)="_$STACK(LOOP,"PLACE")
 . S LRCNT=LRCNT+1,LRMTXT(LRCNT)=TAB_"$STACK("_LOOP_",4,CURRENT SOURCE)="_$STACK(LOOP,"MCODE")
 ;
 ; D SENDMAIL^BLRUTIL3(.MESSAGE,.LRMTXT,ERRFRTN,1)    ; Deliberately commented out.  Do Not send MailMan message.
 ;
 ; Store messages for 30 days
 S NOWDTIME=$$HTFM^XLFDT($H)
 I +$P($G(^XTMP(ERRFRTN,0)),"^")'>(+NOWDTIME) D
 . K ^XTMP(ERRFRTN)
 . K ^XTMP("BLRSGNSP")
 . S ^XTMP(ERRFRTN,0)=$$HTFM^XLFDT(+$H+30)_"^"_$$DT^XLFDT_"^Temporary Informational Message Storage"
 . S ^XTMP("BLRSGNSP")=$$HTFM^XLFDT(+$H+30)_"^"_$$DT^XLFDT_"^'D' Index for Temporary Informational Message Storage"
 ;
 M ^XTMP(ERRFRTN,NOWDTIME,MSG)=LRMTXT
 ; S ^XTMP("BLRSGNSP","D",ORDERNUM,NOWDTIME,ERRFRTN)=""
 S:+$G(ORDERNUM) ^XTMP("BLRSGNSP","D",ORDERNUM,NOWDTIME,ERRFRTN)=""  ; IHS/MSC/MKK - LR*5.2*1037
 Q
 ;
FIXIT ; EP
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,ORDERN,U,XPARSYS,XQXFLG)
 ;
 K ^XTMP("BLRSGNSP")
 S ERRFRTN="BLRSGN"
 F  S ERRFRTN=$O(^XTMP(ERRFRTN))  Q:ERRFRTN=""!($E(ERRFRTN,1,6)'="BLRSGN")  D
 . W "ERRFRTN=",ERRFRTN,!
 . S ORDERNUM=0
 . F  S ORDERNUM=$O(^XTMP(ERRFRTN,"D",ORDERNUM))  Q:ORDERNUM<1  D
 .. S NOWDTIME=0
 .. F  S NOWDTIME=$O(^XTMP(ERRFRTN,"D",ORDERNUM,NOWDTIME))  Q:NOWDTIME<1  D
 ... S ^XTMP("BLRSGNSP","D",ORDERNUM,NOWDTIME,ERRFRTN)=""
 ;
 Q
 ;
OERRSTSC(ODT,SN) ; EP - Change OERR Status from PENDING to DISCOUNTINUED for entire test
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,ODT,SN,U,XPARSYS,XQXFLG)
 S CONTROL="OC"
 D NEW^LR7OB1(ODT,SN,CONTROL,,,1)
 Q
 ;
OERRSTSO(LRODT,LRSN,LROT) ; EP - Change OERR Status from PENDING to DISCOUNTINUED for specific test(s)
 NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,LRODT,LROT,LRSN,U,XPARSYS,XQXFLG)
 S LROTIEN=LROT_","_LRSN_","_LRODT
 S ORIFN=$$GET1^DIQ(69.03,LROTIEN,6)
 S F60IEN=$$GET1^DIQ(69.03,.01,LROTIEN,"I")
 S II(F60IEN)="",LRSTATUS=1
 D NEW^LR7OB1(LRODT,LRSN,"OC",,.II,LRSTATUS)
 Q