source: FOIAVistA/trunk/r/SURGERY-SR/SROCOM.m@ 1166

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

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1SROCOM ;B'HAM ISC/MAM - ENTER COMMENTS ; [ 01/30/01 10:02 AM ]
2 ;;3.0; Surgery ;**100**;24 Jun 93
3CASE ; get case number
4 W @IOF K DIC S DIC=2,DIC(0)="AEQMZ",DIC("A")="Select Patient: " D ^DIC K DIC Q:Y<0 S DFN=+Y,SRNAME=Y(0,0)
5LOOK W ! S (SRTN,CNT)=0 F I=0:0 S SRTN=$O(^SRF("B",DFN,SRTN)) Q:SRTN="" S CNT=CNT+1,SROP1(CNT)=SRTN D LIST
6 I '$D(SROP1(1)) W !!,"There are no cases entered for "_SRNAME_".",!! W !!,"Press RETURN to continue " R X:DTIME G END
7ASK R !!,"Select Number: ",SRNUM:DTIME I '$T!("^"[SRNUM) G END
8 I SRNUM["?" W !!,"Enter the number which corresponds to the case that you want to enter comments." G ASK
9 I '$D(SROP1(SRNUM)) W !!,"You have entered an invalid number, please select again. " G ASK
10 W !! S SRTN=SROP1(SRNUM) I $$LOCK^SROUTL(SRTN) S DIE=130,DA=SRTN,DR=".28T" D ^DIE K DR D UNLOCK^SROUTL(SRTN)
11END K SRTN D ^SRSKILL W @IOF
12 Q
13OTHER ; other operations
14 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>235 S SRLONG=0,OPER=999,SROPERS=" ..."
15 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
16 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
17 Q
18LIST ; list cases
19 S SRSDATE=$P(^SRF(SRTN,0),"^",9),SRSDATE=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)_"/"_$E(SRSDATE,2,3)
20OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
21 S SROP=SRTN D ^SROP1 K SROPS,MM,MMM S:$L(SROPER)<60 SROPS(1)=SROPER I $L(SROPER)>59 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
22 W !,CNT_". "_SRSDATE,?15,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)
23 Q
24LOOP ; break procedure if greater than 60 characters
25 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<60 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
26 Q
Note: See TracBrowser for help on using the repository browser.