source: FOIAVistA/tag/r/SURGERY-SR/SROESARA.m@ 1193

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

initial load of FOIAVistA 6/30/08 version

File size: 4.3 KB
Line 
1SROESARA ;BIR/ADM - ANESTHESIA REPORT E-SIG UTILITY ; [ 02/21/01 9:08 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 ;
8MULT ; process multiples
9 S X=$P(SRFLD,"^",2),Y=$P(SRFLD,"^",3) I $P(X,";")=0 S:SRS=1 ^TMP("SRASAVE",$J,SRTN,$P(SRFLD,"^"),0)=$G(^SRF(SRTN,$P(Y,","),0)) Q
10 S SRCAT=$P(SRFLD,"^"),SRSUB=$P(SRFLD,"^",2),SRFF=$P(SRSUB,"-",3)
11 S SRNP=$P(SRFLD,"^",3),SRN=$P(SRNP,";"),SRP=$P(SRNP,";",2)
12 K SRL F I=1:1 S Y=$P(SRN,",",I) Q:Y="" S SRL(I)=Y,SRL=I
13 S SRW=$S($P(SRFF,";",2)["W":1,1:0)
14 S SRE=0 F S SRE=$O(^SRF(SRTN,SRL(1),SRE)) Q:'SRE D
15 .I SRL=2 D
16 ..I SRS=1 D
17 ...I $P(SRFF,",",2)=.01 S ^TMP("SRASAVE",$J,SRTN,SRCAT,0)=$G(^SRF(SRTN,SRL(1),0))
18 ...S ^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,0,SRSUB)=$P($G(^SRF(SRTN,SRL(1),SRE,SRL(2))),"^",SRP)
19 ..I $P(SRSUB,"-")'["X" S ^TMP("SRARAD"_SRS,$J,SRTN,SRCAT,SRE,0,SRSUB)=$P($G(^SRF(SRTN,SRL(1),SRE,SRL(2))),"^",SRP)
20 .I SRL=3 S SRE1=0 F S SRE1=$O(^SRF(SRTN,SRL(1),SRE,SRL(2),SRE1)) Q:'SRE1 D
21 ..I SRW D Q
22 ...I SRS=1 D
23 ....S ^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,0,SRSUB,0)=$G(^SRF(SRTN,SRL(1),SRE,SRL(2),0))
24 ....S ^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,0,SRSUB,SRE1)=$P($G(^SRF(SRTN,SRL(1),SRE,SRL(2),SRE1,SRL(3))),"^",SRP)
25 ...I $P(SRSUB,"-")'["X" S ^TMP("SRARAD"_SRS,$J,SRTN,SRCAT,SRE,0,SRSUB,SRE1)=$P($G(^SRF(SRTN,SRL(1),SRE,SRL(2),SRE1,SRL(3))),"^",SRP)
26 ..I SRS=1 D
27 ...I $P(SRFF,",",2)=.01 S ^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,0,SRSUB)=$G(^SRF(SRTN,SRL(1),SRE,SRL(2),0))
28 ...S ^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1,SRSUB)=$P($G(^SRF(SRTN,SRL(1),SRE,SRL(2),SRE1,SRL(3))),"^",SRP)
29 ..I $P(SRSUB,"-")'["X" S ^TMP("SRARAD"_SRS,$J,SRTN,SRCAT,SRE,SRE1,SRSUB)=$P($G(^SRF(SRTN,SRL(1),SRE,SRL(2),SRE1,SRL(3))),"^",SRP)
30 Q
31REVRS ; restore pre-edit data in multiples
32 D REMOVE
33 S SRCAT="" F S SRCAT=$O(^TMP("SRARMULT1",$J,SRTN,SRCAT)) Q:SRCAT="" D RESTORE
34 Q
35RESTORE ; enter multiple data saved in ^TMP("SRASAVE"
36 S (SRCNT,SRE)=0 F S SRE=$O(^TMP("SRASAVE",$J,SRTN,SRCAT,SRE)) Q:'SRE S SRE1="" F S SRE1=$O(^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1)) Q:SRE1="" D
37 .S SRSUB="" F S SRSUB=$O(^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1,SRSUB)) Q:SRSUB="" S SRCNT=SRCNT+1 D FIELD
38 Q
39FIELD ; restore individual field
40 S X=$P(SRSUB,"-",3),SRFILE=$P(X,","),Y=$P(X,",",2),SRFIELD=$P(Y,";"),SRW=$S($P(Y,";",2)["W":1,1:0)
41 S:SRCNT=1 SRI="."_$P(SRFILE,".",2) S X=$E($P(SRSUB,"-"),1,2),SRJ=+X D REV^SROESAR1
42 S SRNP=$P(SRFLD,"^",3),SRN=$P(SRNP,";"),SRP=$P(SRNP,";",2)
43 K SRL F I=1:1 S Y=$P(SRN,",",I) Q:Y="" S SRL(I)=Y,SRL=I
44 I 'SRW S SRVAL=^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1,SRSUB)
45 K DA,DIE,DR
46 I SRL=2,SRVAL'="" D
47 .I SRL(1)=13,SRL(2)=2 S ^SRF(SRTN,13,SRE,2)=SRVAL K DA,DIK S DA(1)=SRTN,DA=SRE,DIK="^SRF("_SRTN_",13,",DIK(1)="3" D EN^DIK K DA,DIK Q
48 .I SRE1=0,SRFIELD=.01 S ^SRF(SRTN,SRL(1),0)=^TMP("SRASAVE",$J,SRTN,SRCAT,0)
49 .S DA(1)=SRTN,DA=SRE,DIE="^SRF("_SRTN_","_$S(SRL(1):SRL(1),1:""""_SRL(1)_"""")_",",DR=SRFIELD_"////"_SRVAL D ^DIE K DA,DIE,DR
50 I SRL=3 D
51 .I SRE1=0,SRFIELD=.01,SRVAL'="" S ^SRF(SRTN,SRL(1),SRE,SRL(2),0)=SRVAL Q
52 .I SRW D Q
53 ..S ^SRF(SRTN,SRL(1),SRE,SRL(2),0)=$G(^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1,SRSUB,0))
54 ..S SRLN=0 F S SRLN=$O(^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1,SRSUB,SRLN)) Q:'SRLN S ^SRF(SRTN,SRL(1),SRE,SRL(2),SRLN,0)=$G(^TMP("SRASAVE",$J,SRTN,SRCAT,SRE,SRE1,SRSUB,SRLN))
55 .I SRVAL'="" S DA(2)=SRTN,DA(1)=SRE,DA=SRE1,DIE="^SRF("_SRTN_","_$S(SRL(1):SRL(1),1:""""_SRL(1)_"""")_","_SRE_","_$S(SRL(2):SRL(2),1:""""_SRL(2)_"""")_",",DR=SRFIELD_"////"_SRVAL D ^DIE K DA,DIE,DR
56 Q
57REMOVE ; delete edited multiples
58 S SRCAT="" F S SRCAT=$O(^TMP("SRARMULT1",$J,SRTN,SRCAT)) Q:SRCAT="" S SRE=$O(^TMP("SRARMULT1",$J,SRTN,SRCAT,0)) Q:'SRE S SRE1="",SRE1=$O(^TMP("SRARMULT1",$J,SRTN,SRCAT,SRE,SRE1)) Q:SRE1="" D
59 .S SRSUB="",SRSUB=$O(^TMP("SRARMULT1",$J,SRTN,SRCAT,SRE,SRE1,SRSUB))
60 .S SRFF=$P(SRSUB,"-",3),SRK=$P(SRFF,","),SRI="."_$P(SRK,".",2),SRJ=1 D REV^SROESAR1
61 .S SRNP=$P(SRFLD,"^",3),SRN=$P(SRNP,";"),SRP=$P(SRNP,";",2)
62 .K SRL F I=1:1 S Y=$P(SRN,",",I) Q:Y="" S SRL(I)=Y,SRL=I
63 .D DEL
64 Q
65DEL ; delete all entries from multiple
66 K DA,DIK S SRIEN=0 F S SRIEN=$O(^SRF(SRTN,SRL(1),SRIEN)) Q:'SRIEN S DA(1)=SRTN,DA=SRIEN,DIK="^SRF("_DA(1)_","_$S(SRL(1):SRL(1),1:""""_SRL(1)_"""")_"," D ^DIK K DA,DIK
67 K ^SRF(SRTN,SRL(1))
68 Q
Note: See TracBrowser for help on using the repository browser.