source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASEZPVD.m@ 1096

Last change on this file since 1096 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.6 KB
RevLine 
[613]1EASEZPVD ;ALB/AMA/CMF - GATHER VISTA DATA TO PRINT FROM DG OPTIONS
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**57,66**;Mar 15, 2001
3 ;
4VISTA(EASDFN,EASMTIEN) ;GATHER VISTA DATA -- CALLED FROM EN^EASEZPDG
5 ; INPUT:
6 ; EASDFN - POINTER TO PATIENT FILE (#2)
7 ; EASMTIEN - MeansTestIEN (408.31)
8 ;
9 N X,KEY,VDATA,DISPOS,DGNT,ENROLL,RACE,ETHNC
10 ;
11 ;GET LAST ALIAS NAME
12 S X=$O(^DPT(EASDFN,.01,""),-1)
13 I +X D
14 . S KEY=+$$KEY711^EASEZU1("APPLICANT OTHER NAME")
15 . S VDATA=$$GET^EASEZC1(EASDFN_";"_+X,"2^2.01^.01")
16 . Q:VDATA=-1 Q:VDATA=""
17 . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
18 ;
19 ;GATHER MOST RECENT DISPOSITION DATA, IF IT EXISTS
20 ;OTHERWISE, PRINT "UNKNOWN" FOR THE FOLLOWING FIELDS
21 D I2101^EASEZI(EASDFN,.DISPOS)
22 I $D(DISPOS)>1 D I 1
23 . ;GET TYPE OF BENEFIT
24 . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^2")
25 . I (VDATA'=-1),(VDATA'="") D
26 . . I (VDATA="HOSPITAL")!(VDATA="OUTPATIENT MEDICAL") S VDATA="HEALTH SERVICES"
27 . . I VDATA["DENTAL" S VDATA="DENTAL"
28 . . I VDATA["NURSING" S VDATA="NURSING HOME"
29 . . S KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-"_VDATA)
30 . . S ^TMP("EZDATA",$J,KEY,1,2)="YES"
31 . ;GET FACILITY APPLYING TO
32 . S KEY=+$$KEY711^EASEZU1("FACILITY TO RECEIVE 1010EZ")
33 . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^3")
34 . I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
35 . ;
36 . ;GET NEED RELATED TO JOB INJURY OR ACCIDENT
37 . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO JOB INJURY")
38 . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^20")
39 . I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
40 . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO ACCIDENT")
41 . S VDATA=$$GET^EASEZC1(DISPOS(1),"2^2.101^23")
42 . I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
43 E D
44 . ;IF NO DISPOSITION DATA, PRINT "UNKNOWN" FOR ABOVE FIELDS
45 . S KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-HEALTH SERVICES")
46 . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
47 . S KEY=+$$KEY711^EASEZU1("FACILITY TO RECEIVE 1010EZ")
48 . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
49 . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO JOB INJURY")
50 . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
51 . S KEY=+$$KEY711^EASEZU1("NEED RELATED TO ACCIDENT")
52 . S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
53 ;
54 ;GET DATA FROM FILE #2
55 S KEY=0 F S KEY=$O(^TMP("EZDATA",$J,KEY)) Q:'KEY D
56 . S X=^TMP("EZDATA",$J,KEY)
57 . I $P(X,U,1,2)="2^2" D
58 . . S VDATA=$$GET^EASEZC1(EASDFN,X)
59 . . Q:VDATA=-1 Q:VDATA=""
60 . . I $P(X,U,3)=.09 S VDATA=$$SSNOUT^EASEZT1(VDATA)
61 . . I $P(X,U,3)=.117 D
62 . . . N ST,CNTY,CNAME
63 . . . S ST=$$GET1^DIQ(2,EASDFN,.115,"I")
64 . . . S CNTY=$$GET1^DIQ(2,EASDFN,.117,"I")
65 . . . S CNAME=$$GET1^DIQ(5.01,CNTY_","_ST,.01)
66 . . . S VDATA=CNAME_" ("_VDATA_")"
67 . . I $P(X,U,3)=.3405 D
68 . . . I VDATA="N" S VDATA="EMERGENCY CONTACT"
69 . . . E S VDATA="NEXT OF KIN"
70 . . I $P(X,U,3)=.362 D
71 . . . I VDATA'["IN LIEU OF" S VDATA="NO"
72 . . . E S VDATA="YES"
73 . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
74 ;CONVERT ANSWERS FOR SPINAL CORD INJURY
75 S KEY=+$$KEY711^EASEZU1("SPINAL CORD INJURY")
76 S VDATA=$$GET^EASEZC1(EASDFN,"2^2^57.4") D
77 . I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN" Q
78 . I VDATA="NOT APPLICABLE" S VDATA="NO" Q
79 . S VDATA="YES"
80 S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
81 ;IF PURPLE HEART OR NOSE/THROAT RADIUM UNANSWERED, SET TO "UNKNOWN"
82 S KEY=+$$KEY711^EASEZU1("PURPLE HEART")
83 S VDATA=$G(^TMP("EZDATA",$J,KEY,1,2))
84 I (VDATA=-1)!(VDATA="") S ^TMP("EZDATA",$J,KEY,1,2)="UNKNOWN"
85 S KEY=+$$KEY711^EASEZU1("NOSE/THROAT RADIUM")
86 S X=$$GETCUR^DGNTAPI(EASDFN,"DGNT")
87 S VDATA=$E($G(DGNT("INTRP")))
88 I (VDATA=-1)!(VDATA="") S VDATA="UNKNOWN"
89 I (VDATA'=-1),(VDATA'="") S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
90 ;
91 ;GET ENROLLMENT DATA
92 D I2711^EASEZI(EASDFN,.ENROLL)
93 I $D(ENROLL)>1 D
94 . S VDATA="" D ENR^EASEZC1(ENROLL(1),.VDATA)
95 . Q:VDATA=-1 Q:VDATA=""
96 . S ^TMP("EZDATA",$J,C2711,1,2)=VDATA
97 ;
98 ;GET DATA FROM FILES 408.12, 408.13, 408.21, AND 408.22
99 D V408^EASEZPV2(EASDFN,EASMTIEN)
100 ;
101 ;GET RACE DATA
102 D I202^EASEZI(EASDFN,.RACE)
103 I $D(RACE)>1 D
104 . N SBIEN
105 . S X=0 F S X=$O(RACE(X)) Q:'X D
106 . . S SBIEN=$P(RACE(X),";",2)
107 . . S VDATA=$$GET1^DIQ(2.02,SBIEN_","_EASDFN,.01)
108 . . Q:VDATA=-1 Q:VDATA=""
109 . . S KEY=+$$KEY711^EASEZU1("APPLICANT RACE - "_VDATA)
110 . . S ^TMP("EZDATA",$J,KEY,1,2)="YES"
111 ;
112 ;GET ETHNICITY DATA
113 D I206^EASEZI(EASDFN,.ETHNC)
114 I $D(ETHNC)>1 D
115 . N SBIEN
116 . S X=0 F S X=$O(ETHNC(X)) Q:'X D
117 . . S SBIEN=$P(ETHNC(X),";",2)
118 . . S VDATA=$$GET1^DIQ(2.06,SBIEN_","_EASDFN,.01)
119 . . Q:VDATA=-1 Q:VDATA=""
120 . . Q:$E(VDATA,1,8)="DECLINED"
121 . . I VDATA="HISPANIC OR LATINO" S VDATA="YES"
122 . . I $E(VDATA,1,3)="NOT" S VDATA="NO"
123 . . I $E(VDATA,1,3)="UNK" S VDATA="UNKNOWN"
124 . . S KEY=+$$KEY711^EASEZU1("APPLICANT SPANISH, HISPANIC, OR LATIN")
125 . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
126 ;
127 ;GET INSURANCE DATA
128 D INSUR^EASEZPVI(EASDFN)
129 Q
Note: See TracBrowser for help on using the repository browser.