source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAPED.m@ 1015

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1LRAPED ;AVAMC/REG/WTY - ANATOMIC PATH EDIT LOG-IN ;11/20/01
2 ;;5.2;LAB SERVICE;**1,31,72,115,259**;Sep 27, 1994
3 ;
4 N LRTMP,LRREL,LRCOMP,LRMSG
5 D ^LRAP Q:'$D(Y)
6 D XR^LRU
7 I LRCAPA D @(LRSS_"^LRAPSWK") G:'$D(X) END
8 W !!,"EDIT ",LRO(68)," (",LRABV,") Log-In/Clinical Hx for ",LRH(0)," "
9 S %=1 D YN^LRU G:%<1 END
10 I %=2 D G:Y<1 END
11 .S %DT="AE",%DT(0)="-N",%DT("A")="Enter YEAR: "
12 .D ^%DT K %DT
13 .Q:Y<1
14 .S LRAD=$E(Y,1,3)_"0000",Y=LRAD D D^LRU S LRH(0)=Y
15 S LRC=$E(LRAD,1,3)
16G ;
17 W !!,"Enter ",LRO(68)," Accession #: " R LRAN:DTIME
18 G:LRAN=""!(LRAN[U) END
19 I LRAN'?1N.N!($E(LRAN)=0) D G G
20 .W $C(7),!," ENTER NUMBERS ONLY, No leading zero's"
21 D EDIT
22 G G
23EDIT ;
24 S LRDFN=$O(^LR(LRXREF,LRC,LRABV,LRAN,0))
25 I 'LRDFN W $C(7)," Not in file" Q
26 I '$D(^LR(LRDFN,0)) K ^LR(LRXREF,LRC,LRABV,LRAN,LRDFN) Q
27 S X=^LR(LRDFN,0) D ^LRUP W !,LRP," ID: ",SSN," OK "
28 S %=1 D YN^LRU Q:%'=1
29 D @($S("CYEMSP"[LRSS:"I",1:"A"))
30 Q
31I ;Non-autopsy sections (SP,CY,EM)
32 S LRI=+$O(^LR(LRXREF,LRC,LRABV,LRAN,LRDFN,0))
33 I '$D(^LR(LRDFN,LRSS,LRI,0)) D Q
34 .W $C(7),!,"Entry in x-ref but not in file ! X-ref deleted."
35 .K ^LR(LRXREF,LRC,LRABV,LRAN,LRDFN,LRI)
36 S X=^LR(LRDFN,LRSS,LRI,0),LRRC=$P(X,"^",10)
37 S DA=LRI,DA(1)=LRDFN,DIE="^LR("_LRDFN_","""_LRSS_""",",(LRB,Y)=+X
38 D D^LRU W !,"Specimen date: ",Y
39 I $P(^LR(LRDFN,LRSS,LRI,0),"^",11)!($P(^(0),"^",3)) D Q
40 .W $C(7),!!,"Report released or completed. Cannot edit Log-in data."
41 D:LRCAPA C^LRAPSWK
42DIE ;
43 W ! D CK^LRU
44 I $D(LR("CK")) K LR("CK") Q
45 D SET,^DIE
46 I $D(Y) D HELP G DIE
47 D CK
48 D:$O(^LR(LRDFN,LRSS,LRI,.1,0))&("SPCYEM"[LRSS)&(LRCAPA) C1^LRAPSWK
49 Q
50SET ;
51 S (LRJ,LRE,LRF)=""
52 S DR=".08;S LRE=X;.07;S LRJ=X;S:LRJ LRJ=$P(^VA(200,LRJ,0),U);"
53 S DR=DR_".011//^S X=LRJ;.012;.013;.014;.015;.016;.1;S LRG=X;.02;.021;"
54 S DR=DR_".99;S LRF=X"
55 S:LRSS="SP" DR(2,63.812)=".01"
56 S:LRSS="CY" DR(2,63.902)=".01;.02"
57 S:LRSS="EM" DR(2,63.202)=".01"
58 Q
59SET1 ;
60 S LRJ="",DA=LRDFN,DIE="^LR(",DR="11;S LRRC=X;14.1;S LRLLOC=X;14.5;"
61 S DR=DR_"14.6;S LRSVC=X;12.1;S LRMD=X;13.5:13.8"
62 S:%=1 DR=DR_";16:24;26:31;25;31.1:31.4;25.1:25.9"
63 D D^LRAUAW
64 S (Y,LRB)=LR(63,12),LRI=9999999-$P(LRB,".")
65 Q
66A ;Autopsy
67 S LRREL=+$$GET1^DIQ(63,LRDFN_",",14.7,"I")
68 S LRCOMP=+$$GET1^DIQ(63,LRDFN_",",13,"I")
69 I LRREL!LRCOMP D Q
70 .K LRMSG
71 .S LRMSG=$C(7)_"Report released or completed. Cannot edit Log-in data."
72 .D EN^DDIOL(LRMSG,"","!!")
73 W !!,"Edit Weights & Measurements " S %=2 D YN^LRU Q:%<1
74 S LRRC=$P(^LR(LRDFN,"AU"),U),DA=LRDFN,DIE="^LR("
75 D SET1,D^LRU
76 W !!,"Date Died: ",Y
77 I 'LRB D Q
78 .W $C(7),"? Must have date died entered in ",LR(63,.02)," File."
79AU ;
80 W ! D ^DIE
81 I $D(Y) D HELP G AU
82 D CK1
83 Q
84CK ;
85 I '$D(^LR(LRDFN,LRSS,LRI)) D K
86 Q
87CK1 ;
88 Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) S X=^(0)
89 S:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,3)) ^(3)=LRB_"^^^^"_LRI
90 S LRTMP=$P(X,U,1,2)_U_LRRC_U_$P(X,U,4,6)_U_LRLLOC_U_LRMD_U_LRSVC
91 S LRTMP=LRTMP_U_$P(X,U,10)
92 S ^LRO(68,LRAA,1,LRAD,1,LRAN,0)=LRTMP
93 S LRD=+$P(X,U,3)
94 K ^LRO(68,LRAA,1,LRAD,1,"E",LRD,LRAN)
95 S ^LRO(68,LRAA,1,LRAD,1,"E",LRRC,LRAN)=""
96 S X=^LRO(68,LRAA,1,LRAD,1,LRAN,3),^(3)=LRB_U_$P(X,U,2,99)
97 Q
98K ;
99 Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN)) D K^LRUDEL
100 L +^LRO(68,LRAA)
101 K ^LRO(68,LRAA,1,LRAD,1,LRAN),^LRO(68,LRAA,1,LRAD,1,"E",LRRC,LRAN)
102 K ^LRO(68,LRAA,1,"AC",DUZ(2),LRAD,LRAN)
103 S X=^LRO(68,LRAA,1,LRAD,1,0)
104 S LRTMP=$P(X,"^",1,2)_"^"_(LRAN-1)_"^"_($P(X,"^",4)-1)
105 S ^LRO(68,LRAA,1,LRAD,1,0)=LRTMP
106 L -^LRO(68,LRAA)
107 F A=1,2,3,4 D
108 .I $D(^LRO(69.2,LRAA,A,LRAN)) K ^(LRAN) D
109 ..S X(1)=$O(^LRO(69.2,LRAA,A,0)) S:'X(1) X(1)=0
110 ..I $D(^LRO(69.2,LRAA,A,0)) D
111 ...L +^LRO(69.2,LRAA,A)
112 ...S X=^LRO(69.2,LRAA,A,0)
113 ...S LRTMP=$P(X,"^",1,2)_"^"_X(1)_"^"_$S(X(1)=0:X(1),1:($P(X,"^",4)-1))
114 ...S ^LRO(69.2,LRAA,A,0)=LRTMP
115 ...L -^LRO(69.2,LRAA,A)
116 Q
117HELP ;
118 W $C(7),!!,"Please do not exit EDIT with an ""^""."
119 W !,"Press RETURN key repeatedly to complete the edit.",!!
120 Q
121END ;
122 D V^LRU
123 Q
Note: See TracBrowser for help on using the repository browser.