PSOQUAP2 ;HINES/RMS - UNIFIED PROFILE BASED ON PORTLAND IDEA ; 30 Nov 2007 7:58 AM
;;7.0;OUTPATIENT PHARMACY;**294**;DEC 1997;Build 13
;
;Reference to COVER^ORWPS supported by DBIA 4954
;Reference to BCMALG^PSJUTL2 supported by DBIA 5057
EN ;ENTRY POINT FOR HEALTH SUMMARY
N RPC,RPCT,ALPHA,PSNUM,DRUGNM,RPCNODE,ORDER,SAVE
D COVER^ORWPS(.RPC,DFN)
S RPCT=0 F S RPCT=$O(RPC(RPCT)) Q:'+RPCT D ;
. S RPCNODE=RPC(RPCT)
. S PSNUM=$P(RPCNODE,"^")
. S DRUGNM=$$UP^XLFSTR($P(RPCNODE,"^",2))
. S ORDER=+$P(RPCNODE,"^",3)
. Q:DRUGNM']""!(ORDER=0)!(PSNUM']"")
. K SAVE(DRUGNM) S SAVE(DRUGNM,ORDER,PSNUM)=""
. Q:"ACTIVE^ACTIVE/SUSP^HOLD"'[$P(RPCNODE,"^",4)
. S ALPHA(DRUGNM,ORDER,PSNUM)=""
D ADDREM
D HEADER
D OUTPUT
D FOOTER
Q
D NVADT^PSOQCF04(DFN,.ATEST,.ADATE,.AVALUE,.ATEXT)
D CKP^GMTSUP Q:$D(GMTSQIT)
W $$REPEAT^XLFSTR("-",IOM),!,"Alphabetized list of outpatient Rx's, inpatient orders, remote and Non-VA meds"
D CKP^GMTSUP Q:$D(GMTSQIT)
W !,"Legend: OPT = VA issued outpatient prescription, INP = VA issued inpatient order"
D CKP^GMTSUP Q:$D(GMTSQIT)
W !,"Non-VA Meds Last Documented On: "
W $S(+ADATE:$$FMTE^XLFDT(ADATE,"D"),1:"** Data not found **")
D CKP^GMTSUP Q:$D(GMTSQIT)
W !,$$REPEAT^XLFSTR("-",IOM)
D CKP^GMTSUP Q:$D(GMTSQIT)
Q
OUTPUT N DRUGNM,ORDER,PSNUM
N PACK,PACKREF,SIGLINE,ORDNUM
N LASTACT,OTLINE
S DRUGNM="" F S DRUGNM=$O(ALPHA(DRUGNM)) Q:DRUGNM']"" D K SAVE(DRUGNM) ;
. S ORDER="" F S ORDER=$O(ALPHA(DRUGNM,ORDER)) Q:ORDER']"" D ;
.. S PSNUM="" F S PSNUM=$O(ALPHA(DRUGNM,ORDER,PSNUM)) Q:PSNUM']"" D ;
... S PACK=$P(PSNUM,";",2),ORDNUM=$P(PSNUM,";")
... I PACK="I" D INPDISP
... I PACK="O" D OPTDISP
... I PACK="R" D RDIDISP
Q
N BLINE
S BLINE=$$REPEAT^XLFSTR("-",IOM)
W !,BLINE,!,"Other medications previously dispensed in the last year:",!
D CKP^GMTSUP Q:$D(GMTSQIT)
N DRUGNM,ORDER,PSNUM
N PACK,PACKREF,SIGLINE
S DRUGNM="" F S DRUGNM=$O(SAVE(DRUGNM)) Q:DRUGNM']"" D ;
. S ORDER="" F S ORDER=$O(SAVE(DRUGNM,ORDER)) Q:ORDER']"" D ;
.. S PSNUM="" F S PSNUM=$O(SAVE(DRUGNM,ORDER,PSNUM)) Q:PSNUM']"" D ;
... S PACK=$P(PSNUM,";",2)
... I PACK="O" D OPTFOOT
Q
ADDREM ;6-21-07 ADD ACTIVE MEDS VIA REMOTE DATA INTEROPERABILITY
N PSOQRDI,PSOQMED,PSOQSTAT,PSOQRNAM,PSOQRNUM,PSOQDOWN
Q:'$$HAVEHDR^ORRDI1
D Q:$G(PSOQDOWN)
. I $D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) H $$GET^XPAR("ALL","ORRDI PING FREQ")/2
. I $D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) S PSOQDOWN=1 D
.. D CKP^GMTSUP Q:$D(GMTSQIT)
.. W !,"WARNING: Connection to Remote Data Currently Down",!
.. D CKP^GMTSUP Q:$D(GMTSQIT)
D ;18-MAR-08 TO ALLOW HDR/RDI PROCESS TO USE IO VARIABLE
. D SAVDEV^%ZISUTL("PSOQHFS")
. S PSOQRDI=$$GET^ORRDI1(DFN,"PSOO")
. D USE^%ZISUTL("PSOQHFS")
. D RMDEV^%ZISUTL("PSOQHFS")
I PSOQRDI=-1 D
. D CKP^GMTSUP Q:$D(GMTSQIT)
. W !,"WARNING: Connection to Remote Data Not Available",!
. D CKP^GMTSUP Q:$D(GMTSQIT)
Q:'$D(^XTMP("ORRDI","PSOO",DFN))
S PSOQMED=0 F S PSOQMED=$O(^XTMP("ORRDI","PSOO",DFN,PSOQMED)) Q:'+PSOQMED D
. S PSOQSTAT=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,5,0))
. Q:PSOQSTAT']"" ;8-3-07 TO CATCH INCOMPLETE RECORDS
. Q:"ACTIVE^SUSPENDED"'[PSOQSTAT
. S PSOQRNAM=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,2,0),"Unknown Drug")
. S PSOQRNUM=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,4,0))
. Q:PSOQRNAM']""!(PSOQRNUM']"")
. S ALPHA(PSOQRNAM,PSOQRNUM,PSOQMED_"X;R")=""
Q
S PACKREF=+$G(^OR(100,ORDER,4))
S X1=DT,X2=-365 D C^%DTC S PSOQYEAR=X
S PSOQLRD=$$LRDFUNC^PSOQ0076(PACKREF)
D CKP^GMTSUP Q:$D(GMTSQIT)
Q:PSOQLRD<PSOQYEAR
Q:$P(PSNUM,";")["N"
W !,"OPT "_DRUGNM_" ("_$$GET1^DIQ(52,+PACKREF,100,"E")_"/"_$$DAYSSUPP^PSOQ0076(PACKREF)_" Days Supply Last Released: "_$$FMTE^XLFDT(PSOQLRD,"2D")_")" D CKP^GMTSUP Q:$D(GMTSQIT)
S SIGLINE=0 F S SIGLINE=$O(^PSRX(PACKREF,"SIG1",SIGLINE)) Q:'+SIGLINE D ;
. W !?5,$G(^PSRX(PACKREF,"SIG1",SIGLINE,0)) D CKP^GMTSUP Q:$D(GMTSQIT)
W ! D CKP^GMTSUP Q:$D(GMTSQIT)
Q
INPDISP D CKP^GMTSUP Q:$D(GMTSQIT)
W !,"INP "_DRUGNM D CKP^GMTSUP Q:$D(GMTSQIT)
S LASTACT=$O(^OR(100,+ORDER,8,":"),-1)
S OTLINE=1 F S OTLINE=$O(^OR(100,+ORDER,8,LASTACT,.1,OTLINE)) Q:'+OTLINE D ;
. D WRAPTEXT^PSOQUTIL($$LSIG^PSOQUTIL($G(^OR(100,+ORDER,8,LASTACT,.1,OTLINE,0))),60,5) D CKP^GMTSUP Q:$D(GMTSQIT)
. W !?5,$$BCMALG^PSJUTL2(DFN,ORDNUM) D CKP^GMTSUP Q:$D(GMTSQIT)
W ! D CKP^GMTSUP Q:$D(GMTSQIT)
Q
OPTDISP N PSOQEXP,PSOQREF,PSOQSTA
D CKP^GMTSUP Q:$D(GMTSQIT)
S PACKREF=+$G(^OR(100,ORDER,4))
S PSOQLRD=$$LRDFUNC^PSOQ0076(PACKREF)
S PSOQEXP=$$EXPDATE^PSOQ0076(PACKREF)
S PSOQREF=$$REFILLS^PSOQ0076(PACKREF)
I $P(PSNUM,";")["N" G NVADISP
D ;
. N C,Y
. S Y=$G(^PSRX(PACKREF,"STA"))
. S C=$P(^DD(52,100,0),U,2)
. D Y^DIQ
. S PSOQSTA=Y
W !,"OPT "_DRUGNM_" (Status = "_PSOQSTA_")"
S SIGLINE=0 F S SIGLINE=$O(^PSRX(PACKREF,"SIG1",SIGLINE)) Q:'+SIGLINE D ;
. W !?5,$G(^PSRX(PACKREF,"SIG1",SIGLINE,0)) D CKP^GMTSUP Q:$D(GMTSQIT)
W !?10,"Last Released: "_$$FMTE^XLFDT(PSOQLRD,"2D"),?55,"Days Supply: "_$$DAYSSUPP^PSOQ0076(PACKREF) D CKP^GMTSUP Q:$D(GMTSQIT)
W !?10,"Rx Expiration Date: ",$$FMTE^XLFDT(PSOQEXP,"2D"),?55,"Refills Remaining: ",PSOQREF D CKP^GMTSUP Q:$D(GMTSQIT)
W ! D CKP^GMTSUP Q:$D(GMTSQIT)
Q
RDIDISP D CKP^GMTSUP Q:$D(GMTSQIT)
W !,"Remote "_DRUGNM D CKP^GMTSUP Q:$D(GMTSQIT)
N PSOQSIG,PSOQSTAT
S PSOQSIG=$G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,14,0))
D WRAPTEXT^PSOQUTIL(PSOQSIG,65,5)
D CKP^GMTSUP Q:$D(GMTSQIT)
S PSOQSTAT=$G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,5,0))
S PSOQSTAT=$S(PSOQSTAT["ACTIVE":"Active",PSOQSTAT["SUSPENDED":"Active/Suspended",1:"Unknown")
W !?10,"Last Filled: "_$G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,9,0))_" ("_PSOQSTAT_" at "_$G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,1,0))_") "
W:$X>54 ! ;NEW LINE IF THE STATUS+STATION IS TOO LONG
W ?55,"Days Supply: "_$P($P($G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,6,0)),";",2),"D",2)
D CKP^GMTSUP Q:$D(GMTSQIT)
W !?10,"Rx Expiration Date: ",$G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,7,0)),?55,"Refills Remaining: ",$G(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,10,0))
D CKP^GMTSUP Q:$D(GMTSQIT)
W ! D CKP^GMTSUP Q:$D(GMTSQIT)
Q
NVADISP D CKP^GMTSUP Q:$D(GMTSQIT)
W !,"Non VA "_DRUGNM D CKP^GMTSUP Q:$D(GMTSQIT)
S LASTACT=$O(^OR(100,ORDER,8,":"),-1)
S OTLINE=1 F S OTLINE=$O(^OR(100,ORDER,8,LASTACT,.1,OTLINE)) Q:'+OTLINE D ;
.D WRAPTEXT^PSOQUTIL($G(^OR(100,ORDER,8,LASTACT,.1,OTLINE,0)),65,5) D CKP^GMTSUP Q:$D(GMTSQIT)
W ! D CKP^GMTSUP Q:$D(GMTSQIT)
Q
PSOQUAP2 ;HINES/RMS - UNIFIED PROFILE BASED ON PORTLAND IDEA ; 30 Nov 2007 7:58 AM
+1 ;;7.0;OUTPATIENT PHARMACY;**294**;DEC 1997;Build 13
+2 ;
+3 ;Reference to COVER^ORWPS supported by DBIA 4954
+4 ;Reference to BCMALG^PSJUTL2 supported by DBIA 5057
EN ;ENTRY POINT FOR HEALTH SUMMARY
+1 NEW RPC,RPCT,ALPHA,PSNUM,DRUGNM,RPCNODE,ORDER,SAVE
+2 DO COVER^ORWPS(.RPC,DFN)
+3 ;
SET RPCT=0
FOR
SET RPCT=$ORDER(RPC(RPCT))
IF '+RPCT
QUIT
Begin DoDot:1
+4 SET RPCNODE=RPC(RPCT)
+5 SET PSNUM=$PIECE(RPCNODE,"^")
+6 SET DRUGNM=$$UP^XLFSTR($PIECE(RPCNODE,"^",2))
+7 SET ORDER=+$PIECE(RPCNODE,"^",3)
+8 IF DRUGNM']""!(ORDER=0)!(PSNUM']"")
QUIT
+9 KILL SAVE(DRUGNM)
SET SAVE(DRUGNM,ORDER,PSNUM)=""
+10 IF "ACTIVE^ACTIVE/SUSP^HOLD"'[$PIECE(RPCNODE,"^",4)
QUIT
+11 SET ALPHA(DRUGNM,ORDER,PSNUM)=""
End DoDot:1
+12 DO ADDREM
+13 DO HEADER
+14 DO OUTPUT
+15 DO FOOTER
+16 QUIT
+1 DO NVADT^PSOQCF04(DFN,.ATEST,.ADATE,.AVALUE,.ATEXT)
+2 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+3 WRITE $$REPEAT^XLFSTR("-",IOM),!,"Alphabetized list of outpatient Rx's, inpatient orders, remote and Non-VA meds"
+4 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+5 WRITE !,"Legend: OPT = VA issued outpatient prescription, INP = VA issued inpatient order"
+6 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+7 WRITE !,"Non-VA Meds Last Documented On: "
+8 WRITE $SELECT(+ADATE:$$FMTE^XLFDT(ADATE,"D"),1:"** Data not found **")
+9 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+10 WRITE !,$$REPEAT^XLFSTR("-",IOM)
+11 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+12 QUIT
OUTPUT NEW DRUGNM,ORDER,PSNUM
+1 NEW PACK,PACKREF,SIGLINE,ORDNUM
+2 NEW LASTACT,OTLINE
+3 ;
SET DRUGNM=""
FOR
SET DRUGNM=$ORDER(ALPHA(DRUGNM))
IF DRUGNM']""
QUIT
Begin DoDot:1
+4 ;
SET ORDER=""
FOR
SET ORDER=$ORDER(ALPHA(DRUGNM,ORDER))
IF ORDER']""
QUIT
Begin DoDot:2
+5 ;
SET PSNUM=""
FOR
SET PSNUM=$ORDER(ALPHA(DRUGNM,ORDER,PSNUM))
IF PSNUM']""
QUIT
Begin DoDot:3
+6 SET PACK=$PIECE(PSNUM,";",2)
SET ORDNUM=$PIECE(PSNUM,";")
+7 IF PACK="I"
DO INPDISP
+8 IF PACK="O"
DO OPTDISP
+9 IF PACK="R"
DO RDIDISP
End DoDot:3
End DoDot:2
End DoDot:1
KILL SAVE(DRUGNM)
+10 QUIT
IF $DATA(GMTSQIT)
QUIT
+1 NEW BLINE
+2 SET BLINE=$$REPEAT^XLFSTR("-",IOM)
+3 WRITE !,BLINE,!,"Other medications previously dispensed in the last year:",!
+4 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+5 NEW DRUGNM,ORDER,PSNUM
+6 NEW PACK,PACKREF,SIGLINE
+7 ;
SET DRUGNM=""
FOR
SET DRUGNM=$ORDER(SAVE(DRUGNM))
IF DRUGNM']""
QUIT
Begin DoDot:1
+8 ;
SET ORDER=""
FOR
SET ORDER=$ORDER(SAVE(DRUGNM,ORDER))
IF ORDER']""
QUIT
Begin DoDot:2
+9 ;
SET PSNUM=""
FOR
SET PSNUM=$ORDER(SAVE(DRUGNM,ORDER,PSNUM))
IF PSNUM']""
QUIT
Begin DoDot:3
+10 SET PACK=$PIECE(PSNUM,";",2)
+11 IF PACK="O"
DO OPTFOOT
End DoDot:3
End DoDot:2
End DoDot:1
+12 QUIT
ADDREM ;6-21-07 ADD ACTIVE MEDS VIA REMOTE DATA INTEROPERABILITY
+1 NEW PSOQRDI,PSOQMED,PSOQSTAT,PSOQRNAM,PSOQRNUM,PSOQDOWN
+2 IF '$$HAVEHDR^ORRDI1
QUIT
+3 Begin DoDot:1
+4 IF $DATA(^XTMP("ORRDI","OUTAGE INFO","DOWN"))
HANG $$GET^XPAR("ALL","ORRDI PING FREQ")/2
+5 IF $DATA(^XTMP("ORRDI","OUTAGE INFO","DOWN"))
SET PSOQDOWN=1
Begin DoDot:2
+6 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+7 WRITE !,"WARNING: Connection to Remote Data Currently Down",!
+8 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
End DoDot:2
End DoDot:1
IF $GET(PSOQDOWN)
QUIT
+9 ;18-MAR-08 TO ALLOW HDR/RDI PROCESS TO USE IO VARIABLE
Begin DoDot:1
+10 DO SAVDEV^%ZISUTL("PSOQHFS")
+11 SET PSOQRDI=$$GET^ORRDI1(DFN,"PSOO")
+12 DO USE^%ZISUTL("PSOQHFS")
+13 DO RMDEV^%ZISUTL("PSOQHFS")
End DoDot:1
+14 IF PSOQRDI=-1
Begin DoDot:1
+15 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+16 WRITE !,"WARNING: Connection to Remote Data Not Available",!
+17 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
+18 IF '$DATA(^XTMP("ORRDI","PSOO",DFN))
QUIT
+19 SET PSOQMED=0
FOR
SET PSOQMED=$ORDER(^XTMP("ORRDI","PSOO",DFN,PSOQMED))
IF '+PSOQMED
QUIT
Begin DoDot:1
+20 SET PSOQSTAT=$GET(^XTMP("ORRDI","PSOO",DFN,PSOQMED,5,0))
+21 ;8-3-07 TO CATCH INCOMPLETE RECORDS
IF PSOQSTAT']""
QUIT
+22 IF "ACTIVE^SUSPENDED"'[PSOQSTAT
QUIT
+23 SET PSOQRNAM=$GET(^XTMP("ORRDI","PSOO",DFN,PSOQMED,2,0),"Unknown Drug")
+24 SET PSOQRNUM=$GET(^XTMP("ORRDI","PSOO",DFN,PSOQMED,4,0))
+25 IF PSOQRNAM']""!(PSOQRNUM']"")
QUIT
+26 SET ALPHA(PSOQRNAM,PSOQRNUM,PSOQMED_"X;R")=""
End DoDot:1
+27 QUIT
+1 SET PACKREF=+$GET(^OR(100,ORDER,4))
+2 SET X1=DT
SET X2=-365
DO C^%DTC
SET PSOQYEAR=X
+3 SET PSOQLRD=$$LRDFUNC^PSOQ0076(PACKREF)
+4 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+5 IF PSOQLRD<PSOQYEAR
QUIT
+6 IF $PIECE(PSNUM,";")["N"
QUIT
+7 WRITE !,"OPT "_DRUGNM_" ("_$$GET1^DIQ(52,+PACKREF,100,"E")_"/"_$$DAYSSUPP^PSOQ0076(PACKREF)_" Days Supply Last Released: "_$$FMTE^XLFDT(PSOQLRD,"2D")_")"
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+8 ;
SET SIGLINE=0
FOR
SET SIGLINE=$ORDER(^PSRX(PACKREF,"SIG1",SIGLINE))
IF '+SIGLINE
QUIT
Begin DoDot:1
+9 WRITE !?5,$GET(^PSRX(PACKREF,"SIG1",SIGLINE,0))
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
+10 WRITE !
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+11 QUIT
INPDISP DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+1 WRITE !,"INP "_DRUGNM
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+2 SET LASTACT=$ORDER(^OR(100,+ORDER,8,":"),-1)
+3 ;
SET OTLINE=1
FOR
SET OTLINE=$ORDER(^OR(100,+ORDER,8,LASTACT,.1,OTLINE))
IF '+OTLINE
QUIT
Begin DoDot:1
+4 DO WRAPTEXT^PSOQUTIL($$LSIG^PSOQUTIL($GET(^OR(100,+ORDER,8,LASTACT,.1,OTLINE,0))),60,5)
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+5 WRITE !?5,$$BCMALG^PSJUTL2(DFN,ORDNUM)
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
+6 WRITE !
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+7 QUIT
OPTDISP NEW PSOQEXP,PSOQREF,PSOQSTA
+1 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+2 SET PACKREF=+$GET(^OR(100,ORDER,4))
+3 SET PSOQLRD=$$LRDFUNC^PSOQ0076(PACKREF)
+4 SET PSOQEXP=$$EXPDATE^PSOQ0076(PACKREF)
+5 SET PSOQREF=$$REFILLS^PSOQ0076(PACKREF)
+6 IF $PIECE(PSNUM,";")["N"
GOTO NVADISP
+7 ;
Begin DoDot:1
+8 NEW C,Y
+9 SET Y=$GET(^PSRX(PACKREF,"STA"))
+10 SET C=$PIECE(^DD(52,100,0),U,2)
+11 DO Y^DIQ
+12 SET PSOQSTA=Y
End DoDot:1
+13 WRITE !,"OPT "_DRUGNM_" (Status = "_PSOQSTA_")"
+14 ;
SET SIGLINE=0
FOR
SET SIGLINE=$ORDER(^PSRX(PACKREF,"SIG1",SIGLINE))
IF '+SIGLINE
QUIT
Begin DoDot:1
+15 WRITE !?5,$GET(^PSRX(PACKREF,"SIG1",SIGLINE,0))
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
+16 WRITE !?10,"Last Released: "_$$FMTE^XLFDT(PSOQLRD,"2D"),?55,"Days Supply: "_$$DAYSSUPP^PSOQ0076(PACKREF)
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+17 WRITE !?10,"Rx Expiration Date: ",$$FMTE^XLFDT(PSOQEXP,"2D"),?55,"Refills Remaining: ",PSOQREF
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+18 WRITE !
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+19 QUIT
RDIDISP DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+1 WRITE !,"Remote "_DRUGNM
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+2 NEW PSOQSIG,PSOQSTAT
+3 SET PSOQSIG=$GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,14,0))
+4 DO WRAPTEXT^PSOQUTIL(PSOQSIG,65,5)
+5 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+6 SET PSOQSTAT=$GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,5,0))
+7 SET PSOQSTAT=$SELECT(PSOQSTAT["ACTIVE":"Active",PSOQSTAT["SUSPENDED":"Active/Suspended",1:"Unknown")
+8 WRITE !?10,"Last Filled: "_$GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,9,0))_" ("_PSOQSTAT_" at "_$GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,1,0))_") "
+9 ;NEW LINE IF THE STATUS+STATION IS TOO LONG
IF $X>54
WRITE !
+10 WRITE ?55,"Days Supply: "_$PIECE($PIECE($GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,6,0)),";",2),"D",2)
+11 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+12 WRITE !?10,"Rx Expiration Date: ",$GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,7,0)),?55,"Refills Remaining: ",$GET(^XTMP("ORRDI","PSOO",DFN,+ORDNUM,10,0))
+13 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+14 WRITE !
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+15 QUIT
NVADISP DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+1 WRITE !,"Non VA "_DRUGNM
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+2 SET LASTACT=$ORDER(^OR(100,ORDER,8,":"),-1)
+3 ;
SET OTLINE=1
FOR
SET OTLINE=$ORDER(^OR(100,ORDER,8,LASTACT,.1,OTLINE))
IF '+OTLINE
QUIT
Begin DoDot:1
+4 DO WRAPTEXT^PSOQUTIL($GET(^OR(100,ORDER,8,LASTACT,.1,OTLINE,0)),65,5)
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
+5 WRITE !
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
+6 QUIT