32 lines
1.4 KiB
Mathematica
32 lines
1.4 KiB
Mathematica
PSIVHIS ;BIR/MLM-PRINT HISTORY LOG ;22 MAY 95 / 12:20 PM
|
|
;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
|
|
;
|
|
SPRINT(DFN,PSIVH) ; History log from beginning.
|
|
N DONE,ON,ON55,P,PSIVAC,PSIVOLD,PSIVNEW
|
|
S (ON55,ON)=PSIVH,PSIVAC="PH" D RELATE I '$L(PSIVOLD_PSIVNEW) W !,"No History Log to Report." S DIRUT=1 Q
|
|
S:'PSIVOLD PSIVOLD=PSIVH
|
|
QUE ;Ask device, queue if necessary.
|
|
W ! K IO("Q"),%ZIS,IOP S %ZIS="QM" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED" G K
|
|
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."
|
|
Q
|
|
;
|
|
DEQ ;Entry from queue.
|
|
N DONE,DTOUT,DUOUT,ON55,PSIVNEW,PSGP,PSGORD,PSJSYSU
|
|
U IO F S ON=PSIVOLD D RELATE Q:PSIVOLD=""
|
|
F S (P("PON"),ON55)=ON D DISPLAY,RELATE S ON=PSIVNEW Q:PSIVNEW=""!$D(DONE)
|
|
S:$D(ZTQUEUED) ZTREQ="@" D ^%ZISC
|
|
;
|
|
K ; Kill and exit.
|
|
K PSIVOLD W:$E(IOST,1)'="C"&($Y) @IOF
|
|
Q
|
|
DISPLAY ; Display order.
|
|
I ON["A" S PSJSYSU=1,PSGP=DFN,PSGORD=+ON D EN2^PSGVW
|
|
I ON'["A" D @$S(ON["V":"GT55^PSIVORFB",1:"GT531^PSIVORFA(DFN,ON)"),ENNONUM^PSIVORV2(DFN,ON)
|
|
I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR I $D(DTOUT)!($D(DUOUT)) S DONE=1 Q
|
|
Q
|
|
RELATE ; Get related order.
|
|
I ON["A" S PSIVOLD=$P($G(^PS(55,DFN,5,+ON,0)),U,25),PSIVNEW=$P($G(^(0)),U,26) Q
|
|
I ON["V" S PSIVOLD=$P($G(^PS(55,DFN,"IV",+ON,2)),U,5),PSIVNEW=$P($G(^(2)),U,6) Q
|
|
S PSIVOLD=$P($G(^PS(53.1,+ON,0)),U,25),PSIVNEW=$P($G(^(0)),U,26)
|
|
Q
|