VPSMR51 ;WOIFO/BT - Get the last MRAR data for a patient (Transaction Level) ;01/29/15 15:30
;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Jan 29, 2015;Build 64
;;Per VHA Directive 2004-038, this routine should not be modified.
;
;
TRANS(VPSMRAR,DFN,LASTMRAR) ; -- retrieve conducted with level fields and store them in VPSMRAR
; INPUT
; DFN : Patient IEN
; LASTMRAR : The last MRAR Transaction IEN for the patient
; OUTPUT
; VPSMRAR: local array contains all field names/values for the last mrar
;
N FIL S FIL=853.51
N TRANS D GETS^DIQ(FIL,LASTMRAR_","_DFN_",","*","IE","TRANS")
N ATTR,INVAL,EXVAL
N SUBS S SUBS=""
N FLD S FLD=""
;
F S FLD=$O(TRANS(FIL,LASTMRAR_","_DFN_",",FLD)) Q:'FLD D
. K ATTR D FIELD^DID(FIL,FLD,"","LABEL;TYPE","ATTR")
. S INVAL=TRANS(FIL,LASTMRAR_","_DFN_",",FLD,"I")
. S EXVAL=TRANS(FIL,LASTMRAR_","_DFN_",",FLD,"E")
. I ATTR("TYPE")="WORD-PROCESSING" S EXVAL=$$WP^VPSMRAR9(.TRANS,FIL,SUBS,FLD),INVAL=""
. D ADD^VPSMRAR9(.VPSMRAR,ATTR("LABEL"),SUBS,INVAL,EXVAL)
;
QUIT
;
CNDWTH(VPSMRAR,DFN,LASTMRAR) ; -- retrieve conducted with level fields and store them in VPSMRAR
; INPUT
; DFN : Patient IEN
; LASTMRAR : The last MRAR Transaction IEN for the patient
; OUTPUT
; VPSMRAR: local array contains all field names/values for the last mrar
;
N FIL S FIL=853.5121
N REC,INVAL,EXVAL
N CNDWTH S CNDWTH=0
N ATTR D FIELD^DID(FIL,".01","","LABEL;TYPE","ATTR")
N FLD S FLD=".01"
;
F S CNDWTH=$O(^VPS(853.5,DFN,"MRAR",LASTMRAR,"MRARWITH",CNDWTH)) Q:'CNDWTH D
. K REC D GETS^DIQ(FIL,CNDWTH_","_LASTMRAR_","_DFN_",","*","IE","REC")
. S INVAL=REC(FIL,CNDWTH_","_LASTMRAR_","_DFN_",",FLD,"I")
. S EXVAL=REC(FIL,CNDWTH_","_LASTMRAR_","_DFN_",",FLD,"E")
. D ADD^VPSMRAR9(.VPSMRAR,ATTR("LABEL"),","_INVAL,INVAL,EXVAL)
;
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVPSMR51 1846 printed Oct 16, 2024@18:43:37 Page 2
VPSMR51 ;WOIFO/BT - Get the last MRAR data for a patient (Transaction Level) ;01/29/15 15:30
+1 ;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Jan 29, 2015;Build 64
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ;
TRANS(VPSMRAR,DFN,LASTMRAR) ; -- retrieve conducted with level fields and store them in VPSMRAR
+1 ; INPUT
+2 ; DFN : Patient IEN
+3 ; LASTMRAR : The last MRAR Transaction IEN for the patient
+4 ; OUTPUT
+5 ; VPSMRAR: local array contains all field names/values for the last mrar
+6 ;
+7 NEW FIL
SET FIL=853.51
+8 NEW TRANS
DO GETS^DIQ(FIL,LASTMRAR_","_DFN_",","*","IE","TRANS")
+9 NEW ATTR,INVAL,EXVAL
+10 NEW SUBS
SET SUBS=""
+11 NEW FLD
SET FLD=""
+12 ;
+13 FOR
SET FLD=$ORDER(TRANS(FIL,LASTMRAR_","_DFN_",",FLD))
if 'FLD
QUIT
Begin DoDot:1
+14 KILL ATTR
DO FIELD^DID(FIL,FLD,"","LABEL;TYPE","ATTR")
+15 SET INVAL=TRANS(FIL,LASTMRAR_","_DFN_",",FLD,"I")
+16 SET EXVAL=TRANS(FIL,LASTMRAR_","_DFN_",",FLD,"E")
+17 IF ATTR("TYPE")="WORD-PROCESSING"
SET EXVAL=$$WP^VPSMRAR9(.TRANS,FIL,SUBS,FLD)
SET INVAL=""
+18 DO ADD^VPSMRAR9(.VPSMRAR,ATTR("LABEL"),SUBS,INVAL,EXVAL)
End DoDot:1
+19 ;
+20 QUIT
+21 ;
CNDWTH(VPSMRAR,DFN,LASTMRAR) ; -- retrieve conducted with level fields and store them in VPSMRAR
+1 ; INPUT
+2 ; DFN : Patient IEN
+3 ; LASTMRAR : The last MRAR Transaction IEN for the patient
+4 ; OUTPUT
+5 ; VPSMRAR: local array contains all field names/values for the last mrar
+6 ;
+7 NEW FIL
SET FIL=853.5121
+8 NEW REC,INVAL,EXVAL
+9 NEW CNDWTH
SET CNDWTH=0
+10 NEW ATTR
DO FIELD^DID(FIL,".01","","LABEL;TYPE","ATTR")
+11 NEW FLD
SET FLD=".01"
+12 ;
+13 FOR
SET CNDWTH=$ORDER(^VPS(853.5,DFN,"MRAR",LASTMRAR,"MRARWITH",CNDWTH))
if 'CNDWTH
QUIT
Begin DoDot:1
+14 KILL REC
DO GETS^DIQ(FIL,CNDWTH_","_LASTMRAR_","_DFN_",","*","IE","REC")
+15 SET INVAL=REC(FIL,CNDWTH_","_LASTMRAR_","_DFN_",",FLD,"I")
+16 SET EXVAL=REC(FIL,CNDWTH_","_LASTMRAR_","_DFN_",",FLD,"E")
+17 DO ADD^VPSMRAR9(.VPSMRAR,ATTR("LABEL"),","_INVAL,INVAL,EXVAL)
End DoDot:1
+18 ;
+19 QUIT