RMPR9LM ;HOIFO/SPS - GUI 2319 Tab 2 Last Patient Movement ;9/19/02 11:29
;;3.0;PROSTHETICS;**59**;Feb 09, 1996
A1(IEN) G A2
EN(RESULTS,IEN) ;broker entry point
A2 ;
S DFN=$P($G(^RMPR(668,IEN,0)),U,2)
I DFN="" S RESULTS(0)="NOTHING TO REPORT" G EXIT
S VAIP("D")="L" D DEM^VADPT,IN5^VADPT,ELIG^VADPT
;Header Info
;Last movement
S RESULTS(0)=VADM(1) ;NAME
S RESULTS(1)=VADM(2) ;SSN
S RESULTS(2)=VADM(3) ;DOB
S RESULTS(3)=VAEL(7) ;CLAIM #
;Last Movement
S RESULTS(4)=$S(VAIP(1)>0:1,1:0) ;1=MOVEMENT,0=NONE
S RESULTS(5)=$P(VAIP(2),U,2) ;Trans Type
S RESULTS(6)=$P(VAIP(3),U,2) ;Date
S RESULTS(7)=$P(VAIP(4),U,2) ;Type of Movement
S RESULTS(8)=$P(VAIP(5),U,2) ;Ward
S RESULTS(9)=$P(VAIP(7),U,2) ;Physician
S RESULTS(10)=VAIP(9) ;Diagnosis
;2nd from Last Movement
S RESULTS(11)=$S(VAIP(13)>0:1,1:0) ;1=MOVEMENT,0=NONE
S RESULTS(12)=$P(VAIP(13,2),U,2) ;Trans. type
S RESULTS(13)=$P(VAIP(13,1),U,2) ;Date
S RESULTS(14)=$P(VAIP(13,3),U,2) ;Type of Movement
S RESULTS(15)=$P(VAIP(13,4),U,2) ;Ward
S RESULTS(16)=$P(VAIP(13,5),U,2) ;Physician
S RESULTS(17)=VAIP(13,7) ;Diagnosis
EXIT ;common exit point
I '$D(RESULTS) S RESULTS(0)="NOTHING TO REPORT"
K DFN,VADM,VAIL,VAIP
;END
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPR9LM 1229 printed Dec 13, 2024@02:33:38 Page 2
RMPR9LM ;HOIFO/SPS - GUI 2319 Tab 2 Last Patient Movement ;9/19/02 11:29
+1 ;;3.0;PROSTHETICS;**59**;Feb 09, 1996
A1(IEN) GOTO A2
EN(RESULTS,IEN) ;broker entry point
A2 ;
+1 SET DFN=$PIECE($GET(^RMPR(668,IEN,0)),U,2)
+2 IF DFN=""
SET RESULTS(0)="NOTHING TO REPORT"
GOTO EXIT
+3 SET VAIP("D")="L"
DO DEM^VADPT
DO IN5^VADPT
DO ELIG^VADPT
+4 ;Header Info
+5 ;Last movement
+6 ;NAME
SET RESULTS(0)=VADM(1)
+7 ;SSN
SET RESULTS(1)=VADM(2)
+8 ;DOB
SET RESULTS(2)=VADM(3)
+9 ;CLAIM #
SET RESULTS(3)=VAEL(7)
+10 ;Last Movement
+11 ;1=MOVEMENT,0=NONE
SET RESULTS(4)=$SELECT(VAIP(1)>0:1,1:0)
+12 ;Trans Type
SET RESULTS(5)=$PIECE(VAIP(2),U,2)
+13 ;Date
SET RESULTS(6)=$PIECE(VAIP(3),U,2)
+14 ;Type of Movement
SET RESULTS(7)=$PIECE(VAIP(4),U,2)
+15 ;Ward
SET RESULTS(8)=$PIECE(VAIP(5),U,2)
+16 ;Physician
SET RESULTS(9)=$PIECE(VAIP(7),U,2)
+17 ;Diagnosis
SET RESULTS(10)=VAIP(9)
+18 ;2nd from Last Movement
+19 ;1=MOVEMENT,0=NONE
SET RESULTS(11)=$SELECT(VAIP(13)>0:1,1:0)
+20 ;Trans. type
SET RESULTS(12)=$PIECE(VAIP(13,2),U,2)
+21 ;Date
SET RESULTS(13)=$PIECE(VAIP(13,1),U,2)
+22 ;Type of Movement
SET RESULTS(14)=$PIECE(VAIP(13,3),U,2)
+23 ;Ward
SET RESULTS(15)=$PIECE(VAIP(13,4),U,2)
+24 ;Physician
SET RESULTS(16)=$PIECE(VAIP(13,5),U,2)
+25 ;Diagnosis
SET RESULTS(17)=VAIP(13,7)
EXIT ;common exit point
+1 IF '$DATA(RESULTS)
SET RESULTS(0)="NOTHING TO REPORT"
+2 KILL DFN,VADM,VAIL,VAIP
+3 ;END