source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGOEVS.m@ 1259

Last change on this file since 1259 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1PSGOEVS ;BIR/CML3-SPEED VERIFY SELECTED ORDERS ;05 DEC 97 / 8:43 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**29,110**;16 DEC 97
3 ;
4 ; Reference to ^PS(55 is supported by DBIA 2191
5 ; Reference to ^PSSLOCK is supported by DBIA #2789
6 ;
7EN ;
8 I 'PSJSYSU W $C(7),!!,"THIS FUNCTION NOT AVAILABLE TO WARD STAFF." H 3 Q
9 I '$D(PSJOCNT) W !!,"Speed verify is not available for IVs." H 3 Q
10 W !,"Note: Only orders created by a RENEW can be speed verified."
11 D FULL^VALM1
12EN2 S PSGONV=PSJOCNT,PSJSPEED=1 D NOW^%DTC S PSGDT=+$E(%,1,2)
13 S PSGONW="V",PSGLMT=PSGONV D ENWO^PSGON S PSJRB=X I "^"[X K X G DONE
14 F PSGOEVS=1:1:PSGODDD F PSGOEVS1=1:1 S PSGOEVS2=$P(PSGODDD(PSGOEVS),",",PSGOEVS1) Q:'PSGOEVS2 D
15 .S PSGORD=^TMP("PSJON",$J,PSGOEVS2)
16 .I $$CHKIV Q
17 .I $$CHKVER Q
18 .;I '$$ACTIONS Q
19 .N PSJCOM I $$CHKCOM Q
20 .I '$$RENEWED Q
21 .I $$FROMOERR Q
22 .D VERIFY(PSJSPEED)
23 ;
24DONE ;
25 K %,DA,N,PSGAL,PSGID,PSGLMT,PSGOD,PSGODDD,PSGOEVS,PSGOEVS1,PSGOEVS2
26 K PSGONW,PSGORD,PSJRB,PSJRENEW,PSJSPEED
27 N DIR S DIR(0)="E" D ^DIR
28 Q
29 ;
30RENEWED() ; was it created by a renew?
31 S PSJRENEW=1
32 I PSGORD'["P" D
33 .S PSJRB=$G(^PS(55,PSGP,5,+PSGORD,.2))
34 .S PSJRB=$$NAME(PSJRB)
35 .W !!," ",PSGOEVS2,". ",PSJRB
36 .I $P(^PS(55,PSGP,5,+PSGORD,0),"^",24)'="R" D NOTREN Q
37 E I PSGORD["P" D
38 .S PSJRB=$G(^PS(53.1,+PSGORD,.2))
39 .S PSJRB=$$NAME(PSJRB)
40 .W !!," ",PSGOEVS2,". ",PSJRB
41 .I $P(^PS(53.1,+PSGORD,0),"^",24)'="R" D NOTREN Q
42 Q PSJRENEW
43 ;
44VERIFY(PSJSPEED) ;
45 I '$$LS^PSSLOCK(PSGP,PSGORD) W !,"NO ACTION TAKEN ON ORDER",! ; lock single order
46 D GETUD^PSJLMGUD(PSGP,PSGORD),EN^PSGOEV(PSGORD)
47 D UNL^PSSLOCK(PSGP,PSGORD)
48 Q
49 ;
50CHKVER() ; check if already verified
51 I $D(^PS(55,PSGP,5,+PSGORD,4)),$P(^(4),"^",PSJSYSU) S N=$P(^(4),"^",+PSJSYSU),PSGOD=$P(^(4),"^",PSJSYSU+1)
52 I D VMSG H 2
53 Q $T
54 ;
55CHKIV() ; check if this order is an IV
56 I PSGORD["V"
57 I W !," Order ",PSGOEVS2," is an IV order.",! H 2
58 Q $T
59CHKCOM() ; Check if this order is a complex order
60 S PSJCOM=0
61 I PSGORD=+PSGORD S PSJCOM=PSGORD W !," Order ",PSGOEVS2," is part of a complex order series, No change made.",! H 2 Q PSJCOM
62 S PSJCOM=$S(PSGORD["U":$P($G(^PS(55,PSGP,5,+PSGORD,.2)),U,8),1:$P($G(^PS(53.1,+PSGORD,.2)),U,8))
63 I PSJCOM W !," Order ",PSGOEVS2," is part of a complex order series, No change made.",! H 2
64 Q PSJCOM
65 ;
66VMSG ;
67 S N=$$ENNPN^PSGMI(N),PSJRB=$G(^PS(55,PSGP,5,+PSGORD,.2))
68 S PSJRB=$$NAME(PSJRB)
69 W !!," ",PSGOEVS2,". ",PSJRB,!," was verified by ",N," on "
70 W $$ENDTC^PSGMI(PSGOD),"."
71 Q
72NOTREN ;
73 W !," was not created from a renew, No change made!" H 2
74 S PSJRENEW=0
75 Q
76 ;
77NAME(PSJRB) ;
78 I PSJRB S PSJRB=$$DRUGN_" "_$P(PSJRB,"^",2)
79 E S PSJRB="ORDERABLE ITEM - NOT FOUND"
80 Q PSJRB
81 ;
82DRUGN() Q $P($$DRUGNAME^PSJLMUTL(PSGP,PSGORD),"^")
83 ;
84ACTIONS() ;
85 ;W !," ****** ",$$ENACTION^PSGOE1(PSGP,PSGORD)
86 I $$ENACTION^PSGOE1(PSGP,PSGORD)["V"
87 E W !,PSGOEVS2,". CAN'T BE VERIFIED FOR SOME REASON! ",PSGACT
88 Q $T
89 ;
90FROMOERR() ; is it pending from OERR?
91 I PSGORD["P"&($P($G(^PS(53.1,+PSGORD,0)),"^",9)="P")
92 I D
93 .W !," is Pending from Order Entry/Results Reporting"
94 .W ", No Change made." H 2
95 Q $T
Note: See TracBrowser for help on using the repository browser.