PSOREJP4 ;BP/CMF - Pharmacy Rejects List Mail message
;;7.0;OUTPATIENT PHARMACY;**289**;DEC 1997;Build 107
;; use of ^VADPT supported by IA#10061
;@author - Chris Flegel
;@date - August 18, 2008
;@version - 1.0
Q
EN ; entry point for background option
N RESULT,C
S RESULT=0
D BEGIN
I +$$LOAD() D SORT S RESULT=$$MAIL()
D END
Q
;;
BEGIN ;
K ^TMP($J,"PSOREJP4")
Q
;;
END ;
K ^TMP($J,"PSOREJP4")
Q
;;
BUFDATE(DIVISION) ;
Q:'$G(DIVISION) ""
N RXDIVBUF,CUTDT
D:'$D(^TMP($J,"PSOREJP4","DIVISION",DIVISION))
.S RXDIVBUF=$$GET1^DIQ(52.86,DIVISION,4)
.S ^TMP($J,"PSOREJP4","DIVISION",DIVISION)=RXDIVBUF
S RXDIVBUF=+^TMP($J,"PSOREJP4","DIVISION",DIVISION)
S RXDIVBUF=$S(RXDIVBUF=""!(RXDIVBUF<1):5,1:RXDIVBUF)
S X1=DT,X2=-RXDIVBUF D C^%DTC S CUTDT=X
Q CUTDT
;
LOAD() ;;
N RXIEN,REJECT,BUFDATE,REJDATE,COMDATE,DIVISION,COUNT,RXSTAT,RXDIV
S COUNT=0
S RXIEN=0
F S RXIEN=$O(^PSRX("REJSTS",0,RXIEN)) Q:'RXIEN D
.S REJECT=0
.F S REJECT=$O(^PSRX("REJSTS",0,RXIEN,REJECT)) Q:'REJECT D
..S RXSTAT=$$GET1^DIQ(52,RXIEN,100,"I") Q:",10,12,13,14,15,"[(","_RXSTAT_",") ;quit unless active
..S RXDIV=$$GET1^DIQ(52,RXIEN,20,"I"),DIVISION="",DIVISION=$O(^PS(52.86,"B",RXDIV,DIVISION))
..Q:'DIVISION
..S BUFDATE=$$BUFDATE(DIVISION)
..S REJDATE=$P(^PSRX(RXIEN,"REJ",REJECT,0),U,2),REJDATE=$P(REJDATE,".")
..Q:REJDATE>BUFDATE ;;quit if reject date is newer than the cutoff date
..S COMDATE=""
..I $D(^PSRX(RXIEN,"REJ",REJECT,"COM")) S COMDATE=$O(^PSRX(RXIEN,"REJ",REJECT,"COM","B",COMDATE),-1),COMDATE=$P(COMDATE,".") ;Get the last comments date
..;S COMDATE=$O(^PSRX(RXIEN,"REJ",REJECT,"COM","B",BUFDATE))
..Q:COMDATE>BUFDATE ;don't put on the list if comment was defined after cutoff date
..S ^TMP($J,"PSOREJP4",DIVISION,RXIEN,REJECT)=RXSTAT
..S COUNT=COUNT+1
Q COUNT
;;
SORT ;;
N DIVISION,RXIEN,RX,DRUGNAME,PATNAME,PATSSN,PATLAST4,REJECT,DFN,RXSTAT
N ENTRYNUM,SORT,OUT,I,J,LINE,II,COMM1,COMM2
K ^UTILITY($J,"W")
S (DIVISION,ENTRYNUM)=0
F S DIVISION=$O(^TMP($J,"PSOREJP4",DIVISION)) Q:+DIVISION=0 D
.S RXIEN=0
.F S RXIEN=$O(^TMP($J,"PSOREJP4",DIVISION,RXIEN)) Q:+RXIEN=0 D
..S REJECT=0
..F S REJECT=$O(^TMP($J,"PSOREJP4",DIVISION,RXIEN,REJECT)) Q:'REJECT D
...S DFN=$$GET1^DIQ(52,RXIEN,2,"I")
...S RXSTAT=$$GET1^DIQ(52,RXIEN,100)
...N VA,VADM,VAERR,SORT,OUT
...N RXIENS,REJIENS,REFIENS,RXNUM,RXFILL,I
...N FILLDATE,REJDATE,DETCDATE,RSNCODE,RSNTEXT
...D DEM^VADPT
...Q:+$G(VAERR)
...S PATNAME=VADM(1)
...S PATSSN=VA("PID")
...S PATLAST4=VA("BID")
...S SORT=PATNAME_U_PATSSN_U
...S RXNUM=$$GET1^DIQ(52,RXIEN,.01)
...S REJIENS=REJECT_","_RXIEN_","
...S RXFILL=$$GET1^DIQ(52.25,REJIENS,5)
...S SORT=SORT_RXNUM_U_(999-RXFILL)_U_(999-REJECT)
...S OUT=""
...S OUT=OUT_$$LJ^XLFSTR(RXNUM_"/"_RXFILL,13)
...S PATNAME=$E(PATNAME,1,12)_"("_PATLAST4_")"
...S PATNAME=$E(PATNAME,1,18)
...S OUT=OUT_$$LJ^XLFSTR(PATNAME,20)
...S DRUGNAME=$$GET1^DIQ(52,RXIEN,6)
...S DRUGNAME=$E(DRUGNAME,1,22)
...S OUT=OUT_$$LJ^XLFSTR(DRUGNAME,24)
...S REFIENS=RXFILL_","_RXIEN_","
...S FILLDATE=$S(RXFILL=0:$$GET1^DIQ(52,RXIEN,22,"I"),1:$$GET1^DIQ(52.1,REFIENS,.01,"I"))
...S FILLDATE=$$FMTE^XLFDT(FILLDATE,2)
...S OUT=OUT_$$LJ^XLFSTR(FILLDATE,10)
...S DETCDATE=$P($$GET1^DIQ(52.25,REJIENS,1,"I"),".")
...S DETCDATE=$$FMTE^XLFDT(DETCDATE,2)
...S OUT=OUT_$$LJ^XLFSTR(DETCDATE,8)
...S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,0)=RXIEN_U_REJECT
...S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,1)=OUT
...S OUT=" Rx Status: "_RXSTAT
...S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,2)=OUT
...S RSNCODE=$$GET1^DIQ(52.25,REJIENS,.01)
...S OUT=" Reason: "_RSNCODE
...S RSNCODE=$$FIND1^DIC(9002313.93,,,RSNCODE)
...S RSNTEXT=$$GET1^DIQ(9002313.93,RSNCODE_",",.02,"E")
...S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,3)=OUT_" :"_RSNTEXT
...S LINE=3
...D:$D(^PSRX(RXIEN,"REJ",REJECT,"COM"))
....N DIWL,DIWR,X
....S LINE=LINE+1,COMM1=1
....S II=0
....F S II=$O(^PSRX(RXIEN,"REJ",REJECT,"COM",II)) Q:'II D
.....N COMIENS,COMDATE,COMUSER,COMTEXT,TXT
.....S DIWL=1,DIWR=60
.....K ^UTILITY($J,"W")
.....S COMIENS=II_","_REJECT_","_RXIEN_","
.....S COMDATE=$$GET1^DIQ(52.2551,COMIENS,.01)
.....S X=COMDATE
.....S COMTEXT=$$GET1^DIQ(52.2551,COMIENS,2)
.....S X=X_" - "_COMTEXT
.....S COMUSER=$$GET1^DIQ(52.2551,COMIENS,1)
.....S X=X_" ("_COMUSER_")"
.....D ^DIWP
.....S COMM2=0
.....F J=1:1 Q:'$D(^UTILITY($J,"W",1,J,0)) D
......S TXT=^UTILITY($J,"W",1,J,0),COMM2=COMM2+1
......I COMM1=1 S OUT=" COMMENTS: -"_TXT
......E S OUT=" "_$S(COMM2=1:"-",1:"")_TXT
......S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,LINE)=OUT
......S LINE=LINE+1,(COMM2,COMM1)=COMM1+1
.....K ^UTILITY($J,"W")
...S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,LINE+1)=""
;derive entry number for message
S DIVISION=0
F S DIVISION=$O(^TMP($J,"PSOREJP4",DIVISION)) Q:+DIVISION=0 D
.S SORT=""
.S ENTRYNUM=0
.F S SORT=$O(^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT)) Q:SORT']"" D
..S ENTRYNUM=ENTRYNUM+1
..S OUT=^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,1)
..S ^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,1)=$$RJ^XLFSTR(ENTRYNUM,3)_" "_OUT
;;
MAIL() ;;
N DIVISION,RESULT,COUNT,REJECT,I,SORT,COUNT
S (DIVISION,RESULT)=0
F S DIVISION=$O(^TMP($J,"PSOREJP4",DIVISION)) Q:+DIVISION=0 D
.N XMSUB,XMDUZ,XMTEXT,XMY
.S XMSUB="ePharmacy - OPEN/UNRESOLVED REJECTS LIST for "_$$GET1^DIQ(52.86,DIVISION,.01)
.S XMDUZ="OUTPATIENT PHARMACY PACKAGE"
.S XMTEXT="^TMP($J,""PSOREJP4"",""MESSAGE"","
.S XMY("G.PSO REJECTS BACKGROUND MESSAGE")=""
.K ^TMP($J,"PSOREJP4","MESSAGE")
.S ^TMP($J,"PSOREJP4","MESSAGE",1)="The prescriptions listed below are third party electronically billable and can"
.S ^TMP($J,"PSOREJP4","MESSAGE",2)="not be filled until the rejection is resolved. No action to resolve the"
.S ^TMP($J,"PSOREJP4","MESSAGE",3)="rejection has taken place within the past "_^TMP($J,"PSOREJP4","DIVISION",DIVISION)_" days."
.S ^TMP($J,"PSOREJP4","MESSAGE",4)=""
.S ^TMP($J,"PSOREJP4","MESSAGE",5)="Please use the THIRD PARTY PAYER REJECTS WORKLIST option to resolve the"
.S ^TMP($J,"PSOREJP4","MESSAGE",6)="rejection or add a comment to the rejection."
.S ^TMP($J,"PSOREJP4","MESSAGE",7)=""
.S ^TMP($J,"PSOREJP4","MESSAGE",8)="Unresolved rejects will not be sent to CMOP or the local print queue for"
.S ^TMP($J,"PSOREJP4","MESSAGE",9)="filling. They will continue to show on the rejects list until acted upon."
.S ^TMP($J,"PSOREJP4","MESSAGE",10)=""
.S ^TMP($J,"PSOREJP4","MESSAGE",11)=" FILL REJECT"
.S ^TMP($J,"PSOREJP4","MESSAGE",12)=" # RX/FILL PATIENT(ID) DRUG DATE DATE"
.S ^TMP($J,"PSOREJP4","MESSAGE",13)="------------------------------------------------------------------------------"
.S COUNT=14
.S SORT=""
.F S SORT=$O(^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT)) Q:SORT']"" D
..S I=0
..F S I=$O(^TMP($J,"PSOREJP4",DIVISION,"SORT",SORT,I)) Q:'I S COUNT=COUNT+1,^TMP($J,"PSOREJP4","MESSAGE",COUNT)=^(I) D
.D ^XMD
.S:+$G(XMZ) RESULT=XMZ
Q RESULT
PSOREJP4 ;BP/CMF - Pharmacy Rejects List Mail message
+1 ;;7.0;OUTPATIENT PHARMACY;**289**;DEC 1997;Build 107
+2 ;; use of ^VADPT supported by IA#10061
+3 ;@author - Chris Flegel
+4 ;@date - August 18, 2008
+5 ;@version - 1.0
+6 QUIT
EN ; entry point for background option
+1 NEW RESULT,C
+2 SET RESULT=0
+3 DO BEGIN
+4 IF +$$LOAD()
DO SORT
SET RESULT=$$MAIL()
+5 DO END
+6 QUIT
+7 ;;
BEGIN ;
+1 KILL ^TMP($JOB,"PSOREJP4")
+2 QUIT
+3 ;;
END ;
+1 KILL ^TMP($JOB,"PSOREJP4")
+2 QUIT
+3 ;;
BUFDATE(DIVISION) ;
+1 IF '$GET(DIVISION)
QUIT ""
+2 NEW RXDIVBUF,CUTDT
+3 IF '$DATA(^TMP($JOB,"PSOREJP4","DIVISION",DIVISION))
Begin DoDot:1
+4 SET RXDIVBUF=$$GET1^DIQ(52.86,DIVISION,4)
+5 SET ^TMP($JOB,"PSOREJP4","DIVISION",DIVISION)=RXDIVBUF
End DoDot:1
+6 SET RXDIVBUF=+^TMP($JOB,"PSOREJP4","DIVISION",DIVISION)
+7 SET RXDIVBUF=$SELECT(RXDIVBUF=""!(RXDIVBUF<1):5,1:RXDIVBUF)
+8 SET X1=DT
SET X2=-RXDIVBUF
DO C^%DTC
SET CUTDT=X
+9 QUIT CUTDT
+10 ;
LOAD() ;;
+1 NEW RXIEN,REJECT,BUFDATE,REJDATE,COMDATE,DIVISION,COUNT,RXSTAT,RXDIV
+2 SET COUNT=0
+3 SET RXIEN=0
+4 FOR
SET RXIEN=$ORDER(^PSRX("REJSTS",0,RXIEN))
IF 'RXIEN
QUIT
Begin DoDot:1
+5 SET REJECT=0
+6 FOR
SET REJECT=$ORDER(^PSRX("REJSTS",0,RXIEN,REJECT))
IF 'REJECT
QUIT
Begin DoDot:2
+7 ;quit unless active
SET RXSTAT=$$GET1^DIQ(52,RXIEN,100,"I")
IF ",10,12,13,14,15,"[(","_RXSTAT_",")
QUIT
+8 SET RXDIV=$$GET1^DIQ(52,RXIEN,20,"I")
SET DIVISION=""
SET DIVISION=$ORDER(^PS(52.86,"B",RXDIV,DIVISION))
+9 IF 'DIVISION
QUIT
+10 SET BUFDATE=$$BUFDATE(DIVISION)
+11 SET REJDATE=$PIECE(^PSRX(RXIEN,"REJ",REJECT,0),U,2)
SET REJDATE=$PIECE(REJDATE,".")
+12 ;;quit if reject date is newer than the cutoff date
IF REJDATE>BUFDATE
QUIT
+13 SET COMDATE=""
+14 ;Get the last comments date
IF $DATA(^PSRX(RXIEN,"REJ",REJECT,"COM"))
SET COMDATE=$ORDER(^PSRX(RXIEN,"REJ",REJECT,"COM","B",COMDATE),-1)
SET COMDATE=$PIECE(COMDATE,".")
+15 ;S COMDATE=$O(^PSRX(RXIEN,"REJ",REJECT,"COM","B",BUFDATE))
+16 ;don't put on the list if comment was defined after cutoff date
IF COMDATE>BUFDATE
QUIT
+17 SET ^TMP($JOB,"PSOREJP4",DIVISION,RXIEN,REJECT)=RXSTAT
+18 SET COUNT=COUNT+1
End DoDot:2
End DoDot:1
+19 QUIT COUNT
+20 ;;
SORT ;;
+1 NEW DIVISION,RXIEN,RX,DRUGNAME,PATNAME,PATSSN,PATLAST4,REJECT,DFN,RXSTAT
+2 NEW ENTRYNUM,SORT,OUT,I,J,LINE,II,COMM1,COMM2
+3 KILL ^UTILITY($JOB,"W")
+4 SET (DIVISION,ENTRYNUM)=0
+5 FOR
SET DIVISION=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION))
IF +DIVISION=0
QUIT
Begin DoDot:1
+6 SET RXIEN=0
+7 FOR
SET RXIEN=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION,RXIEN))
IF +RXIEN=0
QUIT
Begin DoDot:2
+8 SET REJECT=0
+9 FOR
SET REJECT=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION,RXIEN,REJECT))
IF 'REJECT
QUIT
Begin DoDot:3
+10 SET DFN=$$GET1^DIQ(52,RXIEN,2,"I")
+11 SET RXSTAT=$$GET1^DIQ(52,RXIEN,100)
+12 NEW VA,VADM,VAERR,SORT,OUT
+13 NEW RXIENS,REJIENS,REFIENS,RXNUM,RXFILL,I
+14 NEW FILLDATE,REJDATE,DETCDATE,RSNCODE,RSNTEXT
+15 DO DEM^VADPT
+16 IF +$GET(VAERR)
QUIT
+17 SET PATNAME=VADM(1)
+18 SET PATSSN=VA("PID")
+19 SET PATLAST4=VA("BID")
+20 SET SORT=PATNAME_U_PATSSN_U
+21 SET RXNUM=$$GET1^DIQ(52,RXIEN,.01)
+22 SET REJIENS=REJECT_","_RXIEN_","
+23 SET RXFILL=$$GET1^DIQ(52.25,REJIENS,5)
+24 SET SORT=SORT_RXNUM_U_(999-RXFILL)_U_(999-REJECT)
+25 SET OUT=""
+26 SET OUT=OUT_$$LJ^XLFSTR(RXNUM_"/"_RXFILL,13)
+27 SET PATNAME=$EXTRACT(PATNAME,1,12)_"("_PATLAST4_")"
+28 SET PATNAME=$EXTRACT(PATNAME,1,18)
+29 SET OUT=OUT_$$LJ^XLFSTR(PATNAME,20)
+30 SET DRUGNAME=$$GET1^DIQ(52,RXIEN,6)
+31 SET DRUGNAME=$EXTRACT(DRUGNAME,1,22)
+32 SET OUT=OUT_$$LJ^XLFSTR(DRUGNAME,24)
+33 SET REFIENS=RXFILL_","_RXIEN_","
+34 SET FILLDATE=$SELECT(RXFILL=0:$$GET1^DIQ(52,RXIEN,22,"I"),1:$$GET1^DIQ(52.1,REFIENS,.01,"I"))
+35 SET FILLDATE=$$FMTE^XLFDT(FILLDATE,2)
+36 SET OUT=OUT_$$LJ^XLFSTR(FILLDATE,10)
+37 SET DETCDATE=$PIECE($$GET1^DIQ(52.25,REJIENS,1,"I"),".")
+38 SET DETCDATE=$$FMTE^XLFDT(DETCDATE,2)
+39 SET OUT=OUT_$$LJ^XLFSTR(DETCDATE,8)
+40 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,0)=RXIEN_U_REJECT
+41 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,1)=OUT
+42 SET OUT=" Rx Status: "_RXSTAT
+43 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,2)=OUT
+44 SET RSNCODE=$$GET1^DIQ(52.25,REJIENS,.01)
+45 SET OUT=" Reason: "_RSNCODE
+46 SET RSNCODE=$$FIND1^DIC(9002313.93,,,RSNCODE)
+47 SET RSNTEXT=$$GET1^DIQ(9002313.93,RSNCODE_",",.02,"E")
+48 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,3)=OUT_" :"_RSNTEXT
+49 SET LINE=3
+50 IF $DATA(^PSRX(RXIEN,"REJ",REJECT,"COM"))
Begin DoDot:4
+51 NEW DIWL,DIWR,X
+52 SET LINE=LINE+1
SET COMM1=1
+53 SET II=0
+54 FOR
SET II=$ORDER(^PSRX(RXIEN,"REJ",REJECT,"COM",II))
IF 'II
QUIT
Begin DoDot:5
+55 NEW COMIENS,COMDATE,COMUSER,COMTEXT,TXT
+56 SET DIWL=1
SET DIWR=60
+57 KILL ^UTILITY($JOB,"W")
+58 SET COMIENS=II_","_REJECT_","_RXIEN_","
+59 SET COMDATE=$$GET1^DIQ(52.2551,COMIENS,.01)
+60 SET X=COMDATE
+61 SET COMTEXT=$$GET1^DIQ(52.2551,COMIENS,2)
+62 SET X=X_" - "_COMTEXT
+63 SET COMUSER=$$GET1^DIQ(52.2551,COMIENS,1)
+64 SET X=X_" ("_COMUSER_")"
+65 DO ^DIWP
+66 SET COMM2=0
+67 FOR J=1:1
IF '$DATA(^UTILITY($JOB,"W",1,J,0))
QUIT
Begin DoDot:6
+68 SET TXT=^UTILITY($JOB,"W",1,J,0)
SET COMM2=COMM2+1
+69 IF COMM1=1
SET OUT=" COMMENTS: -"_TXT
+70 IF '$TEST
SET OUT=" "_$SELECT(COMM2=1:"-",1:"")_TXT
+71 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,LINE)=OUT
+72 SET LINE=LINE+1
SET (COMM2,COMM1)=COMM1+1
End DoDot:6
+73 KILL ^UTILITY($JOB,"W")
End DoDot:5
End DoDot:4
+74 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,LINE+1)=""
End DoDot:3
End DoDot:2
End DoDot:1
+75 ;derive entry number for message
+76 SET DIVISION=0
+77 FOR
SET DIVISION=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION))
IF +DIVISION=0
QUIT
Begin DoDot:1
+78 SET SORT=""
+79 SET ENTRYNUM=0
+80 FOR
SET SORT=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT))
IF SORT']""
QUIT
Begin DoDot:2
+81 SET ENTRYNUM=ENTRYNUM+1
+82 SET OUT=^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,1)
+83 SET ^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,1)=$$RJ^XLFSTR(ENTRYNUM,3)_" "_OUT
End DoDot:2
End DoDot:1
+84 ;;
MAIL() ;;
+1 NEW DIVISION,RESULT,COUNT,REJECT,I,SORT,COUNT
+2 SET (DIVISION,RESULT)=0
+3 FOR
SET DIVISION=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION))
IF +DIVISION=0
QUIT
Begin DoDot:1
+4 NEW XMSUB,XMDUZ,XMTEXT,XMY
+5 SET XMSUB="ePharmacy - OPEN/UNRESOLVED REJECTS LIST for "_$$GET1^DIQ(52.86,DIVISION,.01)
+6 SET XMDUZ="OUTPATIENT PHARMACY PACKAGE"
+7 SET XMTEXT="^TMP($J,""PSOREJP4"",""MESSAGE"","
+8 SET XMY("G.PSO REJECTS BACKGROUND MESSAGE")=""
+9 KILL ^TMP($JOB,"PSOREJP4","MESSAGE")
+10 SET ^TMP($JOB,"PSOREJP4","MESSAGE",1)="The prescriptions listed below are third party electronically billable and can"
+11 SET ^TMP($JOB,"PSOREJP4","MESSAGE",2)="not be filled until the rejection is resolved. No action to resolve the"
+12 SET ^TMP($JOB,"PSOREJP4","MESSAGE",3)="rejection has taken place within the past "_^TMP($JOB,"PSOREJP4","DIVISION",DIVISION)_" days."
+13 SET ^TMP($JOB,"PSOREJP4","MESSAGE",4)=""
+14 SET ^TMP($JOB,"PSOREJP4","MESSAGE",5)="Please use the THIRD PARTY PAYER REJECTS WORKLIST option to resolve the"
+15 SET ^TMP($JOB,"PSOREJP4","MESSAGE",6)="rejection or add a comment to the rejection."
+16 SET ^TMP($JOB,"PSOREJP4","MESSAGE",7)=""
+17 SET ^TMP($JOB,"PSOREJP4","MESSAGE",8)="Unresolved rejects will not be sent to CMOP or the local print queue for"
+18 SET ^TMP($JOB,"PSOREJP4","MESSAGE",9)="filling. They will continue to show on the rejects list until acted upon."
+19 SET ^TMP($JOB,"PSOREJP4","MESSAGE",10)=""
+20 SET ^TMP($JOB,"PSOREJP4","MESSAGE",11)=" FILL REJECT"
+21 SET ^TMP($JOB,"PSOREJP4","MESSAGE",12)=" # RX/FILL PATIENT(ID) DRUG DATE DATE"
+22 SET ^TMP($JOB,"PSOREJP4","MESSAGE",13)="------------------------------------------------------------------------------"
+23 SET COUNT=14
+24 SET SORT=""
+25 FOR
SET SORT=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT))
IF SORT']""
QUIT
Begin DoDot:2
+26 SET I=0
+27 FOR
SET I=$ORDER(^TMP($JOB,"PSOREJP4",DIVISION,"SORT",SORT,I))
IF 'I
QUIT
SET COUNT=COUNT+1
SET ^TMP($JOB,"PSOREJP4","MESSAGE",COUNT)=^(I)
Begin DoDot:3
End DoDot:3
End DoDot:2
+28 DO ^XMD
+29 IF +$GET(XMZ)
SET RESULT=XMZ
End DoDot:1
+30 QUIT RESULT