source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LR7OSAP.m@ 1005

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

initial load of WorldVistAEHR

File size: 5.5 KB
RevLine 
[613]1LR7OSAP ;slc/dcm/wty - Silent AP rpt (compare to LRAPCUM) ;3/27/2002
2 ;;5.2;LAB SERVICE;**121,187,230,256,259,317**;Sep 27, 1994
3 ;
4GET I '$D(^LR(LRDFN,LRSS)) Q
5 N FST,X,LRPTR
6 S (A,FST)=0,LRI=LRIN
7 F S LRI=$O(^LR(LRDFN,LRSS,LRI)) Q:'LRI!(CT1>COUNT)!(LRI>LROUT) S B=$G(^(LRI,0)),CT1=CT1+1 I B D
8 . D W
9 . S X="",$P(X,"=",GIOM)=""
10 . D LN
11 . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,X)
12 . D LINE^LR7OSUM4
13 Q
14F(PIECE) ;
15 ;If PIECE=1, then only get 1st piece; otherwise get whole node
16 I '$G(PIECE) D WRAP^LR7OSAP1("^LR("_LRDFN_","""_LRSS_""","_LRI_","_LRV_")",79) Q
17 S C=0
18 F S C=$O(^LR(LRDFN,LRSS,LRI,LRV,C)) Q:'C S X=$P(^(C,0),"^") D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,X)
19 Q
20W ;
21 N LRTEXT
22 I 'FST D
23 . D LINE^LR7OSUM4,LN
24 . S X=GIOM/2-($L(LRAA(1))/2+5),^TMP("LRH",$J,LRAA(1))=GCNT,^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(X,CCNT,"---- "_LRAA(1)_" ----")
25 I FST D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Next "_LRAA(1)_" Specimen...")
26 S FST=1
27 D TIUCHK^LRAPUTL(.LRPTR,LRDFN,LRSS,LRI)
28 I +$G(LRPTR) D Q
29 .D MAIN^LR7OSAP3(LRPTR)
30 S Y=+B
31 D D^LRU
32 S LRW(1)=Y,Y=$P(B,"^",10)
33 D D^LRU
34 S LRW(10)=Y,Y=$P(B,"^",3)
35 D D^LRU
36 S LRW(3)=Y,X=$P(B,"^",2)
37 D:X D^LRUA
38 S LRW(2)=X,LRW(11)=$P(B,"^",11),X=$P(B,"^",4)
39 D:X D^LRUA
40 S LRW(4)=X,X=$P(B,"^",7)
41 D:X D^LRUA
42 S LRW(7)=X
43 D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Date Spec taken: "_LRW(1)),^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(38,CCNT,"Pathologist:"_LRW(2))
44 D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Date Spec rec'd: "_LRW(10)),^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(38,CCNT,$S(LRSS="SP":"Resident: ",1:"Tech: ")_LRW(4))
45 D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$S($L(LRW(3)):"Date completed: ",1:"REPORT INCOMPLETE")_LRW(3)),^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(38,CCNT,"Accession #: "_$P(B,"^",6))
46 D LN S $P(LR("%"),"-",GIOM)="",^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Submitted by: "_$P(B,"^",5)),^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(38,CCNT,"Practitioner:"_LRW(7)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LR("%"))
47 I LRW(11)="" D A,LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Report not verified") Q ;don't show anymore data if not verified.
48 I $D(^LR(LRDFN,LRSS,LRI,.1)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Specimen: ") S LRV=.1 D F(1)
49 I $P($G(^LR(LRDFN,LRSS,LRI,1.2,0)),"^",4) D
50 .D LN
51 .S LRTEXT="SUPPLEMENTARY REPORT HAS BEEN ADDED"
52 .S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(14,CCNT,"*+* "_LRTEXT_" *+*")
53 .D LN
54 .S LRTEXT="REFER TO BOTTOM OF REPORT"
55 .S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(19,CCNT,"*+* "_LRTEXT_" *+*")
56 .D LN
57 I $D(^LR(LRDFN,LRSS,LRI,.2)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Brief Clinical History:") S LRV=.2 D F()
58 I $D(^LR(LRDFN,LRSS,LRI,.3)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Preoperative Diagnosis:") S LRV=.3 D F()
59 I $D(^LR(LRDFN,LRSS,LRI,.4)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Operative Findings:") S LRV=.4 D F()
60 I $D(^LR(LRDFN,LRSS,LRI,.5)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Postoperative Diagnosis:") S LRV=.5 D F()
61 D SET^LRUA
62 I $O(^LR(LRDFN,LRSS,LRI,1.3,0)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LR(69.2,.13)) I $P($G(^LR(LRDFN,LRSS,LRI,6,0)),U,4) S LR(0)=6 D MOD^LR7OSAP1
63 S LRV=1.3
64 D F()
65 I $O(^LR(LRDFN,LRSS,LRI,1,0)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LR(69.2,.03)) I $P($G(^LR(LRDFN,LRSS,LRI,7,0)),U,4) S LR(0)=7 D MOD^LR7OSAP1
66 S LRV=1
67 D F()
68 I $O(^LR(LRDFN,LRSS,LRI,1.1,0)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LR(69.2,.04)_" (Date Spec taken: "_LRW(1)_")") I $P($G(^LR(LRDFN,LRSS,LRI,4,0)),U,4) S LR(0)=4 D MOD^LR7OSAP1
69 S LRV=1.1
70 D F()
71 I $O(^LR(LRDFN,LRSS,LRI,1.4,0)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LR(69.2,.14)) I $P($G(^LR(LRDFN,LRSS,LRI,5,0)),U,4) S LR(0)=5 D MOD^LR7OSAP1
72 S LRV=1.4
73 D F()
74 I $O(^LR(LRDFN,LRSS,LRI,1.2,0)) D
75 . D LN
76 . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Supplementary Report:")
77 . S C=0 F S C=$O(^LR(LRDFN,LRSS,LRI,1.2,C)) Q:'C D
78 .. S X=^LR(LRDFN,LRSS,LRI,1.2,C,0),Y=+X,X=$P(X,U,2)
79 .. ;Don't even print supp date if supp is not released
80 .. Q:'X
81 .. D D^LRU,LN
82 .. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(3,CCNT,"Date: "_Y)
83 .. I 'X S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(1,CCNT," not verified")
84 .. I $O(^LR(LRDFN,LRSS,LRI,1.2,C,2,0)) D MODSR^LR7OSAP1
85 .. D:X U
86 I $D(^LR(LRDFN,LRSS,LRI,2)) D B
87 Q
88U ;
89 D WRAP^LR7OSAP1("^LR("_LRDFN_","""_LRSS_""","_LRI_",1.2,"_C_",1)",79)
90 Q
91B ;
92 S C=0
93 F S C=$O(^LR(LRDFN,LRSS,LRI,2,C)) Q:'C D SP
94 Q
95SP ;
96 S G=0
97 F S G=$O(^LR(LRDFN,LRSS,LRI,2,C,5,G)) Q:'G S X=^(G,0),Y=$P(X,"^",2),E=$P(X,"^",3),E(1)=$P(X,"^")_":",E(1)=$P($P($G(LR(LRSS)),E(1),2),";") D D^LRU S T(2)=Y D WP
98 Q
99WP ;
100 D LN
101 S X=E(1)_" "_E_" Date: "_T(2)_" ",^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,X)
102 D WRAP^LR7OSAP1("^LR("_LRDFN_","""_LRSS_""","_LRI_",2,"_C_",5,"_G_",1)",79)
103 Q
104A ;
105 D WRAP^LR7OSAP1("^LR("_LRDFN_","""_LRSS_""","_LRI_",97)",79)
106 Q
107LN ;Increment the counter
108 S GCNT=GCNT+1,CCNT=1
109 Q
110EN ;Get AP results
111 I $S('$D(SUBHEAD):1,1:$D(SUBHEAD("CYTOPATHOLOGY"))) D CY
112 I $S('$D(SUBHEAD):1,1:$D(SUBHEAD("SURGICAL PATHOLOGY"))) D SPA
113 I $S('$D(SUBHEAD):1,1:$D(SUBHEAD("EM"))) D EM
114 I $S('$D(SUBHEAD):1,1:$D(SUBHEAD("AUTOPSY"))),$D(^LR(LRDFN,"AU")) D AU
115 Q
116CY S LRSS="CY",LRAA(1)="CYTOPATHOLOGY",LRAA=+$O(^LRO(68,"B",LRAA(1),0)) S:'LRAA LRAA=$$FIND(LRSS) D GET
117 Q
118SPA S LRSS="SP",LRAA(1)="SURGICAL PATHOLOGY",LRAA=+$O(^LRO(68,"B",LRAA(1),0)) S:'LRAA LRAA=$$FIND(LRSS) D GET
119 Q
120EM S LRSS="EM",LRAA(1)="ELECTRON MICROSCOPY",LRAA=+$O(^LRO(68,"B","EM",0)) S:'LRAA LRAA=$$FIND(LRSS) D GET
121 Q
122AU D EN^LR7OSAP2(LRDFN)
123 Q
124FIND(SS) ;Find a valid entry in 68
125 ;SS=LRSS value to look for
126 N I,Y
127 S I=0,Y="" F S I=$O(^LRO(68,I)) Q:I<1 I $P($G(^LRO(68,I,0)),"^",2)=SS S Y=I Q
128 Q Y
Note: See TracBrowser for help on using the repository browser.