Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (15 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
44 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE.m

    r628 r636  
    1 RACTOE ; GENERATED FROM 'RA ORDER EXAM' INPUT TEMPLATE(#1087), FILE 75.1;05/26/08
     1RACTOE ; GENERATED FROM 'RA ORDER EXAM' INPUT TEMPLATE(#1087), FILE 75.1;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE1.m

    r628 r636  
    1 RACTOE1 ; ;05/26/08
     1RACTOE1 ; ;12/27/07
    22 D DE G BEGIN
    33DE S DIE="^RAO(75.1,D0,""M"",",DIC=DIE,DP=75.1125,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^RAO(75.1,D0,"M",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE2.m

    r628 r636  
    1 RACTOE2 ; ;05/26/08
     1RACTOE2 ; ;12/27/07
    22 D DE G BEGIN
    33DE S DIE="^RAO(75.1,D0,""M"",",DIC=DIE,DP=75.1125,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^RAO(75.1,D0,"M",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE3.m

    r628 r636  
    1 RACTOE3 ; ;05/26/08
     1RACTOE3 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,4) S:%]"" DE(10)=% S %=$P(%Z,U,9) S:%]"" DE(16)=% S %=$P(%Z,U,12) S:%]"" DE(21)=% S %=$P(%Z,U,13) S:%]"" DE(27)=% S %=$P(%Z,U,14) S:%]"" DE(9)=% S %=$P(%Z,U,17) S:%]"" DE(31)=% S %=$P(%Z,U,22) S:%]"" DE(18)=%
    5  I $D(^("R")) S %Z=^("R") S %=$P(%Z,U,1) S:%]"" DE(13)=%
     4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,4) S:%]"" DE(11)=%,DE(20)=% S %=$P(%Z,U,9) S:%]"" DE(27)=% S %=$P(%Z,U,14) S:%]"" DE(9)=% S %=$P(%Z,U,22) S:%]"" DE(32)=%
     5 I $D(^("R")) S %Z=^("R") S %=$P(%Z,U,1) S:%]"" DE(24)=%
    66 K %Z Q
    77 ;
     
    8080 G RD:X="@",Z
    8181X9 Q
    82 10 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
     8210 S DQ=11 ;@20
     8311 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
    8384 S DU="I:INPATIENT;O:OUTPATIENT;C:CONTRACT;S:SHARING;E:EMPLOYEE;R:RESEARCH;"
    8485 S X=RACAT
    8586 S Y=X
    8687 G Y
    87 X10 Q
    88 11 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 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
    89 X11 S Y=$E(X),Y=$S(Y="R":"@30",(Y'="")&("CS"[Y):"@40",1:"@50")
     88X11 Q
     8912 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
     90X12 S RAX=$E(X,1),Y=$S(RAX="R":"@30","CS"[RAX:"@40",RAX="I"&($D(RAWARD))!("EO"[RAX&('$D(RAWARD))):"@50",1:"@25")
    9091 Q
    91 12 S DQ=13 ;@30
    92 13 S DW="R;1",DV="FR",DU="",DLB="RESEARCH SOURCE",DIFLD=9.5
     9213 S DQ=14 ;@25
     9314 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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
     94X14 I $D(RAWARD) W !?3,$C(7),"Please choose 'I' for INPATIENT, 'R' RESEARCH, 'C' CONTRACT,",!?3,"'S' SHARING!"
     95 Q
     9615 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
     97X15 I '$D(RAWARD) W !?3,$C(7),"Please choose 'O' for OUTPATIENT, 'E' EMPLOYEE, 'R' RESEARCH,",!?3,"'C' CONTRACT, 'S' SHARING!"
     98 Q
     9916 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 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
     100X16 D CS^RAORD1A I $D(RALIFN("OUT")) S Y="@26"
     101 Q
     10217 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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
     103X17 I '$D(RALIFN("NO")) S Y="@50"
     104 Q
     10518 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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
     106X18 K RALIFN("NO")
     107 Q
     10819 S DQ=20 ;@26
     10920 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
     110 S DU="I:INPATIENT;O:OUTPATIENT;C:CONTRACT;S:SHARING;E:EMPLOYEE;R:RESEARCH;"
     111 S Y="@"
     112 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)
     113 G RD
     114X20 Q
     11521 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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
     116X21 K RALIFN("OUT")
     117 Q
     11822 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 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
     119X22 S Y="@20"
     120 Q
     12123 S DQ=24 ;@30
     12224 S DW="R;1",DV="FR",DU="",DLB="RESEARCH SOURCE",DIFLD=9.5
    93123 S X=$S($D(RARSH):RARSH,1:"")
    94124 S Y=X
    95125 G Y
    96 X13 K:$L(X)>40!($L(X)<3) X
     126X24 K:$L(X)>40!($L(X)<3) X
    97127 I $D(X),X'?.ANP K X
    98128 Q
    99129 ;
    100 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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
    101 X14 S Y="@50"
     13025 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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
     131X25 S Y="@50"
    102132 Q
    103 15 S DQ=16 ;@40
    104 16 S DW="0;9",DV="*P34'R",DU="",DLB="CONTRACT/SHARING SOURCE",DIFLD=9
     13326 S DQ=27 ;@40
     13427 S DW="0;9",DV="*P34'R",DU="",DLB="CONTRACT/SHARING SOURCE",DIFLD=9
    105135 S DU="DIC(34,"
    106136 S X=$S($D(RASHA):RASHA,1:"")
    107137 S Y=X
    108138 G Y
    109 X16 S DIC("S")="I $S('$D(^(""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
     139X27 S DIC("S")="I $S('$D(^(""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
    110140 Q
    111141 ;
    112 17 S DQ=18 ;@50
    113 18 S DW="0;22",DV="P44'",DU="",DLB="REQUESTING LOCATION",DIFLD=22
     14228 S DQ=29 ;@50
     14329 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 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
     144X29 I RAX="I",($P($G(^SC(+RALIFN,0)),U,3)'="W"),($P($G(^SC(+RALIFN,0)),U,3)'="OR") S RAWHEN=$P($G(^RAO(75.1,DA,0)),U,21),RAWHEN=$S(RAWHEN]"":$P(RAWHEN,".",1),1:DT) D REQLOC1^RAORD1A
     145 Q
     14630 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 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
     147X30 I RAX="O",($P($G(^SC(+RALIFN,0)),U,3)'="C"),($P($G(^SC(+RALIFN,0)),U,3)'="OR") D REQLOC1^RAORD1A
     148 Q
     14931 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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
     150X31 I $D(RALIFN("OUT")) K RALIFN("OUT") S Y="@999"
     151 Q
     15232 S DW="0;22",DV="P44'a",DU="",DLB="REQUESTING LOCATION",DIFLD=22
     153 S DE(DW)="C32^RACTOE3"
    114154 S DU="SC("
    115155 S X=RALIFN
     
    117157 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)
    118158 G RD:X="@",Z
    119 X18 Q
    120 19 S DQ=20 ;@100
    121 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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
    122 X20 W !,"IS PATIENT SCHEDULED FOR PRE-OP" S %=2 D YN^DICN S:%<0 Y="@999" S:%=2 Y="@120" I '% W !!,"Enter 'YES' if patient is scheduled for pre-op, or 'NO' if not.",! S Y="@100"
     159C32 G C32S:$D(DE(32))[0 K DB
     160 D ^RACTOE4
     161C32S S X="" G:DG(DQ)=X C32F1 K DB
     162 D ^RACTOE5
     163C32F1 Q
     164X32 Q
     16533 S DQ=34 ;@100
     16634 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 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
     167X34 W !,"IS PATIENT SCHEDULED FOR PRE-OP" S %=2 D YN^DICN S:%<0 Y="@999" S:%=2 Y="@120" I '% W !!,"Enter 'YES' if patient is scheduled for pre-op, or 'NO' if not.",! S Y="@100"
    123168 Q
    124 21 S DW="0;12",DV="D",DU="",DLB="PRE-OP SCHEDULED DATE (TIME optional)",DIFLD=12
    125  S X="TODAY"
    126  S Y=X
    127  G Y
    128 X21 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
    129  Q
    130  ;
    131 22 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 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
    132 X22 S:$D(RAEXMUL) RAPREOP1=X
    133  Q
    134 23 S DQ=24 ;@120
    135 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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
    136 X24 I RASEX="M" S Y="@130"
    137  Q
    138 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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
    139 X25 I RASEX'="F" W !,"THE SEX OF THIS PATIENT IS NOT AVAILABLE. IS PATIENT FEMALE" S %=2 D YN^DICN S:%<0 Y="@999" S:%=2 Y="@130" I '% W !!,"Enter 'YES' if patient is female, or 'NO' if patient is male.",! S Y="@120"
    140  Q
    141 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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
    142 X26 S RASEX="F"
    143  Q
    144 27 S DW="0;13",DV="RS",DU="",DLB="PREGNANT",DIFLD=13
    145  S DU="y:YES;n:NO;u:UNKNOWN;"
    146  S X=$S($D(RAPREG):$$EXTERNAL^DILFD(75.1,13,"",RAPREG),1:"")
    147  S Y=X
    148  G Y
    149 X27 Q
    150 28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 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
    151 X28 S RAPREG=X
    152  Q
    153 29 S DQ=30 ;@130
    154 30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 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
    155 X30 I '$D(RAVSTFLG)!('$D(RAVLEDTI)) S Y="@135"
    156  Q
    157 31 S DW="0;17",DV="D",DU="",DLB="PAST VISIT DATE/TIME",DIFLD=17
    158  S X=9999999.9999-RAVLEDTI
    159  S Y=X
    160  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)
    161  G RD
    162 X31 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
    163  Q
    164  ;
    165 32 S DQ=33 ;@135
    166 33 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=33 D X33 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
    167 X33 S:$D(RAWHEN)#2 Y="@145"
    168  Q
    169 34 D:$D(DG)>9 F^DIE17 G ^RACTOE4
     16935 D:$D(DG)>9 F^DIE17 G ^RACTOE6
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE4.m

    r628 r636  
    1 RACTOE4 ; ;05/26/08
    2  D DE G BEGIN
    3 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(8)=% S %=$P(%Z,U,6) S:%]"" DE(18)=% S %=$P(%Z,U,18) S:%]"" DE(9)=% S %=$P(%Z,U,19) S:%]"" DE(14)=% S %=$P(%Z,U,20) S:%]"" DE(26)=% S %=$P(%Z,U,21) S:%]"" DE(1)=%,DE(5)=%
    5  I  S %=$P(%Z,U,24) S:%]"" DE(16)=% S %=$P(%Z,U,26) S:%]"" DE(21)=%
    6  K %Z Q
    7  ;
    8 W W !?DL+DL-2,DLB_": "
    9  Q
    10 O D W W Y W:$X>45 !?9
    11  I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
    12  W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W "  (No Editing)" Q
    13 TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
    14  Q
    15 A K DQ(DQ) S DQ=DQ+1
    16 B G @DQ
    17 RE G PR:$D(DE(DQ)) D W,TR
    18 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    19 RD G QS:X?."?" I X["^" D D G ^DIE17
    20  I X="@" D D G Z^DIE2
    21  I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W "  "_X
    22 T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    23  K DDER G X
    24 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    25  G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    26  I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    27 V D @("X"_DQ) K YS
    28 Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    29 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    30  S X="?BAD"
    31 QS S DZ=X D D,QQ^DIEQ G B
    32 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
    33 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
    34 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
    35 R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
    36  I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
    37  X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
    38 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
    39 I I DV'["I",DV'["#" G RD
    40  D E^DIE0 G RD:$D(X),PR
    41  Q
    42 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
    43  I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
    44  D ^DIR I 'DDER S %=Y(0),X=Y
    45  Q
    46 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
    47  I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
    48  E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
    49  Q
    50 NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
    51 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    52 BEGIN S DNM="RACTOE4",DQ=1
    53 1 S DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
    54  S DE(DW)="C1^RACTOE4"
    55  G RE
    56 C1 G C1S:$D(DE(1))[0 K DB
    57  S X=DE(1),DIC=DIE
    58  K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
    59 C1S S X="" G:DG(DQ)=X C1F1 K DB
    60  S X=DG(DQ),DIC=DIE
    61  S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
    62 C1F1 Q
    63 X1 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
    64  Q
    65  ;
    66 2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 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
    67 X2 S Y="@150"
    68  Q
    69 3 S DQ=4 ;@145
    70 4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 G A
    71 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
    72  S DE(DW)="C5^RACTOE4"
    73  S X=RAWHEN
    74  S Y=X
    75  G Y
    76 C5 G C5S:$D(DE(5))[0 K DB
    77  S X=DE(5),DIC=DIE
    78  K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
    79 C5S S X="" G:DG(DQ)=X C5F1 K DB
    80  S X=DG(DQ),DIC=DIE
    81  S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
    82 C5F1 Q
    83 X5 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
    84  Q
    85  ;
    86 6 S DQ=7 ;@150
    87 7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 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
    88 X7 S:$D(RAEXMUL)#2 RAWHEN=$$FMTE^XLFDT(X,1)
    89  Q
    90 8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
    91  S DE(DW)="C8^RACTOE4"
    92  S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
    93  S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
    94  S Y=X
    95  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)
    96  G RD:X="@",Z
    97 C8 G C8S:$D(DE(8))[0 K DB
    98  S X=DE(8),DIC=DIE
    99  K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
    100  S X=DE(8),DIC=DIE
    101  ;
    102 C8S S X="" G:DG(DQ)=X C8F1 K DB
    103  S X=DG(DQ),DIC=DIE
    104  S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
    105  S X=DG(DQ),DIC=DIE
    106  D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
    107 C8F1 Q
    108 X8 Q
    109 9 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
    110  S DE(DW)="C9^RACTOE4"
    111  S X="NOW"
    112  S Y=X
    113  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)
    114  G RD
    115 C9 G C9S:$D(DE(9))[0 K DB
    116  S X=DE(9),DIC=DIE
    117  K ^RAO(75.1,"AO",$E(X,1,30),DA)
    118 C9S S X="" G:DG(DQ)=X C9F1 K DB
    119  S X=DG(DQ),DIC=DIE
    120  S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
    121 C9F1 Q
    122 X9 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
    123  Q
    124  ;
    125 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
    126 X10 S Y=$S('$D(^RA(79,+RADIV,.1)):"@160",$P(^(.1),"^",19)="y":"@155",1:"@160")
    127  Q
    128 11 S DQ=12 ;@155
    129 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,D=0 K DE(1) ;75
    130  S DIFLD=75,DGO="^RACTOE5",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
    131  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 M12
    132  S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
    133 M12 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(12)=$P(^(0),U,1)
    134  S X="""NOW"""
    135  S Y=X
    136  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)
    137  G RD
    138 R12 D DE
    139  G A
    140  ;
    141 13 S DQ=14 ;@160
    142 14 S DW="0;19",DV="S",DU="",DLB="MODE OF TRANSPORT",DIFLD=19
    143  S DU="a:AMBULATORY;p:PORTABLE;s:STRETCHER;w:WHEEL CHAIR;"
    144  S X=$S($D(RAMT):$P(RAMT,"^",2),1:"AMBULATORY")
    145  S Y=X
    146  G Y
    147 X14 Q
    148 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
    149 X15 S:$D(RAEXMUL) RAMT=X
    150  Q
    151 16 S DW="0;24",DV="S",DU="",DLB="IS PATIENT ON ISOLATION PROCEDURES?",DIFLD=24
    152  S DU="y:YES;n:NO;"
    153  S X="NO"
    154  S Y=X
    155  G Y
    156 X16 Q
    157 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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
    158 X17 S:$D(RAEXMUL) RAIP=X
    159  Q
    160 18 S DW="0;6",DV="S",DU="",DLB="REQUEST URGENCY",DIFLD=6
    161  S DU="1:STAT;2:URGENT;9:ROUTINE;"
    162  S X="ROUTINE"
    163  S Y=X
    164  G Y
    165 X18 Q
    166 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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
    167 X19 S:$D(RAEXMUL) RARU=X
    168  Q
    169 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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
    170 X20 S:$$ORVR^RAORDU()<3 Y="@163"
    171  Q
    172 21 S DW="0;26",DV="S",DU="",DLB="NATURE OF (NEW) ORDER ACTIVITY",DIFLD=26
    173  S DU="w:WRITTEN;v:VERBAL;p:TELEPHONED;s:SERVICE CORRECTION;i:POLICY;e:PHYSICIAN ENTERED;"
    174  S X="SERVICE CORRECTION"
    175  S Y=X
    176  G Y
    177 X21 Q
    178 22 S DQ=23 ;@163
    179 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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
    180 X23 W !
    181  Q
    182 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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
    183 X24 S RAREQLOC=$$ILOC^RAUTL18(RAPRI)
    184  Q
    185 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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
    186 X25 I 'RAREQLOC S Y="@165"
    187  Q
    188 26 S DW="0;20",DV="*P79.1'",DU="",DLB="IMAGING LOCATION",DIFLD=20
    189  S DU="RA(79.1,"
    190  S X=RAREQLOC
    191  S Y=X
    192  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)
    193  G RD:X="@",Z
    194 X26 Q
    195 27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 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
    196 X27 S Y="@170"
    197  Q
    198 28 S DQ=29 ;@165
    199 29 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 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
    200 X29 I '$D(RALOCFLG) S Y="@175"
    201  Q
    202 30 D:$D(DG)>9 F^DIE17 G ^RACTOE6
     1RACTOE4 ; ;12/27/07
     2 S X=DE(32),DIIX=2_U_DIFLD D AUDIT^DIET
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE5.m

    r628 r636  
    1 RACTOE5 ; ;05/26/08
    2  D DE G BEGIN
    3 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=%
    5  K %Z Q
    6  ;
    7 W W !?DL+DL-2,DLB_": "
    8  Q
    9 O D W W Y W:$X>45 !?9
    10  I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
    11  W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W "  (No Editing)" Q
    12 TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
    13  Q
    14 A K DQ(DQ) S DQ=DQ+1
    15 B G @DQ
    16 RE G PR:$D(DE(DQ)) D W,TR
    17 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    18 RD G QS:X?."?" I X["^" D D G ^DIE17
    19  I X="@" D D G Z^DIE2
    20  I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W "  "_X
    21 T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    22  K DDER G X
    23 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    24  G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    25  I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    26 V D @("X"_DQ) K YS
    27 Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    28 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    29  S X="?BAD"
    30 QS S DZ=X D D,QQ^DIEQ G B
    31 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
    32 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
    33 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
    34 R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
    35  I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
    36  X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
    37 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
    38 I I DV'["I",DV'["#" G RD
    39  D E^DIE0 G RD:$D(X),PR
    40  Q
    41 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
    42  I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
    43  D ^DIR I 'DDER S %=Y(0),X=Y
    44  Q
    45 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
    46  I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
    47  E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
    48  Q
    49 NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
    50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    51 BEGIN S DNM="RACTOE5",DQ=1
    52 1 S DW="0;2",DV="S",DU="",DLB="NEW STATUS",DIFLD=2
    53  S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
    54  S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
    55  S Y=X
    56  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)
    57  G RD:X="@",Z
    58 X1 Q
    59 2 S DW="0;3",DV="P200'",DU="",DLB="COMPUTER USER",DIFLD=3
    60  S DU="VA(200,"
    61  S X=DUZ
    62  S Y=X
    63  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)
    64  G RD:X="@",Z
    65 X2 Q
    66 3 G 1^DIE17
     1RACTOE5 ; ;12/27/07
     2 I $D(DE(32))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE6.m

    r628 r636  
    1 RACTOE6 ; ;05/26/08
     1RACTOE6 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,20) S:%]"" DE(1)=%
     4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(21)=% S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(7)=% S %=$P(%Z,U,17) S:%]"" DE(11)=% S %=$P(%Z,U,18) S:%]"" DE(22)=% S %=$P(%Z,U,21) S:%]"" DE(15)=%,DE(18)=%
    55 K %Z Q
    66 ;
     
    5050KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    5151BEGIN S DNM="RACTOE6",DQ=1
    52 1 S DW="0;20",DV="*P79.1'R",DU="",DLB="SUBMIT REQUEST TO",DIFLD=20
    53  S DU="RA(79.1,"
    54  G RE
    55 X1 S DIC("S")="I $$SUBMIT^RAUTL13(DA,+Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
     521 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="0;12",DV="D",DU="",DLB="PRE-OP SCHEDULED DATE (TIME optional)",DIFLD=12
     53 S X="TODAY"
     54 S Y=X
     55 G Y
     56X1 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
    5657 Q
    5758 ;
    58 2 S DQ=3 ;@170
    59 3 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 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
    60 X3 S:$D(RAEXMUL) RAILOC=X
     592 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 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
     60X2 S:$D(RAEXMUL) RAPREOP1=X
    6161 Q
    62 4 S DQ=5 ;@175
     623 S DQ=4 ;@120
     634 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
     64X4 I RASEX="M" S Y="@130"
     65 Q
    63665 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 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
    64 X5 S (RAFIN,RAFIN1)=""
     67X5 I RASEX'="F" W !,"THE SEX OF THIS PATIENT IS NOT AVAILABLE. IS PATIENT FEMALE" S %=2 D YN^DICN S:%<0 Y="@999" S:%=2 Y="@130" I '% W !!,"Enter 'YES' if patient is female, or 'NO' if patient is male.",! S Y="@120"
    6568 Q
    66 6 S DQ=7 ;@999
    67 7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 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
    68 X7 K RAI,RAPRI,RAMOD,RAIMAG,RAWPFLAG,RAREQLOC,RAMODPRO
     696 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
     70X6 S RASEX="F"
    6971 Q
    70 8 G 0^DIE17
     727 S DW="0;13",DV="RS",DU="",DLB="PREGNANT",DIFLD=13
     73 S DU="y:YES;n:NO;u:UNKNOWN;"
     74 S X=$S($D(RAPREG):$$EXTERNAL^DILFD(75.1,13,"",RAPREG),1:"")
     75 S Y=X
     76 G Y
     77X7 Q
     788 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
     79X8 S RAPREG=X
     80 Q
     819 S DQ=10 ;@130
     8210 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
     83X10 I '$D(RAVSTFLG)!('$D(RAVLEDTI)) S Y="@135"
     84 Q
     8511 S DW="0;17",DV="D",DU="",DLB="PAST VISIT DATE/TIME",DIFLD=17
     86 S X=9999999.9999-RAVLEDTI
     87 S Y=X
     88 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)
     89 G RD
     90X11 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
     91 Q
     92 ;
     9312 S DQ=13 ;@135
     9413 S DQ=14 ;@140
     9514 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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
     96X14 S:$D(RAWHEN)#2 Y="@145"
     97 Q
     9815 S DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
     99 S DE(DW)="C15^RACTOE6"
     100 G RE
     101C15 G C15S:$D(DE(15))[0 K DB
     102 S X=DE(15),DIC=DIE
     103 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
     104C15S S X="" G:DG(DQ)=X C15F1 K DB
     105 S X=DG(DQ),DIC=DIE
     106 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
     107C15F1 Q
     108X15 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
     109 Q
     110 ;
     11116 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 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
     112X16 S Y="@150"
     113 Q
     11417 S DQ=18 ;@145
     11518 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="0;21",DV="D",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
     116 S DE(DW)="C18^RACTOE6"
     117 S X=RAWHEN
     118 S Y=X
     119 G Y
     120C18 G C18S:$D(DE(18))[0 K DB
     121 S X=DE(18),DIC=DIE
     122 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
     123C18S S X="" G:DG(DQ)=X C18F1 K DB
     124 S X=DG(DQ),DIC=DIE
     125 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
     126C18F1 Q
     127X18 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
     128 Q
     129 ;
     13019 S DQ=20 ;@150
     13120 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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
     132X20 S:$D(RAEXMUL)#2 RAWHEN=$$FMTE^XLFDT(X,1)
     133 Q
     13421 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
     135 S DE(DW)="C21^RACTOE6"
     136 S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
     137 S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
     138 S Y=X
     139 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)
     140 G RD:X="@",Z
     141C21 G C21S:$D(DE(21))[0 K DB
     142 S X=DE(21),DIC=DIE
     143 K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
     144 S X=DE(21),DIC=DIE
     145 ;
     146C21S S X="" G:DG(DQ)=X C21F1 K DB
     147 S X=DG(DQ),DIC=DIE
     148 S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
     149 S X=DG(DQ),DIC=DIE
     150 D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
     151C21F1 Q
     152X21 Q
     15322 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
     154 S DE(DW)="C22^RACTOE6"
     155 S X="NOW"
     156 S Y=X
     157 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)
     158 G RD
     159C22 G C22S:$D(DE(22))[0 K DB
     160 S X=DE(22),DIC=DIE
     161 K ^RAO(75.1,"AO",$E(X,1,30),DA)
     162C22S S X="" G:DG(DQ)=X C22F1 K DB
     163 S X=DG(DQ),DIC=DIE
     164 S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
     165C22F1 Q
     166X22 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
     167 Q
     168 ;
     16923 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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
     170X23 S Y=$S('$D(^RA(79,+RADIV,.1)):"@160",$P(^(.1),"^",19)="y":"@155",1:"@160")
     171 Q
     17224 S DQ=25 ;@155
     17325 D:$D(DG)>9 F^DIE17,DE S DQ=25,D=0 K DE(1) ;75
     174 S DIFLD=75,DGO="^RACTOE7",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
     175 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 M25
     176 S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
     177M25 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(25)=$P(^(0),U,1)
     178 S X="""NOW"""
     179 S Y=X
     180 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)
     181 G RD
     182R25 D DE
     183 G A
     184 ;
     18526 S DQ=27 ;@160
     18627 D:$D(DG)>9 F^DIE17 G ^RACTOE8
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE.m

    r628 r636  
    1 RACTQE ; GENERATED FROM 'RA QUICK EXAM ORDER' INPUT TEMPLATE(#1086), FILE 75.1;05/26/08
     1RACTQE ; GENERATED FROM 'RA QUICK EXAM ORDER' INPUT TEMPLATE(#1086), FILE 75.1;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(2)=%,DE(9)=% S %=$P(%Z,U,4) S:%]"" DE(26)=% S %=$P(%Z,U,8) S:%]"" DE(14)=%
     4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(2)=%,DE(9)=% S %=$P(%Z,U,4) S:%]"" DE(27)=% S %=$P(%Z,U,8) S:%]"" DE(14)=%
    55 K %Z Q
    66 ;
     
    153153 Q
    15415425 S DQ=26 ;@35
    155 26 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
     15526 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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
     156X26 I '$D(RACAT) S RACAT="I"
     157 Q
     15827 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
    156159 S DU="I:INPATIENT;O:OUTPATIENT;C:CONTRACT;S:SHARING;E:EMPLOYEE;R:RESEARCH;"
    157160 S X=$E(RACAT)
     
    159162 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)
    160163 G RD:X="@",Z
    161 X26 Q
    162 27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 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
    163 X27 I '$D(RAPREOP1) S Y="@40"
     164X27 Q
     16528 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 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
     166X28 I '$D(RAPREOP1) S Y="@40"
    164167 Q
    165 28 D:$D(DG)>9 F^DIE17 G ^RACTQE2
     16829 D:$D(DG)>9 F^DIE17 G ^RACTQE2
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE1.m

    r628 r636  
    1 RACTQE1 ; ;05/26/08
     1RACTQE1 ; ;12/27/07
    22 D DE G BEGIN
    33DE S DIE="^RAO(75.1,D0,""M"",",DIC=DIE,DP=75.1125,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^RAO(75.1,D0,"M",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE2.m

    r628 r636  
    1 RACTQE2 ; ;05/26/08
     1RACTQE2 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,3) S:%]"" DE(31)=% S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(4)=% S %=$P(%Z,U,20) S:%]"" DE(18)=%,DE(23)=%,DE(27)=% S %=$P(%Z,U,21) S:%]"" DE(11)=%,DE(14)=%
     4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,3) S:%]"" DE(31)=% S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(4)=% S %=$P(%Z,U,20) S:%]"" DE(18)=%,DE(23)=%,DE(27)=% S %=$P(%Z,U,21) S:%]"" DE(11)=%,DE(15)=%
    55 I $D(^(.1)) S %Z=^(.1) S %=$P(%Z,U,1) S:%]"" DE(7)=%
    66 K %Z Q
     
    103103 ;
    10410412 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
    105 X12 S Y="@560"
     105X12 S RAWHEN=$$FMTE^XLFDT(X,1)
    106106 Q
    107 13 S DQ=14 ;@550
    108 14 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
    109  S DE(DW)="C14^RACTQE2"
     10713 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
     108X13 S Y="@560"
     109 Q
     11014 S DQ=15 ;@550
     11115 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW="0;21",DV="D",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
     112 S DE(DW)="C15^RACTQE2"
    110113 S X=RAWHEN
    111114 S Y=X
    112  G Y
    113 C14 G C14S:$D(DE(14))[0 K DB
    114  S X=DE(14),DIC=DIE
     115 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)
     116 G RD
     117C15 G C15S:$D(DE(15))[0 K DB
     118 S X=DE(15),DIC=DIE
    115119 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
    116 C14S S X="" G:DG(DQ)=X C14F1 K DB
     120C15S S X="" G:DG(DQ)=X C15F1 K DB
    117121 S X=DG(DQ),DIC=DIE
    118122 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
    119 C14F1 Q
    120 X14 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
     123C15F1 Q
     124X15 S %DT="TX" D ^%DT S X=Y K:Y<1 X
    121125 Q
    122126 ;
    123 15 S DQ=16 ;@560
    124 16 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 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
    125 X16 S:$D(RAEXMUL)#2 RAWHEN=$$FMTE^XLFDT(X,1)
    126  Q
     12716 S DQ=17 ;@560
    12712817 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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
    128129X17 I $S('$D(RAILOC):1,'RAILOC:1,1:0) S Y="@60"
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE3.m

    r628 r636  
    1 RACTQE3 ; ;05/26/08
     1RACTQE3 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(3)=% S %=$P(%Z,U,6) S:%]"" DE(11)=% S %=$P(%Z,U,14) S:%]"" DE(1)=% S %=$P(%Z,U,18) S:%]"" DE(4)=% S %=$P(%Z,U,19) S:%]"" DE(7)=% S %=$P(%Z,U,22) S:%]"" DE(2)=% S %=$P(%Z,U,24) S:%]"" DE(9)=%
    5  I  S %=$P(%Z,U,26) S:%]"" DE(13)=%
     4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(7)=% S %=$P(%Z,U,6) S:%]"" DE(15)=% S %=$P(%Z,U,14) S:%]"" DE(1)=% S %=$P(%Z,U,18) S:%]"" DE(8)=% S %=$P(%Z,U,19) S:%]"" DE(11)=% S %=$P(%Z,U,22) S:%]"" DE(6)=% S %=$P(%Z,U,24) S:%]"" DE(13)=%
     5 I  S %=$P(%Z,U,26) S:%]"" DE(17)=%
    66 K %Z Q
    77 ;
     
    5858 G RD:X="@",Z
    5959X1 Q
    60 2 S DW="0;22",DV="P44'",DU="",DLB="REQUESTING LOCATION",DIFLD=22
     602 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 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
     61X2 S RAX=$P(^RAO(75.1,DA,0),U,4)
     62 Q
     633 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 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
     64X3 I RAX="I",$P($G(^SC(+RALIFN,0)),U,3)'="W",($P($G(^SC(+RALIFN,0)),U,3)'="OR") D REQLOC1^RAORD1A
     65 Q
     664 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
     67X4 I RAX="O",$P($G(^SC(+RALIFN,0)),U,3)'="C",($P($G(^SC(+RALIFN,0)),U,3)'="OR") D REQLOC1^RAORD1A
     68 Q
     695 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 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
     70X5 I $D(RALIFN("OUT")) K RALIFN("OUT") S Y="@99"
     71 Q
     726 S DW="0;22",DV="P44'a",DU="",DLB="REQUESTING LOCATION",DIFLD=22
     73 S DE(DW)="C6^RACTQE3"
    6174 S DU="SC("
    6275 S X=RALIFN
     
    6477 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)
    6578 G RD:X="@",Z
    66 X2 Q
    67 3 S DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
    68  S DE(DW)="C3^RACTQE3"
     79C6 G C6S:$D(DE(6))[0 K DB
     80 S X=DE(6),DIIX=2_U_DIFLD D AUDIT^DIET
     81C6S S X="" G:DG(DQ)=X C6F1 K DB
     82 I $D(DE(6))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
     83C6F1 Q
     84X6 Q
     857 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
     86 S DE(DW)="C7^RACTQE3"
    6987 S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
    7088 S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
     
    7290 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)
    7391 G RD:X="@",Z
    74 C3 G C3S:$D(DE(3))[0 K DB
    75  S X=DE(3),DIC=DIE
     92C7 G C7S:$D(DE(7))[0 K DB
     93 S X=DE(7),DIC=DIE
    7694 K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
    77  S X=DE(3),DIC=DIE
     95 S X=DE(7),DIC=DIE
    7896 ;
    79 C3S S X="" G:DG(DQ)=X C3F1 K DB
     97C7S S X="" G:DG(DQ)=X C7F1 K DB
    8098 S X=DG(DQ),DIC=DIE
    8199 S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
    82100 S X=DG(DQ),DIC=DIE
    83101 D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
    84 C3F1 Q
    85 X3 Q
    86 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
    87  S DE(DW)="C4^RACTQE3"
     102C7F1 Q
     103X7 Q
     1048 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
     105 S DE(DW)="C8^RACTQE3"
    88106 S X="NOW"
    89107 S Y=X
    90108 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)
    91109 G RD
    92 C4 G C4S:$D(DE(4))[0 K DB
    93  S X=DE(4),DIC=DIE
     110C8 G C8S:$D(DE(8))[0 K DB
     111 S X=DE(8),DIC=DIE
    94112 K ^RAO(75.1,"AO",$E(X,1,30),DA)
    95 C4S S X="" G:DG(DQ)=X C4F1 K DB
     113C8S S X="" G:DG(DQ)=X C8F1 K DB
    96114 S X=DG(DQ),DIC=DIE
    97115 S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
    98 C4F1 Q
    99 X4 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
     116C8F1 Q
     117X8 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
    100118 Q
    101119 ;
    102 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,D=0 K DE(1) ;75
     1209 D:$D(DG)>9 F^DIE17,DE S DQ=9,D=0 K DE(1) ;75
    103121 S DIFLD=75,DGO="^RACTQE4",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
    104  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 M5
     122 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 M9
    105123 S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
    106 M5 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(5)=$P(^(0),U,1)
     124M9 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(9)=$P(^(0),U,1)
    107125 S X="""NOW"""
    108126 S Y=X
    109127 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)
    110128 G RD
    111 R5 D DE
     129R9 D DE
    112130 G A
    113131 ;
    114 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
    115 X6 I '$D(RAMT) S RAMT="a"
     13210 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
     133X10 I '$D(RAMT) S RAMT="a"
    116134 Q
    117 7 S DW="0;19",DV="S",DU="",DLB="MODE OF TRANSPORT",DIFLD=19
     13511 S DW="0;19",DV="S",DU="",DLB="MODE OF TRANSPORT",DIFLD=19
    118136 S DU="a:AMBULATORY;p:PORTABLE;s:STRETCHER;w:WHEEL CHAIR;"
    119137 S X=$P(RAMT,"^")
     
    121139 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)
    122140 G RD:X="@",Z
    123 X7 Q
    124 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
    125 X8 I '$D(RAIP) S RAIP="n"
     141X11 Q
     14212 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
     143X12 I '$D(RAIP) S RAIP="n"
    126144 Q
    127 9 S DW="0;24",DV="S",DU="",DLB="ISOLATION PROCEDURES",DIFLD=24
     14513 S DW="0;24",DV="S",DU="",DLB="ISOLATION PROCEDURES",DIFLD=24
    128146 S DU="y:YES;n:NO;"
    129147 S X=RAIP
     
    131149 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)
    132150 G RD:X="@",Z
    133 X9 Q
    134 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
    135 X10 I '$D(RARU) S RARU=9
     151X13 Q
     15214 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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
     153X14 I '$D(RARU) S RARU=9
    136154 Q
    137 11 S DW="0;6",DV="S",DU="",DLB="REQUEST URGENCY",DIFLD=6
     15515 S DW="0;6",DV="S",DU="",DLB="REQUEST URGENCY",DIFLD=6
    138156 S DU="1:STAT;2:URGENT;9:ROUTINE;"
    139157 S X=RARU
     
    141159 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)
    142160 G RD:X="@",Z
    143 X11 Q
    144 12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
    145 X12 S:$$ORVR^RAORDU()<3 Y="@80"
     161X15 Q
     16216 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 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
     163X16 S:$$ORVR^RAORDU()<3 Y="@80"
    146164 Q
    147 13 S DW="0;26",DV="S",DU="",DLB="NATURE OF (NEW) ORDER ACTIVITY",DIFLD=26
     16517 S DW="0;26",DV="S",DU="",DLB="NATURE OF (NEW) ORDER ACTIVITY",DIFLD=26
    148166 S DU="w:WRITTEN;v:VERBAL;p:TELEPHONED;s:SERVICE CORRECTION;i:POLICY;e:PHYSICIAN ENTERED;"
    149167 S Y="s"
    150168 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)
    151169 G RD:X="@",Z
    152 X13 Q
    153 14 S DQ=15 ;@80
    154 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
    155 X15 S RAFIN=1
     170X17 Q
     17118 S DQ=19 ;@80
     17219 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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
     173X19 S RAFIN=1
    156174 Q
    157 16 S DQ=17 ;@99
    158 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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
    159 X17 K RAI,RAPRI,RAMOD,RAIMAG,RAREQLOC,RAMODPRO
     17520 S DQ=21 ;@99
     17621 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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
     177X21 K RAI,RAPRI,RAMOD,RAIMAG,RAREQLOC,RAMODPRO
    160178 Q
    161 18 G 0^DIE17
     17922 G 0^DIE17
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE4.m

    r628 r636  
    1 RACTQE4 ; ;05/26/08
     1RACTQE4 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG.m

    r628 r636  
    1 RACTRG ; GENERATED FROM 'RA REGISTER' INPUT TEMPLATE(#1083), FILE 70;05/26/08
     1RACTRG ; GENERATED FROM 'RA REGISTER' INPUT TEMPLATE(#1083), FILE 70;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(",DIC=DIE,DP=70,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^RADPT(DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG1.m

    r628 r636  
    1 RACTRG1 ; ;05/26/08
     1RACTRG1 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",",DIC=DIE,DP=70.02,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG10.m

    r628 r636  
    1 RACTRG10 ; ;05/26/08
     1RACTRG10 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",D2,""L"",",DIC=DIE,DP=70.07,DL=4,DIEL=3,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",D2,"L",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG11.m

    r628 r636  
    1 RACTRG11 ; ;05/26/08
     1RACTRG11 ; ;11/06/06
    22 ;;
    3 1 N X,X1,X2 S DIXR=475 D X1(U) K X2 M X2=X D X1("F") K X1 M X1=X
     31 N X,X1,X2 S DIXR=490 D X1(U) K X2 M X2=X D X1("F") K X1 M X1=X
    44 I $G(X(1))]"" D
    55 . D KRAD^RAPXRM(.X,.DA)
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG2.m

    r628 r636  
    1 RACTRG2 ; ;05/26/08
     1RACTRG2 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",",DIC=DIE,DP=70.03,DL=3,DIEL=2,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",DA,""))=""
     
    106106 ;
    107107C8F1 S DIEZRXR(70.03,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
    108  F DIXR=475 S DIEZRXR(70.03,DIXR)=""
     108 F DIXR=490 S DIEZRXR(70.03,DIXR)=""
    109109 Q
    110110X8 S DIC("S")="I $$ACTC^RACPTCSV" X ^DD(70.03,2,9.2)
     
    144144 ;
    145145C15F1 S DIEZRXR(70.03,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
    146  F DIXR=475 S DIEZRXR(70.03,DIXR)=""
     146 F DIXR=490 S DIEZRXR(70.03,DIXR)=""
    147147 Q
    148148X15 S DIC("S")="I $$ACTC^RACPTCSV" X ^DD(70.03,2,9.2)
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG3.m

    r628 r636  
    1 RACTRG3 ; ;05/26/08
     1RACTRG3 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",",DIC=DIE,DP=70.03,DL=3,DIEL=2,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG4.m

    r628 r636  
    1 RACTRG4 ; ;05/26/08
     1RACTRG4 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",D2,""M"",",DIC=DIE,DP=70.1,DL=4,DIEL=3,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",D2,"M",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG5.m

    r628 r636  
    1 RACTRG5 ; ;05/26/08
     1RACTRG5 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",D2,""M"",",DIC=DIE,DP=70.1,DL=4,DIEL=3,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",D2,"M",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG6.m

    r628 r636  
    1 RACTRG6 ; ;05/26/08
     1RACTRG6 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",",DIC=DIE,DP=70.03,DL=3,DIEL=2,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG7.m

    r628 r636  
    1 RACTRG7 ; ;05/26/08
     1RACTRG7 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",D2,""F"",",DIC=DIE,DP=70.04,DL=4,DIEL=3,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",D2,"F",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG8.m

    r628 r636  
    1 RACTRG8 ; ;05/26/08
     1RACTRG8 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",D2,""T"",",DIC=DIE,DP=70.05,DL=4,DIEL=3,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",D2,"T",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTRG9.m

    r628 r636  
    1 RACTRG9 ; ;05/26/08
     1RACTRG9 ; ;11/06/06
    22 D DE G BEGIN
    33DE S DIE="^RADPT(D0,""DT"",D1,""P"",",DIC=DIE,DP=70.03,DL=3,DIEL=2,DU="" K DG,DE,DB Q:$O(^RADPT(D0,"DT",D1,"P",DA,""))=""
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RADD2.m

    r628 r636  
    11RADD2 ;HISC/GJC/CAH-Radiology Data Dictionary Utility Routine ;5/14/97  10:31
    2  ;;5.0;Radiology/Nuclear Medicine;**84**;Mar 16, 1998;Build 13
    3  ;
    4  ;Integration Agreements
    5  ;----------------------
    6  ;EN^DDIOL(10142); FILE^DIE(2053);NOTE^ORX3(868);MES^XPDUTL(10141)
    7  ;
     2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
    83EN1(RAX,RAY) ; Input transform for the .01 field (Procedure) for the Rad/Nuc
    94 ; Med Common Procedure file i.e, ^RAMIS(71.3
     
    106101 Q:+$P(RAUTH,"^")&($S('$P(RAUTH,"^",4):1,$P(RAUTH,"^",4)'<RADT:1,1:0)) 1
    107102 Q 0
    108  ;
    109 PRIDXIXK(DA,X) ;This subroutine executes the KILL logic for the 'new style' AD cross-
    110  ;reference on the 'PRIMARY DIAGNOSTIC CODE' (data dictionary: 70.03; field: 13)
    111  ;Input: DA - an array where DA(2)=RADFN, DA(1)=RADTI, & DA=RACNI
    112  ;        X - the primary diagnostic code value (this field points to file 78.3)
    113  N RACNI,RADFN,RADTI,RAFDA,RAIENS,RAX
    114  S RADFN=DA(2),RADTI=DA(1),RACNI=DA,RAX=X ;save the variables just in case
    115  S RAIENS=DA_","_DA(1)_","_DA(2)_",",RAFDA(70.03,RAIENS,20)="@"
    116  D FILE^DIE(,"RAFDA") ;delete data in 'DIAGNOSTIC PRINT DATE' (DD: 70.03; field: 20)
    117  K ^RADPT("AD",RAX,RADFN,RADTI,RACNI)
    118  Q
    119  ;
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RADLQ3.m

    r628 r636  
    11RADLQ3 ;HISC/GJC-Delq Status/Incomplete Rpt's ;5/7/97  15:58
    2  ;;5.0;Radiology/Nuclear Medicine;**87**;Mar 16, 1998;Build 2
    3  ; 11/15/07 BAY/KAM RA*5*87 Rem Call 217642 change pat ssn to display last four
     2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
    43DISPXAM ; Display exam statuses for selected Imaging Types.  These exam
    54 ; statuses need the 'DELINQUENT STATUS REPORT?' field tripped to
     
    5049 ;       Since only inpatient and outpatient is possibly stored, any
    5150 ;       change in the variable RAVAR will be a change to 'outpatient'.
    52  ; 11/15/07 BAY/KAM RA*5*87 Rem Call 217642 Added next line
    53  S RASSN=$E(RASSN,8,11)
    5451 I IOM=132 D  ;132 column format
    5552 . W !,RANME,?RATAB(1),RACN,?RATAB(2),RASSN,?RATAB(3),RADT,?RATAB(4)
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLO.m

    r628 r636  
    11RAHLO ;HIRMFO/GJC-Process data set from the bridge program ;11/18/97  12:13
    2  ;;5.0;Radiology/Nuclear Medicine;**4,8,27,55,66,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**4,8,27,55,66**;Mar 16, 1998
    33 ; 09/07/2005 Remedy call 108405 - KAM Allow Radiology to accept dx codes from Talk Technology
    4  ;
    5  ;Integration Agreements
    6  ;----------------------
    7  ;DT^DILF(2054); LOCK^DILF(2054); DEM^VADPT(10061); $$DT^XLFDT(10103)
    8  ;
    94EN1 ; Check the validity of the following data globals:
    105 ; Example: '^TMP("RARPT-REC",$J,RASUB,' where RASUB is a
     
    5954 D DT^DILF("ET",RADATE,.RAVLDT)
    6055 S:RAVLDT=-1 RAERR="Invalid report date" Q:$D(RAERR)
    61  K VA,VADM,VAERR S DFN=RADFN D DEM^VADPT
    62  I VADM(1)']"" S RAERR="Unknown Internal patient identifier" K VA,VADM,VAERR Q
    63  I RASSN'=$P(VADM(2),"^") S RAERR="Internal patient identifier and SSN don't match" K VA,VADM,VAERR Q
     56 K VA,VADM,VAERR S DFN=RADFN D DEM^VADPT I VADM(1)']""!(RASSN'=$P(VADM(2),"^")) S RAERR="Internal patient identifier and SSN don't match" K VA,VADM,VAERR Q
    6457 I '$D(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0))!(RALONGCN']"") D  Q
    6558 . S RAERR="Invalid Exam Date and/or Case Number"
     
    7972 ; check resident and staff
    8073 N X1,X2,X3 S X2=0,X3=""
    81  I '$G(RATELE),+$G(^TMP("RARPT-REC",$J,RASUB,"RARESIDENT"))!(+$G(^("RASTAFF"))) D  Q:$G(RAERR)]""
     74 I +$G(^TMP("RARPT-REC",$J,RASUB,"RARESIDENT"))!(+$G(^("RASTAFF"))) D  Q:$G(RAERR)]""
    8275 . S X1=+$G(^TMP("RARPT-REC",$J,RASUB,"RARESIDENT"))
    8376 . I X1 D
    84  .. I '$D(^VA(200,"ARC","R",X1)),'$D(^VA(200,"ARC","S",X1)) S X2=1
     77 .. I '$D(^VA(200,"ARC","R",X1)) S X2=1
    8578 .. I $P($G(^VA(200,X1,"RA")),"^",3),$P(^("RA"),"^",3)'>$$DT^XLFDT S X2=X2+2
    86  .. I X2=1 S X3=$E($P($G(^VA(200,X1,0)),"^"),1,20)_" is not class'd as Resident or Staff"
     79 .. I X2=1 S X3=$E($P($G(^VA(200,X1,0)),"^"),1,20)_" is not class'd as resident"
    8780 .. I X2=2 S X3=$P($G(^VA(200,X1,0)),"^")_"'s INACTIVE DATE is past"
    8881 .. I X2=3 S X3=$P($G(^VA(200,X1,0)),"^")_" is not class'd as resident and past INACTIVE DATE"
     
    9891 . Q
    9992 ; raesig is in alphanumeric format, so shouldn't use $g of it here
    100  I ($G(RAESIG)]"")!($G(RAVERF)) D:'$G(RATELE) VERCHK^RAHLO3 ; check if provider can verify report
     93 I ($G(RAESIG)]"")!($G(RAVERF)) D VERCHK^RAHLO3 ; check if provider can verify report
    10194 ; if verifier fails checks,
    10295 ;   quit only if vendor is non-kurzweil,
     
    10699 K RASECDX ;clear secondary dx array because RAHLO2 may not be called
    107100 ; 09/07/2005 108405 KAM- Removed ('$D(RADENDUM)#2) from next line
    108  I $G(RATELE),'$D(RADENDUM),'$D(^TMP("RARPT-REC",$J,RASUB,"RADX")) D  ;Patch 84
    109  .I RASTAT="R" S:$D(RATELEDR) ^TMP("RARPT-REC",$J,RASUB,"RADX",1)=RATELEDR Q
    110  .S:$D(RATELEDF) ^TMP("RARPT-REC",$J,RASUB,"RADX",1)=RATELEDF
    111101 D:$D(^TMP("RARPT-REC",$J,RASUB,"RADX")) DIAG^RAHLO2 Q:$D(RAERR)  ; DX code check took out - &('$D(RADENDUM)#2)
    112102 ; edit sec Dx codes if they exist for non-addendums
     
    119109 . S:'B RAERR=$$ERR^RAHLO2(A)
    120110 . Q
    121  I $G(RATELE),$G(RARPT) D  Q:$D(RAERR)  ;PATCH 84
    122  .I $D(^RARPT(RARPT,0)) D LOCK^DILF($NA(^RARPT(RARPT))) E  S RAERR="Report: "_$P($G(^RARPT(RARPT,0)),"^")_" Locked on VISTA site" Q
    123  .L -^RARPT(RARPT)
    124  I $G(RATELE),$L($G(RATELEPI)),RATELEPI'?10N S RAERR="Incorrect Teleradiologist's NPI: "_RATELEPI Q
    125111 D RPTSTAT^RAHLO3 ; determine the status of the report
    126112 D FILE^RAHLO1:'$D(RAERR)
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLO1.m

    r628 r636  
    11RAHLO1 ;HIRMFO/GJC/BNT-File rpt (data from bridge program) ;6/25/04  11:49
    2  ;;5.0;Radiology/Nuclear Medicine;**4,5,12,17,21,27,48,55,66,87,84**;Mar 16, 1998;Build 13
    3  ; 11/15/2007 BAY/KAM RA*5*87 Rem Call 216332 Correct UNDEF on null dx code
     2 ;;5.0;Radiology/Nuclear Medicine;**4,5,12,17,21,27,48,55,66**;Mar 16, 1998
    43 ; 09/07/2005 108405 - KAM/BAY Allow Radiology to accept dx codes from Talk Technology
    5  ; 09/29/2005 114302 KAM/BAY Code Added to trigger alert on 2ndary dx
    6  ;
    7  ;Integration Agreements
    8  ;----------------------
    9  ;DIE(10018); ,FILE^DIE(2053); IX^DIK(10013); CREATE^WVRALINK(4793); $$NOW^XLFDT(10103)
    10  ;EN^XUSHSHP(10045)
    11  ;
     4 ; 09/29/2005 114302 KAM/BAY Code Added to trigger alert on 2ndary dx
     5 ; This routine uses the following IA:
     6 ; #4793  - ^WVRALINK         (private)
    127FILE ;Create Entry in File 74 and File Data
    138 I '$D(ZTQUEUED) N ZTQUEUED S ZTQUEUED="1^dummy to suppress screen displays in UP2^RAUTL1 and elsewhere"
     
    1712 N:'$D(RAPRTSET) RAPRTSET N:'$D(RAMEMARR) RAMEMARR
    1813 D EN2^RAUTL20(.RAMEMARR) ; 04/30/99 always recalculate RAPRTSET
    19  ; If the report (stub/real) exists, unverify the existing report... Else create a new report
    20  I RARPT,$D(^RARPT(RARPT,0)) S RASAV=RARPT D  S RARPT=RASAV K RASAV Q:$D(RAERR) G LOCK1
     14 ; If rpt (either stub or real) exists, skip creating a new file 74 entry
     15 I RARPT,$D(^RARPT(RARPT,0)) S RASAV=RARPT D FILETST^RAHLO4 Q:$D(RAERR)  D  S RARPT=RASAV K RASAV G LOCK1
    2116 . ; must save off RARPT, RAVERF and other RA* variables because
    2217 . ; they are being killed off somewhere in the 'Unverify A Report'
    23  . ; option. 'Unverify A Report' does lock the the report record in file 74!
     18 . ; option.
    2419 . N RADFN,RADTI,RACNI,RARPTSTS,RASSN,RADATE,RALONGCN,RAVERF
    2520 . ; if report isn't a stub report, then consider it being edited
     
    3025 . K ^RARPT(RARPT,"I"),^("R"),^("H")
    3126 . Q
    32  ; New report logic @NEW1
     27 I RAPRTSET L +^RADPT(RADFN,"DT",RADTI):0 G:$T NEW1 S RAERR="ANOTHER USER IS CURRENTLY EDITING THIS PRINTSET. TRY LATER." D KVAR Q
    3328NEW1 S I=$P(^RARPT(0),"^",3)
    34  ;since this is a new report (not linked to an exam), directly lock the new record *1 lR*
    35 LOCK S I=I+1 L +^RARPT(I):1 G:'$T LOCK I ($D(^RARPT(I))#2) L -^RARPT(I) G LOCK
     29LOCK S I=I+1 L +^RARPT(I):1 I '$T!($D(^RARPT(I)))!($D(^RARPT("B",I))) L -^RARPT(I) G LOCK
    3630 S ^RARPT(I,0)=RALONGCN,RARPT=I,^(0)=$P(^RARPT(0),"^",1,2)_"^"_I_"^"_($P(^(0),"^",4)+1)
    3731 ;if case is member of a print set, then create sub-recs for file #74
     
    3933 I '$D(RARPTN) N RARPTN S RARPTN=RALONGCN
    4034 N RAXIT D PTR^RARTE2 ;create corresponding subrecs in ^RARPT()
    41  ;
    42  ;if RAERR unlock the report record (locked @LOCK), kill vars, & exit
    43  I $D(RAERR) D LOCKR^RAHLTCPU(.RAERR,1) D KVAR Q  ; *1 uR*
    44  ;
     35 I $D(RAERR) L -^RADPT(RADFN,"DT",RADTI) D KVAR Q  ;unlck & clear vars
    4536LOCK1 I $D(RAESIG) S X=RAESIG,X1=$G(RAVERF),X2=RARPT D EN^XUSHSHP S RAESIG=X
    4637 K DA,DIE,DQ,DR S DA=RARPT,DIE="^RARPT("
     
    5344 S DR=DR_";8////"_$S($D(RAEDIT):"",1:RADATE) ; reported date
    5445 S DR=DR_";9////"_$S($G(RAVERF)&(RARPTSTS="V"):RAVERF,1:"") ; v'fying phys
    55  S:$L($G(RATELENM)) DR=DR_";9.1////"_RATELENM ;Teleradiologist name - Patch 84
    56  S:$L($G(RATELEPI)) DR=DR_";9.2////"_RATELEPI ;Teleradiologist NPI  - Patch 84
    5746 S DR=DR_";11////"_$S($G(RATRANSC):RATRANSC,$G(RAVERF):RAVERF,1:"") ; transcriptionist
    5847 I $G(RAVERF),(RARPTSTS="V") S DR=DR_";17////"_$G(^TMP("RARPT-REC",$J,RASUB,"RAWHOCHANGE")) ;status changed to 'verified' by
     
    6352 S $P(^RARPT(RARPT,0),"^",10)=$S($D(RAESIG)&(RARPTSTS="V"):RAESIG,1:"") ; hard set because Elec Sig Code may contain a semi-colon which causes errors in DIE
    6453 D ^DIE K DA,DR
    65  ;don't file a Pri. Dx code for teleradiology reports in the released status (P84v11 bus. rule)
    66  S RARELTEL=$S(($D(RATELE)#2)&(RARPTSTS="R"):1,1:"")
    67  ;
    68  ; 02/08/2008 GJC replaced $G w/($D(RADX)#2) p84
    69  ; 11/15/2007 BAY/KAM RA*5*87 Rem Call 216332 Changed next line to $G
    7054 ; 09/07/2005 108405 KAM/BAY Removed('$D(RADENDUM)#2) from next line
    71  I ($D(RADX)#2),RARELTEL="" D  Q:($D(RAERR))#2
    72  .;now a silent FM call w/p84 due to xref being killed when stuffing an identical Dx code
    73  .;as the one already on file.
    74  .N RAFDA,RAIENS S RAIENS=RACNI_","_RADTI_","_RADFN_","
    75  .S RAFDA(70.03,RAIENS,13)=RADX
    76  .;lock the exam record, if the lock fails unlock the report record (locked @LOCK) & quit
    77  .D LOCKX^RAHLTCPU(.RAERR) ;*1 lE*
    78  .I ($D(RAERR)#2) D LOCKR^RAHLTCPU(.RAERR,1) Q  ;*1 uR*
    79  .K RAERR D FILE^DIE(,"RAFDA","RAERR") D LOCKX^RAHLTCPU(.RAERR,1) ;*1 uE*
    80  .I ($D(RAERR("DIERR"))#2) D  Q
    81  ..;set the error dialog; unlock the report (locked @LOCK) *1 uR*
    82  ..D LOCKR^RAHLTCPU(.RAERR,1) S RAERR=$G(RAERR("DIERR",1,"TEXT",1))
    83  ..Q
    84  .S:$P(^RA(78.3,+RADX,0),"^",4)="y" RAAB=1
    85  .Q
    86  ;
    87  K RARELTEL
     55 I $D(RADX) D
     56 . K DIE,DA,DR S DA=RACNI,DA(1)=RADTI,DA(2)=RADFN
     57 . S DIE="^RADPT("_DA(2)_",""DT"","_DA(1)_",""P"","
     58 . S DR="13////"_RADX D ^DIE K DIE,DA,DR
     59 . S:$P(^RA(78.3,+RADX,0),"^",4)="y" RAAB=1
     60 . Q
    8861 ; 09/29/2005 114302 KAM/BAY Code Added to trigger alert on 2ndary dx
    8962 I $D(RASECDX) D
     
    9871 . Q:'$G(DR)
    9972 . S DA=RACNI,DA(1)=RADTI,DA(2)=RADFN
    100  . D LOCKX^RAHLTCPU(.RAERR) ;*2 lE*
    10173 . S DIE="^RADPT("_DA(2)_",""DT"","_DA(1)_",""P"","
    10274 . D ^DIE K DIE,DA,DR
    103  . D LOCKX^RAHLTCPU(.RAERR,1) ;*2 uE*
    10475 . Q
    10576 ;
     
    146117 F  S RA7=$O(RAMEMARR(RA7)) Q:RA7=""  I RACNISAV'=RA7 S RACNI=RA7 D UPMEM^RAHLO4 I $D(RASECDX),('$D(RADENDUM)#2) D SECDX^RAHLO2
    147118 S RACNI=RACNISAV
     119 L -^RADPT(RADFN,"DT",RADTI) ;unlock after pce 17 is set in all cases of this printset
    148120 ;Update Activity Log
    149 UPACT S DA=RARPT,DIE="^RARPT(",DR="100///""NOW""",DR(2,74.01)="2////"_$S(RARPTSTS="V":"V",$D(RAEDIT):"E",1:"I")_";3////"_$S($G(RAVERF):RAVERF,$G(RATRANSC):RATRANSC,1:"") D ^DIE K DA,DR,DE,DQ,DIE
     121UPACT S DA=RARPT,DIE="^RARPT(",DR="100///""NOW""",DR(2,74.01)="2////"_$S(RARPTSTS="V":"V",$D(RAEDIT):"E",1:"I")_";3////"_$S($G(RATRANSC):RATRANSC,$G(RAVERF):RAVERF,1:"") D ^DIE K DA,DR,DE,DQ,DIE
    150122 ; use ix^dik to kill before setting xrefs
    151123 S DA=RARPT,DIK="^RARPT(",RAQUEUED=1 D IX^DIK
    152  L -^RARPT(RARPT) ;(1 uR) conventionally unlock the report locked @LOCK
    153  ;
    154  ;If verified, update report & exam statuses; else, just update exam status
    155  ;Note: be careful; exam locks are executed within UP1^RAUTL1!
     124 ; if verfd, update rpt & exam statuses; else, just update exam status
    156125 I $D(RAMDV),RAMDV'="" D:RARPTSTS="V" UPSTAT^RAUTL0 D:RARPTSTS'="V" UP1^RAUTL1
    157  D:'$D(RAERR)&($G(^TMP("RARPT-REC",$J,RASUB,"VENDOR"))'="KURZWEIL") GENACK^RAHLTCPB ; generate 'ACK' message
    158  ;
    159 PACS ;If there are subscribers to RA RPT xxx events broadcast ORU mesages to those subscribers
    160  ;via TASK^RAHLO4. If VOICE DICTATION AUTO-PRINT (#26) field is set to 'Y' print the report to
    161  ;the printer defined in the REPORT PRINTER NAME (#10) field via VOICE^RAHLO4.
    162  I ($P(^RARPT(RARPT,0),U,5)="V")!($P(^(0),U,5)="R") D TASK^RAHLO4,VOICE^RAHLO4
    163  ;
     126 L -^RARPT(RARPT) D:'$D(RAERR)&($G(^TMP("RARPT-REC",$J,RASUB,"VENDOR"))'="KURZWEIL") GENACK^RAHLTCPB ; generate 'ACK' message
     127 ; line pacs is for 2 tasks: hl7 msg'g  &  voice verified rpt printout
     128PACS I ($P(^RARPT(RARPT,0),U,5)="V")!($P(^(0),U,5)="R") D TASK^RAHLO4,VOICE^RAHLO4
    164129KVAR K RAAB,RAEDIT,RAESIG,RAQUEUED,RARPT,RAHIST
    165130 Q
    166  ;
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLO2.m

    r628 r636  
    11RAHLO2 ;HIRMFO/GJC-File rpt (data from bridge program) ;10/30/97  09:02
    2  ;;5.0;Radiology/Nuclear Medicine;**55,80,84**;Mar 16, 1998;Build 13
    3  ;
    4  ;Integration Agreements
    5  ;----------------------
    6  ;$$FIND1^DIC(2051); UPDATE^DIE(2053); $$DT^XLFDT(10103); $$UP^XLFSTR(10104)
    7  ;
    8 ADENDUM ; This functions store new lines of text at the end of the existing
    9  ;impression and report text. If this report is being amended through the
    10  ;teleradiology service, add the addendum text to the IMPRESSION TEXT (#300)
    11  ;field only. Note: Only ADENDUM was edited for RA*5.0*84 gjc/09.18.07
    12  N A,COUNTER,I,J,NODE,ROOT,SUB,X,Y
    13  ;NODE = ^RARPT(RARPT,"I" -or- "R"  -> where the data is to be stored...
    14  ;ROOT = ^TMP("RARPT-REC",$J,RASUB  -> where the addendum data resides...
    15  F A="I","R" D  K I,J
    16  .S SUB=$S(A="I":"RAIMP",1:"RATXT"),ROOT=$NA(^TMP("RARPT-REC",$J,RASUB,SUB)) Q:'$O(@ROOT@(0))
    17  .S NODE=$NA(^RARPT(RARPT,A))
    18  .S COUNTER=+$O(@NODE@($C(32)),-1) ;last record #
    19  .;
    20  .;if there is existing text, add a null line for space.
    21  .I '($D(I)#2),(COUNTER>0) S COUNTER=COUNTER+1,@NODE@(COUNTER,0)=$C(32),I=""
    22  .;
    23  .S Y=0 F  S Y=$O(@ROOT@(Y)) Q:'Y  D
    24  ..S X=@ROOT@(Y)
    25  ..;if addendum text is to be the original text no spacer is needed ('Addendum:' tag applied)
    26  ..;if prior report or impression text exist, insert a blank as a spacer
    27  ..;^RARPT(RARPT,"I",1,0)="original impression"
    28  ..;^RARPT(RARPT,"I",2,0)="" <- insert a null line as a spacer
    29  ..;^RARPT(RARPT,"I",3,0)="Addendum: first line of addendum" ** NOTE 'Addendum:' tag **
    30  ..;^RARPT(RARPT,"I",4,0)="second line of addendum"
    31  ..;...
    32  ..;^RARPT(RARPT,"I",N,0)="Nth and last line of addendum"
    33  ..S COUNTER=COUNTER+1
    34  ..;set the first line of the addendum w/header: 'Addendum: '
    35  ..I '($D(J)#2) S X="Addendum: "_X,J=""
    36  ..S @NODE@(COUNTER,0)=X
    37  ..Q
    38  .S @NODE@(0)="^^"_COUNTER_"^"_COUNTER_"^"_$$DT^XLFDT()
    39  .Q
     2 ;;5.0;Radiology/Nuclear Medicine;**55,80**;Mar 16, 1998;Build 19
     3ADENDUM ; store new lines at the end of existing text
     4 F A="I","R" D
     5 . I $O(^TMP("RARPT-REC",$J,RASUB,$S(A="I":"RAIMP",1:"RATXT"),0)) D
     6 .. S RACNT=+$O(^RARPT(RARPT,A,9999999),-1),RASTRNDE=RACNT+1
     7 .. ; Check if the impression an/or report text sent with the addendum
     8 .. ; is to be the initial text added to the word processing multiples.
     9 .. ; RASTRNDE=the first subscript where impression/report data is to
     10 .. ; be stored.  If no existing impression/report text data, RASTRNDE
     11 .. ; equals one.  If one & RACNT equals one, don't add a blank line
     12 .. ; before adding addendum text.  If RASTRNDE & RACNT both >1, add
     13 .. ; the blank line.
     14 .. S I=0 F  S I=$O(^TMP("RARPT-REC",$J,RASUB,$S(A="I":"RAIMP",1:"RATXT"),I)) Q:I'>0  D
     15 ... S RACNT=RACNT+1,L=$G(^TMP("RARPT-REC",$J,RASUB,$S(A="I":"RAIMP",1:"RATXT"),I))
     16 ... S:I=$O(^TMP("RARPT-REC",$J,RASUB,$S(A="I":"RAIMP",1:"RATXT"),0)) L="Addendum: "_L ; if the first line, append 'addendum:'
     17 ... I (RASTRNDE=RACNT),(RACNT>1) S ^RARPT(RARPT,A,RACNT,0)=" ",RACNT=RACNT+1
     18 ... S ^RARPT(RARPT,A,RACNT,0)=L
     19 ... Q
     20 .. S ^RARPT(RARPT,A,0)="^^"_RACNT_"^"_RACNT_"^"_RADATE
     21 .. Q
     22 . Q
     23 K A,I,L,RACNT,RASTRNDE
    4024 Q
    41  ;
    4225ERR(A) ; Invalid impression/report text message.
    4326 ; Input: 'A' - either "I" for impression, or "R" for report
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLO3.m

    r628 r636  
    11RAHLO3 ;HIRMFO/GJC-Process data set from the bridge program ;11/18/97  12:13
    2  ;;5.0;Radiology/Nuclear Medicine;**4,81,84**;Mar 16, 1998;Build 13
    3  ;
    4  ;Integration Agreements
    5  ;-----------------------
    6  ;$$GET1^DIQ(2056); $$DT^XLFDT(10103)
    7  ;
     2 ;;5.0;Radiology/Nuclear Medicine;**4,81**;Mar 16, 1998;Build 12
    83RPTSTAT ; Determine the status to set this report to.
    94 K RARPTSTS S:$D(RAESIG) RARPTSTS="V" Q:$D(RARPTSTS)
    105 ; $D(RAESIG)=0 now figure out report status
    11  N RASTAT S RASTAT=$E($G(^TMP("RARPT-REC",$J,RASUB,"RASTAT")))
     6 S RASTAT=$E($G(^TMP("RARPT-REC",$J,RASUB,"RASTAT")))
    127 I RASTAT="A" S RARPTSTS="V" Q
    138 I RASTAT]"",("FR"[RASTAT) D
    149 . S:RASTAT="F" RARPTSTS="V" Q:$D(RARPTSTS)
    15  . I $G(RATELE) S RARPTSTS="R" Q  ;Always allow 'Released/Unverified' reports for teleradiology
    1610 . ; do we allow 'Released/Unverified' reports for this location?
    1711 . S RARPTSTS=$S($P($G(^RA(79.1,RAMLC,0)),"^",17)="Y":"R",1:"D")
     
    2115 ; if still no status, default to draft
    2216 S:'$D(RARPTSTS) RARPTSTS="D"
     17 K RASTAT
    2318 Q
    2419TEXT(X) ; Check if the Impression Text and the Report Text contain
     
    4742 ; If 'No' to any of the above questions, kill RAESIG & set the variable
    4843 ; RAERR to the appropriate error message.
    49  I '$D(^VA(200,"ARC","R",+$G(RAVERF))),('$D(^VA(200,"ARC","S",+$G(RAVERF)))),'$G(RATELE) D  Q
     44 I '$D(^VA(200,"ARC","R",+$G(RAVERF))),('$D(^VA(200,"ARC","S",+$G(RAVERF)))) D  Q
    5045 . ; neither a resident or staff
    5146 . K RAESIG S RAERR="Provider not classified as resident or staff."
    5247 . Q
    53  I $D(^VA(200,"ARC","R",+$G(RAVERF))),('$P(RAMDV,"^",18)),'$G(RATELE) D  Q
     48 I $D(^VA(200,"ARC","R",+$G(RAVERF))),('$P(RAMDV,"^",18)) D  Q
    5449 . ; residents can't verify reports linked to this division
    5550 . K RAESIG S RAERR="Residents are not permitted to verify reports."
    5651 . Q
    57  I '$D(^XUSEC("RA VERIFY",+$G(RAVERF))),'$G(RATELE) D  Q
     52 I '$D(^XUSEC("RA VERIFY",+$G(RAVERF))) D  Q
    5853 . ; verifier MUST have the RA VERIFY key.
    5954 . K RAESIG S RAERR="Provider does not meet security requirements to verify report."
    6055 . Q
    61  I '$G(RATELE),$P($G(^VA(200,+$G(RAVERF),"RA")),"^",3),($P(^("RA"),"^",3)'>$$DT^XLFDT()) D
     56 I $P($G(^VA(200,+$G(RAVERF),"RA")),"^",3),($P(^("RA"),"^",3)'>$$DT^XLFDT()) D
    6257 . ; Rad/Nuc Med user has been inactivated.
    6358 . K RAESIG S RAERR="Inactive Rad/Nuc Med Classification for Interpreting Physician."
    6459 . Q
    65  I '$G(RATELE),'$S('$D(^VA(200,+$G(RAVERF),"RA")):1,$P(^("RA"),"^")'="Y":1,1:0) D
     60 I '$S('$D(^VA(200,+$G(RAVERF),"RA")):1,$P(^("RA"),"^")'="Y":1,1:0) D
    6661 . K RAESIG S RAERR="Staff review required to verify report."
    6762 . Q
     
    9489 . I RAVCNT=1,('$D(RAVIEN(RAVCNT))#2) S RAVIEN(RAVCNT)=RAVIEN
    9590 . Q
    96  I RAVCNT=0 S RAERR="Invalid Provider Name: "_RAVERF Q  ; partial match not found
    97  I RAVCNT>1 S RAERR="Non-Unique Provider Name: "_RAVERF Q  ; >1 partial match
    98  ;S RAVERF=$G(RAVIEN(1)) S:'RAVERF RAERR="Provider Name Entry Error"
    99  S:'$G(RAVIEN(1)) RAERR="Provider Name Entry Error: "_RAVERF S RAVERF=$G(RAVIEN(1))
     91 I RAVCNT=0 S RAERR="Invalid Provider Name" Q  ; partial match not found
     92 I RAVCNT>1 S RAERR="Non-Unique Provider Name" Q  ; >1 partial match
     93 S RAVERF=$G(RAVIEN(1)) S:'RAVERF RAERR="Provider Name Entry Error"
    10094 Q
    10195ESIG ; Added for COTS E-Sig capability
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLO4.m

    r628 r636  
    11RAHLO4 ;HIRMFO/GJC-File rpt (data from bridge program) ;7/21/99  11:45
    2  ;;5.0;Radiology/Nuclear Medicine;**4,8,81,84**;Mar 16, 1998;Build 13
    3  ;
    4  ;Integration Agreements
    5  ;----------------------
    6  ;NOW^%DTC(10000); %ZTLOAD(10063); FIND^DIC(2051); ^DIE(10018); ^DIK(10013); $$GET1^DIQ(2056)
    7  ;GETS^DIQ(2056); ^XMD(10070)
    8  ;
     2 ;;5.0;Radiology/Nuclear Medicine;**4,8,81**;Mar 16, 1998;Build 12
    93TASK ; Task ORU message
    104 S ZTDESC="Rad/Nuc Med Compiling HL7 ORU Message",ZTDTH=$H,ZTIO="",ZTRTN="RPT^RAHLRPC",ZTSAVE("RADFN")="",ZTSAVE("RADTI")="",ZTSAVE("RACNI")="",ZTSAVE("RARPT")=""
    11  ;Next line of coding will assure that ORU (report) message will be sent after posible ORM message. (10 second)
    12  S $P(ZTDTH,",",2)=$P(ZTDTH,",",2)+4 S:$P(ZTDTH,",",2)>86400 ZTDTH=$P(ZTDTH,",")+1_","_($P(ZTDTH,",",2)-86400)
     5 ;S:$L($G(RANOSEND))&'$O(RAPRSET(RADTI,0)) ZTSAVE("RANOSEND")="" D ^%ZTLOAD
    136 S:$L($G(RANOSEND)) ZTSAVE("RANOSEND")="" D ^%ZTLOAD
    147 K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
     
    2215 D ^%ZTLOAD K RAMES,ZTDESC,ZTSK,ZTIO,ZTSAVE,ZTRTN,RASV,ZTDTH
    2316 Q
    24  ;
     17FILETST ; is anyone else working on this report?
     18 L +^RARPT(RARPT):1
     19 I '$T S RAERR="This report is being edited by another user" L -^RARPT(RARPT)
     20 Q
    2521UPMEM ;copy (prim:dx,stf,res),rpt ien to other members of same print set
    2622 ; first clear those fields
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLR.m

    r628 r636  
    11RAHLR ;HISC/CAH/BNT - Generate Common Order (ORM) Message ;11/10/99  10:42
    2  ;;5.0;Radiology/Nuclear Medicine;**2,12,10,25,71,82,75,80,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**2,12,10,25,71,82,75,80**;Mar 16, 1998;Build 19
    33 ;Generates msg whenever a case is registered or cancelled or examined
    44 ;              registered        cancelled        examined
     
    66 ; Order status  : IP                CA               CM
    77 ;02/14/2006 BAY/KAM RA*5*71 Add ability to update exam data to V/R
    8  ;
    9  ;Integration Agreements
    10  ;----------------------
    11  ;NOW^%DTC(10000); ^%ZTLOAD(10063); $$GET1^DIQ(2056); ^DIWP(10011)
    12  ;$$HLDATE/$$HLNAME/$$M11^HLFNC(10106); INIT^HLFNC2(2161)
    13  ;GENERATE^HLMA(2164); DEM^VADPT(10061); $$EN^VAFHLPID(263)
    14  ;$$FMTHL7^XLFDT(10103)
    15  ;
    16  ;IA: 10039 global read .01 field WARD LOCATION (#42) file ^DIC(42,
    17  ;IA: 10040 global read .01 field HOSPITAL LOCATION (#44) file ^SC(
    18  ;
    198 S:$D(HLNDAP) ZTSAVE("HLNDAP")="" S:$D(HLDAP) ZTSAVE("HLDAP")="" S:$D(RAEXMDUN) ZTSAVE("RAEXMDUN")=""
    209 S:$D(RAEXEDT) ZTSAVE("RAEXEDT")=""
     
    3625 ;RAEXMDUN passed from EXM^RAHLRPC if conditions are met
    3726 Q:+$G(HL)=15  ;no known client(item) linked to the event driver protocol
    38  Q:$O(HL(""))=""  ;disabled server appl, or no server appl 
     27 Q:$O(HL(""))=""  ;disabled server appl, or no server appl
    3928 ;** branch to new HL7 logic when the HL7 version surpasses 2.3 **
    40  I HL("VER")>2.3,($T(^RAHLR1))'="" D EN^RAHLR1(RADFN,RADTI,RACNI,RAEID) Q
     29 ;I HL("VER")]2.3 D EN^RAHLR1(RADFN,RADTI,RACNI,RAEID) Q
    4130 ;** branch to new HL7 logic when the HL7 version surpasses 2.3 **
    4231 S RACN0=$S($D(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)):^(0),1:"") Q:RACN0']""
     
    4736 S RAPRCNDE=$G(^RAMIS(71,+RAPROC,0)),RACPT=+$P(RAPRCNDE,U,9),RACPTNDE=$$NAMCODE^RACPTMSC(RACPT,DT)
    4837 ;RA*5*82 RAEXEDT= Override the EXM conditions if Case edited
    49  ;I $G(RAEXMDUN)=1,'$G(RAEXEDT),$P(RACN0,U,30)'="",'$G(RATELE) Q  ;last chance to stop exm'd msg if it's already been sent RA*5*84 Is TELERAD ??
     38 I $G(RAEXMDUN)=1,'$G(RAEXEDT),$P(RACN0,U,30)'="" Q  ;last chance to stop exm'd msg if it's already been sent
    5039 ;Compile 'PID' Segment
    5140 K VA,VADM,VAERR,RAVADM S DFN=RADFN D DEM^VADPT I VADM(1)']"" S HLP("ERRTEXT")="Invalid Patient Identifier" G EXIT
     
    7362 ; S RAOBR4=$P(RACPTNDE,U)_$E(HLECH)_$$ESCAPE^RAHLRU($P(RACPTNDE,U,2))_$E(HLECH)_"C4"_$E(HLECH)_+RAPROC_$E(HLECH)_$$ESCAPE^RAHLRU($P(RAPRCNDE,U))_$E(HLECH)_"99RAP"
    7463 I $P(RACPTNDE,U)']"" S $P(RAOBR4,$E(HLECH),1,3)=$P(RAOBR4,$E(HLECH),4,5)_$E(HLECH)_"LOCAL"
    75  ;OBR-7 change: from HLDT1 to $$HLDATE^HLFNC(9999999.9999-RADTI) d/t of registration
    76  ;Driver of change: CareStream Health PACS. Agfa requires a timestamp down to the second
    77  ;POC @ Boston is Maureen Sullivan
    78  S HLA("HLS",3)="OBR"_HLFS_HLFS_RADTE_HLFS_RADTI_"-"_RACNI_$E(HLECH)_RADTE_$E(HLECH)_"L"_HLFS_RAOBR4_HLFS_HLFS_HLFS_$$HLDATE^HLFNC(9999999.9999-RADTI)
     64 S HLA("HLS",3)="OBR"_HLFS_HLFS_RADTE_HLFS_RADTI_"-"_RACNI_$E(HLECH)_RADTE_$E(HLECH)_"L"_HLFS_RAOBR4_HLFS_HLFS_HLFS_HLDT1
    7965 S HLA("HLS",3)=HLA("HLS",3)_HLFS_HLQ_HLFS_HLQ_HLFS_HLFS_HLFS_HLFS_HLFS_HLQ_HLFS_HLFS
    8066 S RAPRV=$$GET1^DIQ(200,+$P(RACN0,"^",14),.01)
     
    126112 N HLEID,HLARYTYP,HLFORMAT,HLMTIEN,HLP
    127113 S HLEID=EID,HLARYTYP="LM",HLFORMAT=1,HLMTIEN="",HLP("PRIORITY")="I"
    128  D:$D(RASSSX(HLEID)) GETHLP^RAHLRS1(HLEID,.HLP,"RASSSX")
    129  D:$D(RASSSX1(HLEID)) GETHLP^RAHLRS1(HLEID,.HLP,"RASSSX1")
     114 D:$D(RASSSX(HLEID)) GETHLP^RAHLRS1(HLEID,.HLP)
    130115 D GENERATE^HLMA(HLEID,HLARYTYP,HLFORMAT,.HLRESLT,HLMTIEN,.HLP)
    131116 Q
     
    134119INIT ; initialize HL7 variables
    135120 D NOW^%DTC S HLDT=%,HLDT1=$$HLDATE^HLFNC(%)
    136  ;Note: HLDT1 is used for HL7 fields: ORC-9 & OBR-22
    137121 Q:'$G(RAEID)  S EID=RAEID
    138122 S HL="HLS(""HLS"")",INT=1
    139123 D INIT^HLFNC2(EID,.HL,INT)
    140124 Q:'$D(HL("Q"))  ;no server application defined
    141  S HLQ=HL("Q")
     125 S HLQ=HL("Q"),HLFS=HL("FS")
    142126 S HLECH=HL("ECH")
    143127 S HLFS=HL("FS")
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLRPC.m

    r628 r636  
    11RAHLRPC ;HIRMFO/BNT-Rad/NM HL7 Protocol calls ;05/21/99   14:50
    2  ;;5.0;Radiology/Nuclear Medicine;**12,25,54,71,82,81,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**12,25,54,71,82,81**;Mar 16, 1998;Build 12
    33 ; 03/16/2006 *71 Rem Call 124379 allow exam updates to create HL7 msg
    4  ;
    5  ;Integration Agreements
    6  ;----------------------
    7  ;$$FIND1^DIC(2051); GETS^DIQ(2056)
    8  ;all access to ^ORD(101 to maintain application specific protocols(872)
    9  ;read w/FileMan HL7 APPLICATION PARAMETER(10136)
    10  ;
    114REG ; register exam
    12  N X,RA101Z,RAEID
    13  S RA101Z="RA REF" ; get all protocols beginning RA REG
    14  F  S RA101Z=$O(^ORD(101,"B",RA101Z)) Q:RA101Z'["RA REG"  D
    15  .S RAEID=$O(^ORD(101,"B",RA101Z,0))
     5 N X,RAPID,RAEID
     6 S RAPID="RA REF" ; get all protocols beginning RA REG
     7 F  S RAPID=$O(^ORD(101,"B",RAPID)) Q:RAPID'["RA REG"  D
     8 .S RAEID=$O(^ORD(101,"B",RAPID,0))
    169 .I RAEID,'$L($P(^ORD(101,RAEID,0),"^",3)) D EN^RAHLR
    1710 Q
    1811CANCEL ; cancel exam
    19  N X,RA101Z,RAEID
    20  S RA101Z="RA CANCEK" ; get all protocols beginning RA CANCEL
    21  F  S RA101Z=$O(^ORD(101,"B",RA101Z)) Q:RA101Z'["RA CANCEL"  D
    22  .S RAEID=$O(^ORD(101,"B",RA101Z,0))
     12 N X,RAPID,RAEID
     13 S RAPID="RA CANCEK" ; get all protocols beginning RA CANCEL
     14 F  S RAPID=$O(^ORD(101,"B",RAPID)) Q:RAPID'["RA CANCEL"  D
     15 .S RAEID=$O(^ORD(101,"B",RAPID,0))
    2316 .I RAEID,'$L($P(^ORD(101,RAEID,0),"^",3)) D EN^RAHLR
    2417 Q
    2518 ;
    2619RPT ; report verified or released/not verified
    27  N X,RA101Z,RAEID,RASSS ; RASSS subcriber array to be passed to HLL for GENERATE^HLMA
     20 N X,RAPID,RAEID,RASSS ; RASSS subcriber array to be passed to HLL for GENERATE^HLMA
    2821 ;S X="^%ET",@^%ZOSF("TRAP")
    29  S RA101Z="RA RPS" ; get all protocols beginning RA RPT
    30  F  S RA101Z=$O(^ORD(101,"B",RA101Z)) Q:RA101Z'["RA RPT"  D
    31  .S RAEID=$O(^ORD(101,"B",RA101Z,0)) K RASSS  ; RA*5*81
     22 S RAPID="RA RPS" ; get all protocols beginning RA RPT
     23 F  S RAPID=$O(^ORD(101,"B",RAPID)) Q:RAPID'["RA RPT"  D
     24 .S RAEID=$O(^ORD(101,"B",RAPID,0)) K RASSS  ; RA*5*81
    3225 .S:$L($G(RANOSEND)) RAEID=$$GETEID(RAEID,RANOSEND,.RASSS) ;RA*5*81
    3326 .I RAEID,'$L($P(^ORD(101,RAEID,0),"^",3)) D EN^RAHLRPT
     
    5144 ; RAEXEDT = Indication of editing of: proc, proc mod, req phys, CPT mod, Tech comm...
    5245 ; RAGENHL7 = Indication that sending ORU is due...
    53  ; RASSSX1(IENs) = Array of subscribers from 771, the message will be sent (SCIMGE)
    5446 ;
    55  N RAIMGTYI,RAIMGTYJ,RALOWER,RANEWST,RAEXMDUN,RAGENHL7,RASSSX1
     47 N RAIMGTYI,RAIMGTYJ,RALOWER,RANEWST,RAEXMDUN,RAGENHL7
    5648 S RAIMGTYI=$P($G(^RADPT(RADFN,"DT",RADTI,0)),U,2),RAIMGTYJ=$P(^RA(79.2,RAIMGTYI,0),U),RANEWST=$P($G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)),U,3)
    5749 S:$P(^RA(72,RANEWST,0),U,8)="Y" RAGENHL7=1 ;this status has GEN HL7 marked Y
     
    6153 ;?? none of the lower status levels have GEN HL7 marked Y
    6254 K:$P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),U,30)="Y" RAGENHL7 ;already sent
    63  ;Q:'$G(RAEXEDT)&'$G(RAGENHL7)
    64  ; Business Rule: RA*5*84 sends an examined message to ScImage unconditionally
    65  I '$G(RAEXEDT),'$G(RAGENHL7) Q:'$O(^RA(79.7,0))  D  Q:'$O(RASSSX1(0))
    66  .N X,RASSS,RASSSL S X=0 F  S X=$O(^RA(79.7,X)) Q:'X  S:$P(^(X,0),U,2) RASSS(X)=""
    67  .D:$D(RASSS) GETSUB^RAHLRS1(.RASSS,.RASSSX1,.RASSSL)
     55 Q:'$G(RAEXEDT)&'$G(RAGENHL7)
     56 ;
    68571 N RAEXMDUN
    6958 S RAEXMDUN=1
    70 A1 N X,RA101Z,RAEID
    71  S RA101Z="RA EXAMINEC" ; get all protocols beginning RA EXAMINED
    72  F  S RA101Z=$O(^ORD(101,"B",RA101Z)) Q:RA101Z'["RA EXAMINED"  D
    73  .N RAGENHL7 S RAEID=$O(^ORD(101,"B",RA101Z,0))
     59A1 N X,RAPID,RAEID
     60 S RAPID="RA EXAMINEC" ; get all protocols beginning RA EXAMINED
     61 F  S RAPID=$O(^ORD(101,"B",RAPID)) Q:RAPID'["RA EXAMINED"  D
     62 .N RAGENHL7 S RAEID=$O(^ORD(101,"B",RAPID,0))
    7463 .I RAEID,'$L($P(^ORD(101,RAEID,0),"^",3)) D EN^RAHLR
    7564 S:$G(RAGENHL7) $P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),U,30)="Y"
     
    8271 ; 0 (zero) returned if No subscriber exist or all subscribers associated with RANOSEND application.
    8372 S RAEID=$G(RAEID) Q:'RAEID!'$L($G(RANOSEND))!'$D(^ORD(101,+RAEID,0)) RAEID
    84  N RAXX,ERR,X1,Y1,YY,RAPL,RANEW,RAPIDS,RAIEDS,DIERR,RAERR
    85  S RAPL=$S(+RANOSEND:+RANOSEND,1:$$FIND1^DIC(771,"","X",RANOSEND,"","","RAERR"))
    86  Q:'RAPL!($D(RAERR)#2) RAEID
     73 N RAXX,ERR,X1,Y1,YY,RAPL,RANEW,RAPIDS,RAIEDS
     74 S RAPL=$S(+RANOSEND:+RANOSEND,1:$O(^HL(771,"B",RANOSEND,0))) Q:'RAPL RAEID
    8775 D GETS^DIQ(101,RAEID_",","**","I","RAXX","ERR")
    8876 Q:$D(ERR) RAEID ; Was not able get Event driver info... so just pass event driver...
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLRPT.m

    r628 r636  
    11RAHLRPT ;HISC/CAH AISC/SAW-Compiles HL7 'ORU' Message Type ; 4/26/01 10:40am
    2  ;;5.0;Radiology/Nuclear Medicine;**2,12,10,25,81,80,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**2,12,10,25,81,80**;Mar 16, 1998;Build 19
    33EN ; Called from RA RPT and RA RPT 2.3 protocol entry action
    44 ; Input variables:
     
    1010 ; Output variables:
    1111 ;   HLA("HLS", array containing HL7 msg
    12  ;   RATELREL = 1  Indicates that the text: 'Released for local dictation by National Teleradiology'
    13  ;              has been included in Impression or Report section
    14  ;   RATELX =   Text used as indication of Release for local dictation... if not set use defauld above...
    15  ;   RATELE =   1 If RANOSEND is Teleradiology type vendor
    1612 ;
    17  ;Integration Agreements
    18  ;----------------------
    19  ;$$GET1^DIQ(2056); ^DIWP(10011); $$HLDATE/$$HLNAME^HLFNC(10106)
    20  ;GENERATE^HLMA(2164); DEM^VADPT(10061); $$FMTHL7^XLFDT(10103)
    21  ;$$PATCH^XPDUTL(10141); $$VERSION^XPDUTL(10141)
    22  ;
    23  N RASET,RACN0,RATELE,RATELREL,RATELX
    24  D INIT^RAHLRPTT ;Patch 84
     13 N RASET,RACN0
     14 S RASET=0
     15 S RACN0=^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)
     16 S:'$D(RARPT) RARPT=+$P(RACN0,"^",17)
    2517 I +$P(RACN0,U,25)=2 D  Q  ; printset
    2618 .; loop through all cases in set and create message
     
    3729 D INIT^RAHLRU ;initialize HL7 variables
    3830 Q:+$G(HL)=15  ;no known client(item) linked to the event driver protocol
    39  Q:$O(HL(""))=""  ;failed return from INIT^HLFNC2 (called by INIT^RAHLRU)
     31 Q:$O(HL(""))=""  ;failed return from init^hlfnc2
    4032 ;
    4133 ;** branch to new HL7 logic when the HL7 version surpasses 2.3 **
    42  I HL("VER")>2.3,($T(^RAHLRPT1))'="" D EN^RAHLRPT1(RADFN,RADTI,RACNI,RAEID),EXIT Q
     34 ;I HL("VER")]2.3 D EN^RAHLRPT1(RADFN,RADTI,RACNI,RAEID),EXIT Q
    4335 ;** branch to new HL7 logic when the HL7 version surpasses 2.3 **
    4436 ;
     
    4941 ; for an inexact date of birth.  If inexact, pass null for DOB in
    5042 ; the 'PID' segment.  Some COTS systems can't handle inexact DOB's.
    51  D SETUP^RAHLRPTT,PID^RAHLRPTT,OBR,OBXPRC,OBXIMP,OBXDIA,OBXRPT,OBXMOD,OBXTCM
     43 D SETUP,PID,OBR,OBXPRC,OBXIMP,OBXDIA,OBXRPT,OBXMOD,OBXTCM
    5244EXIT ; set HL7 message type & return to RA RPT protocol
    53  ;For P84 see if this is a >>Released for local reading<< type report and if yes resend the ORM (^RAHLRS1)...
    54  I $G(RATELREL) D RESEND^RAHLRPTT(RADFN,RADTI,RACNI) Q  ;P84 resend in the case that report released from Telerad
    5545 S HL("MTN")="ORU"
    5646 N HLEID,HLARYTYP,HLFORMAT,HLMTIEN,HLP
    5747 S HLEID=RAEID,HLARYTYP="LM",HLFORMAT=1,HLMTIEN="",HLP("PRIORITY")="I"
    5848 M:$D(RASSS) HLP=RASSS
    59  D:$D(RASSSX(HLEID)) GETHLP^RAHLRS1(HLEID,.HLP,"RASSSX")
     49 D:$D(RASSSX(HLEID)) GETHLP^RAHLRS1(HLEID,.HLP)
    6050 D GENERATE^HLMA(HLEID,HLARYTYP,HLFORMAT,.HLRESLT,HLMTIEN,.HLP)
    6151 K RAVADM
     
    10292 S $P(X1,HLFS,35)="" I $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"TC",0)) D
    10393 .S X2=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"TC",0)) I X2']"" Q
    104  .S X2=$P($G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"TC",X2,0)),"^",1) I X2']"" Q
     94 .S X2=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"TC",X2,0)) I X2']"" Q
    10595 .S XX2=$$GET1^DIQ(200,X2,.01) Q:XX2']""
    10696 .S Y=$$HLNAME^HLFNC(XX2) I Y']"" Q
     
    10898 ;Transcriptionist
    10999 S $P(X1,HLFS,36)="" I $G(^RARPT(RARPT,"T")) D
    110  .S X2=$$GET1^DIQ(200,$P(^RARPT(RARPT,"T"),"^",1),.01) I X2']"" Q
     100 .S X2=$$GET1^DIQ(200,^RARPT(RARPT,"T"),.01) I X2']"" Q
    111101 .S Y=$$HLNAME^HLFNC(X2) I Y']"" Q
    112102 .S $P(X1,HLFS,36)=^RARPT(RARPT,"T")_$E(HLECH)_Y
    113103 ;
    114104 ; if long str, break so 2nd str begins with separator to avoid abend
    115  N RAPART I $L(X1)>245 F RAPART=5:1:18 S RAPART(1)=$P(X1,HLFS,1,RAPART),RAPART(2)=$P(X1,HLFS,RAPART+1,99) Q:$L(RAPART(1))<245&($L(RAPART(2))<245)&($P(RAPART(2),HLFS)="")
     105 I $L(X1)>245 N RAPART F RAPART=5:1:18 S RAPART(1)=$P(X1,HLFS,1,RAPART),RAPART(2)=$P(X1,HLFS,RAPART+1,99) Q:$L(RAPART(1))<245&($L(RAPART(2))<245)&($P(RAPART(2),HLFS)="")
    116106 I $D(RAPART) K:RAPART=18 RAPART ;if RAPART reaches 18, then something's wrong, so kill RAPART to allow abend due "string too long"
    117107 S RAN=RAN+1
     
    146136OBXIMP ;Compile 'OBX' segment for Impression
    147137 I '$O(^RARPT(RARPT,"I",0)) S RAN=RAN+1,HLA("HLS",RAN)="OBX"_HLFS_HLFS_"TX"_HLFS_"I"_$E(HLECH)_"IMPRESSION"_$E(HLECH)_"L"_HLFS_HLFS_"None Entered" D OBX11^RAHLRU Q
    148  K ^UTILITY($J,"W") S DIWF="",DIWR=80,DIWL=1
    149  F RAI=0:0 S RAI=$O(^RARPT(RARPT,"I",RAI)) Q:'RAI  I $D(^(RAI,0)) S X=^(0) D RATELREL,^DIWP
     138 K ^UTILITY($J,"W") S DIWF="",DIWR=80,DIWL=1 F RAI=0:0 S RAI=$O(^RARPT(RARPT,"I",RAI)) Q:'RAI  I $D(^(RAI,0)) S X=^(0) D ^DIWP
    150139 F RAI=0:0 S RAI=$O(^UTILITY($J,"W",DIWL,RAI)) Q:'RAI  I $D(^(RAI,0)) S RAN=RAN+1,HLA("HLS",RAN)="OBX"_HLFS_HLFS_"TX"_HLFS_"I"_$E(HLECH)_"IMPRESSION"_$E(HLECH)_"L"_HLFS_HLFS_^(0) D OBX11^RAHLRU
    151140 Q
     
    156145 S RAN=RAN+1 D OBXPRC^RAHLRU
    157146 Q
    158 OBXTCM ;Compile 'OBX' Segment for Tech Comments
     147OBXTCM ; Compile 'OBX' Segment for Tech Comments
    159148 D OBXTCM^RAHLRU
    160149 Q
    161150OBXRPT ;Compile 'OBX' Segment for Radiology Report Text
    162151 I '$O(^RARPT(RARPT,"R",0)) S RAN=RAN+1,HLA("HLS",RAN)="OBX"_HLFS_HLFS_"TX"_HLFS_"R"_$E(HLECH)_"REPORT"_$E(HLECH)_"L"_HLFS_HLFS_"None Entered" D OBX11^RAHLRU Q
    163  K ^UTILITY($J,"W") S DIWF="",DIWR=80,DIWL=1
    164  F RAI=0:0 S RAI=$O(^RARPT(RARPT,"R",RAI)) Q:'RAI  I $D(^(RAI,0)) S X=^(0) D RATELREL,^DIWP
     152 K ^UTILITY($J,"W") S DIWF="",DIWR=80,DIWL=1 F RAI=0:0 S RAI=$O(^RARPT(RARPT,"R",RAI)) Q:'RAI  I $D(^(RAI,0)) S X=^(0) D ^DIWP
    165153 F RAI=0:0 S RAI=$O(^UTILITY($J,"W",DIWL,RAI)) Q:'RAI  I $D(^(RAI,0)) S RAN=RAN+1,HLA("HLS",RAN)="OBX"_HLFS_HLFS_"TX"_HLFS_"R"_$E(HLECH)_"REPORT"_$E(HLECH)_"L"_HLFS_HLFS_^(0) D OBX11^RAHLRU
    166154 ; Replace above with following when Imaging can cope with ESC chars
    167155 ; F RAI=0:0 S RAI=$O(^UTILITY($J,"W",DIWL,RAI)) Q:'RAI  I $D(^(RAI,0)) S RAN=RAN+1,HLA("HLS",RAN)="OBX"_HLFS_HLFS_"TX"_HLFS_"R"_$E(HLECH)_"REPORT"_$E(HLECH)_"L"_HLFS_HLFS_$$ESCAPE^RAHLRU(^(0)) D OBX11^RAHLRU
    168156 Q
    169 RATELREL ;Release the study for local reading
    170  I $G(RATELE),X[$G(RATELX) S RATELREL=1 Q
    171  ;
     157PID ;Compile 'PID' Segment
     158 I HL("VER")']"2.2" D
     159 .S X1="",X1="PID"_HLFS_HLFS_$G(VA("PID"))_HLFS_Y_HLFS_HLFS S X=VADM(1),Y=$$HLNAME^HLFNC(X) S X1=X1_Y_HLFS_HLFS
     160 .S X=RAVADM(3),Y=$$HLDATE^HLFNC(X) S X1=X1_Y_HLFS_$S(VADM(5)]"":$S("MF"[$P(VADM(5),"^"):$P(VADM(5),"^"),1:"O"),1:"U") S:$P(VADM(2),"^")]"" $P(X1,HLFS,20)=$P(VADM(2),"^") S RAN=RAN+1,HLA("HLS",RAN)=X1
     161 I HL("VER")]"2.2" S RAN=RAN+1,HLA("HLS",RAN)=$$EN^VAFHLPID(DFN,"2,3,5,7,8,19,20")
     162 Q
     163SETUP ; Setup basic examination information
     164 S:RASET RACN0=^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)
     165 S RADTE0=9999999.9999-RADTI,RADTECN=$E(RADTE0,4,7)_$E(RADTE0,2,3)_"-"_+RACN0,RARPT0=^RARPT(RARPT,0)
     166 S RAPROC=+$P(RACN0,U,2),RAPROCIT=+$P($G(^RAMIS(71,RAPROC,0)),U,12),RAPROCIT=$P(^RA(79.2,RAPROCIT,0),U,1)
     167 S RAPRCNDE=$G(^RAMIS(71,+RAPROC,0)),RACPT=+$P(RAPRCNDE,U,9)
     168 S RACPTNDE=$$NAMCODE^RACPTMSC(RACPT,DT)
     169 S Y=$$HLDATE^HLFNC(RADTE0) S RADTE0=$S(Y:Y,1:HLQ),Y=$$M11^HLFNC(RADFN)
     170 Q
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLRS1.m

    r628 r636  
    11RAHLRS1 ;HIRMFO/ROB/PAVEL - Resend HL7 messages for selected Timeframe ; 4/2/07 3:42pm
    2  ;;5.0;Radiology/Nuclear Medicine;**80,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**80**;Mar 01, 2007;Build 19
     3 ;
    34 ; Utility to RESEND HL7 messages for selected Timeframe
    4  ;
    5  ;Integration Agreements
    6  ;----------------------
    7  ;^%DT(10003); C^%DTC(10000); H^%DTC(10000); ^%ZISC(10089); ^%ZTLOAD(10063); $$GET1^DIQ(2056)
    8  ;^DIR(10026); ^XMD(10070)
    9  ;all access to ^ORD(101 to maintain application specific protocols(872)
    10  ;read w/FileMan HL7 APPLICATION PARAMETER(10136)
    115 ;
    126 N RACNI,RADFN,RADTI,RARPT,X,RAED,RABD,RASHBD,RASHED,RASHTD,RASHTM,DIC,DA,XX,YY
     
    3024 S RAED=RAED_"."_9999
    3125 K XX G:'$$GETAP(.XX) STOP
    32  W !!,"*** Pick the application in which to send the radiology data ***",!!
     26 W !!,"****Pick the application to send the RAD data to*****",!!
    3327 F I=1:1 Q:'$D(XX(I))  W !,"  #",I,"   ",$O(XX(I,""))
    34 2 ;user selects the application
    35  S DIR(0)="N^1:"_(I-1)
    36  W ! S DIR("?")="Please select an available application from the list."
    37  D ^DIR Q:$D(DIRUT)
     282 S DIR(0)="N"
     29 W ! S DIR("?")="Please select an available application from the list"
     30 D ^DIR Q:$D(DIRUT)  I (X'<1),(X'<I) W "Please select an available application from the list" G 2
    3831 W !!,"The: ",$O(XX(+X,"")),"   will be the recipient"
    3932 W !!,"Reviewing exams for selected time period... (This may take a few minutes)... "
     
    5346 W !,"Task ",$S('$D(ZTSK):" Has Not been Tasked !!!",1:"#:"_ZTSK_" Has been Tasked")
    5447 D:$D(ZTSK)
    55  .N RAX,RAMPG,XMSUB,XMY,XMTEXT
    56  .S RAX(1)="Task #"_$G(ZTSK)_" is scheduled to run the option: "
    57  .S RAX(2)=">>Re-send HL7 messages for a date range and for designated Recipient.<<"
    58  .S RAX(3)=" Scheduled time to run: "_RASHTM
    59  .S RAX(4)="Date range from: "_$G(RASHBD)_" to: "_$G(RASHED)
     48 .N X,RAMPG,XMSUB,XMY,XMTEXT
     49 .S X(1)="Task #"_$G(ZTSK)_" is scheduled to run the option: "
     50 .S X(2)=">>Re-send HL7 messages for a date range and for designated Recipient.<<"
     51 .S X(3)=" Scheduled time to run: "_RASHTM
     52 .S X(4)="Date range from: "_$G(RASHBD)_" to: "_$G(RASHED)
    6053 .S XMSUB="TASKMAN SCHEDULE NOTIFICATION/INFO"
    6154 .S RAMPG="G.RAD HL7 MESSAGES"
    6255 .S XMY(RAMPG)="",XMDUZ=.5
    63  .S XMTEXT="RAX("
     56 .S XMTEXT="X("
    6457 .D ^XMD
    6558 Q
     
    7265 ..S RADTI=0 F  S RADTI=$O(^RADPT("AR",RABD,RADFN,RADTI)) Q:'RADTI  D
    7366 ...S RACNI=0 F  S RACNI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI)) Q:'RACNI  D RESEND(RADFN,RADTI,RACNI)
    74  K RAX S RAX(1)="Task #"_$G(ZTSK)_" successfully completed the option: "
    75  S RAX(2)=">>Re-send HL7 messages for a date range and for designated Recipient.<<"
    76  S RAX(3)="Date range from: "_$G(RASHBD)_" to: "_$G(RASHED)
    77  S RAX(4)="# Of RAD Reports transferred: "_$G(RASUM7R)
    78  S RAX(5)="# Of Exams transferred:      "_$G(RASUM7)
     67 K X S X(1)="Task #"_$G(ZTSK)_" successfully completed the option: "
     68 S X(2)=">>Re-send HL7 messages for a date range and for designated Recipient.<<"
     69 S X(3)="Date range from: "_$G(RASHBD)_" to: "_$G(RASHED)
     70 S X(4)="# Of RAD Reports transferred: "_$G(RASUM7R)
     71 S X(5)="# Of Exams transferred:      "_$G(RASUM7)
    7972 S:$G(RASUM7E) X(6)="# Of Exams not transferred because of ""BAD DATA"": "_$G(RASUM7E)
    8073 S XMSUB="TASKMAN ""RESEND HL7 OPTION"" COMPLETED/INFO"
    8174 S RAMPG="G.RAD HL7 MESSAGES"
    8275 S XMY(RAMPG)="",XMDUZ=.5
    83  S XMTEXT="RAX("
     76 S XMTEXT="X("
    8477 D ^XMD
    8578 G STOP
     
    8881RESEND(RADFN,RADTI,RACNI) ; re-send exam message(s) to HL7 subscribers
    8982 ; for every 10 messages sent, make sure queue is not clogged... $$HANG
    90  N RAXAMP80 S RAXAMP80=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0))
    91  I '(+$P(RAXAMP80,U))!'($P(RAXAMP80,U,2)) S RASUM7E=RASUM7E+1 Q
    92  N RABD,RAEDP80,QUIT
     83 I '(+^(RACNI,0)) S RASUM7E=RASUM7E+1 Q
     84 I '$P(^(0),U,2) S RASUM7E=RASUM7E+1 Q
     85 N RABD,RAED,QUIT
    9386 ;
    9487 I '$D(DT) D ^%DT S DT=Y
    9588 ;
    96  S RAEDP80=$$RAED(RADFN,RADTI,RACNI)
    97  I '$L(RAEDP80) S RASUM7E=RASUM7E+1 Q
    98  D:RAEDP80[",REG,"
     89 S RAED=$$RAED(RADFN,RADTI,RACNI)
     90 I '$L(RAED) S RASUM7E=RASUM7E+1 Q
     91 D:RAED[",REG,"
    9992 .D CHSUM N RASUM7,RASUM7R,RASUM7E D REG^RAHLRPC
    100  D:RAEDP80[",CANCEL,"
     93 D:RAED[",CANCEL,"
    10194 .D CHSUM N RASUM7,RASUM7R,RASUM7E D CANCEL^RAHLRPC
    102  D:RAEDP80[",EXAM,"
     95 D:RAED[",EXAM,"
    10396 .D CHSUM
    10497 .S $P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),"^",30)="" ;Reset sent flag
    10598 .N RASUM7,RAEXMDUN,RASUM7R,RASUM7E D 1^RAHLRPC
    106  D:RAEDP80[",RPT,"
     99 D:RAED[",RPT,"
    107100 .D CHSUM N RASUM7,RANOSEND,RASUM7R,RASUM7E,RARPT D RPT^RAHLRPC
    108101 Q
     
    153146 .F  S X1=$O(^ORD(101,"B",X1)) Q:X1'[X11  S X2=$O(^ORD(101,"B",X1,0)) Q:'X2  D
    154147 ..K Z S X3=0 F  S X3=$O(^ORD(101,X2,775,X3)) Q:'X3  S Z(+^(X3,0))=""
    155  ..Q:'$D(Z)  K Z1 S X3=0 F  S X3=$O(Z(X3)) Q:'X3  D
    156  ...S Z1=$G(^ORD(101,X3,770)) S:+$P(Z1,U,2) XXX(+$P(Z1,U,2))=""
    157  S X1=0 F J=1:1 S X1=$O(XXX(X1)) Q:'X1  D
    158  .N DIERR,RAERR,Y
    159  .S Y=$$GET1^DIQ(771,X1,.01,"","","RAERR")
    160  .Q:Y=""!($D(RAERR)#2)  S XX(J,Y)=X1
    161  .Q
     148 ..Q:'$D(Z)  K Z1 S X3=0 F  S X3=$O(Z(X3)) Q:'X3  S XXX(+$P($G(^ORD(101,X3,770)),U,2))=""
     149 S X1=0 F J=1:1 S X1=$O(XXX(X1)) Q:'X1  S XX(J,$P(^HL(771,X1,0),U))=X1
    162150 Q $S($D(XXX):1,1:0)
    163151 ;
     
    176164 ...S XX=+$P($G(^ORD(101,XX,770)),U,7) S:XX LINK(XX)=""
    177165 Q
    178 GETHLP(RAEID,HLP,ADR) ; Get excluded subcribers set into HLP array
    179  N I,J,XX,AA S J=$O(HLP("EXCLUDE SUBSCRIBER",99999999),-1)
    180  ;XX Set the list of already excluded subscribers, so be sure we don't set it second time
    181  S AA=ADR_"("_RAEID_",I)"
    182  S I=0 F I=$O(HLP("EXCLUDE SUBSCRIBER",I)) Q:'I  S XX(HLP("EXCLUDE SUBSCRIBER",I))=""
    183  S I=0 F  S I=$O(@AA) Q:'I  S:'$D(XX(I)) J=J+1,HLP("EXCLUDE SUBSCRIBER",J)=I
     166GETHLP(RAEID,HLP) ; Get excluded subcribers set into HLP array
     167 N I,J,II S II=$O(HLP("EXCLUDE SUBSCRIBER",99999999),-1)+1
     168 S I=0 F J=II:1 S I=$O(RASSSX(RAEID,I)) Q:'I  S HLP("EXCLUDE SUBSCRIBER",J)=I
    184169 Q
    185170CHSUM ;CHECKSUM
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLTCPB.m

    r628 r636  
    11RAHLTCPB ; HIRMFO/REL,GJC,BNT,PAV - Rad/Nuc Med HL7 TCP/IP Bridge;05/21/99
    2  ;;5.0;Radiology/Nuclear Medicine;**12,17,25,51,71,81,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**12,17,25,51,71,81**;Mar 16, 1998;Build 12
    33 ; 07/05/2006 BAY/KAM Remedy Call 124379 Eliminate unneeded ORM msgs
    4  ; 09/01/2006   Acomodate multiple ORC/OBR segments Patch 81
    5  ;
    6  ;Integration Agreements
    7  ;----------------------
    8  ;INIT^HLFNC2(2161); GENACK^HLMA1(2165); $$DT^XLFDT(10103)
    9  ;
     4 ; 09/01/2006   Acomodate multiplr ORC/OBR segments Patch 81
    105EN1 ; Build the ^TMP("RARPT-REC" global when we receive the
    116 ; 07/05/2006 Remedy Call 124379 message from HL7. If RAHLTCPB is defined, do not broadcast ORM messages. As of the writing
    12  ; of patch 71, RAHLTCPB is referenced in RAHLTCPB, UPSTAT^RAUTL0, & UP2^RAUTL1 Generic provider: RADIOLOGY,OUTSIDE SERVICE
    13  N RATELE,RATELENM,RATELEPI,RATELEKN,RATELEDR,RATELEDF
    14  D TELE^RAHLRPTT ;Patch 84
    15  ;** branch to new HL7 logic when the HL7 version surpasses 2.3 **
    16  I HL("VER")>2.3,($T(^RAHLTCPX))'="" GOTO EN1^RAHLTCPX
     7 ; of patch 71, RAHLTCPB is referenced in RAHLTCPB, UPSTAT^RAUTL0, & UP2^RAUTL1
     8 ;G:$G(HL("VER"))]"2.3" EN1^RAHLTCPX
    179 S RASUB=HL("MID"),RAHLTCPB=1 K RAERR
    1810 ;**********************************************
     
    6860 . S:$P(RADTCN,$E(HL("ECH")),2)]"" ^TMP(RARRR,$J,RASUB,"RALONGCN")=$P(RADTCN,$E(HL("ECH")),2)
    6961 . Q
    70  I $G(RADTI)'>0 S RAERR="Invalid exam registration timestamp" D XIT Q
    71  I $G(RACNI)'>0 S RAERR="Invalid exam record IEN" D XIT Q
    7262 S RAHLD=$$PCEXTR^RAHLO4(CNT,SEGMNT,25,HL("FS")) K RAHL70
    7363 I RAHLD="" S RAERR="Missing Report Status" D XIT Q
    74  I "AFR"'[RAHLD S RAERR="Invalid Report Status: "_RAHLD D XIT Q
     64 I "AFR"'[RAHLD S RAERR="Invalid Report Status" D XIT Q
    7565 S ^TMP(RARRR,$J,RASUB,"RASTAT")=RAHLD
    7666 G:$P(RARRR,"-",3) 112 S RAHLD=$$PCEXTR^RAHLO4(CNT,SEGMNT,32,HL("FS")) K RAHL70
     
    8272 E  D  ; $D(^VA(200,"B",RAVERF)) true, get the entry ien
    8373 . S RAVERF=$O(^VA(200,"B",RAVERF,0))
    84  . S:'RAVERF RAERR="Invalid Provider Name: "_RAHLD
     74 . S:'RAVERF RAERR="Invalid Provider Name"
    8575 ; can't get resident info from medspeak
    8676 S RAHLD=$$PCEXTR^RAHLO4(CNT,SEGMNT,33,HL("FS")),RARSDNT="" K RAHL70
     
    9686 I $D(RAERR) D XIT Q
    9787 D ESIG^RAHLO3
    98  ;
    9988 ;If last OBR set provider info to all OBRs
    10089 K XX F I=1:1:RACN S XX=RARRR_"-"_I D:$D(^TMP(XX,$J,RASUB))
     
    11099 . Q:SEGMNT?@("1"""_HL("FS")_"""."""_HL("FS")_"""")  ;Quit if OBX is something as:    OBX||||||||
    111100 . I $P(SEGMNT,HL("FS"),3)']"" S RAERR="Missing Observation Identifier" Q
    112  . S OBXTYP=$P($P(SEGMNT,HL("FS"),3),$E(HL("ECH"))),OBXTYP=$E($P(OBXTYP,"&",2))
     101 . S OBXTYP=$P(SEGMNT,HL("FS"),3),OBXTYP=$E(OBXTYP,$F(OBXTYP,"&"))
    113102 . S OBX2CE=""
    114103 . S:OBXTYP="" OBXTYP=" "
     
    144133 S X=$P(SEGMNT,HL("FS"),5)
    145134 I X["\S\"!(X["\R\")!(X["\E\")!(X["\T\") D FORMAT
    146  I $G(RATELE),$D(RATELEKN),X[RATELEKN S X=$P(X,RATELEKN,2),RATELENM=$P(X,"-"),RATELEPI=$TR($P(X,"-",2)," ","") ;SFVAMC/DAD/9-7-2007/Comment out the quit Q  ;Patch 84
    147135 D PAR
    148136 F J=0:0 S J=$O(^TMP("RARPT-HL7",$J,CNT,J)) Q:'J  S X1=^(J),X=$E(X1,1,125) D PAR I $L(X1)>125 S X=$E(X1,126,999) D PAR
    149137 I X=""!(LIN'="") S L=999 D P2
    150138 Q
    151  ;
     139FORMAT ; Format report text for Escape Character delimited codes.
     140 S Y=X N T,Q
     141 I Y["\S\" S Q=$F(Y,"\S\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"))_$E(Y,Q,$L(X)),Y=X
     142 I Y["\R\" S Q=$F(Y,"\R\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"),2)_$E(Y,Q,$L(X)),Y=X
     143 I Y["\E\" S Q=$F(Y,"\E\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"),3)_$E(Y,Q,$L(X)),Y=X
     144 I Y["\T\" S Q=$F(Y,"\T\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"),4)_$E(Y,Q,$L(X)),Y=X
     145 I X["\S\"!(X["\R\")!(X["\E\")!(X["\T\") D FORMAT
     146 Q
    152147PAR ; Build text paragraph
    153148 S LIN=LIN_X
     
    167162 S MSA1="AA"
    168163 Q:$E($G(HL("SAN")),1,3)'="RA-"  ; Don't allow non RA namespaced interfaces
    169  I $D(RAERR) S MSA1=$S($G(HL("SAN"))="RA-PSCRIBE-TCP"!$G(RATELE):"AE",1:"AR")
     164 I $D(RAERR) S MSA1=$S($G(HL("SAN"))="RA-PSCRIBE-TCP":"AE",1:"AR")
    170165 ; Added next line to support MedSpeak interface.  Must re-initialize
    171166 ; FS and EC's before sending ACK.
     
    176171 K HLRESLT D GENACK^HLMA1(HLEID,HLMTIENS,HLEIDS,HLARYTYP,HLFORMAT)
    177172 Q
    178  ;
    179 FORMAT ; Format report text for Escape Character delimited codes.
    180  S Y=X N T,Q
    181  I Y["\S\" S Q=$F(Y,"\S\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"))_$E(Y,Q,$L(X)),Y=X
    182  I Y["\R\" S Q=$F(Y,"\R\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"),2)_$E(Y,Q,$L(X)),Y=X
    183  I Y["\E\" S Q=$F(Y,"\E\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"),3)_$E(Y,Q,$L(X)),Y=X
    184  I Y["\T\" S Q=$F(Y,"\T\"),T=Q-4,X=$E(Y,1,T)_$E(HL("ECH"),4)_$E(Y,Q,$L(X)),Y=X
    185  I X["\S\"!(X["\R\")!(X["\E\")!(X["\T\") D FORMAT
    186  Q
    187  ;
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAMAIN.m

    r628 r636  
    11RAMAIN ;HISC/FPT,GJC,CAH AISC/MJK,RMO;VMP/PW-Utility File Maintenance ;7/24/02  14:45
    2  ;;5.0;Radiology/Nuclear Medicine;**31,43,50,54,87**;Mar 16, 1998;Build 2
     2 ;;5.0;Radiology/Nuclear Medicine;**31,43,50,54**;Mar 16, 1998
    33 ;
    4  ; 11/15/07 BAY/KAM RA*5*87 Rem Call 205080 Option File Access
    543 ;;Major AMIS Code Enter/Edit
    65 N RAI F RAI=1:1:5 W !?9,$P($T(REMIND+RAI),";;",2)
     
    767510 ;;Procedure Modifiers Entry
    7776 K DD,DO,DLAYGO,DIC,DA,DINUM,X,Y
    78  ;S (DIC,DLAYGO)="^RAMIS(71.2,",DIC(0)="AEMQL"
    79  ; 11/15/07 BAY/KAM RA*5*87 Rem Call 205080 Changed next line to set DLAYGO equal to the file number instead of the file root
    80  S DIC="^RAMIS(71.2,",DLAYGO=71.2,DIC(0)="AEMQL"
     77 S (DIC,DLAYGO)="^RAMIS(71.2,",DIC(0)="AEMQL"
    8178 S DIC("A")="Select Procedure Modifier: ",DIC("W")="D PROHLP^RAMAIN"
    8279 W ! D ^DIC K DIC,DLAYGO I +Y'>0 K D,X,Y,POP,I,DDH,DG,DISYS,DUOUT Q
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAO7RO1.m

    r628 r636  
    11RAO7RO1 ;HISC/FPT-RAD/NM Error Messages ;8/28/97  14:16
    2  ;;5.0;Radiology/Nuclear Medicine;**2,75,86**;Mar 16, 1998;Build 7
     2 ;;5.0;Radiology/Nuclear Medicine;**2,75**;Mar 16, 1998;Build 4
    33 ;
    44EN1(RAERR) ; errors encountered with OE v3.0 back & frontdoor transmission
     
    66 I RAEMSG]"" Q RAEMSG
    77 Q "Error # "_RAERR_" does not exist"
    8  ;
    9  ;Note: Error code nine (9) disappears with the release of CPRS GUI V27. P86
    108 ;
    119MSG ; error messages
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAO7RON.m

    r628 r636  
    11RAO7RON ;HISC/GJC- Request message from OE/RR. (frontdoor) ;2/2/98  12:34
    2  ;;5.0;Radiology/Nuclear Medicine;**41,75,86**;Mar 16, 1998;Build 7
    3  ;
    4  ;Supported IA #10040 reference to ^SC
    5  ;Supported IA #2187 reference to EN^ORERR
    6  ;Supported IA #10103 reference to ^XLFDT
    7  ;Supported IA #10141 reference to ^XPDUTL
    8  ;Supported IA #10106 reference to $$FMDATE^HLFNC
     2 ;;5.0;Radiology/Nuclear Medicine;**41,75**;Mar 16, 1998;Build 4
    93 ;
    104 ;------------------------- Variable List -------------------------------
     
    4640 S RAERR=$$EN3^RAO7VLD(44,+RAPV13) S:RAERR RAERR=3 Q:RAERR
    4741 S RANEW(75.1,"+1,",22)=+RAPV13
    48  ;check the GUI version of CPRS at this facility:
    49  ;$$PATCH^XPDUTL("OR*3.0*243")=1 CPRS V27, else CPRS V26.
    50  I '$$PATCH^XPDUTL("OR*3.0*243") D  Q:RAERR  ;P86
    51  .I RAPV12="I",$P(^SC($P(RAPV13,U,1),0),U,3)'="W" S RAERR=9 Q
    52  .I RAPV12="O",$P(^SC($P(RAPV13,U,1),0),U,3)="W" S RAERR=9
    53  .Q
     42 I RAPV12="I",$P(^SC($P(RAPV13,U,1),0),U,3)'="W" S RAERR=9 Q:RAERR
     43 I RAPV12="O",$P(^SC($P(RAPV13,U,1),0),U,3)="W" S RAERR=9 Q:RAERR
    5444 S RAPV119=$P(RADATA,RAHLFS,19)
    5545 Q
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAORD1.m

    r628 r636  
    1 RAORD1 ;HISC/CAH - AISC/RMO-Request An Exam ; 06/27/07 07:22am
    2  ;;5.0;Radiology/Nuclear Medicine;**10,45,41,75,86**;Mar 16, 1998;Build 7
    3  ;
    4  ;Supported IA #10035 reference to ^DPT(
    5  ;Supported IA #10040 reference to ^SC(
    6  ;Supported IA #10060 reference to ^VA(200
    7  ;Supported IA #2055 reference to $$EXTERNAL^DILFD
    8  ;Supported IA #2378 reference to ORCHK^GMRAOR
    9  ;Supported IA #10061 reference to ^VADPT
    10  ;Supported IA #10112 reference to ^VASITE
    11  ;Supported IA #10103 reference to ^XLFDT
    12  ;Supported IA #10141 reference to ^XPDUTL
    13  ;Supported IA #10009 reference to FILE^DICN
    14  ;Supported IA #10018 reference to ^DIE
    15  ;
     1RAORD1 ;HISC/CAH - AISC/RMO-Request An Exam ; 01/21/05 11:25am
     2 ;;5.0;Radiology/Nuclear Medicine;**10,45,41,75**;Mar 16, 1998;Build 4
    163 ;*Billing Awareness Project:
    174 ; RABWDX Array: ICD Diagnosis^SC^AO^IR^EC^MST^HNC
     
    218 S RAPKG="" N RAPTLKUP,RAGMTS,RACOPYOR
    229 G ADDORD:$D(RAVSTFLG)&($D(RALIFN))&($D(RAPIFN))
    23  ;
    2410 I '$D(RAREGFLG),'$D(RAVSTFLG) N RAPTLOCK K RAWARD D  G:'RAPTLKUP Q
    2511PAT .S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC
    26  .I Y<0 S RAPTLKUP=0 Q
    27  .S RAPTLOCK=$$LK^RAUTL19(+Y_";DPT(") G:'RAPTLOCK PAT
     12 .I Y<0 S RAPTLKUP=0 Q
     13 .I $$ORVR^RAORDU()'<3 D  G:'RAPTLOCK PAT
     14 ..S RAPTLOCK=$$LK^RAUTL19(+Y_";DPT(")
     15 ..Q
    2816 .S (DFN,RADFN)=+Y,(VA200,RAPTLKUP)=1
    2917 .W ! D IN5^VADPT S:VAIP(1) RAWARD=$P(VAIP(5),"^",2)
    3018 .D ELIG^RABWORD2
    3119 .Q
    32  ;
    33 PL ;Ask for the patient location (REQ. LOCATION file: 75.1, field: #22)
    34  N RACPRS27 S RACPRS27=$$PATCH^XPDUTL("OR*3.0*243")
    35  S DIC("A")="Patient Location: ",DIC("B")=$S($D(RAWARD)#2:RAWARD,1:"")
    36  S DIC="^SC(",DIC(0)="AEMQ"
    37  ;
    38  ;With the installation of RA*5.0*86 and after the implementation of
    39  ;CPRS v27 all active locations are eligible for selection regardless
    40  ;of patient type.
    41  ;
    42  ;If RAWARD is defined it is set to the name of the ward; pass either a 0
    43  ;or 1.
    44  ;Pass either a 0 or 1 as a value for RACPRS27. If 1 then CPRS GUI v27
    45  ;(OR*3.0*243) is installed at this facility.
    46  S DIC("S")="I $$SCREEN^RAORD1A("_($D(RAWARD)#2)_","_(RACPRS27)_")"
    47  ;
     20PL S DIC("A")="Patient Location: ",DIC("B")=$S($D(RAWARD):RAWARD,1:""),DIC="^SC(",DIC(0)="AEMQ",DIC("S")="I $$SCREEN^RAORD1A()"
    4821 D ^DIC K DIC K:'$D(RAREGFLG) RAWARD G Q:Y<0 S RALIFN=+Y
    4922 S DIC("A")="Person Requesting Order: "
     
    6639 S RADIV=$S($D(^RA(79,RADIV,0)):RADIV,1:$O(^RA(79,0)))
    6740 S RAMDV=$TR($G(^RA(79,+RADIV,.1)),"YyNn","1100")
    68  D:'$D(RACAT)#2  ;if not defined, define the variable RACAT
    69  .I $D(RAWARD)#2 S RACAT="INPATIENT" Q
    70  .N Y S Y=$G(^RADPT(RADFN,0)) I Y="" S RACAT="OUTPATIENT" Q
    71  .S RACAT=$$EXTERNAL^DILFD(70,.04,"",$P(Y,U,4))
    72  .S:RACAT="" RACAT="OUTPATIENT"
     41 S RACAT=$S($D(RACAT):RACAT,$D(RAWARD):"INPATIENT",$P(RAL0,"^",2)="PERSONNEL HEALTH":"EMPLOYEE",'$D(^RADPT(RADFN,0)):"OUTPATIENT",$P(^(0),"^",4)]"":$P($P(^DD(70,.04,0),$P(^RADPT(RADFN,0),"^",4)_":",2),";"),1:"OUTPATIENT")
     42 I "IO"[$E(RACAT,1) D
     43 .S RASTRNG=$$MATCH^RAORD1A(RACAT,RALIFN)
     44 .;if necessary, change category of exam to match type of requesting
     45 .;location and display msg to user
     46 .S RACAT=$P(RASTRNG,"^"),RAWARD=$P(RASTRNG,"^",2)
    7347 .Q
     48 K:$D(RAWARD)&($E(RACAT,1)="O") RAWARD
     49 K RASTRNG
    7450 ; clear clin hist if:
    7551 ;   rad backdoor, or
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAORD1A.m

    r628 r636  
    1 RAORD1A ;HISC/FPT-Request an Exam ;7/27/07  08:00
    2  ;;5.0;Radiology/Nuclear Medicine;**1,86**;Mar 16, 1998;Build 7
     1RAORD1A ;HISC/FPT-Request an Exam ;9/29/97  10:40
     2 ;;5.0;Radiology/Nuclear Medicine;**1**;Mar 16, 1998
    33 ;
    4  ;Call to WIN^DGPMDDCF (Supported IA #1246) from the SCREENW function
    5  ;Supported IA #10039 reference to ^DIC(42
    6  ;Supported IA #10040 reference to ^SC
    7  ;Supported IA #10061 reference to ^VADPT
    8  ;Supported IA #10103 reference to ^XLFDT
     4CS ; Category of exam switch. Called from [RA ORDER EXAM] input template
     5 ; when requesting an exam. User can change category of exam from
     6 ; (1) inpatient to outpatient and select a clinic patient location OR
     7 ; (2) outpatient to inpatient and select a ward patient location.
    98 ;
    10 SCREEN(RAINPAT,RACPRS27) ; screen for active clinics/wards
     9 N RAA,RAB,X,Y K DIR
     10 S RAA=$S($E(RACAT)="I":"INPATIENT",1:"OUTPATIENT")
     11 S RAB=$S($E(RAA)="I":"OUTPATIENT",1:"INPATIENT")
     12 W ! S DIR("A",1)="CATEGORY OF EXAM is currently "_RAA
     13 S DIR("A",2)=" "
     14 S DIR("A")="Want to change CATEGORY OF EXAM to "_RAB
     15 S DIR(0)="Y"
     16 D ^DIR K DIR
     17 I $D(DIRUT) S RALIFN("OUT")="" Q
     18 I Y=0 S RALIFN("NO")="" Q
     19REQLOC ; select patient location
     20 N DIC,RAHL,RAHLWD,RASCI W !
     21ASK S DIC("A")="Patient Location: ",DIC="^SC(",DIC(0)="AEMQ"
     22 I $E(RAB)="O" S DIC("S")="I $$TYPE^RAORD1A(RAB,+Y),$$SCREEN^RAORD1A" I '$D(RAOERRFG) S:$P($G(^SC(+RALIFN,0)),U,3)="C" DIC("B")=$P(^SC(+RALIFN,0),U,1)
     23 I $E(RAB)="I" S DIC("S")="I $$TYPE^RAORD1A(RAB,+Y),$$SCREEN^RAORD1A" I '$D(RAOERRFG) S:$P($G(^SC(+RALIFN,0)),U,3)="W" DIC("B")=$P(^SC(+RALIFN,0),U,1)
     24 D ^DIC K DIC
     25 I +Y'>0 S RALIFN("OUT")="" Q
     26 I $E(RAB)="I" S RAHLWD=+$G(^SC(+Y,42)) I RAHLWD S RAHL=+$G(^DIC(42,RAHLWD,44)) I RAHL,RAHL'=+Y W !!,*7,"This Hospital Location points to ",$P($G(^DIC(42,+Y,0)),U,1) G ASK
     27 S RALIFN=+Y,RACAT=RAB
     28 Q:$D(RAOERFLG)  ;quit if REQLOC was called from REQLOC1
     29 K:$E(RAB)="O" RAWARD
     30 S:$E(RAB)="I" RAWARD=$P(^SC(+Y,0),U,1)
     31 Q
     32SCREEN() ; screen for active clinics/wards
    1133 ; This code is also called from RAORD1 (screen for the Patient Location
    12  ; prompt which is a pointer to the HOSPITAL LOCATION (#44) file.)
    13  ; We want to EXCLUDE from our selection the following types of
    14  ; hospital locations:
     34 ; prompt)
     35 Q:$D(^SC(+Y,"OOS")) 0 ; don't want Occasion Of Service (OOS) locations
     36 N RA44 S RA44=$G(^SC(+Y,0))
     37 Q:"FI"[$P(RA44,"^",3) 0 ; File areas & Imaging Types are not selectable
     38 I $P(RA44,"^",3)="W" G SCREENW ; ward check
     39 ; check inactivation & reactivation dates of clinic/operating
     40 ; room in file #44
     41 I '$D(^SC(+Y,"I")) Q 1
     42 ; This Hospital Location has an "I" node.  We have to check INACTIVATE
     43 ; DATE & REACTIVATE DATE fields to determine if the Hosp. Location is
     44 ; active.
     45 N RASCA S RASCI=$G(^SC(+Y,"I")),RASCA=+$P(RASCI,"^",2)
     46 ; RASCA is the REACTIVATE DATE
     47 ; Not selectable if REACTIVATE DATE is beyond DT or null (0).
     48 S RASCA=$S(RASCA=0:0,RASCA>DT:0,1:RASCA)
     49 I +RASCI=0 Q 1 ; no INACTIVATE DATE
     50 I +RASCI>DT Q 1 ; INACTIVATE DATE exceeds today's date
     51 ; Check INACTIVATE DATE against REACTIVATE DATE
     52 ; if REACTIVATE DATE exists and is not after (or is equal to) the
     53 ; INACTIVATE DATE the location is not active.
     54 I RASCA,(+RASCI<RASCA) Q 1
     55 Q 0
     56SCREENW ; check currently out-of-service field of ward file (#42)
     57 N D0,DGPMOS,X
     58 S D0=+$G(^SC(+Y,42)) I 'D0 Q 0
     59 I '$D(^DIC(42,D0,0)) Q 0
     60 S:$D(RAWHEN) DGPMOS=$P(RAWHEN,".",1)
     61 D WIN^DGPMDDCF
     62 S X=$S(X=0:1,1:0)
     63 Q X
    1564 ;
    16  ;  1) Occasion of Service (OOS) locations (fld: 50.01) 'OOS' node
    17  ;  2) File Area ("F") or Imaging ("I") locations (fld: 2)
    18  ;  3) Inactivate Date (fld: 2505) 'I' node
     65REQLOC1 ; Requesting Location does not go with Category of Exam
     66 ; Category of Exam = Inpatient  -> Requesting Location = Ward
     67 ; Category of Exam = Outpatient -> Requesting Location = Clinic
     68 ; Called from [RA OERR EDIT] and [RA QUICK EXAM ORDER] input templates
     69 W !!?5,*7,"When the CATEGORY OF EXAM is "_$S(RAX="I":"Inpatient",1:"Outpatient")_" the REQUESTING LOCATION",!?5,"must be a "_$S(RAX="I":"Ward",1:"Clinic")_" or OR.",!
     70 W !?5,"The current REQUESTING LOCATION is ",$S($P($G(^SC(+RALIFN,0)),U,1)]"":$P($G(^SC(+RALIFN,0)),U,1),1:"Unknown"),!
     71 N RAB,X,Y
     72 S RAX=$S(RAX="I":"INPATIENT",1:"OUTPATIENT"),RAB=RAX,RAOERRFG=""
     73 D REQLOC
     74 K RAOERRFG
     75 Q
     76TYPE(RACAT,Y) ; Indicates whether a Hospital Location is a valid selection.
     77 ; If the patient is an inpatient, all operating room location types &
     78 ; all wards are valid selections.  If the patient is an outpatient, all
     79 ; operating room location types & all clinics are valid selections.
     80 ; Input Variables: RACAT=$S(Inpatient:"I",1:"O") "O" for outpatient
     81 ; Input Variables: Y=IEN of entries in the Hospital Location file
     82 ; This fuction returns 1 if valid, 0 if not valid
     83 N RAX S RAX=0
     84 I $E(RACAT,1)="I" D
     85 . I $P(^SC(+Y,0),U,3)="W"!($P(^SC(+Y,0),U,3)="OR") S RAX=1
     86 . Q
     87 E  D
     88 . I $P(^SC(+Y,0),U,3)="C"!($P(^SC(+Y,0),U,3)="OR") S RAX=1
     89 . Q
     90 Q RAX
     91MATCH(RACAT,RALOC) ; Detect mismatched req loc type and cat. of exam
     92 ;                 and return code for correct category of exam
     93 ; Input Variable: 'RACAT' - the value for the 'Category Of Exam' field.
     94 ;                 Only passed in if either 'I' or 'O'.
     95 ;                 'RALOC' - The ien of the 'Requesting Location'
     96 ; Output: correct category (I or O)_"^"_$S(Category='I':ward,1:"")
    1997 ;
    20  ; input: RAINPAT=1 if the patient is an inpatient located on a ward, else 0.
    21  ;        RACPRS27=1 if the environment is running CPRS GUI v27, else 0.
    22  ;
    23  Q:$D(^SC(+Y,"OOS"))#2 0 ; #1
    24  N RA44 S RA44=$G(^SC(+Y,0)),RA44(42)=$P($G(^SC(+Y,42)),U)
    25  Q:"^F^I^"[(U_$P(RA44,U,3)_U) 0 ; #2
    26  ;
    27  ; if the hospital location is defined as a ward set RAWARD to 1, else 0
    28  N RAWARD S RAWARD=0
    29  ;check the pointer to the WARD LOCATION file.
    30  I RA44(42)>0 D  Q:RAWARD=-1 0
    31  .;Error; the HOSPITAL LOCATION cannot be of TYPE 'Clinic' & point to a ward
    32  .I $P(RA44,U,3)="C" S RAWARD=-1 Q
    33  .;Error; bad pointers between files 42 & 44
    34  .I $P($G(^DIC(42,RA44(42),44)),U)'=+Y S RAWARD=-1 Q
    35  .;ok, set ward flag...
    36  .S RAWARD=1
    37  .Q
    38  ;
    39  ; 1) if the hospital location is a ward check if we should screen by ward
    40  ; 2) the hosp location=ward, facility is running v26, and we have an
    41  ;    outpatient quit zero (default of the $S)
    42  I RAWARD  Q $S(RACPRS27!RAINPAT:$$SCREENW(+Y),1:0)
    43  ;
    44  ; if the hospital location is a clinic, we have an inpatient, and the
    45  ; facility is not running CPRS v27 return 0
    46  I 'RACPRS27,(RAINPAT) Q 0
    47  ;
    48  ; Check INACTIVATE DATE against REACTIVATE DATE
    49  ; inactivate date = reactivate date (allow)
    50  ; inactivate date > reactivate date (disallow)
    51  ; inactivate date < reactivate date (allow)
    52  ;
    53  N RASCA,RASCI,RASCINDE S RASCINDE=$G(^SC(+Y,"I"))
    54  S RASCI=+$P(RASCINDE,U),RASCA=+$P(RASCINDE,U,2)
    55  ;
    56  Q $S(RASCI'>0:1,RASCI>DT:1,1:RASCI'>RASCA)
    57  ;
    58 SCREENW(Y) ; check the out-of-service field of the WARD LOCATION (#42) record.
    59  ;input Y: ien of the HOSPITAL LOCATION record
    60  ; RAWHEN: DATE DESIRED (Not guaranteed) (file: 75.1, fld: 21) optional
    61  ;output : '0' if not valid, else '1' if valid
    62  N D0,DGPMOS,X
    63  S D0=+$G(^SC(Y,42))
    64  Q:'D0 0
    65  Q:'($D(^DIC(42,D0,0))#2) 0
    66  ;
    67  ;WIN^DGPMDDCF (Supported IA #1246) Is the ward active?
    68  ; Input
    69  ;  D0 "Dee zero" (req): IEN of WARD LOCATION file. 
    70  ;  DGPMOS (opt): defaults to DT. Is the ward in service on this date? 
    71  ; Output
    72  ;  X: 1 if out of service, 0 if in service, or -1 if input variables
    73  ;     not defined properly. Be careful; note the difference in their
    74  ;     boolean definition ('0'=success) and ours ('0'=failure)
    75  ;
    76  S:$D(RAWHEN)#2 DGPMOS=$P(RAWHEN,".",1)
    77  D WIN^DGPMDDCF
    78  Q 'X  ;alter 'X' (the WIN^DGPMDDCF output value) to meet our ($$SCREENW) output definition
     98 N RA44 S RA44=$G(^SC(+RALOC,0))
     99 I $E(RACAT,1)'="I",$E(RACAT,1)'="O" Q RACAT
     100 I $E(RACAT,1)="O",$P(RA44,U,3)'="C",($P(RA44,U,3)'="OR") S RACAT="INPATIENT"
     101 I $E(RACAT,1)="I",$P(RA44,U,3)'="W",($P(RA44,U,3)'="OR") S RACAT="OUTPATIENT"
     102 Q RACAT_"^"_$S($E(RACAT,1)="I":$P(RA44,"^"),1:"")
    79103 ;
    80104PREG(RADFN,RADT) ; Subroutine will display the pregnancy prompt to the
     
    105129 F  S RACNT=$O(RAMOD(RACNT),-1) Q:RACNT=""!(X=0)  S:RAMOD(RACNT)=Y X=0
    106130 Q X
    107  ;
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RARTR.m

    r628 r636  
    11RARTR ;HISC/CAH COLUMBIA/REB AISC/MJK,RMO-Queue/print Reports ;11/27/98  09:05
    2  ;;5.0;Radiology/Nuclear Medicine;**5,13,16,27,43,55,75,92**;Mar 16, 1998;Build 4
     2 ;;5.0;Radiology/Nuclear Medicine;**5,13,16,27,43,55,75**;Mar 16, 1998;Build 4
    33PRT ; Begin print/build of e-mail message
    44 ;
     
    132132 K RARPT,RAHDFM,RAFTFM,RAV,RAIOF,RABTCH,RAOOUT,RAPIR,RAPIS,VAERR,Z
    133133 ; K RASTRSK S RAFFLF=RAORIOF K RAORIOF,RAFFLF,RAERRFLG
    134  ; 05/15/08 BAY/KAM Patch RA*5*92 Added Conditional Kill to next line
    135  ; to support an AMIE interface (IA 708)
    136  K RASTRSK,RAORIOF,RAFFLF,RAERRFLG K:'($D(RAMIE)#2) DFN
    137  ;the next kill line corrects the CPRS V27 report display issue when repeated
    138  ;on same patient P92
    139  K %,DIW,DIWF,DIWI,DIWL,DIWT,DIWTC,DIWX,RAACNT,RADUPHX,RANUM,RAREZON,RAST
     134 K RASTRSK,RAORIOF,RAFFLF,RAERRFLG
    140135 Q
    141136Q ; Queue the report
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RARTR0.m

    r628 r636  
    11RARTR0 ;HISC/GJC-Queue/Print Radiology Rpts utility routine. ;1/8/97  08:07
    2  ;;5.0;Radiology/Nuclear Medicine;**8,26,74,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**8,26,74**;Mar 16, 1998;Build 2
    33 ; 06/28/2006 BAY/KAM Remedy Call 146291 - Change Patient Age to DOB
    4  ;
    5  ;Integration Agreements
    6  ;----------------------
    7  ;DT^DILF(2054); GETS^DIQ(2056); $$FMTE^XLFDT(10103); $$UP^XLFSTR(10104)
    8  ;NEW PERSON file read w/FM (10060)
    9  ;
    10 EN1 ; Called from RARTR ;P84 GETS^DIQ added...
     4EN1 ; Called from RARTR
    115 S RARPT(0)=$G(^RARPT(+$G(RARPT),0)) Q:RARPT(0)']""
    126 S RARPT(10)=$P(RARPT(0),"^",10)
    137 S RAVERF=+$P(RARPT(0),U,9),RAPVERF=+$P(RARPT(0),U,13)
    14  K RAPIR,RAPIS S RAPIR=+$P(RALB,"^",12),RAPIS=+$P(RALB,"^",15)
    15  ;format of the RAPIR/RAPIS arrays: P84 logic
    16  ;RAPI*=IEN file 200
    17  ;RAPI*(200,RAPI*,.01)= NAME (required)
    18  ;RAPI*(200,RAPI*,20.2) = SIGNATURE BLOCK PRINTED NAME (if any)
    19  ;RAPI*(200,RAPI*,20.3) = SIGNATURE BLOCK TITLE (if any)
    20  I RAPIR D GETS^DIQ(200,RAPIR,".01;20.2;20.3","","RAPIR") S RAPIR("IENS")=RAPIR_","
    21  I RAPIS D GETS^DIQ(200,RAPIS,".01;20.2;20.3","","RAPIS") S RAPIS("IENS")=RAPIS_","
     8 S RAPIR=+$P(RALB,"^",12),RAPIS=+$P(RALB,"^",15)
    229 S RAWHOVER=+$P(RARPT(0),"^",17)
    2310 I RAVERF,((RAPIR=RAVERF)!(RAPIS=RAVERF)) D
     
    2512 . Q
    2613 I RAPIS D  Q:$D(RAOOUT)
    27  . ;get signature block name if defined
    28  . S RALBS=$E(RAPIS(200,RAPIS("IENS"),20.2),1,25)
    29  . S:RALBS="" RALBS=$E(RAPIS(200,RAPIS("IENS"),.01),1,25) ;default to NAME
    30  . ;
    31  . ;get signature block title if defined
    32  . S RALBST=$G(RAPIS(200,RAPIS("IENS"),20.3)) ; max: 50 chars
    33  . S:RALBST="" RALBST=$$TITLE^RARTR0(RAPIS)
    34  . ;
     14 . S RALBS=$E($P($G(^VA(200,RAPIS,20)),"^",2),1,25)
     15 . S:RALBS']"" RALBS=$E($P($G(VA(200,RAPIS,0)),"^"),1,25)
     16 . S RALBST=$P($G(^VA(200,RAPIS,20)),"^",3) ; max: 50 chars
     17 . I RALBST']"" S RALBST=$$TITLE^RARTR0(RAPIS)
    3518 . I '$D(RAUTOE) D:($Y+RAFOOT+4)>IOSL HANG^RARTR2 Q:$D(RAOOUT)
    3619 . I '$D(RAUTOE) D HD^RARTR:($Y+RAFOOT+4)>IOSL
    3720 . I '$D(RAUTOE) D
    38  .. W !,"Primary Interpreting Staff:",!?2,$S(RALBS]"":RALBS,1:"Unknown")
    39  .. W:$L(RALBST) ", "_$E(RALBST,1,((IOM-$X)-16))
     21 .. W !,"Primary Interpreting Staff:"
     22 .. W !?2,$S(RALBS]"":RALBS,1:"Unknown"),", ",$E(RALBST,1,((IOM-$X)-16))
    4023 .. ; The '-16' above is derived from $L("(Pre-Verifier)")+1 FORMATTING
    4124 .. Q
     
    4326 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="Primary Interpreting Staff:"
    4427 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="  "_$S(RALBS]"":RALBS,1:"Unknown")
    45  .. Q:'$L(RALBST)  N RALEN S RALEN=$L(^TMP($J,"RA AUTOE",RAACNT))
     28 .. N RALEN S RALEN=$L(^TMP($J,"RA AUTOE",RAACNT))
    4629 .. S ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_", "_$E(RALBST,1,((80-RALEN)-16))
    4730 .. Q
    48  . I $D(RAVERFND)&(RAPIS=RAVERF),(RAPIS(200,RAPIS("IENS"),.01)'="RADIOLOGY,OUTSIDE SERVICE") D
     31 . I $D(RAVERFND)&(RAPIS=RAVERF) D
    4932 .. I $G(RARPT(10))']"",('$D(RAUTOE)) D  Q
    5033 ... W:RAWHOVER=RAPIS !?10,"(Verifier, no e-sig)"
     
    6245 . Q
    6346 D SECSTF^RARTR1 Q:$D(RAOOUT)  ; Print secondary interp'ting staff now
    64  ;now for primary resident definitions...
    6547 I RAPIR D  Q:$D(RAOOUT)
    66  . ;get signature block name if defined
    67  . S RALBR=$E(RAPIR(200,RAPIR("IENS"),20.2),1,25)
    68  . S:RALBR="" RALBR=$E(RAPIR(200,RAPIR("IENS"),.01),1,25) ;default to NAME
    69  . ;
    70  . ;get signature block title if defined
    71  . S RALBRT=$G(RAPIR(200,RAPIR("IENS"),20.3)) ; max: 50 chars
    72  . S:RALBRT="" RALBRT=$$TITLE^RARTR0(RAPIR)
    73  . ;
     48 . S RALBR=$E($P($G(^VA(200,RAPIR,20)),"^",2),1,25)
     49 . S:RALBR']"" RALBR=$E($P($G(VA(200,RAPIR,0)),"^"),1,25)
     50 . S RALBRT=$P($G(^VA(200,RAPIR,20)),"^",3) ; max: 50 chars
     51 . I RALBRT']"" S RALBRT=$$TITLE^RARTR0(RAPIR)
    7452 . I '$D(RAUTOE) D:($Y+RAFOOT+4)>IOSL HANG^RARTR2 Q:$D(RAOOUT)
    7553 . I '$D(RAUTOE) D HD^RARTR:($Y+RAFOOT+4)>IOSL
    76  . I '$D(RAUTOE) D
    77  .. W !,"Primary Interpreting Resident:",!?2,$S(RALBR]"":RALBR,1:"Unknown")
    78  .. W:$L(RALBRT) ", "_$E(RALBRT,1,((IOM-$X)-16))
    79  .. Q
     54 . W:'$D(RAUTOE) !,"Primary Interpreting Resident:"
     55 . W:'$D(RAUTOE) !?2,$S(RALBR]"":RALBR,1:"Unknown")_", ",$E(RALBRT,1,((IOM-$X)-16))
     56 . ; The '-16' above is derived from $L("(Pre-Verifier)")+1 FORMATTING
    8057 . I $D(RAUTOE) D
    8158 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="Primary Interpreting Resident:"
    8259 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="  "_$S(RALBR]"":RALBR,1:"Unknown")
    83  .. Q:'$L(RALBRT)  N RALEN S RALEN=$L(^TMP($J,"RA AUTOE",RAACNT))
     60 .. N RALEN S RALEN=$L(^TMP($J,"RA AUTOE",RAACNT))
    8461 .. S ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_", "_$E(RALBRT,1,((80-RALEN)-16))
    8562 .. Q
     
    10077 . Q
    10178 D SECRES^RARTR1 ; Print out secondary interp'ting resident now
    102  K RAPIR,RAPIS ;P84 kills added
    10379 Q
    104  ;
    105 TITLE(X) ;Return the radiology classification in lieu of the signature block title
     80TITLE(X) ; Determine an individuals title
    10681 ; 'X' is the IEN of the Primary Interpreting Resident i.e, ^DD(70.03,12
    10782 ; -OR-
    10883 ; 'X' is the IEN of the Primary Interpreting Staff i.e, ^DD(70.03,15
    109  Q $S($D(^VA(200,"ARC","R",X)):"Resident Physician",$D(^VA(200,"ARC","S",X)):"Staff Physician",1:"")
    110  ;
     84 N Y
     85 I $D(^VA(200,"ARC","R",X)) S Y="Resident Physician" Q Y
     86 I $D(^VA(200,"ARC","S",X)) S Y="Staff Physician" Q Y
     87 S Y=""
     88 Q Y
    11189HEAD ; Set up header info for e-mail message (called from INIT^RARTR)
    11290 ; 06/28/2006 BAY/KAM Remedy Call 146291 Change Patient Age to DOB
  • FOIAVistA/tag/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAUTL1.m

    r628 r636  
    11RAUTL1 ;HISC/CAH,FPT,GJC AISC/MJK,RMO-Utility Routine ;10/22/97  13:54
    2  ;;5.0;Radiology/Nuclear Medicine;**5,9,18,71,82,81,84**;Mar 16, 1998;Build 13
     2 ;;5.0;Radiology/Nuclear Medicine;**5,9,18,71,82**;Mar 16, 1998;Build 8
    33 ;last modification by SS for P18 June 19,00
    44 ;02/10/2006 BAY/KAM RA*5*71 Add ability to update exam data to V/R
    5  ;
    6  ;Integration Agreements
    7  ;----------------------
    8  ;DIC(10006); DIE(10018); FILE^DIE(2053); UPDATE^DIE(2053); EN^ORB3(1362); NOTE^ORX3(868)
    9  ;
    105 I "IOSCR"'[X!(X="") S X="Unknown" Q
    116 G @($E(X))
     
    3631 ;Variable Y is returned as either an elapsed time in the form DD:HH:MM where DD=days, HH=hours, MM=minutes or as the string 'Neg. Time' indicating a negative elapsed time
    3732 ;Variable Y1 is returned as the # of minutes of elapsed time
    38  I '$D(RAMTIME) S DIC="^DD(""FUNC"",",DIC(0)="FX",RAX=X,X="MINUTES" D ^DIC K DIC S X=RAX S:$D(^DD("FUNC",+Y,1)) RAMTIME=^(1) I '$D(RAMTIME) W $C(7),!!,"Can't continue --- No 'MINUTES' function found in File Manager" K Y,Y1 G Q
     33 I '$D(RAMTIME) S DIC="^DD(""FUNC"",",DIC(0)="FX",RAX=X,X="MINUTES" D ^DIC K DIC S X=RAX S:$D(^DD("FUNC",+Y,1)) RAMTIME=^(1) I '$D(RAMTIME) W *7,!!,"Can't continue --- No 'MINUTES' function found in File Manager" K Y,Y1 G Q
    3934 X RAMTIME S Y1=X I X<0 S Y="Neg. Time" G Q
    4035MINUTS S X(1)=X\1440,X=X-(1440*X(1)),X(2)=X\60,X(3)=X-(60*X(2)),Y=$E(100+X(1),2,3)_":"_$E(100+X(2),2,3)_":"_$E(100+X(3),2,3)
     
    4641 I $G(RAIMGTY)="" K XQUIT Q  ; didn't sign-on to an imaging location
    4742 D ^RACNLU G UPQ:"^"[X
    48  I $D(^RA(72,"AA",RAIMGTY,9,+RAST)),'$D(^XUSEC("RA MGR",DUZ)) W !!?3,$C(7),"You do not have the appropriate access privileges to act on completed exams." G UPDATE
    49  I $D(^RA(72,"AA",RAIMGTY,0,+RAST)) W !!?3,$C(7),"Exam has been 'cancelled' therefore the status cannot be changed." G UPDATE
     43 I $D(^RA(72,"AA",RAIMGTY,9,+RAST)),'$D(^XUSEC("RA MGR",DUZ)) W !!?3,*7,"You do not have the appropriate access privileges to act on completed exams." G UPDATE
     44 I $D(^RA(72,"AA",RAIMGTY,0,+RAST)) W !!?3,*7,"Exam has been 'cancelled' therefore the status cannot be changed." G UPDATE
    5045 ;D UP1 I RAOR>0 S DA(2)=RADFN,DA(1)=RADTI,DA=RACNI,DIE="^RADPT("_DA(2)_",""DT"","_DA(1)_",""P"",",DR="100///""NOW""",DR(2,70.07)="2///U;3////"_$S($G(RADUZ):RADUZ,1:DUZ) D ^DIE
    5146 D UP1 I RAOR>0 D
    52  .L +^RADPT(RADFN,"DT",RADTI,"P",RACNI):$G(DILOCKTM,3)
     47 .L +^RADPT(RADFN,"DT",RADTI,"P",RACNI)
    5348 .N RAIEN
    5449 .S RAIENS="+1,"_RACNI_","_RADTI_","_RADFN_","
     
    5651 .K RAERR D UPDATE^DIE("E","RAFDA","RAIEN","RAERR")
    5752 .K RAFDA,RAIENS
    58  .I $D(RAERR) S RAERR="Error in update of 70.07, .01 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR") L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) K RAIEN Q
     53 .I $D(RAERR) L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) K RAIEN Q
    5954 .S RAIENS=RAIEN(1)_","_RACNI_","_RADTI_","_RADFN_","
    6055 .S RAFDA(70.07,RAIENS,2)="U"
    6156 .S RAFDA(70.07,RAIENS,3)=$S($G(RADUZ):RADUZ,1:DUZ)
    62  .D FILE^DIE(,"RAFDA","RAERR")
     57 .D FILE^DIE(,"RAFDA")
    6358 .L -^RADPT(RADFN,"DT",RADTI,"P",RACNI)
    64  .I $D(RAERR) S RAERR="Error in update of 70.07, 2,3 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR")
    6559UPQ K RAFDA,RAIENS
    6660 K %,D,DA,DE,DIC,DIE,DQ,DR,I,J,POP,RACS,RAEND,RAF5,RAFL,RAFST,RAI,RAIX,RAJ1,RAORDIFN,RAPRIT,RAHEAD,RASN,RAOR,RASTI,RASSN,RADATE,RAST,RACN,RACNI,RADFN,RADTE,RADTI,RANME,RAPRC,RARPT,X,Y,Z,^TMP($J,"RAEX"),C,DIPGM Q
     
    9690 ;S DR(2,70.05)=$S($P(RAMDV,"^",11)&('$D(ZTQUEUED)):".01;",1:"")_"2////"_RASTI_";3////"_$S($G(RADUZ):RADUZ,1:DUZ)
    9791 ;D ^DIE
    98  L +^RADPT(RADFN,"DT",RADTI,"P",RACNI):$G(DILOCKTM,3)
     92 L +^RADPT(RADFN,"DT",RADTI,"P",RACNI)
    9993 N RAIEN
    10094 S RAIENS=RACNI_","_RADTI_","_RADFN_","
    10195 S RAFDA(70.03,RAIENS,3)=RASTI
    10296 K RAERR D FILE^DIE(,"RAFDA","RAERR")
    103  I $D(RAERR) S RAERR="Error in update of 70.03 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR") L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) G UP2K ;L - P18
     97 I $D(RAERR) L -^RADPT(RADFN,"DT",RADTI,"P",RACNI) G UP2K ;L - P18
    10498 I $P(RAMDV,"^",10) D
    105  .N RAERR2
    10699 .S RAIENS="+1,"_RACNI_","_RADTI_","_RADFN_","
    107100 .S RAFDA(70.05,RAIENS,.01)=$$MIDNGHT^RAUTL5($$NOW^XLFDT())
    108  .D UPDATE^DIE(,"RAFDA","RAIEN","RAERR")
     101 .D UPDATE^DIE(,"RAFDA","RAIEN")
    109102 .K RAFDA,RAIENS
    110  .I $D(RAERR) S RAERR="Error in update of 70.05, .01 "_$G(RAERR("DIERR",1,"TEXT",1)) K RAERR("DIERR")
    111103 .Q:'$D(RAIEN(1))
    112104 .I $P(RAMDV,"^",11),('$D(ZTQUEUED)) D
     
    117109 .S RAFDA(70.05,RAIENS,2)=RASTI
    118110 .S RAFDA(70.05,RAIENS,3)=$S($G(RADUZ):RADUZ,1:DUZ)
    119  .K RAERR2 D FILE^DIE(,"RAFDA","RAERR2")
    120  .I $D(RAERR2) S RAERR2="Error in update of 70.05 2,3 "_$G(RAERR2("DIERR",1,"TEXT",1)),RAERR=$S($D(RAERR):RAERR_";"_RAERR2,1:RAERR2)
     111 .K RAERR2 D FILE^DIE(,"RAFDA")
    121112 ;Patch RA*5*82 added next line send EXM message after status update, not before the update
    122  D:'$D(RAERR) EXM^RAHLRPC
     113 D EXM^RAHLRPC
    123114 L -^RADPT(RADFN,"DT",RADTI,"P",RACNI)
    124115 ;
Note: See TracChangeset for help on using the changeset viewer.