AHIEHMLA        ;NC/RLP  EHC Misc. Mail Utility                      29-Mar-02
        ;;v1.5
VARS    K DIC,DIR,EMPIEN,EMPNAM,EMPNODE,EMPTL,TMPTEXT,TSTIEN,TSTMSG,TSTNAM
        K TSTNUM,TSTSUB,Y,XMY
        D KILL^XM
        Q
        ;
EXIT    D VARS,END^AHIEH01
        Q
        ;
EN      W !! D VARS
        S DIC="^PRSPC(",DIC(0)="AEMQZ"
        S DIC("A")="Select Active Employee: "
        S DIC("S")="I $D(^(1)),$P(^(1),U,33)=""N"""
        D ^DIC K DIC("A"),DIC("S")
        I +Y'>0 G EXIT
        S EMPIEN=+Y
        S EMPNODE=Y(0)
        S EMPNAM=Y(0,0)
        S EMPTL=$P(EMPNODE,U,8)
        D RECPNT^AHIEHEP(EMPIEN,EMPTL)
        ; --- 901 Rita Eckert
        ; --- 15891 Stephanie D'Angelo
        S XMY(DUZ)="",XMY(901)="",XMY(15891)=""
        ;S XMY(3927)=""  ; Randie Pettigrew
        ;
TST     S DIR(0)="SO^1:Chest X-Ray;2:EKG;3:Lab;4:Test"
        S DIR("A")="Select Follow-up Message"
        D ^DIR K DIR
        I $D(DIRUT) G EN
        S TSTNUM=+Y
        S TSTNAM=Y(0)
        S TSTIEN=$S(TSTNUM=1:40,TSTNUM=2:39,TSTNUM=3:38,TSTNUM=4:41)
        S TSTMSG=3
        S TSTSUB="Employee - "_TSTNAM_" Results"
        ;
NTFY    W !!,"Notification will be sent to:"
        W !?13,"EHC Nurse.: Stephanie D'Angelo"
        W !?13,"EHC Scrtry: Rita Eckert"
        W !
        W !?13,"Employee..: ",EMPNAM
        W !
        ;
        S DIR(0)="YAO"
        S DIR("A")="Send Notification "
        S DIR("B")="YES"
        D ^DIR K DIR
        I $D(DIRUT) G EN
        I 'Y G EN
        ;
MES     S TMPTEXT(.2)=" "
        S TMPTEXT(.4)="Dear: "_EMPNAM
        S TMPTEXT(.6)=" "
        ;
        S LOOP=0 F  S LOOP=$O(^AHIEI(TSTIEN,TSTMSG,LOOP)) Q:'LOOP  D  ;
        . S TMPTEXT(LOOP)=^AHIEI(TSTIEN,TSTMSG,LOOP,0)
        ;
        S XMSUB=TSTSUB
        S XMTEXT="TMPTEXT("
        D ^XMD
        ;
        G EN