Index: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE5.m
===================================================================
--- WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE5.m	(revision 613)
+++ WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE5.m	(revision 623)
@@ -1,6 +1,6 @@
-RACTQE5 ; ;01/02/09
+RACTQE5 ; ;12/10/05
  D DE G BEGIN
-DE S DIE="^RAO(75.1,D0,""T"",",DIC=DIE,DP=75.12,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^RAO(75.1,D0,"T",DA,""))=""
- I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=%
+DE S DIE="^RAO(75.1,",DIC=DIE,DP=75.1,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^RAO(75.1,DA,""))=""
+ I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(1)=% S %=$P(%Z,U,6) S:%]"" DE(9)=% S %=$P(%Z,U,18) S:%]"" DE(2)=% S %=$P(%Z,U,19) S:%]"" DE(5)=% S %=$P(%Z,U,24) S:%]"" DE(7)=% S %=$P(%Z,U,26) S:%]"" DE(11)=%
  K %Z Q
  ;
@@ -50,5 +50,6 @@
 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
 BEGIN S DNM="RACTQE5",DQ=1
-1 S DW="0;2",DV="S",DU="",DLB="NEW STATUS",DIFLD=2
+1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
+ S DE(DW)="C1^RACTQE5"
  S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
  S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
@@ -56,11 +57,90 @@
  S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
  G RD:X="@",Z
+C1 G C1S:$D(DE(1))[0 K DB
+ S X=DE(1),DIC=DIE
+ K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
+ S X=DE(1),DIC=DIE
+ ;
+C1S S X="" G:DG(DQ)=X C1F1 K DB
+ S X=DG(DQ),DIC=DIE
+ S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
+ S X=DG(DQ),DIC=DIE
+ D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
+C1F1 Q
 X1 Q
-2 S DW="0;3",DV="P200'",DU="",DLB="COMPUTER USER",DIFLD=3
- S DU="VA(200,"
- S X=DUZ
+2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
+ S DE(DW)="C2^RACTQE5"
+ S X="NOW"
+ S Y=X
+ S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
+ G RD
+C2 G C2S:$D(DE(2))[0 K DB
+ S X=DE(2),DIC=DIE
+ K ^RAO(75.1,"AO",$E(X,1,30),DA)
+C2S S X="" G:DG(DQ)=X C2F1 K DB
+ S X=DG(DQ),DIC=DIE
+ S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
+C2F1 Q
+X2 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
+ Q
+ ;
+3 D:$D(DG)>9 F^DIE17,DE S DQ=3,D=0 K DE(1) ;75
+ S DIFLD=75,DGO="^RACTQE6",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
+ I $D(DSC(75.12))#2,$P(DSC(75.12),"I $D(^UTILITY(",1)="" X DSC(75.12) S D=$O(^(0)) S:D="" D=-1 G M3
+ S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
+M3 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(3)=$P(^(0),U,1)
+ S X="""NOW"""
+ S Y=X
+ S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
+ G RD
+R3 D DE
+ G A
+ ;
+4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
+X4 I '$D(RAMT) S RAMT="a"
+ Q
+5 S DW="0;19",DV="S",DU="",DLB="MODE OF TRANSPORT",DIFLD=19
+ S DU="a:AMBULATORY;p:PORTABLE;s:STRETCHER;w:WHEEL CHAIR;"
+ S X=$P(RAMT,"^")
  S Y=X
  S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
  G RD:X="@",Z
-X2 Q
-3 G 1^DIE17
+X5 Q
+6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
+X6 I '$D(RAIP) S RAIP="n"
+ Q
+7 S DW="0;24",DV="S",DU="",DLB="ISOLATION PROCEDURES",DIFLD=24
+ S DU="y:YES;n:NO;"
+ S X=RAIP
+ S Y=X
+ S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
+ G RD:X="@",Z
+X7 Q
+8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
+X8 I '$D(RARU) S RARU=9
+ Q
+9 S DW="0;6",DV="S",DU="",DLB="REQUEST URGENCY",DIFLD=6
+ S DU="1:STAT;2:URGENT;9:ROUTINE;"
+ S X=RARU
+ S Y=X
+ S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
+ G RD:X="@",Z
+X9 Q
+10 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
+X10 S:$$ORVR^RAORDU()<3 Y="@80"
+ Q
+11 S DW="0;26",DV="S",DU="",DLB="NATURE OF (NEW) ORDER ACTIVITY",DIFLD=26
+ S DU="w:WRITTEN;v:VERBAL;p:TELEPHONED;s:SERVICE CORRECTION;i:POLICY;e:PHYSICIAN ENTERED;"
+ S Y="s"
+ S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
+ G RD:X="@",Z
+X11 Q
+12 S DQ=13 ;@80
+13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
+X13 S RAFIN=1
+ Q
+14 S DQ=15 ;@99
+15 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
+X15 K RAI,RAPRI,RAMOD,RAIMAG,RAREQLOC,RAMODPRO
+ Q
+16 G 0^DIE17
