[623] | 1 | RACTOE3 ; ;12/27/07
|
---|
[613] | 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,""))=""
|
---|
[623] | 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)=%
|
---|
[613] | 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="RACTOE3",DQ=1
|
---|
[623] | 53 | 1 S D=0 K DE(1) ;400
|
---|
| 54 | S Y="CLINICAL HISTORY FOR EXAM^W^^0;1^Q",DG="H",DC="^75.11" D DIEN^DIWE K DE(1) G A
|
---|
| 55 | ;
|
---|
| 56 | 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
|
---|
| 57 | X2 I $D(DIRUT) S Y="@999"
|
---|
| 58 | Q
|
---|
[613] | 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
|
---|
[623] | 60 | X3 S:+$O(^RAO(75.1,DA,"H",0))=0 Y="@15"
|
---|
[613] | 61 | Q
|
---|
[623] | 62 | 4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 63 | X4 S RAWPFLAG=$$VALWP^RAUTL5("^RAO(75.1,"_DA_",""H"",")
|
---|
[613] | 64 | Q
|
---|
[623] | 65 | 5 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
|
---|
| 66 | X5 I 'RAWPFLAG W !!?3,$C(7),"Text must be at least two (2) alphanumeric characters in length.",! S Y="@10"
|
---|
| 67 | Q
|
---|
[613] | 68 | 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
|
---|
[623] | 69 | X6 I $P($G(^RAO(75.1,DA,"H",0)),U,3)>350 W ?3,$C(7),"Clinical History cannot exceed 350 lines!" S Y="@10"
|
---|
[613] | 70 | Q
|
---|
[623] | 71 | 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
|
---|
| 72 | X7 I $O(^RAO(75.1,DA,"H",0)) D UPDT^RAUTL3("^RAO(75.1,"_DA_",""H"",")
|
---|
[613] | 73 | Q
|
---|
[623] | 74 | 8 S DQ=9 ;@15
|
---|
| 75 | 9 S DW="0;14",DV="R*P200'X",DU="",DLB="REQUESTING PHYSICIAN",DIFLD=14
|
---|
| 76 | S DU="VA(200,"
|
---|
| 77 | S X=RAPIFN
|
---|
[613] | 78 | S Y=X
|
---|
| 79 | 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)
|
---|
| 80 | G RD:X="@",Z
|
---|
[623] | 81 | X9 Q
|
---|
| 82 | 10 S DQ=11 ;@20
|
---|
| 83 | 11 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
|
---|
| 84 | S DU="I:INPATIENT;O:OUTPATIENT;C:CONTRACT;S:SHARING;E:EMPLOYEE;R:RESEARCH;"
|
---|
| 85 | S X=RACAT
|
---|
[613] | 86 | S Y=X
|
---|
| 87 | G Y
|
---|
[623] | 88 | X11 Q
|
---|
| 89 | 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
|
---|
| 90 | X12 S RAX=$E(X,1),Y=$S(RAX="R":"@30","CS"[RAX:"@40",RAX="I"&($D(RAWARD))!("EO"[RAX&('$D(RAWARD))):"@50",1:"@25")
|
---|
[613] | 91 | Q
|
---|
[623] | 92 | 13 S DQ=14 ;@25
|
---|
[613] | 93 | 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
|
---|
[623] | 94 | X14 I $D(RAWARD) W !?3,$C(7),"Please choose 'I' for INPATIENT, 'R' RESEARCH, 'C' CONTRACT,",!?3,"'S' SHARING!"
|
---|
[613] | 95 | Q
|
---|
[623] | 96 | 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
|
---|
| 97 | X15 I '$D(RAWARD) W !?3,$C(7),"Please choose 'O' for OUTPATIENT, 'E' EMPLOYEE, 'R' RESEARCH,",!?3,"'C' CONTRACT, 'S' SHARING!"
|
---|
| 98 | Q
|
---|
[613] | 99 | 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
|
---|
[623] | 100 | X16 D CS^RAORD1A I $D(RALIFN("OUT")) S Y="@26"
|
---|
[613] | 101 | Q
|
---|
| 102 | 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
|
---|
[623] | 103 | X17 I '$D(RALIFN("NO")) S Y="@50"
|
---|
[613] | 104 | Q
|
---|
| 105 | 18 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
|
---|
[623] | 106 | X18 K RALIFN("NO")
|
---|
[613] | 107 | Q
|
---|
[623] | 108 | 19 S DQ=20 ;@26
|
---|
| 109 | 20 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
|
---|
| 114 | X20 Q
|
---|
| 115 | 21 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
|
---|
| 116 | X21 K RALIFN("OUT")
|
---|
[613] | 117 | Q
|
---|
| 118 | 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
|
---|
[623] | 119 | X22 S Y="@20"
|
---|
[613] | 120 | Q
|
---|
[623] | 121 | 23 S DQ=24 ;@30
|
---|
| 122 | 24 S DW="R;1",DV="FR",DU="",DLB="RESEARCH SOURCE",DIFLD=9.5
|
---|
| 123 | S X=$S($D(RARSH):RARSH,1:"")
|
---|
[613] | 124 | S Y=X
|
---|
[623] | 125 | G Y
|
---|
| 126 | X24 K:$L(X)>40!($L(X)<3) X
|
---|
| 127 | I $D(X),X'?.ANP K X
|
---|
[613] | 128 | Q
|
---|
| 129 | ;
|
---|
| 130 | 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
|
---|
[623] | 131 | X25 S Y="@50"
|
---|
[613] | 132 | Q
|
---|
[623] | 133 | 26 S DQ=27 ;@40
|
---|
| 134 | 27 S DW="0;9",DV="*P34'R",DU="",DLB="CONTRACT/SHARING SOURCE",DIFLD=9
|
---|
| 135 | S DU="DIC(34,"
|
---|
| 136 | S X=$S($D(RASHA):RASHA,1:"")
|
---|
[613] | 137 | S Y=X
|
---|
| 138 | G Y
|
---|
[623] | 139 | X27 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
|
---|
[613] | 140 | Q
|
---|
| 141 | ;
|
---|
[623] | 142 | 28 S DQ=29 ;@50
|
---|
| 143 | 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
|
---|
| 144 | X29 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
|
---|
[613] | 145 | Q
|
---|
[623] | 146 | 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
|
---|
| 147 | X30 I RAX="O",($P($G(^SC(+RALIFN,0)),U,3)'="C"),($P($G(^SC(+RALIFN,0)),U,3)'="OR") D REQLOC1^RAORD1A
|
---|
| 148 | Q
|
---|
| 149 | 31 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
|
---|
| 150 | X31 I $D(RALIFN("OUT")) K RALIFN("OUT") S Y="@999"
|
---|
| 151 | Q
|
---|
| 152 | 32 S DW="0;22",DV="P44'a",DU="",DLB="REQUESTING LOCATION",DIFLD=22
|
---|
| 153 | S DE(DW)="C32^RACTOE3"
|
---|
| 154 | S DU="SC("
|
---|
| 155 | S X=RALIFN
|
---|
[613] | 156 | S Y=X
|
---|
| 157 | 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)
|
---|
| 158 | G RD:X="@",Z
|
---|
[623] | 159 | C32 G C32S:$D(DE(32))[0 K DB
|
---|
| 160 | D ^RACTOE4
|
---|
| 161 | C32S S X="" G:DG(DQ)=X C32F1 K DB
|
---|
| 162 | D ^RACTOE5
|
---|
| 163 | C32F1 Q
|
---|
| 164 | X32 Q
|
---|
| 165 | 33 S DQ=34 ;@100
|
---|
| 166 | 34 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
|
---|
| 167 | X34 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"
|
---|
[613] | 168 | Q
|
---|
[623] | 169 | 35 D:$D(DG)>9 F^DIE17 G ^RACTOE6
|
---|