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

EASEZPVD.m

Go to the documentation of this file.
  1. EASEZPVD ;ALB/AMA/CMF,LBD - GATHER VISTA DATA TO PRINT FROM DG OPTIONS ; 10/13/10 4:05pm
  1. ;;1.0;ENROLLMENT APPLICATION SYSTEM;**57,66,70,81,92**;Mar 15, 2001;Build 20
  1. ;
  1. VISTA(EASDFN,EASMTIEN) ;GATHER VISTA DATA -- CALLED FROM EN^EASEZPDG
  1. ; INPUT:
  1. ; EASDFN - POINTER TO PATIENT FILE (#2)
  1. ; EASMTIEN - MeansTestIEN (408.31)
  1. ;
  1. N X,KEY,VDATA,DISPOS,DGNT,ENROLL,RACE,ETHNC
  1. ;
  1. ;GET LAST ALIAS NAME
  1. S X=$O(^DPT(EASDFN,.01,""),-1)
  1. I +X D
  1. . S KEY=+$$KEY711^EASEZU1("APPLICANT OTHER NAME")
  1. . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.01^.01")
  1. . Q:VDATA=-1 Q:VDATA=""
  1. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. ;
  1. ;GATHER MOST RECENT DISPOSITION DATA, IF IT EXISTS
  1. ;OTHERWISE, PRINT "UNKNOWN" FOR THE FOLLOWING FIELDS
  1. D I2101^EASEZI(EASDFN,.DISPOS)
  1. I $D(DISPOS),$D(DISPOS(1)) I DISPOS(1)="NO DISPOSITION" Q
  1. I $D(DISPOS)>1 D I 1
  1. . ;GET TYPE OF BENEFIT
  1. . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^2")
  1. . I (VDATA'=-1),(VDATA'="") D
  1. . . I (VDATA="HOSPITAL")!(VDATA="OUTPATIENT MEDICAL") S VDATA="HEALTH SERVICES"
  1. . . I VDATA["DENTAL" S VDATA="DENTAL"
  1. . . I VDATA["NURSING" S VDATA="NURSING HOME"
  1. . . S KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-"_VDATA)
  1. . . S ^TMP("EZDATA",$J,KEY,1,2)="YES"
  1. . ;GET FACILITY APPLYING TO
  1. . S KEY=+$$KEY711^EASEZU1("FACILITY TO RECEIVE 1010EZ")
  1. . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^3")
  1. . I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. . ;
  1. . ;GET NEED RELATED TO JOB INJURY OR ACCIDENT
  1. . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO JOB INJURY")
  1. . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^20")
  1. . I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO ACCIDENT")
  1. . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^23")
  1. . I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. E D
  1. . ;IF NO DISPOSITION DATA, PRINT "UNKNOWN" FOR ABOVE FIELDS
  1. . S KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-HEALTH SERVICES")
  1. . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
  1. . S KEY=+$$KEY711^EASEZU1("FACILITY TO RECEIVE 1010EZ")
  1. . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
  1. . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO JOB INJURY")
  1. . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
  1. . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO ACCIDENT")
  1. . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
  1. ;
  1. ;GET DATA FROM FILE #2
  1. S KEY=0 F S KEY=$O(^TMP("EZDATA",$J,KEY)) Q:'KEY D
  1. . S X=^TMP("EZDATA",$J,KEY)
  1. . I $P(X,U,1,2)="2^2" D
  1. . . S VDATA=$$GET^EASEZC1(EASDFN,X)
  1. . . Q:VDATA=-1 Q:VDATA=""
  1. . . I $P(X,U,3)=.09 S VDATA=$$SSNOUT^EASEZT1(VDATA)
  1. . . I $P(X,U,3)=.117 D
  1. . . . N ST,CNTY,CNAME
  1. . . . S ST=$$GET1^DIQ(2,EASDFN,.115,"I")
  1. . . . S CNTY=$$GET1^DIQ(2,EASDFN,.117,"I")
  1. . . . S CNAME=$$GET1^DIQ(5.01,CNTY_","_ST,.01)
  1. . . . S VDATA=CNAME_" ("_VDATA_")"
  1. . . ;EAS*1.0*70
  1. . . I $P(X,U,3)=.1173 S VDATA=$$COUNTRY^EASEZT1(VDATA) Q:VDATA=-1
  1. . . I $P(X,U,3)=.3405 D
  1. . . . I VDATA="N" S VDATA="EMERGENCY CONTACT"
  1. . . . E S VDATA="NEXT OF KIN"
  1. . . I $P(X,U,3)=.362 D
  1. . . . I VDATA'["IN LIEU OF" S VDATA="NO"
  1. . . . E S VDATA="YES"
  1. . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. ;CONVERT ANSWERS FOR SPINAL CORD INJURY
  1. S KEY=+$$KEY711^EASEZU1("SPINAL CORD INJURY")
  1. S VDATA=$$GET^EASEZC1(EASDFN,"2^2^57.4") D
  1. . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN" Q
  1. . I VDATA="NOT APPLICABLE" S VDATA="NO" Q
  1. . S VDATA="YES"
  1. S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. ;IF PURPLE HEART OR NOSE/THROAT RADIUM UNANSWERED, SET TO "UNKNOWN"
  1. S KEY=+$$KEY711^EASEZU1("PURPLE HEART")
  1. S VDATA=$G(^TMP("EZDATA",$J,KEY,1,2))
  1. I (VDATA=-1)!(VDATA="") S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
  1. S KEY=+$$KEY711^EASEZU1("NOSE/THROAT RADIUM")
  1. S X=$$GETCUR^DGNTAPI(EASDFN,"DGNT")
  1. S VDATA=$E($G(DGNT("INTRP")))
  1. I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
  1. I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. ;
  1. ;GET LAST MILITARY SERVICE EPISODE DATA FROM MSE SUB-FILE #2.3216
  1. ;DG*5.3*797
  1. I '$D(^DPT(EASDFN,.3216)) D MOVMSE^DGMSEUTL(EASDFN)
  1. S X=$O(^DPT(EASDFN,.3216,"B",""),-1) S:X X=$O(^DPT(EASDFN,.3216,"B",X,""))
  1. I +X D
  1. . S KEY=+$$KEY711^EASEZU1("LAST ENTRY DATE")
  1. . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.3216^.01")
  1. . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
  1. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. . S KEY=+$$KEY711^EASEZU1("LAST DISCHARGE DATE")
  1. . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.3216^.02")
  1. . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
  1. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. . S KEY=+$$KEY711^EASEZU1("LAST BRANCH OF SERVICE")
  1. . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.3216^.03")
  1. . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
  1. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. . S KEY=+$$KEY711^EASEZU1("SERVICE NUMBER")
  1. . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.3216^.05")
  1. . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
  1. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. . S KEY=+$$KEY711^EASEZU1("LAST DISCHARGE TYPE")
  1. . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.3216^.06")
  1. . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
  1. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. ;
  1. ;GET ENROLLMENT DATA
  1. D I2711^EASEZI(EASDFN,.ENROLL)
  1. I $D(ENROLL)>1 D
  1. . S VDATA="" D ENR^EASEZC1(ENROLL(1),.VDATA)
  1. . Q:VDATA=-1 Q:VDATA=""
  1. . S ^TMP("EZDATA",$J,C2711,1,2)=VDATA
  1. ;
  1. ;GET DATA FROM FILES 408.12, 408.13, 408.21, AND 408.22
  1. D V408^EASEZPV2(EASDFN,EASMTIEN)
  1. ;
  1. ;GET RACE DATA
  1. D I202^EASEZI(EASDFN,.RACE)
  1. I $D(RACE)>1 D
  1. . N SBIEN
  1. . S X=0 F S X=$O(RACE(X)) Q:'X D
  1. . . S SBIEN=$P(RACE(X),";",2)
  1. . . S VDATA=$$GET1^DIQ(2.02,SBIEN_","_EASDFN,.01)
  1. . . Q:VDATA=-1 Q:VDATA=""
  1. . . S KEY=+$$KEY711^EASEZU1("APPLICANT RACE - "_VDATA)
  1. . . S ^TMP("EZDATA",$J,KEY,1,2)="YES"
  1. ;
  1. ;GET ETHNICITY DATA
  1. D I206^EASEZI(EASDFN,.ETHNC)
  1. I $D(ETHNC)>1 D
  1. . N SBIEN
  1. . S X=0 F S X=$O(ETHNC(X)) Q:'X D
  1. . . S SBIEN=$P(ETHNC(X),";",2)
  1. . . S VDATA=$$GET1^DIQ(2.06,SBIEN_","_EASDFN,.01)
  1. . . Q:VDATA=-1 Q:VDATA=""
  1. . . Q:$E(VDATA,1,8)="DECLINED"
  1. . . I VDATA="HISPANIC OR LATINO" S VDATA="YES"
  1. . . I $E(VDATA,1,3)="NOT" S VDATA="NO"
  1. . . I $E(VDATA,1,3)="UNK" S VDATA="UNKNOWN"
  1. . . S KEY=+$$KEY711^EASEZU1("APPLICANT SPANISH, HISPANIC, OR LATIN")
  1. . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
  1. ;
  1. ;GET INSURANCE DATA
  1. D INSUR^EASEZPVI(EASDFN)
  1. Q