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

EASEZT2.m

Go to the documentation of this file.
EASEZT2 ;ALB/jap - Data Transformation Logic for 1010EZ Processing ;10/12/00  13:08
 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**51,57,66**;Mar 15, 2001
 ;
WORKPH(EASAPP,TYPE) ;
 ;input  EASAPP = application ien in file #712
 ;         TYPE = "APPLICANT", "SPOUSE", "NEXT-OF-KIN", "E-CONTACT",
 ;output  PHONE = formatted work phone or null;
 ;                example: (432)987-1234 X123
 ;
 N PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
 S PHONE="",MULTIPLE=1
 S KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE AREA CODE") I KEY D
 .S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 S KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE NUMBER") I KEY D
 .S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 S KEY=+$$KEY711^EASEZU1(TYPE_" WORK PHONE EXTENSION") I KEY D
 .S EXT=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 I AC'="" S AC="("_AC_")"
 I NUM="-" S NUM=""
 I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
 I EXT'="" S EXT=" X"_EXT
 I NUM="" Q PHONE
 S PHONE=AC_NUM_EXT
 Q PHONE
 ;
HOMEPH(EASAPP,TYPE) ;
 ;input  EASAPP = application ien in file #712
 ;         TYPE = "APPLICANT", "SPOUSE", "NEXT-OF-KIN", "E-CONTACT"
 ;output  PHONE = formatted home phone;
 ;                example: (432)987-1234
 ;
 N PHONE,MULTIPLE,AC,NUM,KEY,T
 S PHONE="",MULTIPLE=1
 S KEY=+$$KEY711^EASEZU1(TYPE_" HOME PHONE AREA CODE") I KEY D
 .S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 S KEY=+$$KEY711^EASEZU1(TYPE_" HOME PHONE NUMBER") I KEY D
 .S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 I AC'="" S AC="("_AC_")"
 I NUM="-" S NUM=""
 I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
 I NUM="" Q PHONE
 S PHONE=AC_NUM
 Q PHONE
 ;
INSPH(EASAPP,TYPE,MULTIPLE) ;
 ;input  EASAPP = application ien in file #712
 ;         TYPE = "APPLICANT", "OTHER(N)"
 ;     MULTIPLE = EASMULT Value def=1
 ;output  PHONE = formatted home phone;
 ;                example: (432)987-1234
 ;
 N PHONE,AC,NUM,KEY,T
 S PHONE="",MULTIPLE=+$G(MULTIPLE) I MULTIPLE<2 S MULTIPLE=1
 S KEY=+$$KEY711^EASEZU1(TYPE_" INSURANCE PHONE AREA CODE") I KEY D
 .S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 S KEY=+$$KEY711^EASEZU1(TYPE_" INSURANCE PHONE NUMBER") I KEY D
 .S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 I AC'="" S AC="("_AC_")"
 I NUM="-" S NUM=""
 I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
 I NUM="" Q PHONE
 S PHONE=AC_NUM
 Q PHONE
 ;
EMPLPH(EASAPP,TYPE) ;
 ;input  EASAPP = application ien in file #712
 ;         TYPE = "APPLICANT", "SPOUSE" 
 ;output  PHONE = formatted employer phone or null;
 ;                example: (432)987-1234 X123
 ;
 N PHONE,MULTIPLE,AC,NUM,EXT,KET,T
 S PHONE="",MULTIPLE=1
 S KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE AREA CODE") I KEY D
 .S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 S KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE NUMBER") I KEY D
 .S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 S KEY=+$$KEY711^EASEZU1(TYPE_" EMPLOYER PHONE EXTENSION") I KEY D
 .S EXT=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 I AC'="" S AC="("_AC_")"
 I NUM="-" S NUM=""
 I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
 I EXT'="" S EXT=" X"_EXT
 I NUM="" Q PHONE
 S PHONE=AC_NUM_EXT
 Q PHONE
 ;
CELLPH(EASAPP,TYPE) ;
 ;input  EASAPP = application ien in file #712
 ;         TYPE = "APPLICANT"
 ;output  PHONE = formatted cell phone or null;
 ;                example: (432)987-1234
 ;
 N PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
 S PHONE="",MULTIPLE=1
 S KEY=+$$KEY711^EASEZU1(TYPE_" CELLULAR PHONE AREA CODE") I KEY D
 .S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 S KEY=+$$KEY711^EASEZU1(TYPE_" CELLULAR PHONE NUMBER") I KEY D
 .S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 I AC'="" S AC="("_AC_")"
 I NUM="-" S NUM=""
 I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
 I NUM="" Q PHONE
 S PHONE=AC_NUM
 Q PHONE
 ;
