source: WorldVistAEHR/trunk/r/SURGERY-SR/SROESNR.m@ 1096

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

initial load of WorldVistAEHR

File size: 5.2 KB
Line 
1SROESNR ;BIR/ADM - NURSE INTRAOP REPORT E-SIG UTILITY ; [ 02/20/02 6:57 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 Q
9IN N SRS S SRS=1 D GET
10 Q
11EX N SRS S SRS=2 D GET,COMP
12 I $D(^TMP("SRNRAD1",$J,SRTN))!$D(^TMP("SRNRAD2",$J,SRTN)) D ^SROESNR2
13 Q
14GET K ^TMP("SRNRAD"_SRS,$J,SRTN) D VIEW^SROESNR0,MULT
15 Q
16MULT ; get data from multiples
17 N SRK
18 F SRK=130.23,130.28,130.36,130.24,130.065,130.31,130.028,130.16,130.02,130.32,130.01,130.33,130.08,130.04,130.0129,130.013,130.18 D MULT^SROESNR1
19 S SRK=130.06 D MULT^SROESNR3
20 Q
21COMP ; compare before and after view
22 N SRFLD,SRCHNG,SRE,SRE1,SRE2,SRS,SRS1,SROTH,SRLN,SRMULT,X
23 S SRFLD="" F S SRFLD=$O(^TMP("SRNRAD1",$J,SRTN,130,SRFLD)) Q:SRFLD="" S SRCHNG=0 D
24 .I $P(SRFLD,"-",2)[";W" D Q
25 ..F SRS=1,2 Q:SRCHNG S SRLN=0,SROTH=$S(SRS=1:2,1:1) F S SRLN=$O(^TMP("SRNRAD"_SRS,$J,SRTN,130,SRFLD,SRLN)) Q:'SRLN D Q:SRCHNG
26 ...I ^TMP("SRNRAD"_SRS,$J,SRTN,130,SRFLD,SRLN)'=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,130,SRFLD,SRLN)) S SRCHNG=1
27 ..I 'SRCHNG F SRS=1,2 K ^TMP("SRNRAD"_SRS,$J,SRTN,130,SRFLD)
28 .I ^TMP("SRNRAD1",$J,SRTN,130,SRFLD)'=$G(^TMP("SRNRAD2",$J,SRTN,130,SRFLD)) S SRCHNG=1
29 .I 'SRCHNG F SRS=1,2 K ^TMP("SRNRAD"_SRS,$J,SRTN,130,SRFLD)
30CMULT ; process multiples
31 F SRS=1,2 K ^TMP("SRNRMULT"_SRS,$J,SRTN)
32 F SRS=1,2 S SRMULT="A" F S SRMULT=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT)) Q:SRMULT="" S SROTH=$S(SRS=1:2,1:1) D PASS1
33 F SRS=1,2 S SRMULT="A" F S SRMULT=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT)) Q:SRMULT="" S SROTH=$S(SRS=1:2,1:1) D PASS2
34 F SRS=1,2 S SRMULT="A" F S SRMULT=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT)) Q:SRMULT="" S SROTH=$S(SRS=1:2,1:1) D PASS3
35 F SRS=1,2 S SRMULT="A" F S SRMULT=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT)) Q:SRMULT="" S SROTH=$S(SRS=1:2,1:1) D PASS4
36 Q
37PASS1 ; delete nodes for unchanged fields except for .01 fields
38 S SRE=0 F S SRE=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE)) Q:'SRE S SRE1="" F S SRE1=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1)) Q:SRE1="" D
39 .S SRFLD="" F S SRFLD=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)) Q:SRFLD="" S SRCHNG=0 D
40 ..S Y=$P(SRFLD,"-",3) I $P(Y,",",2)=.01 Q
41 ..I $P(SRFLD,"-",3)[";W" D Q
42 ...F SRS1=1,2 Q:SRCHNG S SRLN=0,SROTH=$S(SRS1=1:2,1:1) F S SRLN=$O(^TMP("SRNRAD"_SRS1,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN)) Q:'SRLN D
43 ....I ^TMP("SRNRAD"_SRS1,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN)'=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN)) S SRCHNG=1
44 ...I 'SRCHNG F SRS1=1,2 K ^TMP("SRNRAD"_SRS1,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)
45 ..S SROTH=$S(SRS=1:2,1:1) I ^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)'=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)) S SRCHNG=1
46 ..I 'SRCHNG F SRS1=1,2 K ^TMP("SRNRAD"_SRS1,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)
47 Q
48PASS2 ; delete .01 nodes of sub-multiples if no changes underneath - before or after
49 N SRNXT1,SRNXT2,SRY1,SRY2
50 S SRE=0 F S SRE=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE)) Q:'SRE S SRE1=0 F S SRE1=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1)) Q:SRE1="" D
51 .S SRFLD="" F S SRFLD=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)) Q:SRFLD="" D
52 ..I ^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)'=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)) Q
53 ..S SRNXT1=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD))
54 ..S SRNXT2=$O(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD))
55 ..I SRNXT1="",SRNXT2="" K ^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD),^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD) Q
56 ..S SRY1=$P(SRNXT1,"-",3),SRY2=$P(SRNXT2,"-",3) I $P(SRY1,",",2)=.01,$P(SRY2,",",2)=.01 K ^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD),^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)
57 Q
58PASS3 ; delete .01 nodes for top level multiples if no changes underneath
59 S SRE=0 F S SRE=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE)) Q:'SRE S SRFLD="" F S SRFLD=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,0,SRFLD)) Q:SRFLD="" D
60 .S Y=$P(SRFLD,"-",3) I $P(Y,",",2)'=.01 Q
61 .I ^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,0,SRFLD)'=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,0,SRFLD)) Q
62 .I $O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,0,SRFLD))="",$O(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,0,SRFLD))="" D
63 ..I $O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,0))'="",$O(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,0))'="" Q
64 ..K ^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,0,SRFLD),^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,0,SRFLD)
65 Q
66PASS4 ; set up list of changed fields for display in addendum
67 S SRE="" F S SRE=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE)) Q:'SRE S SRE1="" F S SRE1=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1)) Q:SRE1="" S SRFLD="" F S SRFLD=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)) Q:SRFLD="" D
68 .I $P(SRFLD,"-",3)[";W" D Q
69 ..S SRLN=0 F S SRLN=$O(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN)) Q:'SRLN D
70 ...S ^TMP("SRNRMULT"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN)=$G(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN))
71 ...S ^TMP("SRNRMULT"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN)=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD,SRLN))
72 .S ^TMP("SRNRMULT"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)=$G(^TMP("SRNRAD"_SRS,$J,SRTN,SRMULT,SRE,SRE1,SRFLD))
73 .S ^TMP("SRNRMULT"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD)=$G(^TMP("SRNRAD"_SROTH,$J,SRTN,SRMULT,SRE,SRE1,SRFLD))
74 Q
Note: See TracBrowser for help on using the repository browser.