source: FOIAVistA/trunk/r/SURGERY-SR/SROESNRA.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

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