VAFCRAU ;BHAM/DRI-LIST MANAGER ROUTINE FOR MPI/PD VAFC EXCPT REMOTE AUDIT IN PDR ;3/14/02 11:41
;;5.3;Registration;**477,479,1015**;Aug 13, 1993;Build 21
;Reference to RPCCHK^XWB2HL7 supported by IA #3144
;Reference to RTNDATA^XWBDRPC supported by IA #3149
EN(ICN) ;main entry point for VAFC EXCPT REMOTE AUDIT
D EN^VALM("VAFC EXCPT REMOTE AUDIT")
Q
HDR ;header code
S VALMHDR(1)="MPI/PD REMOTE AUDIT DATA"
S VALMHDR(2)=""
Q
INIT ;
K @VALMAR ;K ^TMP("VAFCRAU",$J)
I '$D(DFN) G EXIT
S LIN=1,X=0,STR="",TXT=""
S TXT="-> For Patient "_$P($G(^DPT(DFN,0)),"^",1) S STR=$$SETSTR^VALM1(TXT,STR,2,78) D ADDTMP
S L=0 F S L=$O(TFARR(L)) Q:'L D
. S SL=$P(TFARR(L),"^",1)
. S STATUS=$P(TFL(SL),"^",3)
. I STATUS["Handle" S STATUS="Error in Process"
. E I STATUS["New" S STATUS="Request Sent"
. E I STATUS["Running" S STATUS="Awaiting Response"
. E I STATUS["Done" S STATUS="Response Received"
. S TXT=" "_$P(TFL(SL),"^")_" status: ("_STATUS_")"
. D ADDTMP
. S STR=$$SETSTR^VALM1(TXT,STR,2,78) D ADDTMP D
. S LOC=$P(TFL(SL),"^",2)
. N STATUS,RETURN,RESULT,RET
. I '$D(^XTMP("VAFCRAUD"_ICN,0)) S TXT=" - No audit query exists for this patient." S STR=$$SETSTR^VALM1(TXT,STR,2,78) D ADDTMP
. I $D(^XTMP("VAFCRAUD"_ICN,LOC,0)) D
.. S RETURN(0)=$P(^XTMP("VAFCRAUD"_ICN,LOC,0),"^")
.. D RPCCHK^XWB2HL7(.RESULT,RETURN(0)) I +RESULT(0)=1 D
... D RTNDATA^XWBDRPC(.RET,RETURN(0))
... I $G(RET(0))<0 S TXT="No Data Returned Due To: "_$P(RET(0),"^",2,99) S STR=$$SETSTR^VALM1(TXT,STR,2,78) D ADDTMP Q
... I $G(RET)'="",$D(@RET) S GLO=RET F S GLO=$Q(@GLO) Q:$QS(GLO,1)'=$J S TXT=@GLO S STR=$$SETSTR^VALM1(TXT,STR,2,78) D ADDTMP
... S R="" F S R=$O(RET(R)) Q:R="" S TXT=RET(R) S STR=$$SETSTR^VALM1(TXT,STR,2,78) D ADDTMP ;**479
K TFARR,R,L,SL,LOC,TFL,GLO
S VALMCNT=LIN-1
Q
ADDTMP ;
S ^TMP("VAFCRAU",$J,LIN,0)=STR
S ^TMP("VAFCRAU",$J,"IDX",LIN,LIN)=""
S LIN=LIN+1,STR=""
Q
HELP ;
S X="?" D DISP^XQORM1 W !!
Q
EXIT ;
S VALMBCK=""
K ^TMP("VAFCRAU",$J),LIN,X,STR,TXT
S VALMBCK="R"
Q
VAFCRAU ;BHAM/DRI-LIST MANAGER ROUTINE FOR MPI/PD VAFC EXCPT REMOTE AUDIT IN PDR ;3/14/02 11:41
+1 ;;5.3;Registration;**477,479,1015**;Aug 13, 1993;Build 21
+2 ;Reference to RPCCHK^XWB2HL7 supported by IA #3144
+3 ;Reference to RTNDATA^XWBDRPC supported by IA #3149
EN(ICN) ;main entry point for VAFC EXCPT REMOTE AUDIT
+1 DO EN^VALM("VAFC EXCPT REMOTE AUDIT")
+2 QUIT
HDR ;header code
+1 SET VALMHDR(1)="MPI/PD REMOTE AUDIT DATA"
+2 SET VALMHDR(2)=""
+3 QUIT
INIT ;
+1 ;K ^TMP("VAFCRAU",$J)
KILL @VALMAR
+2 IF '$DATA(DFN)
GOTO EXIT
+3 SET LIN=1
SET X=0
SET STR=""
SET TXT=""
+4 SET TXT="-> For Patient "_$PIECE($GET(^DPT(DFN,0)),"^",1)
SET STR=$$SETSTR^VALM1(TXT,STR,2,78)
DO ADDTMP
+5 SET L=0
FOR
SET L=$ORDER(TFARR(L))
IF 'L
QUIT
Begin DoDot:1
+6 SET SL=$PIECE(TFARR(L),"^",1)
+7 SET STATUS=$PIECE(TFL(SL),"^",3)
+8 IF STATUS["Handle"
SET STATUS="Error in Process"
+9 IF '$TEST
IF STATUS["New"
SET STATUS="Request Sent"
+10 IF '$TEST
IF STATUS["Running"
SET STATUS="Awaiting Response"
+11 IF '$TEST
IF STATUS["Done"
SET STATUS="Response Received"
+12 SET TXT=" "_$PIECE(TFL(SL),"^")_" status: ("_STATUS_")"
+13 DO ADDTMP
+14 SET STR=$$SETSTR^VALM1(TXT,STR,2,78)
DO ADDTMP
Begin DoDot:2
End DoDot:2
+15 SET LOC=$PIECE(TFL(SL),"^",2)
+16 NEW STATUS,RETURN,RESULT,RET
+17 IF '$DATA(^XTMP("VAFCRAUD"_ICN,0))
SET TXT=" - No audit query exists for this patient."
SET STR=$$SETSTR^VALM1(TXT,STR,2,78)
DO ADDTMP
+18 IF $DATA(^XTMP("VAFCRAUD"_ICN,LOC,0))
Begin DoDot:2
+19 SET RETURN(0)=$PIECE(^XTMP("VAFCRAUD"_ICN,LOC,0),"^")
+20 DO RPCCHK^XWB2HL7(.RESULT,RETURN(0))
IF +RESULT(0)=1
Begin DoDot:3
+21 DO RTNDATA^XWBDRPC(.RET,RETURN(0))
+22 IF $GET(RET(0))<0
SET TXT="No Data Returned Due To: "_$PIECE(RET(0),"^",2,99)
SET STR=$$SETSTR^VALM1(TXT,STR,2,78)
DO ADDTMP
QUIT
+23 IF $GET(RET)'=""
IF $DATA(@RET)
SET GLO=RET
FOR
SET GLO=$QUERY(@GLO)
IF $QSUBSCRIPT(GLO,1)'=$JOB
QUIT
SET TXT=@GLO
SET STR=$$SETSTR^VALM1(TXT,STR,2,78)
DO ADDTMP
+24 ;**479
SET R=""
FOR
SET R=$ORDER(RET(R))
IF R=""
QUIT
SET TXT=RET(R)
SET STR=$$SETSTR^VALM1(TXT,STR,2,78)
DO ADDTMP
End DoDot:3
End DoDot:2
End DoDot:1
+25 KILL TFARR,R,L,SL,LOC,TFL,GLO
+26 SET VALMCNT=LIN-1
+27 QUIT
ADDTMP ;
+1 SET ^TMP("VAFCRAU",$JOB,LIN,0)=STR
+2 SET ^TMP("VAFCRAU",$JOB,"IDX",LIN,LIN)=""
+3 SET LIN=LIN+1
SET STR=""
+4 QUIT
HELP ;
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
EXIT ;
+1 SET VALMBCK=""
+2 KILL ^TMP("VAFCRAU",$JOB),LIN,X,STR,TXT
+3 SET VALMBCK="R"
+4 QUIT