source: WorldVistAEHR/trunk/r/SURGERY-SR/SROWRQ1.m@ 1006

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1SROWRQ1 ;B'HAM ISC/MAM - REQUESTS BY WARD (CONT) ;5 Oct 1988 10:01 AM
2 ;;3.0; Surgery ;**37,48,109**;24 Jun 93
3 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
4 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
5 W ! G END
6ALL ; all wards
7 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
8 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
9 W:$E(IOST)="P" @IOF
10END I $E(IOST)'="P",'SRQ W !!,"Press RETURN to continue " R X:DTIME
11 K ^TMP("SRWREQ",$J) I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
12 D ^SRSKILL K SRTN D ^%ZISC W @IOF
13 Q
14OTHER ; other operations
15 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
16 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
17 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
18 Q
19LOOP ; break procedure if greater than 63 characters
20 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
21 Q
22UTL K SRWARD I $D(^DPT(DFN,.1)),$P(^(.1),"^")'="" S SRWARD=$P(^DPT(DFN,.1),"^")
23 S:'$D(SRWARD) SRWARD="OUTPATIENT" S ^TMP("SRWREQ",$J,SRWARD,SRTN)=DFN_"^"_SRSDATE
24 Q
25MORE ;
26 F S SRTN=$O(^SRF("AR",SRSDATE,DFN,SRTN)) Q:'SRTN!(SRQ) D SET
27 Q
28SET ; set and print data
29 I $Y+7>IOSL D ASK Q:SRQ
30 S SRSDATE1=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)_"/"_$E(SRSDATE,2,3)
31 K SRB,SRCPT,SRBT,SRBLOOD,SRBU,SRANES,SRDISP,SRORD,SROP,SROPER
32 D DEM^VADPT S SRNM=VADM(1),SRSSN=VA("PID")
33 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
34 S Y=$P($G(^SRF(SRTN,"1.0")),"^"),C=$P(^DD(130,1.01,0),"^",2) D:Y'="" Y^DIQ S SRANES=Y
35 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
36OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
37 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=""
38 K SRSCC,SRSCC1 I $D(^SRF(SRTN,"CON")),$P(^("CON"),"^")'="" S SRSCC=$P(^("CON"),"^"),SRSCC1="Concurrent Case Number: "_SRSCC
39PRINT ; print results
40 W !," Patient: "_SRNM_" ("_VA("PID")_")",?58,"Case Number: "_SRTN,!," Date of Operation: "_SRSDATE1,?40,"Case Order: "_SRORD,!," Requested Anesthesia: "_SRANES
41 I $O(SRN(0)) W !,"Requested Blood Component: " S SRB=0 F S SRB=$O(SRB(SRB)) Q:SRB="" W ?28,SRB(SRB),!
42 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)
43 W !!," Comments:" S COMMENT=0 F S COMMENT=$O(^SRF(SRTN,5,COMMENT)) Q:'COMMENT W !," "_^SRF(SRTN,5,COMMENT,0)
44 I $D(SRSCC) W !!,?4,SRSCC1 D CON^SROWRQ
45 W ! F LINE=1:1:80 W "-"
46 Q
47BLOOD ; requested blood component information
48 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")
49 S SRB(SRB)=SRB(SRB)_" "_SRBT
50 Q
51ASK I SRASK,$E(IOST,1)'="P" W !!,"Press RETURN to continue or '^' to quit. " R X:DTIME I '$T!(X="^") S SRQ=1 Q
52 S SRASK=1 I SRWARD'="" D HDR^SROWRQ
Note: See TracBrowser for help on using the repository browser.