source: FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSIVORV1.m@ 636

Last change on this file since 636 was 628, checked in by George Lilly, 14 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1PSIVORV1 ;BIR/MLM-VIEW AN ORDER, EDIT OR DETAILED (OE/RR) ;07 OCT 97 / 9:42 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**58,81**;16 DEC 97
3 ;
4 ; Reference to ^PS(52.7 is supported by DBIA 2173.
5 ;
6ENED ; Display order entered by MD.
7 ;
8 S PSIVLN=0,TAB=16,UL80="",$P(UL80,"-",80)=""
9 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)
10 W !,?4,"Entry By: ",$P(P("CLRK"),U,2),?49,"Login: ",$$WDTE^PSIVUTL(P("LOG")),!,UL80,!!!
11 F DRGT="AD","SOL" D GTDRG
12 W:'$O(DRG("SOL",0)) ! S X=59 D CKNUM W "Inf Rate:",?TAB,P(8)
13 W ! S X=1 D CKNUM W "Provider: ",?TAB,$P(P(6),U,2) K TAB
14 ;
15PC ; Display Provider's comments.
16 W ! S X=66 D CKNUM W "Provider Comments: "
17 ;F PSIVX=0:0 S PSIVX=$O(^PS(53.45,+$G(PSIVUP),4,PSIVX)) Q:'PSIVX D
18 I +$G(ON) F PSIVX=0:0 S PSIVX=$O(^PS(53.1,+ON,12,PSIVX)) Q:'PSIVX D
19 .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
20 W !,UL80
21 Q
22 ;
23GTDRG ; Get and print each additive and solution in the order.
24 S DRGTN=$S(DRGT="AD":"Additive",1:"Solution")_$S($G(DRG(DRGT,0))>1:"s",1:"")
25 W:DRGT="AD" ! S X=$S(DRGT="AD":57,1:58) D CKNUM W DRGTN,": "
26 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:""),!
27 Q
28CKNUM ; Display number next to field if necessary.
29 I $G(PSIVAC)="OE",(U_EDIT_U[(U_X_U)) S PSIVLN=PSIVLN+1 W "*(",PSIVLN,")"
30 W:$G(PSIVAC)="OE" ?4
31 Q
32 ;
33WRTDRG ; Print drugs for "backdoor" view.
34 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
35 I $G(PSIVAC)="PN" S DRGTN=" "_DRGTN G WRTDRG1
36 I DRGT="AD" S DRGTN=$S(P(17)'="P":"*"_DRGTN,$E(P("OT"))="F":"*"_DRGTN,1:" "_DRGTN)
37 I DRGT="SOL" S DRGTN=$S(P(17)'="P"&(P("DTYP")'=1):"*"_DRGTN,$E(P("OT"))="F":"*"_DRGTN,1:" "_DRGTN)
38WRTDRG1 ;
39 W " ",DRGTN D RC^PSIVORV2 F DRG=0:0 S DRG=$O(DRG(DRGT,DRG)) Q:'DRG D
40 .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)
41 .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
42 K DRGT,DRGTN
43 Q
44 ;
45PD ; Print primary drug, dosage ordered (backdoor view).
46 I $D(PSIVNUM),P("DTYP") W $S(PSIVAC="PN":" ",1:" *"),$S(P("DTYP")=1:"(9)",1:"(7)")
47 W ?7,"Primary Drug: ",$P(P("PD"),U,2) D RC^PSIVORV2
48 I $D(PSIVNUM),P("DTYP") W:P("DTYP")'=1 " " W $S(PSIVAC="PN":" ",1:"*"),$S(P("DTYP")=1:"(10)",1:"(8)")
49 W ?13,"Dosage: ",P("DO") D RC^PSIVORV2
50 Q
51 ;
52ONCALL ; Display msg. for orders placed ONCALL by Pharmacy.
53 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."
54 Q
55 ;
56ALLREN ; Display msg. for orders that have been renewed.
57 W $C(7),!,"This order has been renewed and may not be edited or renewed again."
58 Q
59 ;
60ALLED ; Display msg. for orders that have been edited.
61 W $C(7),!,"This order has been edited and may not be edited or renewed again."
62 Q
63 ;
64ENDT ; Display order entered by MD. (OE/RR detailed order view.)
65 S TAB=23,UL80="",$P(UL80,"-",80)="" W:$Y @IOF W !!,"IV Room: ",?23,$P(P("IVRM"),U,2),!,"Type:"
66 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 "..."
67 F DRGT="AD","SOL" D GTDRG
68 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:"
69 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
70 W:P("RES")="R" !,$C(7),"This order is a renewal." D:P(17)="O" ONCALL D:P("FRES")="R" ALLREN
71 Q
Note: See TracBrowser for help on using the repository browser.