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

DG53351M.m

Go to the documentation of this file.
  1. DG53351M ;ALB/JAN - DG*5.3*351 POST-INSTALL MAINMAN MSG; 6/26/01
  1. ;;5.3;Registration;**351,1015**;JUNE 26, 2001;Build 21
  1. ;
  1. ; This routine will be run as part of the post-install for patch DG*5.3*351
  1. ;
  1. ; A mail message will be sent to the user when the post-install is completed.
  1. ;
  1. MAIL ;
  1. ; Send a mailman message to user with results
  1. N DIFROM,%
  1. N XMDUZ,XMSUB,XMTEXT,XMY,Y
  1. K ^TMP("DG53351")
  1. S XMDUZ="REGISTRATION PACKAGE",XMY(DUZ)="",XMY(.5)=""
  1. S XMSUB="DG*5.3*351 POST-INSTALL - Update CURRENT ENROLLMENT STATUS"
  1. S XMTEXT="^TMP(""DG53351"",$J,"
  1. D NOW^%DTC S Y=% D DD^%DT
  1. ;
  1. I $G(^XTMP("DG-DTC",1))=0 D
  1. .S ^TMP("DG53351",$J,1)="No records were updated between the ENROLLMENT STATUS field (#.04)"
  1. .S ^TMP("DG53351",$J,2)="of the PATIENT ENROLLMENT file (#27.11) and the cross reference"
  1. .S ^TMP("DG53351",$J,3)="""AENRC"" of the PATIENT file (#2)."
  1. I $G(^XTMP("DG-DTC",1))>0 D
  1. .S ^TMP("DG53351",$J,1)="The following patients had the cross reference ""AENRC"" of the"
  1. .S ^TMP("DG53351",$J,2)="PATIENT file (#2) updated."
  1. .S ^TMP("DG53351",$J,3)=""
  1. .S ^TMP("DG53351",$J,4)=$$BLDSTR("PATIENT NAME","SSN","OLD ENROLLMENT STATUS")
  1. .S ^TMP("DG53351",$J,5)=$$BLDSTR("------------","---","---------------------")
  1. .S ^TMP("DG53351",$J,6)=""
  1. .; add patients from temp global to the mail message
  1. .N ST,PAT,TMPNODE,PATNAME,PATSSN,ENRST,I,LINE,TEXT
  1. .S (ST,PAT)=""
  1. .F I=7:1 S PAT=$O(^XTMP("DG-AENRC",PAT)) Q:PAT="" F S ST=$O(^XTMP("DG-AENRC",PAT,ST)) Q:ST="" D
  1. ..S TMPNODE=$G(^XTMP("DG-AENRC",PAT,ST)),LINE=I
  1. ..S PATNAME=$P(TMPNODE,U,1),PATSSN=$P(TMPNODE,U,2),ENRST=$P(TMPNODE,U,3)
  1. ..S ^TMP("DG53351",$J,LINE)=$$BLDSTR(PATNAME,PATSSN,ENRST)
  1. ..Q
  1. .S LINE=$G(LINE)+1,^TMP("DG53351",$J,LINE)=""
  1. .S TEXT="Number of records updated"
  1. .S LINE=$G(LINE)+1,^TMP("DG53351",$J,LINE)=TEXT
  1. .S LINE=$G(LINE)+1,^TMP("DG53351",$J,LINE)=$$REPEAT^XLFSTR("=",$L(TEXT))
  1. .S LINE=$G(LINE)+1,^TMP("DG53351",$J,LINE)=+$G(^XTMP("DG-DTC",1))
  1. ;
  1. MAIL1 ; send mail message to user
  1. D ^XMD
  1. D BMES^XPDUTL(" MAIL MESSAGE < #"_XMZ_" > sent.")
  1. K ^TMP("DG53351",$J)
  1. Q
  1. BLDSTR(P1,P2,P3) ; build a string from input
  1. N S1,S2,S3
  1. S S1=$E(P1,1,25) I $L(S1)'>24 D
  1. .S S1=S1_$J("",(24-$L(S1)))
  1. S S2=P2
  1. S S3=$E(P3,1,25) I $L(S3)'>24 D
  1. .S S3=S3_$J("",(24-$L(S3)))
  1. Q S1_$J("",5)_S2_$J("",5)_S3