source: FOIAVistA/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSIVHIS.m@ 1724

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

initial load of FOIAVistA 6/30/08 version

File size: 1.4 KB
Line 
1PSIVHIS ;BIR/MLM-PRINT HISTORY LOG ;22 MAY 95 / 12:20 PM
2 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
3 ;
4SPRINT(DFN,PSIVH) ; History log from beginning.
5 N DONE,ON,ON55,P,PSIVAC,PSIVOLD,PSIVNEW
6 S (ON55,ON)=PSIVH,PSIVAC="PH" D RELATE I '$L(PSIVOLD_PSIVNEW) W !,"No History Log to Report." S DIRUT=1 Q
7 S:'PSIVOLD PSIVOLD=PSIVH
8QUE ;Ask device, queue if necessary.
9 W ! K IO("Q"),%ZIS,IOP S %ZIS="QM" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED" G K
10 G:'$D(IO("Q")) DEQ K ZTDTH,ZTSAVE,ZTSK S ZTIO=ION,ZTSAVE("PSIVOLD")="",ZTSAVE("DFN")="",ZTDESC="IV HISTORY LOG",ZTRTN="DEQ^PSIVHIS" K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"Queued."
11 Q
12 ;
13DEQ ;Entry from queue.
14 N DONE,DTOUT,DUOUT,ON55,PSIVNEW,PSGP,PSGORD,PSJSYSU
15 U IO F S ON=PSIVOLD D RELATE Q:PSIVOLD=""
16 F S (P("PON"),ON55)=ON D DISPLAY,RELATE S ON=PSIVNEW Q:PSIVNEW=""!$D(DONE)
17 S:$D(ZTQUEUED) ZTREQ="@" D ^%ZISC
18 ;
19K ; Kill and exit.
20 K PSIVOLD W:$E(IOST,1)'="C"&($Y) @IOF
21 Q
22DISPLAY ; Display order.
23 I ON["A" S PSJSYSU=1,PSGP=DFN,PSGORD=+ON D EN2^PSGVW
24 I ON'["A" D @$S(ON["V":"GT55^PSIVORFB",1:"GT531^PSIVORFA(DFN,ON)"),ENNONUM^PSIVORV2(DFN,ON)
25 I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR I $D(DTOUT)!($D(DUOUT)) S DONE=1 Q
26 Q
27RELATE ; Get related order.
28 I ON["A" S PSIVOLD=$P($G(^PS(55,DFN,5,+ON,0)),U,25),PSIVNEW=$P($G(^(0)),U,26) Q
29 I ON["V" S PSIVOLD=$P($G(^PS(55,DFN,"IV",+ON,2)),U,5),PSIVNEW=$P($G(^(2)),U,6) Q
30 S PSIVOLD=$P($G(^PS(53.1,+ON,0)),U,25),PSIVNEW=$P($G(^(0)),U,26)
31 Q
Note: See TracBrowser for help on using the repository browser.