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

LR517.m

Go to the documentation of this file.
LR517 ;HPS/JLG - LR*5.2*517 PATCH POST INSTALL ROUTINE ;Mar 19, 2019@12:00
 ;;5.2;LAB SERVICE;**517**;Sep 27, 1994;Build 5
 ;
 ; $$HTFM^XLFDT supported by DBIA #10103
 ; $$SENDMSG^XMXAPI supported by IA #2729
 ;
EN ;
 N LRI,LRSS,LRHDR,LRMTXT,LRCTR,LRDATA,MIDX,MTXT
 S LRHDR=1,LRCTR=0
 ;
 S LRCTR=LRCTR+1,LRMTXT="The following orphaned data was removed from the LABORATORY TEST file (#60): " D SETMSG(LRCTR,LRMTXT)
 ;
 S LRI=0 F  S LRI=$O(^LAB(60,LRI)) Q:'LRI  D
 .S LRSS=0 F  S LRSS=$O(^LAB(60,LRI,1,LRSS)) Q:LRSS=""  D
 ..Q:'$D(^LAB(60,LRI,1,LRSS,5))  Q:$D(^LAB(60,LRI,1,LRSS,0)) 
 ..S:LRCTR=1 ^XTMP("LR_5.2_517_POST_INSTALL",0)=$$HTFM^XLFDT($H+30,1)_"^"_$$HTFM^XLFDT($H,1)_"^Removing Data from LABORATORY TEST file (#60)"
 ..S LRDATA=$G(^LAB(60,LRI,1,LRSS,5)),^XTMP("LR_5.2_517_POST_INSTALL",LRI,LRSS)=LRDATA
 ..K ^LAB(60,LRI,1,LRSS,5)
 ..S LRCTR=LRCTR+1 D SETMSG(LRCTR," ")
 ..S LRMTXT="LAB TEST:       "_$$GET1^DIQ(60,LRI_",",.01)_" (ien: "_LRI_")",LRCTR=LRCTR+1 D SETMSG(LRCTR,LRMTXT)
 ..S LRMTXT="SITE/SPECIMEN:  "_$$GET1^DIQ(61,LRSS_",",.01)_" (ien: "_LRSS_")",LRCTR=LRCTR+1 D SETMSG(LRCTR,LRMTXT)
 ;
 I LRCTR=1 S LRCTR=LRCTR+1 D SETMSG(LRCTR," ") S LRCTR=LRCTR+1 W ! D SETMSG(LRCTR,"NO DATA FOUND TO REMOVE")
 S LRCTR=LRCTR+1 D SETMSG(LRCTR," ")
 ;
MMMSG ; create and send a mailman message
 N XMY,XMSUB,XMTEXT,XMFROM,XMDUZ
 S XMFROM("FROM")="LR*5.2*517 Post-Install"
 S XMY(DUZ)=""
 S XMSUB="LR*5.2*517 Data Removal",XMDUZ=.5
 S XMTEXT="^TMP($J,""LR517"")"
 D SENDMSG^XMXAPI(DUZ,XMSUB,XMTEXT,.XMY,.XMFROM,,"")
 K ^TMP($J),XMY,XMSUB,XMTEXT,XMFROM,XMDUZ
 Q
SETMSG(MIDX,MTXT) ; set global entry for mailman message
 S ^TMP($J,"LR517",MIDX)=MTXT
 W !,MTXT
 Q