1 | LRAPAUSR ;AVAMC/REG/WTY - AUTOPSY SUPPLEMENTARY REPORT;9/14/01
|
---|
2 | ;;5.2;LAB SERVICE;**1,173,248,259,317**;Sep 27, 1994
|
---|
3 | ;
|
---|
4 | ;Reference to ^DD(63 supported by IA #10155
|
---|
5 | ;
|
---|
6 | S X="T",%DT="" D ^%DT,D^LRU S LRH(3)=Y,LRFLG=1
|
---|
7 | W !!,LRO(68)," Autopsy Supplementary Reports" D XR^LRU
|
---|
8 | S LRS(1)=$P(^LRO(69.2,LRAA,0),U,3),LRS(2)=$P(^(0),U,4)
|
---|
9 | D EN2^LRUA
|
---|
10 | G END:LRAPX=2,SGL:LRAPX=3,CH:LRAPX=4
|
---|
11 | S XTMP="Someone else is building a print queue for this Accession Area"
|
---|
12 | L +^LRO(69.2,LRAA,3):5 I '$T D EN^DDIOL(XTMP,"","$C(7),!!") K XTMP Q
|
---|
13 | GETP ;Add a patient to the report queue
|
---|
14 | W ! S X="" D ^LRUPS G GETP:LRAN["?" I LRAN=-1 L -^LRO(69.2,LRAA,3) Q
|
---|
15 | S FDAIEN(2)=LRAN
|
---|
16 | S FDA(1,69.29,"+2,"_+LRAA_",",.01)=LRDFN
|
---|
17 | D UPDATE^DIE("","FDA(1)","FDAIEN") K FDAIEN G GETP
|
---|
18 | CH I '$O(^LRO(69.2,LRAA,3,0)) D Q
|
---|
19 | .W $C(7),!!,"No AUTOPSY SUPPLEMENTARY REPORTS currently on the "
|
---|
20 | .W "print queue.",!!
|
---|
21 | SPC R !,"(D)ouble or (S)ingle spacing of report(s): ",X:DTIME
|
---|
22 | Q:X=""!(X[U)
|
---|
23 | I $E(X)'="D"&($E(X)'="S") D G SPC
|
---|
24 | .W $C(7),!,"Enter 'S' for single or 'D' for double spacing of reports"
|
---|
25 | S LRS=$S(X="D":"D",1:"")_"W" Q:LRAPX=3
|
---|
26 | W !!,"Save supplementary report list for reprinting "
|
---|
27 | S %=2 D YN^LRU S:%=1 LRSAV=1
|
---|
28 | DEV ;
|
---|
29 | W !
|
---|
30 | S %ZIS="Q" D ^%ZIS
|
---|
31 | I POP W ! Q
|
---|
32 | I $D(IO("Q")) D Q
|
---|
33 | .S ZTDESC="ANAT PATH FINAL REPORT"
|
---|
34 | .S ZTSAVE("LR*")="",ZTRTN="QUE^LRAPAUSR"
|
---|
35 | .D ^%ZTLOAD W:$D(ZTSK) !,"Request Queued, #",ZTSK W !
|
---|
36 | .K ZTSK,IO("Q") D HOME^%ZIS
|
---|
37 | QUE U IO D L^LRU,S^LRU,EN^LRUA
|
---|
38 | ;LRSF515=1 indicates that an SF515 is being generated.
|
---|
39 | S:'$D(LRSF515) LRSF515=0
|
---|
40 | S (LRS(5),LRAURPT)=1
|
---|
41 | I $D(LRAP) S LRDFN=LRAP D EN Q:LR("Q") K LRAP G LST
|
---|
42 | F LRAN=0:0 S LRAN=$O(^LRO(69.2,LRAA,3,LRAN)) Q:'LRAN!(LR("Q")) D
|
---|
43 | .S LRDFN=+^(LRAN,0) D EN
|
---|
44 | LST K:'$D(LRSAV) ^LRO(69.2,LRAA,3) K LRAURPT
|
---|
45 | S:'$D(^LRO(69.2,LRAA,3,0)) ^(0)="^69.29A^0^0"
|
---|
46 | I 'LR("Q"),$D(LR("F")),IOST?1"C".E D CONT
|
---|
47 | K LRSAV D K^LRU
|
---|
48 | W:IOST?1"P-".E @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
|
---|
49 | K %,DIR,DTOUT,DUOUT,DIRUT,X,Y
|
---|
50 | Q
|
---|
51 | W W !,LR("%") Q
|
---|
52 | E K ^UTILITY($J) S DIWR=IOM-5,DIWL=5,DIWF=LRS Q
|
---|
53 | ;
|
---|
54 | EN S LRQ=0,X=^LR(LRDFN,0) Q:'$O(^LR(LRDFN,84,0)) D ^LRUP
|
---|
55 | I '$D(^LR(LRDFN,"AU")) L +^LRO(69.2,LRAA,3,LRAN):5 Q:'$T D Q
|
---|
56 | .S DIK="^LRO(69.2,LRAA,3,",DA=LRAN,DA(1)=0
|
---|
57 | .D ^DIK K KA,DIK
|
---|
58 | .L -^LRO(69.2,LRAA,3,LRAN)
|
---|
59 | S X=^LR(LRDFN,"AU"),LRAC=$P(X,"^",6),LRM(2)=$P(X,"^",7)
|
---|
60 | S LRM(1)=$P(X,"^",12),LRW(9)=$P(X,"^",13),LRM(3)=$P(X,"^",10)
|
---|
61 | S Y=$P(X,"^"),LRH(2)=$E(Y,2,3) D D^LRU S LRH(1)=Y
|
---|
62 | S LRLLOC=$P(X,"^",5),AGE=$P(X,"^",9)
|
---|
63 | ;Define the service
|
---|
64 | S Y=$P(X,"^",8),C=$P(^DD(63,14.5,0),U,3)
|
---|
65 | D Y^DIQ S LRSVC=Y
|
---|
66 | ;Define autopsy type
|
---|
67 | S Y=$P(X,"^",11),C=$P(^DD(63,13.7,0),U,3)
|
---|
68 | D Y^DIQ S LRS(3)=Y
|
---|
69 | S DA=LRDFN D D^LRAUAW S Y=LR(63,12) D D^LRU S LRH=Y,X=LRM(1)
|
---|
70 | D:X D^LRUA S LRM(1)=X,X=LRM(2) D:X D^LRUA S LRM(2)=X,X=LRM(3)
|
---|
71 | D:X D^LRUA S LRM(3)=X
|
---|
72 | D H Q:LR("Q") S LR("F")=1
|
---|
73 | W:LRH(1)="" !?20,"+*+* REPORT INCOMPLETE *+*+"
|
---|
74 | S LRA=0 F S LRA=$O(^LR(LRDFN,84,LRA)) Q:'LRA!(LR("Q")) D
|
---|
75 | .S LRB=^LR(LRDFN,84,LRA,0)
|
---|
76 | .D:$Y>(IOSL-13) FT,H Q:LR("Q")
|
---|
77 | .W !!,"SUPPLEMENTARY REPORT DATE: "
|
---|
78 | .S Y=LRB D D^LRU W Y
|
---|
79 | .D:$Y>(IOSL-13) FT,H Q:LR("Q")
|
---|
80 | .D:$P($G(^LR(LRDFN,84,LRA,2,0)),U,4) SUPA
|
---|
81 | .D WRT
|
---|
82 | Q:LR("Q") D FT Q
|
---|
83 | WRT D E S LRC=0
|
---|
84 | F LRZ=0:1 S LRC=$O(^LR(LRDFN,84,LRA,1,LRC)) Q:'LRC!(LR("Q")) D
|
---|
85 | .D:$Y>(IOSL-13) FT,H S LR("F")=1 Q:LR("Q")
|
---|
86 | .S X=^LR(LRDFN,84,LRA,1,LRC,0) D:X["|TOP|" TOP D ^DIWP
|
---|
87 | Q:LR("Q") D:LRZ ^DIWW
|
---|
88 | Q
|
---|
89 | SUPA ;Print supplementary report audit information
|
---|
90 | W !?14,"*+* SUPPLEMENTARY REPORT HAS BEEN ADDED/MODIFIED*+*"
|
---|
91 | W !,"(Added/Last modified: "
|
---|
92 | S (A,B)=0 F S A=$O(^LR(LRDFN,84,LRA,2,A)) Q:'A!(LR("Q")) D
|
---|
93 | .S B=A
|
---|
94 | Q:LR("Q")
|
---|
95 | Q:'$D(^LR(LRDFN,84,LRA,2,B,0))
|
---|
96 | S A=^(0),Y=+A,LRSGN=" typed by ",A2=$P(A,"^",2)
|
---|
97 | I $P(A,"^",3) D
|
---|
98 | .S LRSGN=" signed by ",A2=$P(A,"^",3),Y=$P(A,"^",4)
|
---|
99 | S A2=$S($D(^VA(200,A2,0)):$P(^(0),"^"),1:A2)
|
---|
100 | ;If supp rpt is released, display 'signed by' instead of 'typed by'
|
---|
101 | D D^LRU W Y,LRSGN,A2,")"
|
---|
102 | ;If RELEASE SUPP REPORT MODIFIED set to 1, display "NOT VERIFIED"
|
---|
103 | I $P(^LR(LRDFN,84,LRA,0),"^",3) W !,?25,"**-* NOT VERIFIED *-**"
|
---|
104 | D:$D(LRQ(9)) SUPM
|
---|
105 | Q
|
---|
106 | SUPM ;Print previous versions of supplementary reports
|
---|
107 | ;This is used by menu option 'Print path modifications [LRAPMOD]'
|
---|
108 | ;
|
---|
109 | S A=0 F S A=$O(^LR(LRDFN,84,LRA,2,A)) Q:'A!(LR("Q")) D
|
---|
110 | .S LRT=^LR(LRDFN,84,LRA,2,A,0)
|
---|
111 | .D:$Y>(IOSL-13) FT,H Q:LR("Q")
|
---|
112 | .S Y=+LRT,Y2="modified: ",X=$P(LRT,"^",2),LRSGN=" typed by "
|
---|
113 | .;If supp rpt is released, display 'signed by' instead of 'typed by'
|
---|
114 | .I $P(LRT,"^",3) S LRSGN=" signed by",X=$P(LRT,"^",3),Y=$P(LRT,"^",4),Y2="released: "
|
---|
115 | .S X=$S($D(^VA(200,X,0)):$P(^(0),"^"),1:X)
|
---|
116 | .D D^LRU W !,"Date ",Y2,Y,LRSGN,X
|
---|
117 | .K ^UTILITY($J) S DIWR=IOM-5,DIWL=5,DIWF="W"
|
---|
118 | .S B=0
|
---|
119 | .F LRZ=0:1 S B=$O(^LR(LRDFN,84,LRA,2,A,1,B)) Q:'B!(LR("Q")) D
|
---|
120 | ..S LRT=^LR(LRDFN,84,LRA,2,A,1,B,0)
|
---|
121 | ..D:$Y>(IOSL-13) FT,H Q:LR("Q")
|
---|
122 | ..S X=LRT D ^DIWP
|
---|
123 | .Q:LR("Q") D:LRZ ^DIWW
|
---|
124 | Q:LR("Q")
|
---|
125 | W !?13,"==========Text below appears on final report=========="
|
---|
126 | Q
|
---|
127 | H ;Header
|
---|
128 | I $D(LR("F")),IOST?1"C".E D CONT Q:LR("Q")
|
---|
129 | W:($D(LR("F"))) @IOF
|
---|
130 | S LRQ=LRQ+1
|
---|
131 | ;W:IOST?1"C".E!(IOST'?1"C".E&('$D(LRFLG))) @IOF,!
|
---|
132 | ;K LRFLG
|
---|
133 | W ! D W
|
---|
134 | W !?5,"CLINICAL RECORD |",?40,"AUTOPSY SUPPLEMENTARY REPORT"
|
---|
135 | W ?73,"Pg ",LRQ,!,LR("%")
|
---|
136 | W !,"Date died: ",LRH,?40,"| Autopsy date: ",LRH(1)
|
---|
137 | W !,"Resident: ",LRM(2),?40,"| ",LRS(3)
|
---|
138 | W ?56,"Autopsy No. ",$S(LRQ(8)]"":LRQ(8)_LRH(2)_" "_LRAC,1:LRAC)
|
---|
139 | W !,LR("%")
|
---|
140 | Q
|
---|
141 | FT ;Footer
|
---|
142 | Q:LR("Q")
|
---|
143 | I IOSL'>66 F Q:$Y>(IOSL-13) W !
|
---|
144 | D W W !!,"Pathologist: ",LRM(3),?52,LRW(9),?55,"| Date ",$E(LRH(3),1,12)
|
---|
145 | D W W !,LRQ(1),?(IOM-30),"AUTOPSY SUPPLEMENTARY REPORT"
|
---|
146 | W !,$E(LRP,1,30),?31,SSN,?49,"SEX:",SEX,?55,"DOB:",DOB,!,LRLLOC
|
---|
147 | W ?31,LRM(1),?55,"AGE AT DEATH: ",AGE
|
---|
148 | Q
|
---|
149 | SGL ;Entry point for printing single report
|
---|
150 | S X="" D ^LRUPS G:LRAN="?" SGL Q:LRAN=-1
|
---|
151 | I $D(LR("AU1")),'$P(^LR(LRDFN,"AU"),U,15) D Q
|
---|
152 | .W $C(7),!!,"Report not verified."
|
---|
153 | D SPC Q:X=""!(X[U)
|
---|
154 | S LRAP=LRDFN,LRSAV=1
|
---|
155 | D EN2^LRUA
|
---|
156 | G DEV
|
---|
157 | CONT ;
|
---|
158 | K DIR S DIR(0)="E"
|
---|
159 | D ^DIR W !
|
---|
160 | S:$D(DTOUT)!(X[U) LR("Q")=1
|
---|
161 | Q
|
---|
162 | END ;
|
---|
163 | W $C(7),!!,"OK to delete the AUTOPSY SUPPLEMENTARY REPORT list "
|
---|
164 | S %=2 D YN^LRU
|
---|
165 | I %=1 K ^LRO(69.2,LRAA,3) S ^LRO(69.2,LRAA,3,0)="^69.29A^0^0" D Q
|
---|
166 | .W $C(7),!,"LIST DELETED !",!
|
---|
167 | W !!,"OK, LET'S FORGET IT.",!
|
---|
168 | Q
|
---|
169 | TOP S Z=$P(X,"|TOP|",1)_$P(X,"|TOP|",2)
|
---|
170 | D FT,H S X=Z,LR("F")=1
|
---|
171 | Q
|
---|