Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSIVORV1

PSIVORV1.m

Go to the documentation of this file.
  1. PSIVORV1 ;BIR/MLM-VIEW AN ORDER, EDIT OR DETAILED (OE/RR) ;07 OCT 97 / 9:42 AM
  1. ;;5.0; INPATIENT MEDICATIONS ;**58,81**;16 DEC 97
  1. ;
  1. ; Reference to ^PS(52.7 is supported by DBIA 2173.
  1. ;
  1. ENED ; Display order entered by MD.
  1. ;
  1. S PSIVLN=0,TAB=16,UL80="",$P(UL80,"-",80)=""
  1. W:$Y @IOF W !!,?5,"Patient: ",$P($G(^DPT(+ORVP,0)),U),?48,"Status: ",$P("DISCONTINUED^COMPLETE^HOLD^FLAGGED^PENDING^ACTIVE^EXPIRED^SCHEDULED^INCOMPLETE^^UNRELEASED",U,+ORSTS)
  1. W !,?4,"Entry By: ",$P(P("CLRK"),U,2),?49,"Login: ",$$WDTE^PSIVUTL(P("LOG")),!,UL80,!!!
  1. F DRGT="AD","SOL" D GTDRG
  1. W:'$O(DRG("SOL",0)) ! S X=59 D CKNUM W "Inf Rate:",?TAB,P(8)
  1. W ! S X=1 D CKNUM W "Provider: ",?TAB,$P(P(6),U,2) K TAB
  1. ;
  1. PC ; Display Provider's comments.
  1. W ! S X=66 D CKNUM W "Provider Comments: "
  1. ;F PSIVX=0:0 S PSIVX=$O(^PS(53.45,+$G(PSIVUP),4,PSIVX)) Q:'PSIVX D
  1. I +$G(ON) F PSIVX=0:0 S PSIVX=$O(^PS(53.1,+ON,12,PSIVX)) Q:'PSIVX D
  1. .S Y=$G(^PS(53.1,+ON,12,PSIVX,0)) W !?5,Y I $Y>23 K DIR S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT) W:$Y @IOF
  1. W !,UL80
  1. Q
  1. ;
  1. GTDRG ; Get and print each additive and solution in the order.
  1. S DRGTN=$S(DRGT="AD":"Additive",1:"Solution")_$S($G(DRG(DRGT,0))>1:"s",1:"")
  1. W:DRGT="AD" ! S X=$S(DRGT="AD":57,1:58) D CKNUM W DRGTN,": "
  1. W:+$G(DRG(DRGT,0))=0 ! F I=0:0 S I=$O(DRG(DRGT,I)) Q:'I W ?TAB,$P(DRG(DRGT,I),U,2)," ",$P(DRG(DRGT,I),U,3),$S($P(DRG(DRGT,I),U,4):"("_$P(DRG(DRGT,I),U,4)_")",1:""),!
  1. Q
  1. CKNUM ; Display number next to field if necessary.
  1. I $G(PSIVAC)="OE",(U_EDIT_U[(U_X_U)) S PSIVLN=PSIVLN+1 W "*(",PSIVLN,")"
  1. W:$G(PSIVAC)="OE" ?4
  1. Q
  1. ;
  1. WRTDRG ; Print drugs for "backdoor" view.
  1. S DRGTN=$S(DRGT="AD":"(1) Additive",1:"(2) Solution")_$S($G(DRG(DRGT,0))>1:"s",1:"")_": " I '$D(PSIVNUM)!('P("DTYP")) S DRGTN=" "_$P(DRGTN,") ",2) G WRTDRG1
  1. I $G(PSIVAC)="PN" S DRGTN=" "_DRGTN G WRTDRG1
  1. I DRGT="AD" S DRGTN=$S(P(17)'="P":"*"_DRGTN,$E(P("OT"))="F":"*"_DRGTN,1:" "_DRGTN)
  1. I DRGT="SOL" S DRGTN=$S(P(17)'="P"&(P("DTYP")'=1):"*"_DRGTN,$E(P("OT"))="F":"*"_DRGTN,1:" "_DRGTN)
  1. WRTDRG1 ;
  1. W " ",DRGTN D RC^PSIVORV2 F DRG=0:0 S DRG=$O(DRG(DRGT,DRG)) Q:'DRG D
  1. .S X=$G(DRG(DRGT,DRG)) I DRGT="SOL",$P($G(^PS(52.7,+X,0)),U,4)]"" S $P(X,U,2)=$P(X,U,2)_" "_$P(^(0),U,4)
  1. .W ?6,$$LONG^PSIVORV2($S($P(X,U,2)]"":$P(X,U,2)_" "_$P(X,U,3)_" "_$P(X,U,4),1:"*** Undefined ***")) D RC^PSIVORV2
  1. K DRGT,DRGTN
  1. Q
  1. ;
  1. PD ; Print primary drug, dosage ordered (backdoor view).
  1. I $D(PSIVNUM),P("DTYP") W $S(PSIVAC="PN":" ",1:" *"),$S(P("DTYP")=1:"(9)",1:"(7)")
  1. W ?7,"Primary Drug: ",$P(P("PD"),U,2) D RC^PSIVORV2
  1. I $D(PSIVNUM),P("DTYP") W:P("DTYP")'=1 " " W $S(PSIVAC="PN":" ",1:"*"),$S(P("DTYP")=1:"(10)",1:"(8)")
  1. W ?13,"Dosage: ",P("DO") D RC^PSIVORV2
  1. Q
  1. ;
  1. ONCALL ; Display msg. for orders placed ONCALL by Pharmacy.
  1. W $C(7),!,"This order has been placed ""ON-CALL"" by pharmacy. No action may be taken on",!,"it until it has been removed from on-call status by pharmacy."
  1. Q
  1. ;
  1. ALLREN ; Display msg. for orders that have been renewed.
  1. W $C(7),!,"This order has been renewed and may not be edited or renewed again."
  1. Q
  1. ;
  1. ALLED ; Display msg. for orders that have been edited.
  1. W $C(7),!,"This order has been edited and may not be edited or renewed again."
  1. Q
  1. ;
  1. ENDT ; Display order entered by MD. (OE/RR detailed order view.)
  1. S TAB=23,UL80="",$P(UL80,"-",80)="" W:$Y @IOF W !!,"IV Room: ",?23,$P(P("IVRM"),U,2),!,"Type:"
  1. S X=$$CODES^PSIVUTL(P(4),53.1,53) W ?23,$S($E(X)="C":"CHEMO",1:X),$S(P(23)'="":" ("_P(23)_")",1:""),$S(P(5)=1:" (I)",P(5)=0:"(C)",1:""),!,"Syr. Size:",?23,$E(P("SYRS"),1,13) W:$L(P("SYRS"))>13 "..."
  1. F DRGT="AD","SOL" D GTDRG
  1. W !,"Infusion Rate:",?23,P(8),!,"Schedule:",?23,P(9),!,"Administration Times:",?23,P(11),!,"Med Route:",?23,$P(P("MR"),U,2),!,"Remarks:",?23,P("REM"),!,"Other Print Info:",?23,$P(P("OPI"),"^"),!,"Last Fill:"
  1. S Y=$$WDTE^PSIVUTL(P("LF")) W ?23,$S(Y="******":"",1:Y),!,"Quantity: " W:P("LFA") ?23,P("LFA") W !,"Cumulative Doses: " W:P("CUM") ?23,P("CUM") D PC
  1. W:P("RES")="R" !,$C(7),"This order is a renewal." D:P(17)="O" ONCALL D:P("FRES")="R" ALLREN
  1. Q