source: WorldVistAEHR/trunk/r/SURGERY-SR/SRONP0.m@ 623

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1SRONP0 ;BIR/ADM - PROCEDURE REPORT (NON-OR) ;10 Mar 2005 10:39 AM
2 ;;3.0; Surgery ;**132,142**;24 Jun 93
3 D TIMES
4 D PRIN I $O(^SRF(SRTN,13,0)) D OTHER
5 D ^SRONP1
6 Q
7N(SRL) N SRNM I $L(Y)>SRL S SRNM=$P(Y,",")_","_$E($P(Y,",",2))_".",Y=SRNM
8 Q
9TIMES ; anesthesia start and end times, procedure start and end times
10 N AB,AE,OB,OE D LINE(1)
11 S AB="N/A",Y=$P(SR(.2),"^") I Y D D^DIQ S AB=$P(Y,"@")_" "_$P(Y,"@",2)
12 S AE="N/A",Y=$P(SR(.2),"^",4) I Y D D^DIQ S AE=$P(Y,"@")_" "_$P(Y,"@",2)
13 I AB="N/A",AE="N/A" G PRTM
14 D LINE(1) S @SRG@(SRI)="Anes Begin: "_AB S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Anes End: "_AE
15PRTM S Y=$P(SR("NON"),"^",4) I Y D D^DIQ S OB=$P(Y,"@")_" "_$P(Y,"@",2)
16 D LINE(1) S @SRG@(SRI)="Proc Begin: "_$S($D(OB):OB,1:"NOT ENTERED")
17 S Y=$P(SR("NON"),"^",5) I Y D D^DIQ S OE=$P(Y,"@")_" "_$P(Y,"@",2)
18 S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Proc End: "_$S($D(OE):OE,1:"NOT ENTERED")
19 Q
20PRIN ; principal procedure information
21 N CNT,I,LOOP,M,MM,MMM,SRJ,SROPER,SROPS,SRX,SRY,SRZ,X,Z
22 D LINE(2) S @SRG@(SRI)="Procedure(s) Performed:"
23PRIN2 S SROPER=$P(^SRF(SRTN,"OP"),"^")
24 S SROPER="Principal: "_SROPER
25 S:$L(SROPER)<74 SROPS(1)=SROPER I $L(SROPER)>73 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
26 F I=1:1 Q:'$D(SROPS(I)) D LINE(1) S @SRG@(SRI)=$S(I=1:" ",1:" ")_SROPS(I)
27 Q
28LOOP ; break procedure if greater than 74 characters
29 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<74 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
30 Q
31OTHER ; other procedures
32 N CNT,OTH,OTHER,SRJ,SRX,SRY,SRZ,Z
33 D LINE(1) S (OTH,CNT)=0 F S OTH=$O(^SRF(SRTN,13,OTH)) Q:'OTH S CNT=CNT+1 D OTH
34 Q
35OTH S OTHER=$P(^SRF(SRTN,13,OTH,0),"^")
36 S @SRG@(SRI)=" Other: "_OTHER
37 I $P($G(^SRF(SRTN,13,OTH,2)),"^"),$O(^SRF(SRTN,13,OTH,1,0)) D CPT
38 Q
39CPT D LINE(1) S @SRG@(SRI)=" Procedure Code Comments:" S SRLINE=0
40 F S SRLINE=$O(^SRF(SRTN,13,OTH,1,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,13,OTH,1,SRLINE,0) D COMM^SRONP2(X,5)
41 Q
42SPACE(NUM) ;create spaces
43 ;pass in position returns number of needed spaces
44 I '$D(@SRG@(SRI)) S @SRG@(SRI)=""
45 Q $J("",NUM-$L(@SRG@(SRI)))
46LINE(NUM) ;create carriage returns
47 F J=1:1:NUM S SRI=SRI+1,@SRG@(SRI)=""
48 Q
Note: See TracBrowser for help on using the repository browser.