source: FOIAVistA/trunk/r/SURGERY-SR/SROGMTS0.m@ 635

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1SROGMTS0 ;BIR/ADM - SURGERY HEALTH SUMMARY ; [ 02/18/04 7:12 AM ]
2 ;;3.0; Surgery ;**100**;24 Jun 93
3 ;
4 ;** NOTICE: This routine is part of an implementation of a nationally
5 ;** controlled procedure. Local modifications to this routine
6 ;** are prohibited.
7 ;
8 ; Reference to TGET^TIUSRVR1 supported by DBIA #2944
9 ;
10 Q
11ED(X) ; external date
12 S X=$G(X) Q:'$L(X) ""
13 S X=$TR($$FMTE^XLFDT(X,"5DZ"),"@"," ")
14 Q X
15EDT(X) ; external date and time
16 S X=$G(X) Q:'$L(X) ""
17 S X=$TR($$FMTE^XLFDT(X,"2ZM"),"@"," ")
18 Q X
19EN(X) ; Convert Case
20 N Y,SROK,SROC,SRWORD,SRPC,SRLEAD,SRTLR,SRTR,SRCTR,SRPRE
21 S (SRTR,SRWORD,SRPC)="",X=$$UP(X)
22 ; Parse by Spaces
23 F SRCTR=1:1:$L(X," ") D
24 . S SRWORD=$P(X," ",SRCTR)
25 . S (SRPC,SRLEAD,SRTLR)=""
26 . I $E(SRWORD,1)="(" S SRWORD=$E(SRWORD,2,$L(SRWORD)),SRLEAD="("
27 . I $E(SRWORD,$L(SRWORD))=")" S SRWORD=$E(SRWORD,1,($L(SRWORD)-1)),SRTLR=")"
28 . ; String contains special characters
29 . S SROK=1 F SROC="(",")","-","*","+","{","&","}","[","]","/","\","|",",","'" S:SRWORD[SROC SROK=0 Q:'SROK
30 . I 'SROK D SP
31 . I SROK D SRWORD
32 . S:SRLEAD'="" SRWORD=SRLEAD_SRWORD
33 . S:SRTLR'="" SRWORD=SRWORD_SRTLR
34 . S SRTR=SRTR_" "_SRWORD
35 S X=$$TRIM(SRTR) Q X
36EN2(X) ; Convert Case 2
37 S X=$$CK($$EN($G(X))) Q X
38SP ; Special Characters
39 ; Special Cases of Special Characters
40 I $$UP(SRWORD)="W/&W/O" S SRWORD="w/&w/o" Q
41 I $$UP(SRWORD)="W&W/O" S SRWORD="w&w/o" Q
42 I $$UP(SRWORD)="&/OR" S SRWORD="&/or" Q
43 I SRWORD="W/O" S SRWORD="w/o" Q
44 N SROK,SRWD1,SRWD2,SRW,SRWCTR,SRCHR
45 S SRWD1=SRWORD,SRWD2="",SRW=""
46 F SRWCTR=1:1:$L(SRWD1) D
47 . S SRCHR=$E(SRWD1,SRWCTR) I "()-*+{}'&[]/\|,"[SRCHR,$L(SRW) D Q
48 . . S SRPRE=""
49 . . S:$E(SRW,1,2)="ZZ"&($L(SRW)>2) SRPRE="ZZ",SRW=$E(SRW,3,$L(SRW))
50 . . S SRW=SRPRE_$$CASE(SRW,SRCHR)
51 . . S SRWD2=SRWD2_SRW_SRCHR,SRW=""
52 . S SRW=SRW_SRCHR
53 I $L(SRW) D
54 . N SRPSN F SRPSN=1:1:$L(SRW) Q:"()-*+{}'&[]/\|,"'[$E(SRW,SRPSN)
55 . N SROW,SRLW S SRLW=$E(SRW,0,(SRPSN-1))
56 . S SROW=$E(SRW,SRPSN,$L(SRW))
57 . S SRPRE="" S:$E(SROW,1,2)="ZZ"&($L(SROW)>2) SRPRE="ZZ",SROW=$E(SROW,3,$L(SROW))
58 . S SROW=SRPRE_$$CASE(SROW,$E($G(SRWD2),$L($G(SRWD2))))
59 . S SRW=SRLW_SROW
60 . S SRWD2=SRWD2_SRW
61 S SRWORD=SRWD2 S:SRCTR=1 SRWORD=$$LD(SRWORD)
62 K SRWD1,SRWD2
63 Q
64SRWORD ; Convert word
65 S SRPRE="" S:$E(SRWORD,1,2)="ZZ"&($L(SRWORD)>2) SRPRE="ZZ",SRWORD=$E(SRWORD,3,$L(SRWORD))
66 S SRWORD=SRPRE_$$CASE(SRWORD,"")
67 Q
68CASE(X,J) ; Set to Mixed/lower/UPPER case
69 N SRTAG,SRRTN,Y S X=$$UP($G(X)),Y="",SRTAG=$L(X),SRRTN="SROGMTS1"
70 S:+SRTAG>4 SRRTN="SROGMTS2" S:+SRTAG>9 SRTAG="M"
71 Q:+SRTAG=0&(SRTAG'="M") X
72 S SRRTN=SRTAG_"^"_SRRTN D @SRRTN
73 I $L(Y) S X=Y Q X
74 S X=$$MX(X)
75 Q X
76LO(X) Q $TR(X,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
77UP(X) Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
78MX(X) Q $TR($E(X,1),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")_$TR($E(X,2,$L(X)),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
79LD(X) Q $TR($E(X,1),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")_$E(X,2,$L(X))
80TRIM(X) S X=$G(X) F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
81 F Q:$E(X,$L(X))'=" " S X=$E(X,1,($L(X)-1))
82 Q X
83CK(X) ;
84 S X=$G(X)
85 F Q:X'["(S)" S X=$P(X,"(S)",1)_"(s)"_$P(X,"(S)",2,299)
86 F Q:X'[" A " S X=$P(X," A ",1)_" a "_$P(X," A ",2,229)
87 I X["Class a" F Q:X'["Class a" S X=$P(X,"Class a",1)_"Class A"_$P(X,"Class a",2,229)
88 I X["Type a" F Q:X'["Type a" S X=$P(X,"Type a",1)_"Type A"_$P(X,"Type a",2,229)
89 F Q:X'["'S" S X=$P(X,"'S",1)_"'s"_$P(X,"'S",2,229)
90 I X["mg Diet" F Q:X'["mg Diet" S X=$P(X,"mg Diet",1)_"MG Diet"_$P(X,"mg Diet",2,229)
91 I X["LO-Fat" F Q:X'["LO-Fat" S X=$P(X,"LO-Fat",1)_"Lo-Fat"_$P(X,"LO-Fat",2,229)
92 I $E(X,1)="'" S X="'"_$$LD($E(X,2,$L(X)))
93 S X=$TR($E(X,1),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")_$E(X,2,$L(X))
94 Q X
95DICT ; get dictation from TIU completed
96 N SRCT,SRL,SRNON,SRSTAT,SRSUM,SRTIU,SRTN,SROY,SRT
97 S SRTN=IEN,SRNON=$S($P($G(^SRF(SRTN,"NON")),"^")="Y":1,1:0)
98 S (SRSTAT,SRSUM)="" D STATUS I SRSTAT=7 K ^TMP("SRLQ",$J) D
99 . S REC(130,SRTN,1.15,1)=SRSUM,REC(130,SRTN,1.15,2)="",SRCT=3
100 . D TGET^TIUSRVR1(.SROY,SRTIU,"VIEW")
101 . S SRT=0 F S SRT=$O(@SROY@(SRT)) Q:SRT="" D
102 . . I $D(@SROY@(SRT))=10 S REC(130,SRTN,1.15,SRCT)=@SROY@(SRT,0)
103 . . E S REC(130,SRTN,1.15,SRCT)=@SROY@(SRT)
104 . . S SRCT=SRCT+1
105 . K @SROY
106 Q
107STATUS ; get status of summary in TIU
108 I 'SRNON D Q
109 .S SRTIU=$P($G(^SRF(SRTN,"TIU")),"^") I SRTIU S SRSTAT=$$STATUS^SROESUTL(SRTIU) D
110 ..I SRSTAT=7 S SRSUM=" * * The Operation Report has been electronically signed. * *"
111 I SRNON D
112 .S SRTIU=$P($G(^SRF(SRTN,"TIU")),"^",3) I SRTIU S SRSTAT=$$STATUS^SROESUTL(SRTIU) D
113 ..I SRSTAT=7 S SRSUM=" * * The Procedure Report (Non-OR) has been electronically signed. * *" Q
114 Q
Note: See TracBrowser for help on using the repository browser.