source: FOIAVistA/trunk/r/SURGERY-SR/SROGTSR.m@ 1611

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1SROGTSR ;WASH/GEK,BIR/ADM - IMAGING: SURGERY CASE LIST ; [ 05/08/97 6:11 AM ]
2 ;;3.0; Surgery ;**66,89**;24 Jun 93
3ERRA ; Error trap
4 S SRGY(0)="0^ERROR "_$$EC^%ZOSV
5 D @^%ZOSF("ERRTN")
6 Q
7GET(SRGY,SRDFN) ;
8 N CNT,DFN,J,K,LOOP,M,MM,MMM,SR,SRDT,SRIMAGE,SRIMCNT,SRLONG,SROP,SROPER,SROPERS,SROPS,SROTHER,SRSCAN,SRSDATE,SRSOUT,SRSTAT,SRSTATUS,SRTOT,X,Y
9 S X="ERRA^SROGTSR",@^%ZOSF("TRAP")
10 S DFN=+SRDFN
11 S SRSOUT=0
12 S (SRDT,SRTOT)=0,CNT=2 F S SRDT=$O(^SRF("ADT",DFN,SRDT)) Q:'SRDT!(SRSOUT) S SROP=0 F S SROP=$O(^SRF("ADT",DFN,SRDT,SROP)) Q:'SROP!(SRSOUT) D LIST
13 I '$D(SRGY(2)) S SRGY(0)="0^There are no cases entered" Q
14 S SRGY(0)=SRTOT_"^Case"_$S(SRTOT=1:"",1:"s")_" found"
15 S SRGY(1)="#^Date^Case description"
16 Q
17LIST ; list cases
18 I $P($G(^SRF(SROP,"NON")),"^")="Y" Q
19 S SRSCAN=1 I $D(^SRF(SROP,.2)),$P(^(.2),"^",12)'="" K SRSCAN
20 I $D(SRSCAN),$D(^SRF(SROP,30)),$P(^(30),"^") Q
21 I $D(SRSCAN),$D(^SRF(SROP,31)),$P(^(31),"^",8) Q
22 I $D(^SRF(SROP,37)),$P(^(37),"^") Q
23 S SRSDATE=$P(^SRF(SROP,0),"^",9)
24 S SRTOT=SRTOT+1,SRGY(CNT)=SRTOT_U_$E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_($E(SRSDATE,1,3)+1700)_U
25 S SROPER=$P(^SRF(SROP,"OP"),"^") I $O(^SRF(SROP,13,0)) S SROTHER=0 F I=0:0 S SROTHER=$O(^SRF(SROP,13,SROTHER)) Q:'SROTHER D OTHER
26 D ^SROP1 K SROPS,MM,MMM S:$L(SROPER)<65 SROPS(1)=SROPER I $L(SROPER)>64 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
27 S (SRIMCNT,SRIMAGE)=0 F S SRIMAGE=$O(^SRF(SROP,2005,SRIMAGE)) Q:'SRIMAGE S SRIMCNT=SRIMCNT+1
28 S SRGY(CNT)=SRGY(CNT)_SROPS(1)_U_SROP_U_SRSDATE_U_SRIMCNT,CNT=CNT+1
29 S J=2 F Q:'$D(SROPS(J)) S SRGY(CNT)="^^"_SROPS(J),J=J+1,CNT=CNT+1
30 Q
31OTHER ; other operations
32 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,SROTHER,0),"^"))>235 S SRLONG=0,SROTHER=999,SROPERS=" ..."
33 I SRLONG S SROPERS=$P(^SRF(SROP,13,SROTHER,0),"^")
34 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
35 Q
36LOOP ; break procedure
37 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<65 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
38 Q
Note: See TracBrowser for help on using the repository browser.