XUSECBUL ;SFISC/BT-SEND SEPARATION MESSAGE TO G.XUSEC/PRS PAID SEPARATION ;10 AM 10 Jan 2006
;;8.0;KERNEL;**384**;Jul 10, 1995;Build 8
N TMP,NAME,SSN,SERVICE,MSGSBJ,WHO,LN,OUT,IEN200
S (NAME,SSN,SERVICE,OUT)=""
D I OUT'="Y" Q ;Person's 'SEPARATION IND' not equal to Y
. N DIERR,IENS,Z,ZERR
. S IENS=DA_","
. D GETS^DIQ(450,IENS,".01;8;80;700","EI","Z","ZERR")
. S OUT=Z(450,IENS,80,"E")
. I OUT'="Y" Q
. S NAME=Z(450,IENS,.01,"E")
. S SSN="***-**-"_$P(Z(450,IENS,8,"E"),"-",3)
. I Z(450,IENS,700,"I") S SERVICE=$$GET1^DIQ(200,Z(450,IENS,700,"I")_",",29,"","","ZERR"),IEN200=Z(450,IENS,700,"I")
. Q
I +IEN200,'$$ACTIVE^XUSER(+IEN200) Q
; Mail back message
S LN=1
S TMP(LN)=NAME_" ("_SSN_") separated from "_SERVICE_".",LN=LN+1
S TMP(LN)="Please terminate the employee.",LN=LN+1
S WHO(DUZ)=""
I $$GOTLOCAL^XMXAPIG("XUSEC/PRS PAID SEPARATION") S WHO("G.XUSEC/PRS PAID SEPARATION")=""
S MSGSBJ="Employee ("_NAME_") Seperated From Station Notification"
;
SEND D SENDMSG^XMXAPI(DUZ,MSGSBJ,"TMP",.WHO)
D CLEAN^DILF
Q
XUSECBUL ;SFISC/BT-SEND SEPARATION MESSAGE TO G.XUSEC/PRS PAID SEPARATION ;10 AM 10 Jan 2006
+1 ;;8.0;KERNEL;**384**;Jul 10, 1995;Build 8
+2 NEW TMP,NAME,SSN,SERVICE,MSGSBJ,WHO,LN,OUT,IEN200
+3 SET (NAME,SSN,SERVICE,OUT)=""
+4 ;Person's 'SEPARATION IND' not equal to Y
Begin DoDot:1
+5 NEW DIERR,IENS,Z,ZERR
+6 SET IENS=DA_","
+7 DO GETS^DIQ(450,IENS,".01;8;80;700","EI","Z","ZERR")
+8 SET OUT=Z(450,IENS,80,"E")
+9 IF OUT'="Y"
QUIT
+10 SET NAME=Z(450,IENS,.01,"E")
+11 SET SSN="***-**-"_$PIECE(Z(450,IENS,8,"E"),"-",3)
+12 IF Z(450,IENS,700,"I")
SET SERVICE=$$GET1^DIQ(200,Z(450,IENS,700,"I")_",",29,"","","ZERR")
SET IEN200=Z(450,IENS,700,"I")
+13 QUIT
End DoDot:1
IF OUT'="Y"
QUIT
+14 IF +IEN200
IF '$$ACTIVE^XUSER(+IEN200)
QUIT
+15 ; Mail back message
+16 SET LN=1
+17 SET TMP(LN)=NAME_" ("_SSN_") separated from "_SERVICE_"."
SET LN=LN+1
+18 SET TMP(LN)="Please terminate the employee."
SET LN=LN+1
+19 SET WHO(DUZ)=""
+20 IF $$GOTLOCAL^XMXAPIG("XUSEC/PRS PAID SEPARATION")
SET WHO("G.XUSEC/PRS PAID SEPARATION")=""
+21 SET MSGSBJ="Employee ("_NAME_") Seperated From Station Notification"
+22 ;
SEND DO SENDMSG^XMXAPI(DUZ,MSGSBJ,"TMP",.WHO)
+1 DO CLEAN^DILF
+2 QUIT