53 lines
3.6 KiB
Mathematica
53 lines
3.6 KiB
Mathematica
SROWRQ1 ;B'HAM ISC/MAM - REQUESTS BY WARD (CONT) ;5 Oct 1988 10:01 AM
|
|
;;3.0; Surgery ;**37,48,109**;24 Jun 93
|
|
K %DT S SRASK=0 K ^TMP("SRWREQ",$J) U IO S SRQ=0,X="T-1" D ^%DT S SRSDATE=+Y I SRWARD="" G ALL
|
|
D HDR^SROWRQ S DFN="" F S SRSDATE=$O(^SRF("AR",SRSDATE)) Q:SRSDATE=""!(SRQ) F S DFN=$O(^SRF("AR",SRSDATE,DFN)) Q:DFN=""!SRQ I $D(^DPT(DFN,.1)),$P(^(.1),"^")=SRWARD S SRTN=0 D MORE
|
|
W ! G END
|
|
ALL ; all wards
|
|
K SRWARD S (DFN,SRTN)=0 F S SRSDATE=$O(^SRF("AR",SRSDATE)) Q:'SRSDATE!(SRQ) F S DFN=$O(^SRF("AR",SRSDATE,DFN)) Q:'DFN!(SRQ) F S SRTN=$O(^SRF("AR",SRSDATE,DFN,SRTN)) Q:'SRTN!(SRQ) D UTL
|
|
S SRWARD=0 F S SRWARD=$O(^TMP("SRWREQ",$J,SRWARD)) Q:SRWARD=""!(SRQ) D ASK Q:SRQ S SRTN=0 F S SRTN=$O(^TMP("SRWREQ",$J,SRWARD,SRTN)) Q:'SRTN!(SRQ) S DFN=^(SRTN) S SRSDATE=$P(DFN,"^",2),DFN=+DFN D SET
|
|
W:$E(IOST)="P" @IOF
|
|
END I $E(IOST)'="P",'SRQ W !!,"Press RETURN to continue " R X:DTIME
|
|
K ^TMP("SRWREQ",$J) I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
|
|
D ^SRSKILL K SRTN D ^%ZISC W @IOF
|
|
Q
|
|
OTHER ; other operations
|
|
S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
|
|
I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
|
|
S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
|
|
Q
|
|
LOOP ; break procedure if greater than 63 characters
|
|
S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<63 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
|
|
Q
|
|
UTL K SRWARD I $D(^DPT(DFN,.1)),$P(^(.1),"^")'="" S SRWARD=$P(^DPT(DFN,.1),"^")
|
|
S:'$D(SRWARD) SRWARD="OUTPATIENT" S ^TMP("SRWREQ",$J,SRWARD,SRTN)=DFN_"^"_SRSDATE
|
|
Q
|
|
MORE ;
|
|
F S SRTN=$O(^SRF("AR",SRSDATE,DFN,SRTN)) Q:'SRTN!(SRQ) D SET
|
|
Q
|
|
SET ; set and print data
|
|
I $Y+7>IOSL D ASK Q:SRQ
|
|
S SRSDATE1=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)_"/"_$E(SRSDATE,2,3)
|
|
K SRB,SRCPT,SRBT,SRBLOOD,SRBU,SRANES,SRDISP,SRORD,SROP,SROPER
|
|
D DEM^VADPT S SRNM=VADM(1),SRSSN=VA("PID")
|
|
S SRORD=$P(^SRF(SRTN,0),"^",11),Y=$P($G(^SRF(SRTN,.4)),"^",6),C=$P(^DD(130,.46,0),"^",2) D:Y'="" Y^DIQ S SRDISP=Y
|
|
S Y=$P($G(^SRF(SRTN,"1.0")),"^"),C=$P(^DD(130,1.01,0),"^",2) D:Y'="" Y^DIQ S SRANES=Y
|
|
I $O(^SRF(SRTN,11,0)) S SRB=0 F S SRB=$O(^SRF(SRTN,11,SRB)) Q:'SRB S SRBLOOD=$P(^SRF(SRTN,11,SRB,0),"^"),SRBU=$P(^(0),"^",2),SRBT=$P(^(0),"^",3) D BLOOD ;,SRBLOOD=$P(^LAB(66,SRBLOOD,0),"^") D BLOOD ;RLM
|
|
OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
|
|
K SROPS,MM,MMM S:$L(SROPER)<63 SROPS(1)=SROPER I $L(SROPER)>62 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
|
|
K SRSCC,SRSCC1 I $D(^SRF(SRTN,"CON")),$P(^("CON"),"^")'="" S SRSCC=$P(^("CON"),"^"),SRSCC1="Concurrent Case Number: "_SRSCC
|
|
PRINT ; print results
|
|
W !," Patient: "_SRNM_" ("_VA("PID")_")",?58,"Case Number: "_SRTN,!," Date of Operation: "_SRSDATE1,?40,"Case Order: "_SRORD,!," Requested Anesthesia: "_SRANES
|
|
I $O(SRN(0)) W !,"Requested Blood Component: " S SRB=0 F S SRB=$O(SRB(SRB)) Q:SRB="" W ?28,SRB(SRB),!
|
|
W !," Operation(s): "_SROPS(1) I $D(SROPS(2)) W !,?15,SROPS(2) I $D(SROPS(3)) W !,?15,SROPS(3) I $D(SROPS(4)) W !,?15,SROPS(4) I $D(SROPS(5)) W !,?15,SROPS(5) I $D(SROPS(6)) W !,?15,SROPS(6)
|
|
W !!," Comments:" S COMMENT=0 F S COMMENT=$O(^SRF(SRTN,5,COMMENT)) Q:'COMMENT W !," "_^SRF(SRTN,5,COMMENT,0)
|
|
I $D(SRSCC) W !!,?4,SRSCC1 D CON^SROWRQ
|
|
W ! F LINE=1:1:80 W "-"
|
|
Q
|
|
BLOOD ; requested blood component information
|
|
S SRBT=$S(SRBT="C":"CROSSMATCH",SRBT="S":"SCREEN",SRBT="A":"AUTOLOGOUS",1:"") S SRB(SRB)=SRBLOOD S SRB(SRB)=SRB(SRB)_" "_SRBU_$S(SRBU>1:" UNITS",SRBU>0:" UNIT",1:" UNITS NOT ENTERED")
|
|
S SRB(SRB)=SRB(SRB)_" "_SRBT
|
|
Q
|
|
ASK I SRASK,$E(IOST,1)'="P" W !!,"Press RETURN to continue or '^' to quit. " R X:DTIME I '$T!(X="^") S SRQ=1 Q
|
|
S SRASK=1 I SRWARD'="" D HDR^SROWRQ
|