VAQDIS11 ;ALB/JFP - PDX,SELECTION SCREEN FOR DISPLAY BY PATIENT;01MAR93
;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
EP ; -- Main entry point for the list processor
K XQORS,VALMEVL
N VAQSSN,VAQPAT,VAQFLAG,VAQECNT,VAQRSLT,VAQUNSOL,X0,STATUS,TRDE
D EN^VALM("VAQ DIS PATIENT PDX9") ; -- Protocol = VAQ PDX9 (MENU)
QUIT
;
INIT ; -- Builds array of PDX trans for the patient entered (SSN) or name
K ^TMP("VAQD1",$J),^TMP("VAQIDX",$J)
;
S TRDE="",(VAQECNT,VALMCNT)=0
S VAQPAT=$P($G(^VAT(394.61,+VAQDFN,"QRY")),U,1)
S VAQSSN=$P($G(^VAT(394.61,+VAQDFN,"QRY")),U,2)
I (VAQSSN="")&(VAQPAT="") D MSG1 QUIT
;
D STATPTR^VAQUTL95 ; -- Sets PDX status pointers (vaq-rslt,vaq-unsol)
MAIN ; -- Main processing loop
F S TRDE=$O(^VAT(394.61,$S(VAQSSN'="":"SSN",1:"NAME"),$S(VAQSSN'="":VAQSSN,1:VAQPAT),TRDE)) Q:TRDE="" D SETD
I VAQECNT=0 D MSG2 QUIT
QUIT
;
SETD ; -- Set data for display in list processor
S VAQCSTAT=$P($G(^VAT(394.61,TRDE,0)),U,2)
; -- Filter out transaction without results
I ((VAQCSTAT)'=VAQRSLT)&((VAQCSTAT)'=VAQUNSOL) QUIT
; -- Filter out transactions marked as purged OR excides life cap
S VAQFLAG=$$EXPTRN^VAQUTL97(TRDE)
Q:VAQFLAG=1
;
S X0=$$TRNDATA^VAQUTL92(TRDE) ; -- Extracts data from transaction file
S STATUS=$S(VAQCSTAT'="":$P($G(^VAT(394.85,VAQCSTAT,0)),U,2),1:" ")
S:VAQADT'="" DATETIME=VAQADT_" (Rs)"
S:VAQADT="" DATETIME=VAQRDT_" (Rq)"
S VAQECNT=VAQECNT+1
S X=$$SETFLD^VALM1(VAQECNT,"","ENTRY")
S X=$$SETFLD^VALM1(VAQADOM,X,"DOMAIN")
S X=$$SETFLD^VALM1(DATETIME,X,"DATE")
S X=$$SETFLD^VALM1(VAQTRN,X,"TRNO")
D TMP
S X=$$SETSTR^VALM1(" ","",1,80) D TMP ; -- null line
D KILLTRN^VAQUTL92 ; -- Cleans up variables set in TRNDATA
QUIT
;
HD ; -- Make header line for list processor
S X0=$$TRNDATA^VAQUTL92(VAQDFN)
D HD1^VAQEXT02
D KILLTRN^VAQUTL92
QUIT
;
SEL ; -- Selects patient to display, checks sensative patient
N VALMY,SDI,SDAT
S:'$D(VAQBCK) VAQBCK=0
D EN^VALM2($G(XQORNOD(0)),"S")
Q:'$D(VALMY)
S SDI=""
S SDI=$O(VALMY(SDI)) Q:SDI=""
S SDAT=$G(^TMP("VAQIDX",$J,SDI))
S VAQTRN=$P(SDAT,U,2),DFN=""
S (VAQDFN,DFN)=$O(^VAT(394.61,"B",VAQTRN,DFN))
I $P($G(^VAT(394.61,DFN,0)),U,4)=1 D WORKLD
D EP^VAQDIS15 ; -- Display segments
I VAQBCK=1 K VALMBCK QUIT
D INIT
S VALMBCK="R"
QUIT
;
TMP ; -- Set the array used by list processor
S VALMCNT=VALMCNT+1
S ^TMP("VAQD1",$J,VALMCNT,0)=$E(X,1,79)
S ^TMP("VAQD1",$J,"IDX",VALMCNT,VAQECNT)=""
S ^TMP("VAQIDX",$J,VAQECNT)=VALMCNT_"^"_VAQTRN
QUIT
;
WORKLD ; -- Updates workload file
S X=$$WORKDONE^VAQADS01("SNSTVE",DFN,$G(DUZ))
I X<0 W !,"Error updating workload file (SNSTVE)... "_$P(X,U,2)
QUIT
;
MSG1 ; -- Message 1
S VAQTRN=0,X=$$SETSTR^VALM1(" ","",1,79) D TMP
S X=$$SETSTR^VALM1(" ** Insufficient Information for Patient Look-up...","",1,80) D TMP
QUIT
;
MSG2 ; -- Message 2
S VAQTRN=0,X=$$SETSTR^VALM1(" ","",1,79) D TMP
S X=$$SETSTR^VALM1(" ** PDX results not found for patient entered... ","",1,80) D TMP
QUIT
;
EXIT ; -- Note: The list processor cleans up its own variables.
; All other variables cleaned up here.
;
K VAQADFL ; -- set in VAQDIS01 (display min)
K VAQSSN,VAQPAT,VAQFLAG,VAQECNT,VAQRSLT,VAQUNSOL,X0,STATUS,TRDE,VAQBCK
K ENTRY,DATETIME,VAQECNT
K ^TMP("VAQD1",$J),^TMP("VAQIDX",$J)
QUIT
;
END ; -- End of code
QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVAQDIS11 3384 printed Sep 02, 2024@19:10:38 Page 2
VAQDIS11 ;ALB/JFP - PDX,SELECTION SCREEN FOR DISPLAY BY PATIENT;01MAR93
+1 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
EP ; -- Main entry point for the list processor
+1 KILL XQORS,VALMEVL
+2 NEW VAQSSN,VAQPAT,VAQFLAG,VAQECNT,VAQRSLT,VAQUNSOL,X0,STATUS,TRDE
+3 ; -- Protocol = VAQ PDX9 (MENU)
DO EN^VALM("VAQ DIS PATIENT PDX9")
+4 QUIT
+5 ;
INIT ; -- Builds array of PDX trans for the patient entered (SSN) or name
+1 KILL ^TMP("VAQD1",$JOB),^TMP("VAQIDX",$JOB)
+2 ;
+3 SET TRDE=""
SET (VAQECNT,VALMCNT)=0
+4 SET VAQPAT=$PIECE($GET(^VAT(394.61,+VAQDFN,"QRY")),U,1)
+5 SET VAQSSN=$PIECE($GET(^VAT(394.61,+VAQDFN,"QRY")),U,2)
+6 IF (VAQSSN="")&(VAQPAT="")
DO MSG1
QUIT
+7 ;
+8 ; -- Sets PDX status pointers (vaq-rslt,vaq-unsol)
DO STATPTR^VAQUTL95
MAIN ; -- Main processing loop
+1 FOR
SET TRDE=$ORDER(^VAT(394.61,$SELECT(VAQSSN'="":"SSN",1:"NAME"),$SELECT(VAQSSN'="":VAQSSN,1:VAQPAT),TRDE))
if TRDE=""
QUIT
DO SETD
+2 IF VAQECNT=0
DO MSG2
QUIT
+3 QUIT
+4 ;
SETD ; -- Set data for display in list processor
+1 SET VAQCSTAT=$PIECE($GET(^VAT(394.61,TRDE,0)),U,2)
+2 ; -- Filter out transaction without results
+3 IF ((VAQCSTAT)'=VAQRSLT)&((VAQCSTAT)'=VAQUNSOL)
QUIT
+4 ; -- Filter out transactions marked as purged OR excides life cap
+5 SET VAQFLAG=$$EXPTRN^VAQUTL97(TRDE)
+6 if VAQFLAG=1
QUIT
+7 ;
+8 ; -- Extracts data from transaction file
SET X0=$$TRNDATA^VAQUTL92(TRDE)
+9 SET STATUS=$SELECT(VAQCSTAT'="":$PIECE($GET(^VAT(394.85,VAQCSTAT,0)),U,2),1:" ")
+10 if VAQADT'=""
SET DATETIME=VAQADT_" (Rs)"
+11 if VAQADT=""
SET DATETIME=VAQRDT_" (Rq)"
+12 SET VAQECNT=VAQECNT+1
+13 SET X=$$SETFLD^VALM1(VAQECNT,"","ENTRY")
+14 SET X=$$SETFLD^VALM1(VAQADOM,X,"DOMAIN")
+15 SET X=$$SETFLD^VALM1(DATETIME,X,"DATE")
+16 SET X=$$SETFLD^VALM1(VAQTRN,X,"TRNO")
+17 DO TMP
+18 ; -- null line
SET X=$$SETSTR^VALM1(" ","",1,80)
DO TMP
+19 ; -- Cleans up variables set in TRNDATA
DO KILLTRN^VAQUTL92
+20 QUIT
+21 ;
HD ; -- Make header line for list processor
+1 SET X0=$$TRNDATA^VAQUTL92(VAQDFN)
+2 DO HD1^VAQEXT02
+3 DO KILLTRN^VAQUTL92
+4 QUIT
+5 ;
SEL ; -- Selects patient to display, checks sensative patient
+1 NEW VALMY,SDI,SDAT
+2 if '$DATA(VAQBCK)
SET VAQBCK=0
+3 DO EN^VALM2($GET(XQORNOD(0)),"S")
+4 if '$DATA(VALMY)
QUIT
+5 SET SDI=""
+6 SET SDI=$ORDER(VALMY(SDI))
if SDI=""
QUIT
+7 SET SDAT=$GET(^TMP("VAQIDX",$JOB,SDI))
+8 SET VAQTRN=$PIECE(SDAT,U,2)
SET DFN=""
+9 SET (VAQDFN,DFN)=$ORDER(^VAT(394.61,"B",VAQTRN,DFN))
+10 IF $PIECE($GET(^VAT(394.61,DFN,0)),U,4)=1
DO WORKLD
+11 ; -- Display segments
DO EP^VAQDIS15
+12 IF VAQBCK=1
KILL VALMBCK
QUIT
+13 DO INIT
+14 SET VALMBCK="R"
+15 QUIT
+16 ;
TMP ; -- Set the array used by list processor
+1 SET VALMCNT=VALMCNT+1
+2 SET ^TMP("VAQD1",$JOB,VALMCNT,0)=$EXTRACT(X,1,79)
+3 SET ^TMP("VAQD1",$JOB,"IDX",VALMCNT,VAQECNT)=""
+4 SET ^TMP("VAQIDX",$JOB,VAQECNT)=VALMCNT_"^"_VAQTRN
+5 QUIT
+6 ;
WORKLD ; -- Updates workload file
+1 SET X=$$WORKDONE^VAQADS01("SNSTVE",DFN,$GET(DUZ))
+2 IF X<0
WRITE !,"Error updating workload file (SNSTVE)... "_$PIECE(X,U,2)
+3 QUIT
+4 ;
MSG1 ; -- Message 1
+1 SET VAQTRN=0
SET X=$$SETSTR^VALM1(" ","",1,79)
DO TMP
+2 SET X=$$SETSTR^VALM1(" ** Insufficient Information for Patient Look-up...","",1,80)
DO TMP
+3 QUIT
+4 ;
MSG2 ; -- Message 2
+1 SET VAQTRN=0
SET X=$$SETSTR^VALM1(" ","",1,79)
DO TMP
+2 SET X=$$SETSTR^VALM1(" ** PDX results not found for patient entered... ","",1,80)
DO TMP
+3 QUIT
+4 ;
EXIT ; -- Note: The list processor cleans up its own variables.
+1 ; All other variables cleaned up here.
+2 ;
+3 ; -- set in VAQDIS01 (display min)
KILL VAQADFL
+4 KILL VAQSSN,VAQPAT,VAQFLAG,VAQECNT,VAQRSLT,VAQUNSOL,X0,STATUS,TRDE,VAQBCK
+5 KILL ENTRY,DATETIME,VAQECNT
+6 KILL ^TMP("VAQD1",$JOB),^TMP("VAQIDX",$JOB)
+7 QUIT
+8 ;
END ; -- End of code
+1 QUIT