[613] | 1 | PSIVHIS ;BIR/MLM-PRINT HISTORY LOG ;22 MAY 95 / 12:20 PM
|
---|
| 2 | ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
|
---|
| 3 | ;
|
---|
| 4 | SPRINT(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
|
---|
| 8 | QUE ;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 | ;
|
---|
| 13 | DEQ ;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 | ;
|
---|
| 19 | K ; Kill and exit.
|
---|
| 20 | K PSIVOLD W:$E(IOST,1)'="C"&($Y) @IOF
|
---|
| 21 | Q
|
---|
| 22 | DISPLAY ; 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
|
---|
| 27 | RELATE ; 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
|
---|