source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSIVLTR.m@ 1258

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

initial load of WorldVistAEHR

File size: 1.4 KB
RevLine 
[613]1PSIVLTR ;BIR/PR-BUILD LABEL TRACKER FOR ACTIVITY LOG ; 15 May 98 / 9:27 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**3**;16 DEC 97
3 ;This routine needs the following parameters:
4 ;TRACK - only defined if label action is dispensed or suspended
5 ; 1=Ind lbs, 2=Sched lbs, 3= Sus lbs, 4= Order act lab
6 ;ACTION - What is being done with the labels
7 ;1=Dispensed, 2=Recycled, 3=Destroyed, 4=Cancelled, 5=Suspended
8 ;PSIVNOL- number of labels being acted on
9 ;DFN - Patient
10 ;ON - Order number
11 ;L +^PS(55,DFN,"IV",0)
12 S:'$D(^PS(55,DFN,"IV",+ON,"LAB",0)) ^(0)="^55.1111^^" S N=^(0)
13 F DA=$P(N,U,3)+1 I '$D(^PS(55,DFN,"IV",+ON,"LAB",DA)) S $P(N,U,3)=DA,$P(N,U,4)=$P(N,U,4)+1,^PS(55,DFN,"IV",+ON,"LAB",0)=N Q
14 D NOW^%DTC D @ACTION G K
15 ;
161 ;Dispensed
17 S J=DA_U_%_U_ACTION_U_DUZ_U_PSIVNOL_U_TRACK_U_$S('$D(PSIVCT):1,1:0),^PS(55,DFN,"IV",+ON,"LAB",DA,0)=J
18 Q
19 ;
202 ;Recycled
21 S J=DA_U_%_U_ACTION_U_DUZ_U_PSIVNOL D ERROR S ^PS(55,DFN,"IV",+ON,"LAB",DA,0)=J
22 Q
233 ;Destroyed
24 S J=DA_U_%_U_ACTION_U_DUZ_U_PSIVNOL D ERROR S ^PS(55,DFN,"IV",+ON,"LAB",DA,0)=J
25 Q
264 ;Cancelled
27 S J=DA_U_%_U_ACTION_U_DUZ_U_PSIVNOL D ERROR S ^PS(55,DFN,"IV",+ON,"LAB",DA,0)=J
28 Q
295 ;Suspended
30 S J=DA_U_%_U_ACTION_U_DUZ_U_PSIVNOL_U_TRACK,^PS(55,DFN,"IV",+ON,"LAB",DA,0)=J
31 Q
32ERROR ;Set piece 8 if user is in the wrong IV room.
33 I $D(E)&($D(E1)) S $P(J,U,8)=E1_" "_E
34 Q
35K ;
36 ;L -^PS(55,DFN,"IV",0) K DA,J,%,N,TRACK,ACTION
37 K DA,J,%,N,TRACK,ACTION
38 Q
Note: See TracBrowser for help on using the repository browser.