VistA-WorldVistAEHR/r/PAID-PRS/PRSDADD.m

11 lines
681 B
Mathematica

PRSDADD ;HISC/GWB-PAID ADD NEW EMPLOYEES ;8/20/93 10:44
;;4.0;PAID;;Sep 21, 1995
I TYPE="T" S OLDSSN=$P(^XTMP("PRS",SUB,DATE,TYPE,STA,SSN,TMPIEN),":",10) I OLDSSN'="" D CHGSSN^PRSDERR Q:IEN
I NAME="" S ERRMSG="SSN "_$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)_" not found" D ERR^PRSDSERV Q
S DIC="^PRSPC(",DIC(0)="L",DIC("DR")="8///"_SSN,DLAYGO=450,X=NAME
K DD,DO D FILE^DICN
I Y=-1 S ERRMSG="Error adding "_NAME_" to PAID EMPLOYEE File" D ERR^PRSDSERV Q
S IEN=+Y,^TMP($J,"PRS",NAME,SSN)=""
I $D(^VA(200,"SSN",SSN)) S VAIEN=$O(^VA(200,"SSN",SSN,0)),$P(^PRSPC(IEN,200),"^",1)=VAIEN,$P(^VA(200,VAIEN,450),"^",1)=IEN
I '$D(^VA(200,"SSN",SSN)) S ^TMP($J,"PRSNP",NAME,SSN)=""