PAGERPH(EASAPP,TYPE) ;
 ;input  EASAPP = application ien in file #712
 ;         TYPE = "APPLICANT"
 ;output  PHONE = formatted pager phone or null;
 ;                example: (432)987-1234
 ;
 N PHONE,MULTIPLE,AC,NUM,EXT,KEY,T
 S PHONE="",MULTIPLE=1
 S KEY=+$$KEY711^EASEZU1(TYPE_" PAGER PHONE AREA CODE") I KEY D
 .S AC=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 S KEY=+$$KEY711^EASEZU1(TYPE_" PAGER PHONE NUMBER") I KEY D
 .S NUM=$P($$DATA712^EASEZU1(EASAPP,KEY,MULTIPLE),U,1)
 .F T=1,2 S ^TMP("EZDATA",$J,KEY,MULTIPLE,T)=""
 I AC'="" S AC="("_AC_")"
 I NUM="-" S NUM=""
 I NUM'="" S:NUM'["-" NUM=$E(NUM,1,3)_"-"_$E(NUM,4,7)
 I NUM="" Q PHONE
 S PHONE=AC_NUM
 Q PHONE
 ;
ZIP(XDATA) ;
 N X
 I XDATA="-" S XDATA=""
 I XDATA["-",($L(XDATA)'=10) Q $E(XDATA,1,5)
 I $L(XDATA)<5 S XDATA=""
 Q XDATA
 ;
EMPLOY(XDATA) ;
 N X
 I XDATA="" Q "UNKNOWN"
 I XDATA="EMPLOYED" Q "EMPLOYED FULL TIME"
 Q XDATA
 ;
MARR(XDATA) ;
 N X
 I XDATA="" Q "UNKNOWN"
 I XDATA["WIDOW" S XDATA="WIDOW/WIDOWER"
 S X=$O(^DIC(11,"B",XDATA,0))
 I X="" Q "UNKNOWN"
 Q XDATA
 ;
RELIGION(XDATA) ;
 N X
 I XDATA="" Q "UNKNOWN/NO PREFERENCE"
 S X=$O(^DIC(13,"B",XDATA,0))
 I X="" Q "UNKNOWN/NO PREFERENCE"
 Q XDATA
 ;
SVCBRCH(XDATA) ;
 N X
 I XDATA="" Q "OTHER"
 S X=$O(^DIC(23,"B",XDATA,0))
 I X="" Q "OTHER"
 Q XDATA
 ;
SUMSSI(XDATA,IEN) ; glomb income fields for print
 N NODE,CIVIL,RAIL,MILIT,UNEMP,OTHER,INTER,COMP,OUT
 S NODE=$G(^DGMT(408.21,IEN,0))
 S CIVIL=$P(NODE,U,9)
 S RAIL=$P(NODE,U,10)
 S MILIT=$P(NODE,U,11)
 S UNEMP=$P(NODE,U,12)
 S OTHER=$P(NODE,U,13)
 S INTER=$P(NODE,U,15)
 S COMP=$P(NODE,U,16)
 I (XDATA=""),(CIVIL=""),(RAIL=""),(MILIT=""),(UNEMP=""),(OTHER=""),(INTER=""),(COMP="") Q ""   ;EAS*66 - IF ALL NULL, PRINT NULL
 S OUT=XDATA+CIVIL+RAIL+MILIT+UNEMP+OTHER+INTER+COMP
 Q OUT
 ;
SUMCASH(XDATA,IEN) ; glomb net worth fields for print
 N NODE,STOCKS,OUT
 S NODE=$G(^DGMT(408.21,IEN,2))
 S STOCKS=$P(NODE,U,2)
 I (XDATA=""),(STOCKS="") Q ""   ;EAS*66 - IF ALL NULL, PRINT NULL
 S OUT=XDATA+STOCKS
 Q OUT
 ;
SUMPROP(XDATA,IEN) ; glomb net worth fields for print
 N NODE,DEBT,OUT
 S NODE=$G(^DGMT(408.21,IEN,2))
 S DEBT=$P(NODE,U,5)
 I (XDATA=""),(DEBT="") Q ""   ;EAS*66 - IF ALL NULL, PRINT NULL
 S OUT=XDATA-DEBT
 Q OUT
 ;