54 lines
2.6 KiB
Mathematica
54 lines
2.6 KiB
Mathematica
|
RMPFDB1 ;DDC/KAW-DISPLAY TRANSMISSION BATCH; [ 09/03/97 3:42 PM ]
|
||
|
;;2.0;REMOTE ORDER/ENTRY SYSTEM;**8**;MAY 30, 1995
|
||
|
;; input: RMPFBT
|
||
|
;;output: RMPFB
|
||
|
G END:'$D(RMPFBT),END:'$D(^RMPF(791812,RMPFBT,0)) S S0=^(0)
|
||
|
S Y=$P(S0,U,1) D DD^%DT S RMPFBDT=Y,RMPFSTP="",RMPFST=$P(S0,U,2)
|
||
|
S RMPFSTP=$S(RMPFST=1:"OPEN",RMPFST=2:"CLOSED",RMPFST=3:"TRANSMITTED",RMPFST=4:"RECEIVED BY DDC",1:"")
|
||
|
S RMPFBNA=$P(S0,U,4) D HEAD S (CT,RMPFBJ)=0
|
||
|
A1 S RMPFBJ=$O(^RMPF(791812,RMPFBT,101,RMPFBJ)) G B1:'RMPFBJ,A1:'$D(^(RMPFBJ,0)) S S0=^(0),RMPFDU=$P(S0,U,2),RMPFDUP=""
|
||
|
I RMPFDU,$D(^VA(200,RMPFDU,0)) S RMPFDUP=$P(^(0),U,1)
|
||
|
S RMPFDTD="",Y=$P(S0,U,3) I Y D DD^%DT S RMPFDTD=Y
|
||
|
S RMPFDLR=$P(S0,U,4),RMPFX=$P(S0,U,1) G A1:'RMPFX
|
||
|
S RMPFDL=$S(RMPFDUP'="":"YES",1:"")
|
||
|
G A1:'$D(^RMPF(791810,RMPFX,0)) S S0=^(0),Y=$P(S0,U,1)
|
||
|
D DD^%DT S RMPFTD=Y,RMPFTYP="",X=$P(S0,U,2)
|
||
|
I X,$D(^RMPF(791810.1,X,0)) S RMPFTYP=$P(^(0),U,8)
|
||
|
S RMPFAD=$P(S0,U,8),RMPFADP="" I RMPFAD,$D(^VA(200,RMPFAD,0)) S RMPFADP=$P(^(0),U,1)
|
||
|
S DFN=$P(S0,U,4),RMPFNAM="N/A"
|
||
|
I DFN D PAT^RMPFUTL
|
||
|
I $Y>$S(IOST?1"C-".E:20,1:58) D CONT G END:$D(RMPFOUT),END:$D(ZTSK),END:'$D(RMPFBDT) D HEAD
|
||
|
S CT=CT+1 W !,$J(CT,2),". ",$E(RMPFTD,1,18),?24,$E(RMPFTYP,1,6),?32,$E(RMPFADP,1,17),?51,$E(RMPFNAM,1,19),?74,RMPFDL S RMPFB(CT)=RMPFBJ
|
||
|
I RMPFDL="YES" W !?4,"Deleted By: ",$E(RMPFDUP,1,18) W:RMPFDLR'="" ?42,"Reason: ",$E(RMPFDLR,1,30)
|
||
|
G A1
|
||
|
B1 W !!,"Total Orders in Batch: ",CT
|
||
|
W:IOST?1"P-".E @IOF
|
||
|
D:$D(IO("S")) ^%ZISC
|
||
|
END K RMPFBDT,RMPFSTP,RMPFST,RMPFBNA,RMPFBJ,RMPFDU,RMPFDUP,RMPFDLR
|
||
|
K RMPFX,RMPFDL,RMPFDLR,RMPFTD,RMPFTYP,RMPFAD,RMPFADP,DFN,RMPFNAM
|
||
|
K RMPFDOB,RMPFSSN,RMPFDTD,RMPFDOD,S0,CT,I,X,Y Q
|
||
|
HEAD W @IOF,!?17,"REMOTE ORDER/ENTRY TRANSMISSION BATCH ENTRIES"
|
||
|
W !,"Station: ",RMPFSTAP,?68,RMPFDAT
|
||
|
W !?2,"Batch: ",RMPFBDT,?37,"Status: ",$E(RMPFSTP,1,14),?62,"Number Active: ",$J(RMPFBNA,3)
|
||
|
W ! F I=1:1:80 W "-"
|
||
|
W !," #",?5,"Order Date/Time",?25,"Type",?35,"Ordered By",?57,"Patient",?72,"Deleted"
|
||
|
W !,"---",?4,"------------------",?24,"------",?32,"-----------------",?51,"-------------------",?72,"--------" W !
|
||
|
Q
|
||
|
CONT F I=1:1 Q:$Y>20 W !
|
||
|
W !,"Enter <RETURN> to continue, <P>rint or <^> to exit: " D READ
|
||
|
Q:$D(RMPFOUT) I $D(RMPFQUT) D MSG^RMPFDD G CONT
|
||
|
Q:Y="" S Y=$E(Y,1) G CONT:"Pp"'[Y D QUE
|
||
|
Q
|
||
|
QUE S ZTRTN="^RMPFDB1",ZTDESC="ORDER BATCH"
|
||
|
S %ZIS="NPQ" D ^%ZIS G QUEE:POP
|
||
|
I IO=IO(0),'$D(IO("S")) G RMPFDB1
|
||
|
I $D(IO("S")) S %ZIS="",IOP=ION D ^%ZIS G ^RMPFDB1
|
||
|
S ZTSAVE("RM*")="",ZTIO=ION D ^%ZTLOAD,HOME^%ZIS
|
||
|
W:$D(ZTSK) !!,"*** Request Queued ***" H 2
|
||
|
QUEE Q
|
||
|
READ K RMPFOUT,RMPFQUT
|
||
|
R Y:DTIME I '$T W $C(7) R Y:5 G READ:Y="." S:'$T Y=U
|
||
|
I Y?1"^".E S (RMPFOUT,Y)="" Q
|
||
|
S:Y?1"?".E (RMPFQUT,Y)=""
|
||
|
Q
|