source: FOIAVistA/tag/r/SURGERY-SR/SRONP1.m@ 1410

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1SRONP1 ;BIR/ADM - PROCEDURE REPORT (NON-OR) ; [ 07/10/04 10:45 AM ]
2 ;;3.0; Surgery ;**132**;24 Jun 93
3 I $O(^SRF(SRTN,22,0)) D LINE(2) S @SRG@(SRI)="Medications:" D MED
4 I $O(^SRF(SRTN,40,0)) D LINE(2) S @SRG@(SRI)="Indications for Procedure:" S SRLINE=0 D
5 .F S SRLINE=$O(^SRF(SRTN,40,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,40,SRLINE,0) D COMM^SRONP2(X,2)
6 I $O(^SRF(SRTN,39,0)) D LINE(2) S @SRG@(SRI)="Brief Clinical History:" S SRLINE=0 D
7 .F S SRLINE=$O(^SRF(SRTN,39,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,39,SRLINE,0) D COMM^SRONP2(X,2)
8 I $O(^SRF(SRTN,38,0)) D LINE(2) S @SRG@(SRI)="Operative Findings:" S SRLINE=0 D
9 .F S SRLINE=$O(^SRF(SRTN,38,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,38,SRLINE,0) D COMM^SRONP2(X,2)
10 I $O(^SRF(SRTN,9,0)) D LINE(2) S @SRG@(SRI)="Specimens: " S SRLINE=0 D
11 .F S SRLINE=$O(^SRF(SRTN,9,SRLINE)) Q:'SRLINE D LINE(1) S @SRG@(SRI)=$$SPACE(2)_^SRF(SRTN,9,SRLINE,0)
12 I $O(^SRF(SRTN,43,0)) D LINE(2) S @SRG@(SRI)="Occurrences:" D OCC
13 I $O(^SRF(SRTN,5,0)) D LINE(2) S @SRG@(SRI)="General Comments:" S SRLINE=0 D
14 .F S SRLINE=$O(^SRF(SRTN,5,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,5,SRLINE,0) D COMM^SRONP2(X,2)
15 S Y=$P($G(^SRF(SRTN,"TIU")),"^",5),Y=$S(Y=0:"NO",Y=1:"YES",1:"NOT ENTERED")
16 D LINE(2) S @SRG@(SRI)="Dictated Summary Expected: "_Y
17 Q
18N(SRL) N SRNM I $L(Y)>SRL S SRNM=$P(Y,",")_","_$E($P(Y,",",2))_".",Y=SRNM
19 Q
20MED ; medications
21 N ADBY,ADM,C,CNT,COMMENT,DOSE,MED,MM,ORBY,ROUTE,TIME,X,Y
22 S (CNT,MED)=0 F S MED=$O(^SRF(SRTN,22,MED)) Q:'MED S CNT=CNT+1 D
23 .S Y=$P(^SRF(SRTN,22,MED,0),"^"),C=$P(^DD(130.33,.01,0),"^",2) D Y^DIQ,LINE(1) S @SRG@(SRI)=" "_Y,ADM=0 F S ADM=$O(^SRF(SRTN,22,MED,1,ADM)) Q:'ADM D
24 ..S MM=^SRF(SRTN,22,MED,1,ADM,0),Y=$P(MM,"^") D D^DIQ S TIME=$P(Y,"@")_" "_$P(Y,"@",2)
25 ..S DOSE=$P(MM,"^",2)
26 ..S Y=$P(MM,"^",5),C=$P(^DD(130.34,4,0),"^",2) D:Y'="" Y^DIQ S ROUTE=Y
27 ..D LINE(1) S @SRG@(SRI)=" Time Administered: "_TIME D LINE(1) S @SRG@(SRI)=" Route: "_ROUTE,@SRG@(SRI)=@SRG@(SRI)_$$SPACE(40)_"Dosage: "_DOSE
28 Q
29OCC N C,SRC,SRT,Y S SRC=0 F S SRC=$O(^SRF(SRTN,43,SRC)) Q:'SRC D
30 .D LINE(1) S @SRG@(SRI)=" "_$P(^SRF(SRTN,43,SRC,0),"^")
31 .S Y=$P(^SRF(SRTN,43,SRC,0),"^",3) D:Y D^DIQ S SRT=$S(Y'="":$P(Y,"@")_" "_$P(Y,"@",2),1:"") S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(50)_"Date: "_SRT
32 .D LINE(1) S @SRG@(SRI)=" Treatment: "_$P(^SRF(SRTN,43,SRC,0),"^",4)
33 .S Y=$P(^SRF(SRTN,43,SRC,0),"^",2),C=$P(^DD(130.0126,1,0),"^",2) D:Y'="" Y^DIQ S @SRG@(SRI)=@SRG@(SRI)_$$SPACE(58)_"Outcome: "_Y
34 .I $O(^SRF(SRTN,43,SRC,1,0)) D LINE(1) S @SRG@(SRI)=" Comments:" S SRLINE=0 D
35 ..F S SRLINE=$O(^SRF(SRTN,43,SRC,1,SRLINE)) Q:'SRLINE S X=^SRF(SRTN,43,SRC,1,SRLINE,0) D COMM^SRONP2(X,6)
36 Q
37SPACE(NUM) ;create spaces
38 ;pass in position returns number of needed spaces
39 I '$D(@SRG@(SRI)) S @SRG@(SRI)=""
40 Q $J("",NUM-$L(@SRG@(SRI)))
41LINE(NUM) ;create carriage returns
42 F J=1:1:NUM S SRI=SRI+1,@SRG@(SRI)=""
43 Q
Note: See TracBrowser for help on using the repository browser.