VistA-FOIAVistA/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR9DEM.m

80 lines
2.8 KiB
Mathematica

RMPR9DEM ;HOIFO/HNC/SPS - GUI 2319 DEM VADPT IN RESULTS ARRAY ;9/19/02 11:27
;;3.0;PROSTHETICS;**59**;Feb 09, 1996
EN(RESULTS,IEN) ;broker entry point
;translate ien 668 to DFN
;
TST ;S IEN=311
S DFN=$P($G(^RMPR(668,IEN,0)),U,2)
I DFN="" S RESULTS(999)="NOTHING TO REPORT" G EXIT
D DEM^VADPT
S RESULTS(0)=VADM(1) ;Name
S RESULTS(1)=VADM(2) ;SSN
S RESULTS(2)=VADM(3) ;Date of Birth
S RESULTS(3)=VADM(4) ;Age
S RESULTS(4)=VADM(5) ;Sex
S RESULTS(5)=VADM(6) ;Date of Death
S RESULTS(6)=VADM(8) ;Race
S RESULTS(7)=VADM(9) ;Religion
S RESULTS(8)=VADM(10) ;Marital Status
S RESULTS(9)=VA("PID") ;Primary Long ID
S RESULTS(10)=VA("BID") ;Primary Short ID
;I $G(VAERR)'="" S RESULTS(999)=VAERR
;
S DFN=$P($G(^RMPR(668,IEN,0)),U,2)
I DFN="" S RESULTS(999)="NOTHING TO REPORT" G EXIT
D ADD^VADPT
S RESULTS(12)=VAPA(1) ;First line address
S RESULTS(13)=VAPA(4) ;City
S RESULTS(14)=VAPA(5) ;State
S RESULTS(15)=VAPA(6) ;Zip
S RESULTS(16)=VAPA(7) ;County
S RESULTS(17)=VAPA(8) ;Phone
S RESULTS(18)=VAPA(11) ;Zip+4
;NOK
D OAD^VADPT
S RESULTS(19)=VAOA(9) ;NOK name
S RESULTS(20)=VAOA(1) ;NOK Address
S RESULTS(21)=VAOA(4) ;NOK CITY
S RESULTS(22)=VAOA(5) ;NOK STATE
S RESULTS(23)=VAOA(6) ;NOK ZIP
S RESULTS(24)=VAOA(8) ;NOK PHONE
S RESULTS(25)=VAOA(10) ;NOK RELATIONSHIP
; Eligibility segment
D ELIG^VADPT
S RESULTS(11)=VAEL(7) ;Claim #
S RESULTS(26)=$P(VAEL(6),U,2) ;Patient Type
S RESULTS(27)=$P(VAEL(2),U,2) ;Period of Service
S RESULTS(28)=$P(VAEL(1),U,2) ;Primary Eligibility Code
S RESULTS(29)=$S(VAEL(8)]"":$P(VAEL(8),U,2),1:"NOT VERIFIED") ;Verification?
;Monetary Benefit Info from MB^VADPT
D MB^VADPT
S RESULTS(30)="NO" I $P(VAMB(1),U)=1 S RESULTS(30)="YES",RMPRCHK=$P(VAMB(1),U,2)
S RESULTS(31)="NO" I $P(VAMB(2),U)=1 S RESULTS(31)="YES",RMPRCHK=$P(VAMB(2),U,2)
S RESULTS(32)="NO" I $P(VAMB(4),U)=1 S RESULTS(32)="YES",RMPRCHK=$P(VAMB(4),U,2)
S RESULTS(33)="NO" I $P(VAMB(7),U)=1 S RESULTS(33)="YES",RMPRCHK=$P(VAMB(7),U,2)
S RESULTS(34)=0 I $G(RMPRCHK)]"" S RESULTS(34)=$G(RMPRCHK) ;Total Annual VA Check Amount
;Prosthetics Disability Codes
S (RMPRDC,RO,FG)=0 I '$D(^RMPR(665,DFN,1)) S RESULTS(35)="None" S RO=1
K RMPRDC
I RO=0 F S:'FG RMPRDC="" S RO=$O(^RMPR(665,DFN,1,RO)) Q:RO'>0 D
.S RR=^(RO,0) S:$P(RR,U,10) FG=1 I '$P(RR,U,10) S RMPRDC=RMPRDC_$P(^RMPR(662,+RR,0),U,1)_"-"_$S($P(RR,U,3)=1:"SC",$P(RR,U,3)=2:"NSC",1:"") S FG=1
S:FG=1 RESULTS(35)=RMPRDC
;POW
D SVC^VADPT
S RESULTS(36)=$S(VASV(4)=1:"YES",1:"NO") ;POW YES/NO
;Emergency Contact
S VAOA("A")=1 D OAD^VADPT
S RESULTS(37)=VAOA(9) ;Name of Emergency Contact
S RESULTS(38)=VAOA(1) ;Street Address
S RESULTS(39)=VAOA(4) ;City
S RESULTS(40)=$P(VAOA(5),U,2) ;State
S RESULTS(41)=VAOA(6) ;Zip
S RESULTS(42)=VAOA(8) ;Home Phone
S RESULTS(43)=VAOA(10) ;Relationship
I $G(VAERR)'="" S RESULTS(999)=VAERR
;
Q
EXIT ;
Q
;END