source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RARTR1.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 6.8 KB
Line 
1RARTR1 ;HISC/FPT,GJC-Queue/print Radiology Reports (cont.) ;1/8/97 08:08
2 ;;5.0;Radiology/Nuclear Medicine;**8,18**;Mar 16, 1998
3 ;last modification by SS for P18 JUNE 29,00
4PRTDX ; print dx codes on report
5 I '$D(RAUTOE) D HANG^RARTR2:($Y+RAFOOT+4)>IOSL Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL
6 S RADXCODE=$P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),U,13)
7 I '$D(RAUTOE) W !?RATAB,"Primary Diagnostic Code: ",!?RATAB+4,$S($D(^RA(78.3,+RADXCODE,0)):$P(^(0),U,1),1:"")
8 I $D(RAUTOE) D
9 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Primary Diagnostic Code: "_$S($D(^RA(78.3,+RADXCODE,0)):$P(^(0),U,1),1:"")
10 . Q
11 I '$D(RAUTOE) D HANG^RARTR2:($Y+RAFOOT+4)>IOSL Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL
12 I '$D(RAUTOE),('$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"DX",0))) W ! Q
13 I '$D(RAUTOE),($O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"DX",0))) D Q
14 . W !!?RATAB,"Secondary Diagnostic Codes: "
15 . S RADXCODE=0
16 . F S RADXCODE=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"DX","B",RADXCODE)) Q:RADXCODE'>0!('$D(^RA(78.3,+RADXCODE,0)))!($D(RAOOUT)) D
17 .. D HANG^RARTR2:($Y+RAFOOT+4)>IOSL Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL W !?RATAB+4,$P(^RA(78.3,RADXCODE,0),U,1)
18 .. Q
19 . K RADXCODE W !
20 . Q
21 I $D(RAUTOE),('$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"DX",0))) D Q
22 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=""
23 . Q
24 I $D(RAUTOE),($O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"DX",0))) D
25 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Secondary Diagnostic Codes: "
26 . S RADXCODE=0
27 . F S RADXCODE=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"DX","B",RADXCODE)) Q:RADXCODE'>0 D
28 .. Q:'$D(^RA(78.3,+$G(RADXCODE),0))#2
29 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" "_$P(^RA(78.3,+$G(RADXCODE),0),U)
30 .. Q
31 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=""
32 . Q
33 Q
34WARNING ; this printed report should not be used for charting
35 S RARPTSTT=$S(RAST="D":"DRAFT",RAST="PD":"PROBLEM DRAFT",RAST="R":"(RELEASED/NOT VERIFIED)",1:"REPORT STATUS UNKNOWN")
36 S RAPOSITN=(80-$L(RARPTSTT)\2)
37 I '$D(RAUTOE) D ;P18 modif
38 . W !?RAPOSITN-1,$$REPEAT^XLFSTR("*",$L(RARPTSTT)+2)
39 . W:RAST="R" !?(80-$L(RARPTSTT)\2)-1,"* PRELIMINARY REPORT *" ;P18
40 . W !?(80-$L(RARPTSTT)\2)-1,"*"_RARPTSTT_"*",!?RAPOSITN-1,$$REPEAT^XLFSTR("*",$L(RARPTSTT)+2)
41 . Q
42 I $D(RAUTOE) D
43 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=$$REPEAT^XLFSTR("*",$L(RARPTSTT)+2)
44 . I RAST="R" S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="* PRELIMINARY REPORT *" ;P18
45 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="*"_RARPTSTT_"*" ;P18
46 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=$$REPEAT^XLFSTR("*",$L(RARPTSTT)+2)
47 . S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=""
48 . Q
49 K RAPOSITN,RARPTSTT
50 Q
51SECRES ; Print from the secondary resident multiple
52 Q:'$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"SRR",0)) ; no data, quit
53 N RASR,RASRSBN,RASRSBT
54 I '$D(RAUTOE) D:($Y+RAFOOT+4)>IOSL HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL
55 W:'$D(RAUTOE) !,"Secondary Interpreting Resident:"
56 S:$D(RAUTOE) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="Secondary Interpreting Resident:"
57 S RASR=0
58 F S RASR=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"SRR",RASR)) Q:RASR'>0 D
59 . S RASR(0)=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"SRR",RASR,0))
60 . Q:'$D(^VA(200,+RASR(0),0))
61 . S RASRSBN=$E($P($G(^VA(200,+RASR(0),20)),"^",2),1,25)
62 . S:RASRSBN']"" RASRSBN=$E($P($G(^VA(200,+RASR(0),0)),"^"),1,25)
63 . S RASRSBT=$P($G(^VA(200,+RASR(0),20)),"^",3) ; max: 50 chars
64 . I RASRSBT']"" S RASRSBT=$$TITLE^RARTR0(+RASR(0))
65 . I '$D(RAUTOE) D:($Y+RAFOOT+4)>IOSL HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL
66 . W:'$D(RAUTOE) !?2,$S(RASRSBN]"":RASRSBN,1:"Unknown"),", ",$E(RASRSBT,1,((IOM-$X)-16))
67 . ; The '-16' above is derived from $L("(Pre-Verifier)")+1 FORMATTING
68 . I $D(RAUTOE) D
69 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" "_$S(RASRSBN]"":RASRSBN,1:"Unknown")
70 .. N RALEN S RALEN=$L(^TMP($J,"RA AUTOE",RAACNT))
71 .. S ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_", "_$E(RASRSBT,1,((80-RALEN)-16))
72 .. Q
73 . I '$D(RAVERFND),(RAVERF=+RASR(0)) D
74 .. S RAVERFND=""
75 .. I $G(RARPT(10))']"",('$D(RAUTOE)) D Q
76 ... W:RAWHOVER=+RASR(0) !?10,"(Verifier, no e-sig)"
77 ... W:RAWHOVER'=+RASR(0) !?10,"Verified by transcriptionist for "_RASRSBN ;Removed RA*5*8 _", M.D."
78 ... Q
79 .. I $G(RARPT(10))']"",($D(RAUTOE)) D Q
80 ... S:RAWHOVER=+RASR(0) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" (Verifier, no e-sig)"
81 ... S:RAWHOVER'=+RASR(0) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Verified by transcriptionist for "_RASRSBN ;Removed RA*5*8 _", M.D."
82 ... Q
83 .. W:'$D(RAUTOE) " (Verifier)"
84 .. S:$D(RAUTOE) ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_" (Verifier)"
85 .. Q
86 . I RAPVERF=+RASR(0) W:'$D(RAUTOE) " (Pre-Verifier)" S:$D(RAUTOE) ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_" (Pre-Verifier)"
87 . Q
88 Q
89SECSTF ; Print from the secondary staff multiple
90 Q:'$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"SSR",0)) ; no data, quit
91 N RASS,RASSSBN,RASSSBT
92 I '$D(RAUTOE) D:($Y+RAFOOT+4)>IOSL HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL
93 W:'$D(RAUTOE) !,"Secondary Interpreting Staff:"
94 S:$D(RAUTOE) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))="Secondary Interpreting Staff:"
95 S RASS=0
96 F S RASS=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"SSR",RASS)) Q:RASS'>0 D
97 . S RASS(0)=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"SSR",RASS,0))
98 . Q:'$D(^VA(200,+RASS(0),0))
99 . S RASSSBN=$E($P($G(^VA(200,+RASS(0),20)),"^",2),1,25)
100 . S:RASSSBN']"" RASSSBN=$E($P($G(^VA(200,+RASS(0),0)),"^"),1,25)
101 . S RASSSBT=$P($G(^VA(200,+RASS(0),20)),"^",3) ; max: 50 chars
102 . I RASSSBT']"" S RASSSBT=$$TITLE^RARTR0(+RASS(0))
103 . I '$D(RAUTOE) D:($Y+RAFOOT+4)>IOSL HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR:($Y+RAFOOT+4)>IOSL
104 . W:'$D(RAUTOE) !?2,$S(RASSSBN]"":RASSSBN,1:"Unknown"),", ",$E(RASSSBT,1,((IOM-$X)-16))
105 . ; The '-16' above is derived from $L("(Pre-Verifier)")+1 FORMATTING
106 . I $D(RAUTOE) D
107 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" "_$S(RASSSBN]"":RASSSBN,1:"Unknown")
108 .. N RALEN S RALEN=$L(^TMP($J,"RA AUTOE",RAACNT))
109 .. S ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_", "_$E(RASSSBT,1,((80-RALEN)-16))
110 .. Q
111 . I '$D(RAVERFND),(RAVERF=+RASS(0)) D
112 .. S RAVERFND=""
113 .. I $G(RARPT(10))']"",('$D(RAUTOE)) D Q
114 ... W:RAWHOVER=+RASS(0) !?10,"(Verifier, no e-sig)"
115 ... W:RAWHOVER'=+RASS(0) !?10,"Verified by transcriptionist for "_RASSSBN ;Removed RA*5*8 _", M.D."
116 ... Q
117 .. I $G(RARPT(10))']"",($D(RAUTOE)) D Q
118 ... S:RAWHOVER=+RASS(0) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" (Verifier, no e-sig)"
119 ... S:RAWHOVER'=+RASS(0) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Verified by transcriptionist for "_RASSSBN ;Removed RA*5*8 _", M.D."
120 ... Q
121 .. W:'$D(RAUTOE) " (Verifier)"
122 .. S:$D(RAUTOE) ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_" (Verifier)"
123 .. Q
124 . I RAPVERF=+RASS(0) W:'$D(RAUTOE) " (Pre-Verifier)" S:$D(RAUTOE) ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_" (Pre-Verifier)"
125 . Q
126 Q
Note: See TracBrowser for help on using the repository browser.