PSOREJP1 ;BIRM/MFR - Third Party Reject Display Screen ;04/29/05
;;7.0;OUTPATIENT PHARMACY;**148,247,260,281,287,289**;DEC 1997;Build 107
;Reference to File 9002313.93 - BPS NCPDP REJECT CODES supported by IA 4720
;Reference to ^PS(59.7 supported by IA 694
;Reference to ^PSDRUG("AQ" supported by IA 3165
;
EN(RX,REJ,CHANGE) ; Entry point
;
; - DO NOT change the IF logic below as both of them might get executed (intentional)
N FILL,LASTLN,PSOTRIC,PSOCODE,PSOTCODE
S FILL=+$$GET1^DIQ(52.25,REJ_","_RX,5)
S PSOTRIC="",PSOTRIC=$$TRIC(RX,FILL,PSOTRIC),PSOCODE=$$GET1^DIQ(52.25,REJ_","_RX,.01)
S PSOTCODE=0 S:PSOCODE'=79&(PSOCODE'=88)&(PSOTRIC) PSOTCODE=1
I $$CLOSED(RX,REJ) D EN^VALM("PSO REJECT DISPLAY - RESOLVED")
I '$$CLOSED(RX,REJ)&(PSOTCODE) D EN^VALM("PSO REJECT TRICARE")
I '$$CLOSED(RX,REJ)&('PSOTCODE) D EN^VALM("PSO REJECT DISPLAY")
D FULL^VALM1
Q
;
HDR ; - Builds the Header section
N LINE1,LINE2,X
S VALMHDR(1)=$$DVINFO^PSOREJU2(RX,FILL,1),VALMHDR(2)=$$PTINFO^PSOREJU2(RX,1)
S VALMHDR(3)=$$RXINFO^PSOREJP3(RX,FILL,1),VALMHDR(4)=$$RXINFO^PSOREJP3(RX,FILL,2)
Q
;
TRIC(RX,RFL,PSOTRIC) ; - Return 1 for TRICARE or 0 (zero) for not TRICARE
S PSOTRIC="",PSOTRIC=$S(RFL=0&($$GET1^DIQ(52,RX_",",85,"I")="T"):1,$$GET1^DIQ(52.1,RFL_","_RX_",",85,"I")="T":1,1:0)
Q PSOTRIC
;
INIT ; Builds the Body section
N DATA,LINE
I '$D(RFL) S RFL=$$LSTRFL^PSOBPSU1(RX)
S PSOTRIC="",PSOTRIC=$$TRIC(RX,RFL,PSOTRIC)
F I=1:1:$G(LASTLN) D RESTORE^VALM10(I)
K ^TMP("PSOREJP1",$J) S VALMCNT=0,LINE=0
D GET^PSOREJU2(RX,FILL,.DATA,REJ,1)
D REJ ; Display the REJECT Information
D OTH ; Display the Other Rejects Information
D COM^PSOREJP3 ; Display the Comment
D INS ; Display the Insurance Information
D CLS ; Display the Resolution Information
S VALMCNT=LINE
Q
;
REJ ; - DUR Information
N TYPE,PFLDT,TREJ,TDATA,PSOTRIC S TDATA=""
S PSOTRIC="",PSOTRIC=$$TRIC(RX,FILL,PSOTRIC)
I $G(PSOTRIC) D
. D SETLN("REJECT Information"_$S($G(PSOTRIC):" (TRICARE)",1:""),1,1)
. S TDATA=$$EXP(DATA(REJ,"CODE"))_" ("_$G(DATA(REJ,"CODE"))_") "
. D SETLN("Date/Time : "_$$FMTE^XLFDT($G(DATA(REJ,"DATE/TIME"))),,,18)
. D SETLN("Reject(s) : "_TDATA,,,18)
. F I=1:1 Q:'$D(TDATA(I)) D SETLN(" : "_TDATA(I),,,18)
. D SETLN("Status : "_$G(DATA(REJ,"STATUS"))_" - "_$$STATUS^PSOBPSUT(RX,FILL),,,18)
. ;REJDATA(REJ,"OTHER REJECTS"
I '$G(PSOTRIC) D
.D SETLN("REJECT Information",1,1)
.S TYPE=$S($G(DATA(REJ,"CODE"))=79:"79 - REFILL TOO SOON",1:"")
.I TYPE="" S TYPE=DATA(REJ,"CODE")_" - "_$E($$EXP(DATA(REJ,"CODE")),1,23)_"-"
.D SETLN("Reject Type : "_TYPE_" received on "_$$FMTE^XLFDT($G(DATA(REJ,"DATE/TIME"))),,,18)
.D SETLN("Reject Status : "_$G(DATA(REJ,"STATUS")),,,18)
.D SET("PAYER MESSAGE",63)
.D SET("REASON",63)
.S PFLDT=$$FMTE^XLFDT($G(DATA(REJ,"PLAN PREVIOUS FILL DATE")))
.D SET("DUR TEXT",63,$S(PFLDT="":1,1:0))
.I PFLDT'="" D SETLN("Last Fill Date : "_PFLDT_" (from payer)",,1,18)
Q
;
OTH ; - Other Rejects Information
N LST,I,RJC,J,LAST
S LST=$G(DATA(REJ,"OTHER REJECTS")) I LST="" Q
D SETLN()
D SETLN("OTHER REJECTS",1,1)
F I=1:1:$L(LST,",") S RJC=$P(LST,",",I) D
. S LAST=1 F J=(I+1):1:$L(LST,",") I $P(LST,",",J)'="" S LAST=0 Q
. I RJC'="" D SETLN(RJC_" - "_$$EXP(RJC),,$S(LAST:1,1:0),6)
Q
;
INS ; - Insurance Information
D SETLN()
D SETLN("INSURANCE Information",1,1)
D SETLN("Insurance : "_$G(DATA(REJ,"INSURANCE NAME")),,,18)
D SETLN("Contact : "_$G(DATA(REJ,"PLAN CONTACT")),,,18)
D SETLN("Group Name : "_$G(DATA(REJ,"GROUP NAME")),,,18)
D SETLN("Group Number : "_$G(DATA(REJ,"GROUP NUMBER")),,,18)
D SETLN("Cardholder ID : "_$G(DATA(REJ,"CARDHOLDER ID")),,1,18)
Q
;
CLS ; - Resolution Information
N X
I '$$CLOSED(RX,REJ) Q
D SETLN()
D SETLN("RESOLUTION Information",1,1)
D SETLN("Resolved By : "_$G(DATA(REJ,"CLOSED BY")),,,18)
D SETLN("Date/Time : "_$G(DATA(REJ,"CLOSED DATE/TIME")),,,18)
I $G(DATA(REJ,"CLOSE COMMENTS"))'="" D SET("CLOSE COMMENTS",63)
I $G(DATA(REJ,"COD1"))'="" D SETLN("Reason for Svc : "_$$OVRX^PSOREJU1(1,$G(DATA(REJ,"COD1"))),,,18)
I $G(DATA(REJ,"COD2"))'="" D SETLN("Profes. Svc : "_$$OVRX^PSOREJU1(2,$G(DATA(REJ,"COD2"))),,,18)
I $G(DATA(REJ,"COD3"))'="" D SETLN("Result of Svc : "_$$OVRX^PSOREJU1(3,$G(DATA(REJ,"COD3"))),,,18)
I $G(DATA(REJ,"CLA CODE"))'="" D
. N CLAPNTR S CLAPNTR=$$GET1^DIQ(52.25,REJ_","_RX_",",24,"I")
. S X=DATA(REJ,"CLA CODE")_" - "_$$GET1^DIQ(9002313.25,CLAPNTR,".02")
. D SETLN("Clarific. Code : "_X,,,18)
I $G(DATA(REJ,"PRIOR AUTH TYPE"))'="" D
. S X=$$GET1^DIQ(52.25,REJ_","_RX,25,"I")_" - "_(DATA(REJ,"PRIOR AUTH TYPE"))
. D SETLN("Prior Auth.Type: "_X,,,18),SETLN("Prior Auth. # : "_DATA(REJ,"PRIOR AUTH NUMBER"),,,18)
D SETLN("Reason : "_$G(DATA(REJ,"CLOSE REASON")),,1,18)
Q
;
;
SET(FIELD,L,UND) ; Sets the lines for fields that require text wrapping
N TXT,T
S TXT=DATA(REJ,FIELD) I $L(TXT)'>L D SETLN($$LABEL(FIELD)_TXT,,$S($G(UND):1,1:0),80-L) Q
F I=1:1 Q:TXT="" D
. I I=1 D SETLN($$LABEL(FIELD)_$E(TXT,1,L),,,80-L) S TXT=$E(TXT,L+1,999) Q
. S T="",$E(T,81-L)=$E(TXT,1,L) D SETLN(T,,$S($E(TXT,L+1,999)=""&$G(UND):1,1:0),80-L) S TXT=$E(TXT,L+1,999)
Q
;
LABEL(FIELD) ; Sets the label for the field
I FIELD="REASON" Q "Reason : "
I FIELD="PAYER MESSAGE" Q "Payer Message : "
I FIELD="DUR TEXT" Q "DUR Text : "
I FIELD="CLOSE COMMENTS" Q "Comments : "
Q ""
;
VIEW ; - Rx View hidden action
N VALMCNT,TITLE
I $G(PSOBACK) D Q
. S VALMSG="Not available through Backdoor!",VALMBCK="R"
S TITLE=VALM("TITLE")
;
; - DO structure used to avoid losing variables RX,FILL,REJ,LINE,TITLE
DO
. N PSOVDA,DA,PS
. S (PSOVDA,DA)=RX,PS="REJECT"
. N RX,REJ,FILL,LINE,TITLE D DP^PSORXVW
;
S VALMBCK="R",VALM("TITLE")=TITLE
Q
;
EDT ; - Rx Edit hidden action
N VALMCNT,TITLE
I $G(PSOBACK) D Q
. S VALMSG="Not available through Backdoor!",VALMBCK="R"
S TITLE=VALM("TITLE")
;
; - DO structure used to avoid losing variables RX,FILL,REJ,LINE,TITLE
DO
. N PSOSITE,ORN,PSOPAR,PSOLIST
. S PSOSITE=$$RXSITE^PSOBPSUT(RX,FILL),ORN=RX
. S PSOPAR=$G(^PS(59,PSOSITE,1)),PSOLIST(1)=ORN_","
. N RX,REJ,FILL,LINE,TITLE D EPH^PSORXEDT
;
K VALMBCK I $$CLOSED(RX,REJ),$D(PSOSTFLT),PSOSTFLT="U" S CHANGE=1 Q
S VALMBCK="R",VALM("TITLE")=TITLE
Q
;
OVR ; - Override a REJECT action
I $$CLOSED(RX,REJ,1) Q
N COD1,COD2,COD3
D FULL^VALM1 W !
S COD1=$$OVRCOD^PSOREJU1(1,$$GET1^DIQ(52.25,REJ_","_RX,14)) I COD1="^" S VALMBCK="R" Q
S COD2=$$OVRCOD^PSOREJU1(2) I COD2="^" S VALMBCK="R" Q
S COD3=$$OVRCOD^PSOREJU1(3) I COD3="^" S VALMBCK="R" Q
D OVRDSP^PSOREJU1(COD1_"^"_COD2_"^"_COD3)
D SEND^PSOREJP3(COD1,COD2,COD3)
Q
;
RES ; - Re-submit a claim action
I $$CLOSED(RX,REJ,1) Q
D FULL^VALM1 W !
D SEND^PSOREJP3()
Q
;
CLA ; - Submit Clarification Code
N CLA
I $$CLOSED(RX,REJ,1) Q
D FULL^VALM1 W !
S CLA=$$CLA^PSOREJU1() I CLA="^" S VALMBCK="R" Q
W ! D SEND^PSOREJP3(,,,CLA)
Q
;
PA ; - Submit Prior Authorization
N PA
I $$CLOSED(RX,REJ,1) Q
D FULL^VALM1 W !
S PA=$$PA^PSOREJU2() I PA="^" S VALMBCK="R" Q
W ! D SEND^PSOREJP3(,,,,PA)
Q
;
MP ; - Patient Medication Profile
I $G(PSOBACK) D Q
. S VALMSG="Not available through Backdoor!",VALMBCK="R"
N SITE,PATIENT
D FULL^VALM1 W !
S SITE=+$$RXSITE^PSOBPSUT(RX,FILL) S:$G(PSOSITE) SITE=PSOSITE
S PATIENT=+$$GET1^DIQ(52,RX,2,"I")
D LST^PSOPMP0(SITE,PATIENT) S VALMBCK="R"
Q
;
EXIT ;
K ^TMP("PSOREJP1",$J)
Q
;
SETLN(TEXT,REV,UND,HIG) ; Sets a line to be displayed in the Body section
N X
S:$G(TEXT)="" $E(TEXT,80)=""
S:$L(TEXT)>80 TEXT=$E(TEXT,1,80)
S LINE=LINE+1,^TMP("PSOREJP1",$J,LINE,0)=$G(TEXT)
;
I LINE>$G(LASTLN) D SAVE^VALM10(LINE) S LASTLN=LINE
;
I $G(REV) D Q
. D CNTRL^VALM10(LINE,1,$L(TEXT),IORVON,IOINORM)
. I $G(UND) D CNTRL^VALM10(LINE,$L(TEXT)+1,80,IOUON,IOINORM)
I $G(UND) D CNTRL^VALM10(LINE,1,80,IOUON,IOINORM)
I $G(HIG) D
. D CNTRL^VALM10(LINE,HIG,80,IOINHI_$S($G(UND):IOUON,1:""),IOINORM)
Q
HELP ;
Q
;
CLOSED(RX,REJ,MSG) ; Returns whether the REJECT is RESOLVED or NOT
I $$GET1^DIQ(52.25,REJ_","_RX,10,"I") D:$G(MSG) Q 1
. S VALMSG="This Reject is marked resolved!",VALMBCK="R" W $C(7)
Q 0
;
REOPN(RX,REJ) ; Returns whether the REJECT was RE-OPENED or NOT
Q $S($$GET1^DIQ(52.25,REJ_","_RX,23)="":0,1:1)
;
EXP(CODE) ; - Returns the explanation field (.02) for a reject code
; Input: (r) CODE - .01 field (Code) value from file 9002313.93
; Output: .02 field (Explanation) value from file 9002313.93
N DIC,X,Y
S DIC=9002313.93,DIC(0)="Z",X=CODE D ^DIC
Q $P($G(Y(0)),"^",2)
;
OUT(RX) ; - Supported call by outside PROTOCOLs to act on specific REJECTs
N I,RFL,DATA,REJ,PSOBACK,VALMCNT,RXN
I '$D(^XUSEC("PSORPH",DUZ)) D Q
. S VALMSG="PSORPH key required to use the REJ action.",VALMBCK="R"
I $G(PS)="REJECT" D
. S VALMSG="REJ action is not available at this point.",VALMBCK="R"
S PSOBACK=1
S (RFL,I)=0 F I=1:1 Q:'$D(^PSRX(RX,1,I)) S RFL=I
S X=$$FIND^PSOREJUT(RX,RFL,.DATA) S REJ=$O(DATA(""))
I '$G(REJ) S VALMSG="Invalid selection!",VALMBCK="R" Q
D EN(RX,REJ) S VALMBCK="R"
Q
;
PSOREJP1 ;BIRM/MFR - Third Party Reject Display Screen ;04/29/05
+1 ;;7.0;OUTPATIENT PHARMACY;**148,247,260,281,287,289**;DEC 1997;Build 107
+2 ;Reference to File 9002313.93 - BPS NCPDP REJECT CODES supported by IA 4720
+3 ;Reference to ^PS(59.7 supported by IA 694
+4 ;Reference to ^PSDRUG("AQ" supported by IA 3165
+5 ;
EN(RX,REJ,CHANGE) ; Entry point
+1 ;
+2 ; - DO NOT change the IF logic below as both of them might get executed (intentional)
+3 NEW FILL,LASTLN,PSOTRIC,PSOCODE,PSOTCODE
+4 SET FILL=+$$GET1^DIQ(52.25,REJ_","_RX,5)
+5 SET PSOTRIC=""
SET PSOTRIC=$$TRIC(RX,FILL,PSOTRIC)
SET PSOCODE=$$GET1^DIQ(52.25,REJ_","_RX,.01)
+6 SET PSOTCODE=0
IF PSOCODE'=79&(PSOCODE'=88)&(PSOTRIC)
SET PSOTCODE=1
+7 IF $$CLOSED(RX,REJ)
DO EN^VALM("PSO REJECT DISPLAY - RESOLVED")
+8 IF '$$CLOSED(RX,REJ)&(PSOTCODE)
DO EN^VALM("PSO REJECT TRICARE")
+9 IF '$$CLOSED(RX,REJ)&('PSOTCODE)
DO EN^VALM("PSO REJECT DISPLAY")
+10 DO FULL^VALM1
+11 QUIT
+12 ;
HDR ; - Builds the Header section
+1 NEW LINE1,LINE2,X
+2 SET VALMHDR(1)=$$DVINFO^PSOREJU2(RX,FILL,1)
SET VALMHDR(2)=$$PTINFO^PSOREJU2(RX,1)
+3 SET VALMHDR(3)=$$RXINFO^PSOREJP3(RX,FILL,1)
SET VALMHDR(4)=$$RXINFO^PSOREJP3(RX,FILL,2)
+4 QUIT
+5 ;
TRIC(RX,RFL,PSOTRIC) ; - Return 1 for TRICARE or 0 (zero) for not TRICARE
+1 SET PSOTRIC=""
SET PSOTRIC=$SELECT(RFL=0&($$GET1^DIQ(52,RX_",",85,"I")="T"):1,$$GET1^DIQ(52.1,RFL_","_RX_",",85,"I")="T":1,1:0)
+2 QUIT PSOTRIC
+3 ;
INIT ; Builds the Body section
+1 NEW DATA,LINE
+2 IF '$DATA(RFL)
SET RFL=$$LSTRFL^PSOBPSU1(RX)
+3 SET PSOTRIC=""
SET PSOTRIC=$$TRIC(RX,RFL,PSOTRIC)
+4 FOR I=1:1:$GET(LASTLN)
DO RESTORE^VALM10(I)
+5 KILL ^TMP("PSOREJP1",$JOB)
SET VALMCNT=0
SET LINE=0
+6 DO GET^PSOREJU2(RX,FILL,.DATA,REJ,1)
+7 ; Display the REJECT Information
DO REJ
+8 ; Display the Other Rejects Information
DO OTH
+9 ; Display the Comment
DO COM^PSOREJP3
+10 ; Display the Insurance Information
DO INS
+11 ; Display the Resolution Information
DO CLS
+12 SET VALMCNT=LINE
+13 QUIT
+14 ;
REJ ; - DUR Information
+1 NEW TYPE,PFLDT,TREJ,TDATA,PSOTRIC
SET TDATA=""
+2 SET PSOTRIC=""
SET PSOTRIC=$$TRIC(RX,FILL,PSOTRIC)
+3 IF $GET(PSOTRIC)
Begin DoDot:1
+4 DO SETLN("REJECT Information"_$SELECT($GET(PSOTRIC):" (TRICARE)",1:""),1,1)
+5 SET TDATA=$$EXP(DATA(REJ,"CODE"))_" ("_$GET(DATA(REJ,"CODE"))_") "
+6 DO SETLN("Date/Time : "_$$FMTE^XLFDT($GET(DATA(REJ,"DATE/TIME"))),,,18)
+7 DO SETLN("Reject(s) : "_TDATA,,,18)
+8 FOR I=1:1
IF '$DATA(TDATA(I))
QUIT
DO SETLN(" : "_TDATA(I),,,18)
+9 DO SETLN("Status : "_$GET(DATA(REJ,"STATUS"))_" - "_$$STATUS^PSOBPSUT(RX,FILL),,,18)
+10 ;REJDATA(REJ,"OTHER REJECTS"
End DoDot:1
+11 IF '$GET(PSOTRIC)
Begin DoDot:1
+12 DO SETLN("REJECT Information",1,1)
+13 SET TYPE=$SELECT($GET(DATA(REJ,"CODE"))=79:"79 - REFILL TOO SOON",1:"")
+14 IF TYPE=""
SET TYPE=DATA(REJ,"CODE")_" - "_$EXTRACT($$EXP(DATA(REJ,"CODE")),1,23)_"-"
+15 DO SETLN("Reject Type : "_TYPE_" received on "_$$FMTE^XLFDT($GET(DATA(REJ,"DATE/TIME"))),,,18)
+16 DO SETLN("Reject Status : "_$GET(DATA(REJ,"STATUS")),,,18)
+17 DO SET("PAYER MESSAGE",63)
+18 DO SET("REASON",63)
+19 SET PFLDT=$$FMTE^XLFDT($GET(DATA(REJ,"PLAN PREVIOUS FILL DATE")))
+20 DO SET("DUR TEXT",63,$SELECT(PFLDT="":1,1:0))
+21 IF PFLDT'=""
DO SETLN("Last Fill Date : "_PFLDT_" (from payer)",,1,18)
End DoDot:1
+22 QUIT
+23 ;
OTH ; - Other Rejects Information
+1 NEW LST,I,RJC,J,LAST
+2 SET LST=$GET(DATA(REJ,"OTHER REJECTS"))
IF LST=""
QUIT
+3 DO SETLN()
+4 DO SETLN("OTHER REJECTS",1,1)
+5 FOR I=1:1:$LENGTH(LST,",")
SET RJC=$PIECE(LST,",",I)
Begin DoDot:1
+6 SET LAST=1
FOR J=(I+1):1:$LENGTH(LST,",")
IF $PIECE(LST,",",J)'=""
SET LAST=0
QUIT
+7 IF RJC'=""
DO SETLN(RJC_" - "_$$EXP(RJC),,$SELECT(LAST:1,1:0),6)
End DoDot:1
+8 QUIT
+9 ;
INS ; - Insurance Information
+1 DO SETLN()
+2 DO SETLN("INSURANCE Information",1,1)
+3 DO SETLN("Insurance : "_$GET(DATA(REJ,"INSURANCE NAME")),,,18)
+4 DO SETLN("Contact : "_$GET(DATA(REJ,"PLAN CONTACT")),,,18)
+5 DO SETLN("Group Name : "_$GET(DATA(REJ,"GROUP NAME")),,,18)
+6 DO SETLN("Group Number : "_$GET(DATA(REJ,"GROUP NUMBER")),,,18)
+7 DO SETLN("Cardholder ID : "_$GET(DATA(REJ,"CARDHOLDER ID")),,1,18)
+8 QUIT
+9 ;
CLS ; - Resolution Information
+1 NEW X
+2 IF '$$CLOSED(RX,REJ)
QUIT
+3 DO SETLN()
+4 DO SETLN("RESOLUTION Information",1,1)
+5 DO SETLN("Resolved By : "_$GET(DATA(REJ,"CLOSED BY")),,,18)
+6 DO SETLN("Date/Time : "_$GET(DATA(REJ,"CLOSED DATE/TIME")),,,18)
+7 IF $GET(DATA(REJ,"CLOSE COMMENTS"))'=""
DO SET("CLOSE COMMENTS",63)
+8 IF $GET(DATA(REJ,"COD1"))'=""
DO SETLN("Reason for Svc : "_$$OVRX^PSOREJU1(1,$GET(DATA(REJ,"COD1"))),,,18)
+9 IF $GET(DATA(REJ,"COD2"))'=""
DO SETLN("Profes. Svc : "_$$OVRX^PSOREJU1(2,$GET(DATA(REJ,"COD2"))),,,18)
+10 IF $GET(DATA(REJ,"COD3"))'=""
DO SETLN("Result of Svc : "_$$OVRX^PSOREJU1(3,$GET(DATA(REJ,"COD3"))),,,18)
+11 IF $GET(DATA(REJ,"CLA CODE"))'=""
Begin DoDot:1
+12 NEW CLAPNTR
SET CLAPNTR=$$GET1^DIQ(52.25,REJ_","_RX_",",24,"I")
+13 SET X=DATA(REJ,"CLA CODE")_" - "_$$GET1^DIQ(9002313.25,CLAPNTR,".02")
+14 DO SETLN("Clarific. Code : "_X,,,18)
End DoDot:1
+15 IF $GET(DATA(REJ,"PRIOR AUTH TYPE"))'=""
Begin DoDot:1
+16 SET X=$$GET1^DIQ(52.25,REJ_","_RX,25,"I")_" - "_(DATA(REJ,"PRIOR AUTH TYPE"))
+17 DO SETLN("Prior Auth.Type: "_X,,,18)
DO SETLN("Prior Auth. # : "_DATA(REJ,"PRIOR AUTH NUMBER"),,,18)
End DoDot:1
+18 DO SETLN("Reason : "_$GET(DATA(REJ,"CLOSE REASON")),,1,18)
+19 QUIT
+20 ;
+21 ;
SET(FIELD,L,UND) ; Sets the lines for fields that require text wrapping
+1 NEW TXT,T
+2 SET TXT=DATA(REJ,FIELD)
IF $LENGTH(TXT)'>L
DO SETLN($$LABEL(FIELD)_TXT,,$SELECT($GET(UND):1,1:0),80-L)
QUIT
+3 FOR I=1:1
IF TXT=""
QUIT
Begin DoDot:1
+4 IF I=1
DO SETLN($$LABEL(FIELD)_$EXTRACT(TXT,1,L),,,80-L)
SET TXT=$EXTRACT(TXT,L+1,999)
QUIT
+5 SET T=""
SET $EXTRACT(T,81-L)=$EXTRACT(TXT,1,L)
DO SETLN(T,,$SELECT($EXTRACT(TXT,L+1,999)=""&$GET(UND):1,1:0),80-L)
SET TXT=$EXTRACT(TXT,L+1,999)
End DoDot:1
+6 QUIT
+7 ;
LABEL(FIELD) ; Sets the label for the field
+1 IF FIELD="REASON"
QUIT "Reason : "
+2 IF FIELD="PAYER MESSAGE"
QUIT "Payer Message : "
+3 IF FIELD="DUR TEXT"
QUIT "DUR Text : "
+4 IF FIELD="CLOSE COMMENTS"
QUIT "Comments : "
+5 QUIT ""
+6 ;
VIEW ; - Rx View hidden action
+1 NEW VALMCNT,TITLE
+2 IF $GET(PSOBACK)
Begin DoDot:1
+3 SET VALMSG="Not available through Backdoor!"
SET VALMBCK="R"
End DoDot:1
QUIT
+4 SET TITLE=VALM("TITLE")
+5 ;
+6 ; - DO structure used to avoid losing variables RX,FILL,REJ,LINE,TITLE
+7 Begin DoDot:1
+8 NEW PSOVDA,DA,PS
+9 SET (PSOVDA,DA)=RX
SET PS="REJECT"
+10 NEW RX,REJ,FILL,LINE,TITLE
DO DP^PSORXVW
End DoDot:1
+11 ;
+12 SET VALMBCK="R"
SET VALM("TITLE")=TITLE
+13 QUIT
+14 ;
EDT ; - Rx Edit hidden action
+1 NEW VALMCNT,TITLE
+2 IF $GET(PSOBACK)
Begin DoDot:1
+3 SET VALMSG="Not available through Backdoor!"
SET VALMBCK="R"
End DoDot:1
QUIT
+4 SET TITLE=VALM("TITLE")
+5 ;
+6 ; - DO structure used to avoid losing variables RX,FILL,REJ,LINE,TITLE
+7 Begin DoDot:1
+8 NEW PSOSITE,ORN,PSOPAR,PSOLIST
+9 SET PSOSITE=$$RXSITE^PSOBPSUT(RX,FILL)
SET ORN=RX
+10 SET PSOPAR=$GET(^PS(59,PSOSITE,1))
SET PSOLIST(1)=ORN_","
+11 NEW RX,REJ,FILL,LINE,TITLE
DO EPH^PSORXEDT
End DoDot:1
+12 ;
+13 KILL VALMBCK
IF $$CLOSED(RX,REJ)
IF $DATA(PSOSTFLT)
IF PSOSTFLT="U"
SET CHANGE=1
QUIT
+14 SET VALMBCK="R"
SET VALM("TITLE")=TITLE
+15 QUIT
+16 ;
OVR ; - Override a REJECT action
+1 IF $$CLOSED(RX,REJ,1)
QUIT
+2 NEW COD1,COD2,COD3
+3 DO FULL^VALM1
WRITE !
+4 SET COD1=$$OVRCOD^PSOREJU1(1,$$GET1^DIQ(52.25,REJ_","_RX,14))
IF COD1="^"
SET VALMBCK="R"
QUIT
+5 SET COD2=$$OVRCOD^PSOREJU1(2)
IF COD2="^"
SET VALMBCK="R"
QUIT
+6 SET COD3=$$OVRCOD^PSOREJU1(3)
IF COD3="^"
SET VALMBCK="R"
QUIT
+7 DO OVRDSP^PSOREJU1(COD1_"^"_COD2_"^"_COD3)
+8 DO SEND^PSOREJP3(COD1,COD2,COD3)
+9 QUIT
+10 ;
RES ; - Re-submit a claim action
+1 IF $$CLOSED(RX,REJ,1)
QUIT
+2 DO FULL^VALM1
WRITE !
+3 DO SEND^PSOREJP3()
+4 QUIT
+5 ;
CLA ; - Submit Clarification Code
+1 NEW CLA
+2 IF $$CLOSED(RX,REJ,1)
QUIT
+3 DO FULL^VALM1
WRITE !
+4 SET CLA=$$CLA^PSOREJU1()
IF CLA="^"
SET VALMBCK="R"
QUIT
+5 WRITE !
DO SEND^PSOREJP3(,,,CLA)
+6 QUIT
+7 ;
PA ; - Submit Prior Authorization
+1 NEW PA
+2 IF $$CLOSED(RX,REJ,1)
QUIT
+3 DO FULL^VALM1
WRITE !
+4 SET PA=$$PA^PSOREJU2()
IF PA="^"
SET VALMBCK="R"
QUIT
+5 WRITE !
DO SEND^PSOREJP3(,,,,PA)
+6 QUIT
+7 ;
MP ; - Patient Medication Profile
+1 IF $GET(PSOBACK)
Begin DoDot:1
+2 SET VALMSG="Not available through Backdoor!"
SET VALMBCK="R"
End DoDot:1
QUIT
+3 NEW SITE,PATIENT
+4 DO FULL^VALM1
WRITE !
+5 SET SITE=+$$RXSITE^PSOBPSUT(RX,FILL)
IF $GET(PSOSITE)
SET SITE=PSOSITE
+6 SET PATIENT=+$$GET1^DIQ(52,RX,2,"I")
+7 DO LST^PSOPMP0(SITE,PATIENT)
SET VALMBCK="R"
+8 QUIT
+9 ;
EXIT ;
+1 KILL ^TMP("PSOREJP1",$JOB)
+2 QUIT
+3 ;
SETLN(TEXT,REV,UND,HIG) ; Sets a line to be displayed in the Body section
+1 NEW X
+2 IF $GET(TEXT)=""
SET $EXTRACT(TEXT,80)=""
+3 IF $LENGTH(TEXT)>80
SET TEXT=$EXTRACT(TEXT,1,80)
+4 SET LINE=LINE+1
SET ^TMP("PSOREJP1",$JOB,LINE,0)=$GET(TEXT)
+5 ;
+6 IF LINE>$GET(LASTLN)
DO SAVE^VALM10(LINE)
SET LASTLN=LINE
+7 ;
+8 IF $GET(REV)
Begin DoDot:1
+9 DO CNTRL^VALM10(LINE,1,$LENGTH(TEXT),IORVON,IOINORM)
+10 IF $GET(UND)
DO CNTRL^VALM10(LINE,$LENGTH(TEXT)+1,80,IOUON,IOINORM)
End DoDot:1
QUIT
+11 IF $GET(UND)
DO CNTRL^VALM10(LINE,1,80,IOUON,IOINORM)
+12 IF $GET(HIG)
Begin DoDot:1
+13 DO CNTRL^VALM10(LINE,HIG,80,IOINHI_$SELECT($GET(UND):IOUON,1:""),IOINORM)
End DoDot:1
+14 QUIT
HELP ;
+1 QUIT
+2 ;
CLOSED(RX,REJ,MSG) ; Returns whether the REJECT is RESOLVED or NOT
+1 IF $$GET1^DIQ(52.25,REJ_","_RX,10,"I")
IF $GET(MSG)
Begin DoDot:1
+2 SET VALMSG="This Reject is marked resolved!"
SET VALMBCK="R"
WRITE $CHAR(7)
End DoDot:1
QUIT 1
+3 QUIT 0
+4 ;
REOPN(RX,REJ) ; Returns whether the REJECT was RE-OPENED or NOT
+1 QUIT $SELECT($$GET1^DIQ(52.25,REJ_","_RX,23)="":0,1:1)
+2 ;
EXP(CODE) ; - Returns the explanation field (.02) for a reject code
+1 ; Input: (r) CODE - .01 field (Code) value from file 9002313.93
+2 ; Output: .02 field (Explanation) value from file 9002313.93
+3 NEW DIC,X,Y
+4 SET DIC=9002313.93
SET DIC(0)="Z"
SET X=CODE
DO ^DIC
+5 QUIT $PIECE($GET(Y(0)),"^",2)
+6 ;
OUT(RX) ; - Supported call by outside PROTOCOLs to act on specific REJECTs
+1 NEW I,RFL,DATA,REJ,PSOBACK,VALMCNT,RXN
+2 IF '$DATA(^XUSEC("PSORPH",DUZ))
Begin DoDot:1
+3 SET VALMSG="PSORPH key required to use the REJ action."
SET VALMBCK="R"
End DoDot:1
QUIT
+4 IF $GET(PS)="REJECT"
Begin DoDot:1
+5 SET VALMSG="REJ action is not available at this point."
SET VALMBCK="R"
End DoDot:1
+6 SET PSOBACK=1
+7 SET (RFL,I)=0
FOR I=1:1
IF '$DATA(^PSRX(RX,1,I))
QUIT
SET RFL=I
+8 SET X=$$FIND^PSOREJUT(RX,RFL,.DATA)
SET REJ=$ORDER(DATA(""))
+9 IF '$GET(REJ)
SET VALMSG="Invalid selection!"
SET VALMBCK="R"
QUIT
+10 DO EN(RX,REJ)
SET VALMBCK="R"
+11 QUIT
+12 ;