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

ECDEAL2.m

Go to the documentation of this file.
  1. ECDEAL2 ;ALB/MRY - Remove DSS UNITS from terminated users; 03 JUL 2009
  1. ;;2.0; EVENT CAPTURE ;**100**;8 May 96;Build 21
  1. Q
  1. USER ;
  1. N ECDUZ,X,CNT,DSSU,DSSUN S (CNT,ECDUZ)=0
  1. K ^TMP($J,"ECDEAL2"),^TMP("ECDEAL2",$J)
  1. F S ECDUZ=$O(^VA(200,ECDUZ)) Q:'ECDUZ D
  1. . S X=$$ACTIVE^XUSER(ECDUZ) I +X Q
  1. . I $P(X,"^",2)'="TERMINATED" Q
  1. . I '$O(^VA(200,ECDUZ,"EC",0)) Q
  1. . S CNT=CNT+1,DSSU=0
  1. . F S DSSU=$O(^VA(200,ECDUZ,"EC",DSSU)) Q:'DSSU D
  1. . . S DSSUN=$$GET1^DIQ(724,+DSSU,.01)
  1. . . S ^TMP($J,"ECDEAL2",DSSUN,$P(^VA(200,ECDUZ,0),"^"),ECDUZ)=""
  1. . S DA(1)=ECDUZ,DA=0 F I=0:0 S DA=$O(^VA(200,DA(1),"EC",DA)) Q:'DA S DIK="^VA(200,"_DA(1)_",""EC""," D ^DIK
  1. . K DA,DIK
  1. I CNT=0 K ^TMP($J,"ECDEAL2"),^TMP("ECDEAL2",$J) Q
  1. ;
  1. MSG ;generate message to ECXMGR mailgroup
  1. N X,XMDUZ,XMTEXT,XMSUB,XMY,LINECT,DSSUN,EC200
  1. S XMDUZ="EVENT CAPTURE",XMSUB="Removed Terminated Users from DSS UNIT Access"
  1. S XMTEXT="^TMP(""ECDEAL2"",$J,",XMY(DUZ)="",XMY("G.ECMGR")=""
  1. S ^TMP("ECDEAL2",$J,1)="Event Capture - Terminated Users removed from DSS UNITS"
  1. S ^TMP("ECDEAL2",$J,2)=""
  1. S ^TMP("ECDEAL2",$J,3)="Total number of Terminated users: "_CNT
  1. S ^TMP("ECDEAL2",$J,4)=""
  1. S ^TMP("ECDEAL2",$J,5)="DSS UNITS NAME of Terminated User Removed from DSS UNIT"
  1. S ^TMP("ECDEAL2",$J,6)="-----------------------------------------------------------------"
  1. S LINECT=6
  1. S DSSUN="",CNT=0
  1. F S DSSUN=$O(^TMP($J,"ECDEAL2",DSSUN)) Q:DSSUN="" D
  1. . S SPACES="",SPACESN=0
  1. . S ^TMP("ECDEAL2",$J,LINECT+1)=DSSUN
  1. . S SPACESN=20-(+$L(DSSUN)) F I=1:1:SPACESN S SPACES=SPACES_" "
  1. . S LINECT=LINECT+1
  1. . S CNT=0,EC200=""
  1. . F S EC200=$O(^TMP($J,"ECDEAL2",DSSUN,EC200)) Q:EC200="" D
  1. . . S CNT=CNT+1
  1. . . I CNT=1 S ^TMP("ECDEAL2",$J,LINECT)=^TMP("ECDEAL2",$J,LINECT)_SPACES_EC200
  1. . . I CNT>1 S ^TMP("ECDEAL2",$J,LINECT+1)=" "_EC200
  1. . . S LINECT=LINECT+1,CNT=CNT+1
  1. . S ^TMP("ECDEAL2",$J,LINECT+1)=" ",LINECT=LINECT+1
  1. I CNT=0 S ^TMP("ECDEAL2",$J,LINECT+1)="No terminated users to display."
  1. D ^XMD K ^TMP("ECDEAL2",$J),^TMP($J,"ECDEAL2"),XMY
  1. Q