source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRARCML1.m@ 846

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1LRARCML1 ;DALISC/CKA - ARCHIVED WKLD COST REP BY MAJ SCTN; 5/22/95
2 ;;5.2;LAB SERVICE;**59**;Aug 31, 1995
3 ;same as LRCAPML1 except archived wkld file
4EN ;
5 D INITMAN^LRARCMR1
6 S LRGETIN=$S(LRIN:0,1:1)
7 F D BUILD Q:(LREND)!('LRLOOP)!(LRBLDONE)
8 Q
9BUILD ; BUILD DATA SUBSET IN ^TMP
10 D GTIN
11 I 'LRIN S LRBLDONE=1 Q
12 S (LRAPIGT,LRAPIGTU,LRCPIGT,LRCPIGTU)=0
13 S LRCDT=LRCDTB-1
14 F S LRCDT=$O(^LAR(64.19999,LRIN,1,"B",LRCDT)) Q:(LRCDT>LRCDTE)!(LRCDT<1) D
15 . S LRCDTN=0,LRCDTN=$O(^LAR(64.19999,LRIN,1,"B",LRCDT,LRCDTN))
16 . D DATCOM^LRARCMR1
17 . W:$E(IOST,1,2)="C-" "."
18 . S LRCC=""
19 . F S LRCC=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,"B",LRCC)) Q:(LRCC="") D CC
20 S LRGTOTS=$G(^TMP("LRAR-WL",$J,0))
21 S $P(LRGTOTS,U)=$P(LRGTOTS,U)+LRAPIGT+LRCPIGT
22 S $P(LRGTOTS,U,2)=$P(LRGTOTS,U,2)+LRAPIGTU+LRCPIGTU
23 S ^TMP("LRAR-WL",$J,0)=LRGTOTS
24 S LRGTOTS=$G(^TMP("LRAR-WL",$J,"DIV","AP",LRIN,0))
25 S $P(LRGTOTS,U)=$P(LRGTOTS,U)+LRAPIGT
26 S $P(LRGTOTS,U,2)=$P(LRGTOTS,U,2)+LRAPIGTU
27 S ^TMP("LRAR-WL",$J,"DIV","AP",LRIN,0)=LRGTOTS
28 S LRGTOTS=$G(^TMP("LRAR-WL",$J,"DIV","CP",LRIN,0))
29 S $P(LRGTOTS,U)=$P(LRGTOTS,U)+LRCPIGT
30 S $P(LRGTOTS,U,2)=$P(LRGTOTS,U,2)+LRCPIGTU
31 S ^TMP("LRAR-WL",$J,"DIV","CP",LRIN,0)=LRGTOTS
32 Q
33CC ;
34 S LRCCN=0,LRCCN=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,"B",LRCC,LRCCN))
35 S LRCCZ=$P(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,0),U)
36 S:$E(LRCCZ)="+" LRCCZ=$E(LRCCZ,2,99)
37 S LRCAPNUM=$$WKLDCODE^LRARCU(LRCCZ)
38 S LRCAPNAM=$$WKLDNAME^LRARCU(LRCAPIFN)
39 D BMPMANL^LRARCMR1
40 S LRCTM=$S(LRCTMB=0:"",1:LRCTMB-.001),LRFIRST=1
41 F S LRCTM=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,"B",LRCTM)) Q:(LRCTM>LRCTME)!(LRCTM="") S LRCTMN=0,LRCTMN=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,"B",LRCTM,LRCTMN)) D TM
42 Q
43TM ;
44 Q:'($D(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,LRCTMN,0))#2) S LRX=^(0),LRX4=$G(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,LRCTMN,4))
45 S LRMA=$P(LRX,U,5),X=LRMA D GETA S LRMA=+Y
46 I LRAA Q:'$D(LRAA(LRMA))
47 S LRUC=+$P(LRX,U,3),LRLDIV=$P(LRX,U,4),LRLSS=$P(LRX,U,6),LRSPEC=+$P(LRX4,U)
48 S:LRLDIV="ANATOMIC PATHOLOGY" LRLDIV="AP"
49 S:LRLDIV="CLINICAL PATHOLOGY" LRLDIV="CP"
50 S:'LRUC LRUC=1
51 S LRUW=+$P($G(^LAM(LRCAPIFN,0)),U,10),LRFIRST=0 S LRUWSP=+$P($G(^LAM(LRCAPIFN,5,LRSPEC,0)),U,2) S:LRUWSP LRUW=LRUWSP_"*" K LRUWSP
52 S LRWC=LRUC*LRUW
53 ;
54 ;
55 I +LRMA D
56 . S LRREC=$G(^LRO(68,LRMA,0))
57 . S LRMAA=$S($P(LRREC,U,11)]"":$P(LRREC,U,11),1:LRNDFN)
58 . S LRMAN=$S($P(LRREC,U)]"":$P(LRREC,U),1:LRNDFN)
59 . S LRMAN(LRMAA)=LRMAN
60 I '+LRMA S (LRMAA,LRMAN)=LRNDFN,LRMAN(LRMAA)=LRMAN
61 I LRLSS]"" D
62 . S X=LRLSS D GETA S LRLSS=+Y
63 . Q:'+LRLSS
64 . S LRREC=$G(^LRO(68,LRLSS,0))
65 . S LRLSSA=$S($P(LRREC,U,11)]"":$P(LRREC,U,11),1:LRNDFN)
66 . S LRLSSN=$S($P(LRREC,U)]"":$P(LRREC,U),1:LRNDFN)
67 . S LRLSSN(LRLSSA)=LRLSSN
68 I '+LRLSS S (LRLSSA,LRLSSN)=LRNDFN,LRLSSN(LRLSSA)=LRLSSN
69 ;
70 ;
71 I $D(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCAPNAM))#2 S LRX=^(LRCAPNAM),LRX1=LRUC+$P(LRX,"^"),LRX2=LRWC+$P(LRX,"^",2),^(LRCAPNAM)=LRX1_"^"_LRX2_"^"_LRUW_"^"_LRCAPNUM
72 E S ^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCAPNAM)=LRUC_"^"_LRWC_"^"_LRUW_"^"_LRCAPNUM
73 I LRLDIV="AP" S LRAPIGT=LRAPIGT+LRWC,LRAPIGTU=LRAPIGTU+LRUC
74 E S LRCPIGT=LRCPIGT+LRWC,LRCPIGTU=LRCPIGTU+LRUC
75 I $D(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))#2 S LRX1=+$P(^(0),"^")+LRWC,LRX2=+$P(^(0),"^",2)+LRUC,^(0)=LRX1_"^"_LRX2
76 E S ^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0)=LRWC_"^"_LRUC
77 I $D(^TMP("LRAR-WL",$J,"AA",LRMAA,LRLSSA,0))#2 S LRX1=+$P(^(0),"^")+LRWC,LRX2=+$P(^(0),"^",2)+LRUC,^(0)=LRX1_"^"_LRX2
78 E S ^TMP("LRAR-WL",$J,"AA",LRMAA,LRLSSA,0)=LRWC_"^"_LRUC
79 Q
80GTIN ;
81 S:LRGETIN LRIN=+$O(^LAR(64.19999,LRIN))
82 S:LRIN LRINN=$S($D(^LAR(64.19999,LRIN,0)):^(0),1:"UNDEFINED")
83 S LRGETIN=1
84 Q
85GETA ;Get pointer value for file 68
86 K DIC S DIC=68,DIC(0)="XMZ"
87 D ^DIC Q:Y=-1
88 Q
Note: See TracBrowser for help on using the repository browser.