source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAPMOD.m@ 1604

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1LRAPMOD ;AVAMC/REG/WTY/KLL - PRINT PATH MICRO MODIFICATIONS ;9/22/00
2 ;;5.2;LAB SERVICE;**72,248,259**;Sep 27, 1994
3 ;
4 ;Reference to ^%DT supported by IA #10003
5 ;
6 ;If ESIG Switch turned ON, print from TIU if found,
7 ; otherwise print from LR.
8 N LRESSW
9 D GETDATA^LRAPESON(.LRESSW)
10 I +$G(LRESSW) D TIUPRT,END Q
11 ;Print from LR
12 S LRDICS="AUSPCYEM" D ^LRAP G:'$D(Y) END
13 W !!?15,LRO(68),!!?15,"Print pathology report modifications",!!
14GETP D EN2^LRUA,EN1^LRUPS
15 G:LRAN["?" GETP
16 I LRAN=-1 D END Q
17 S FLGMOD=1
18LRPRT I LRSS'="AU" D
19 .S:($D(^LR(LRDFN,LRSS,LRI,4))!($D(^(5)))!($D(^(6)))!($D(^(7)))) FLGMOD=0
20 I FLGMOD D K LRFILE
21 .S LRFILE=$S(LRSS="AU":"^LR(LRDFN,84",1:"^LR(LRDFN,LRSS,LRI,1.2")
22 .I $D(@(LRFILE_")")) D
23 ..F A=0:0 S A=$O(@(LRFILE_",A)")) Q:'A!('FLGMOD) D
24 ...S:$D(@(LRFILE_",A,2)")) FLGMOD=0
25 I FLGMOD W $C(7),!!?5,"No modifications to print." G END
26 K FLGMOD
27 S (LRQ(9),LRSAV)=1,LRAP=LRDFN
28 I LRSS'="AU" D G DEV^LRSPRPT
29 .S LRAP=LRAP_"^"_LRI,LRS(99)=1
30 S X="T",%DT="" D ^%DT,D^LRU S LRH(3)=Y,LRFLG=1
31 G DEV^LRAPAUSR
32TIUPRT ;Print from TIU
33 N LRPTR,LREL,LRDATA
34 S (LRQUIT,LRCONT,LRPTR2)=0
35 S LRDICS="AUSPCYEM" D ^LRAP G:'$D(Y) END
36 W !!?15,LRO(68),!!?5,"Print All AP Reports for an Accession from TIU",!!
37 D ACCYR^LRAPMRL
38 I LRQUIT D END Q
39 S LRAU=0
40 I LRSS="AU" S LRAU=1
41 D LOOKUP^LRAPUTL(.LRDATA,LRH(0),LRO(68),LRSS,LRAD,LRAA)
42 Q:'LRDATA!(LRDATA=-1)
43 S FLGMOD=1
44 S LRDFN=LRDATA,LRI=LRDATA(1)
45 S LRIENS=LRI_","_LRDFN_","
46 ;Check for release date
47 I LRSS'="AU" S LREL=$$GET1^DIQ(LRSF,LRIENS,.11,"I")
48 I LRSS="AU" S LREL=$$GET1^DIQ(63,LRDFN_",",14.7,"I")
49 I 'LREL D
50 .S DIR(0)="Y",DIR("B")="YES",DIR("A")="CONTINUE?"
51 .S DIR("A",1)="Report not verified. Check for and print"
52 .S DIR("A",2)=" previous versions?"
53 .D ^DIR
54 .I Y=0 S LRQUIT=1
55 I LRQUIT D END Q
56 I 'LREL D
57 .D GETPREV
58 .;No previous versions found, retrieve from LR?
59 .I '+$G(LRPTR) D
60 ..S DIR(0)="Y",DIR("B")="YES",DIR("A")="CONTINUE?"
61 ..S DIR("A",1)="No previous versions found in TIU."
62 ..S DIR("A",2)=" Print from LR?"
63 ..D ^DIR
64 ..I Y=0 S LRQUIT=1
65 ..I Y=1 S LRCONT=1
66 G:LRCONT GETP
67 I LRQUIT D END Q
68 ;Release date found, check TIU
69 I LREL D
70 .D TIUCHK^LRAPUTL(.LRPTR,LRDFN,LRSS,LRI)
71 .I '+$G(LRPTR) D
72 ..S DIR(0)="Y",DIR("B")="YES",DIR("A")="CONTINUE?"
73 ..S DIR("A",1)="Report not found in TIU."
74 ..S DIR("A",2)=" Print from LR?"
75 ..D ^DIR
76 ..I Y=0 S LRQUIT=1
77 ..I Y=1 S LRCONT=1
78 I LRQUIT D END Q
79 G:LRCONT GETP
80 ;Found in TIU, print from TIU
81 I +$G(LRPTR) D
82 .S LRPTR2=1
83 .W !
84 .S %ZIS="Q" D ^%ZIS
85 .I POP W ! D END Q
86 .I $D(IO("Q")) D Q
87 ..S ZTDESC="Print Anat Path Reports"
88 ..S ZTSAVE("LR*")="",ZTRTN="PRTRPT^LRAPMOD"
89 ..D ^%ZTLOAD W:$D(ZTSK) !,"Request Queued, #",ZTSK W !
90 ..K ZTSK,IO("Q") D HOME^%ZIS
91 .D PRTRPT
92 D ^%ZISC
93 ;Allow print of LR even if stored in TIU
94 I LRPTR2=1 D
95 .S DIR(0)="Y",DIR("B")="YES",DIR("A")="CONTINUE?"
96 .S DIR("A",1)="Print a copy from LR in addition to TIU print?"
97 .D ^DIR
98 .I Y=0 S LRQUIT=1
99 .I Y=1 S LRCONT=1,LRPTR=0
100 Q:LRQUIT
101 G:LRCONT GETP
102 Q
103PRTRPT ;Print from TIU
104 U IO
105 F D Q:'LRPTR!(LRQUIT)
106 .D MAIN^LRAPTIUP(LRPTR,0)
107 .S LRPTR=$$GET1^DIQ(8925,LRPTR,1406,"I")
108 Q
109GETPREV ;
110 I LRSS="AU" D
111 .S LRROOT="^LR(LRDFN,101,""A"")",LRIENS=LRDFN_","
112 .S LRFILE=63.101
113 I LRSS'="AU" D
114 .S LRROOT="^LR(LRDFN,LRSS,LRI,.05,""A"")"
115 .S LRIENS=LRI_","_LRDFN_","
116 .S LRFILE=$S(LRSS="SP":63.19,LRSS="CY":63.47,LRSS="EM":63.49,1:"")
117 S LRTREC=$O(@(LRROOT),-1)
118 I LRFILE=""!(LRTREC="") S LRPTR=0 Q
119 S LRIENS=LRTREC_","_LRIENS
120 S LRPTR=+$$GET1^DIQ(LRFILE,LRIENS,1,"I")
121 I '+$G(LRPTR) D
122 .W $C(7),"Report not found in TIU",!
123 .S LRQUIT=1
124 Q
125END ;
126 D V^LRU
127 Q
Note: See TracBrowser for help on using the repository browser.