source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSLRPE.m@ 837

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1GMTSLRPE ; SLC/JER,KER - Cytopathology Extract Routine ; 08/27/2002
2 ;;2.7;Health Summary;**3,28,37,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 525 ^LR(
6 ; DBIA 529 ^LAB(61.1 0;1
7 ; DBIA 526 ^LAB(61.2 0;1
8 ; DBIA 10133 ^LAB(61.4 0;1
9 ; DBIA 10134 ^LAB(61.5 0;1
10 ; DBIA 2056 $$GET1^DIQ (file #61.1, 61.2, 61.4, and 61.5)
11 ;
12XTRCT ; Extract
13 N IX0,IX K ^TMP("LRCY",$J) S IX=GMTS1
14 F IX0=1:0:MAX S IX=$O(^LR(LRDFN,"CY",IX)) Q:IX'>0!(IX>GMTS2) D CYSET
15 Q
16CYSET ; Sets ^TMP("LRCY",$J, with appropriate data elements
17 N ACC,CDT,D1,D2,D3,DA,DIC,DIQ,DR,DX,ICD,OT,SR,RELEASE,SITE,SN,X,YR
18 S CDT=$P(^LR(LRDFN,"CY",IX,0),U),ACC=$P(^(0),U,6),RELEASE=$P(^(0),U,11)
19 I $D(ACC) S IX0=IX0+1
20 S X=CDT D REGDT4^GMTSU S CDT=X K X
21 S ^TMP("LRCY",$J,IX,0)=CDT_U_ACC
22 I $D(^LR(LRDFN,"CY",IX,.1)) S ^TMP("LRCY",$J,IX,1)="Site/Specimen"_U_RELEASE
23 Q:'RELEASE
24 S SN=0 F S SN=$O(^LR(LRDFN,"CY",IX,.1,SN)) Q:SN'>0 S ^TMP("LRCY",$J,IX,1,SN)=$P(^LR(LRDFN,"CY",IX,.1,SN,0),U)
25 S OT=0 F S OT=$O(^LR(LRDFN,"CY",IX,.2,OT)) Q:+OT'>0 S ^TMP("LRCY",$J,IX,"AH",OT)=$G(^LR(LRDFN,"CY",IX,.2,OT,0))
26 S OT=0 F S OT=$O(^LR(LRDFN,"CY",IX,1,OT)) Q:OT'>0 S ^TMP("LRCY",$J,IX,"G",OT)=^LR(LRDFN,"CY",IX,1,OT,0)
27 S OT=0 F S OT=$O(^LR(LRDFN,"CY",IX,1.1,OT)) Q:OT'>0 S ^TMP("LRCY",$J,IX,"MI",OT)=^LR(LRDFN,"CY",IX,1.1,OT,0)
28 S OT=0 F S OT=$O(^LR(LRDFN,"CY",IX,1.2,OT)) Q:OT'>0 D
29 . Q:+$P($G(^LR(LRDFN,"CY",IX,1.2,OT,0)),U,2)'>0
30 . S ^TMP("LRCY",$J,IX,"SR",OT,0)=$P($G(^LR(LRDFN,"CY",IX,1.2,OT,0)),U)
31 . S SR=0 F S SR=$O(^LR(LRDFN,"CY",IX,1.2,OT,1,SR)) Q:SR'>0 D
32 . . S ^TMP("LRCY",$J,IX,"SR",OT,SR)=$P($G(^LR(LRDFN,"CY",IX,1.2,OT,1,SR,0)),U)
33 S OT=0 F S OT=$O(^LR(LRDFN,"CY",IX,1.4,OT)) Q:+OT'>0 S ^TMP("LRCY",$J,IX,"NDX",OT)=$P($G(^LR(LRDFN,"CY",IX,1.4,OT,0)),U)
34 Q
35D ; Get Disease Field data
36 N GMI,GMD,DIS S GMD=0 F S GMD=$O(^LR(LRDFN,"CY",IX,2,OT,1,GMD)) Q:GMD="" D
37 . S GMI=+^LR(LRDFN,"CY",IX,2,OT,1,GMD,0)
38 . S ^TMP("LRCY",$J,IX,"OT"_OT,"D"_GMD)=$$GET1^DIQ(61.4,GMI,.01,"I")
39 Q
40M ; Get Morphology Field data
41 N GMI,GMM,MORPH S GMM=0 F S GMM=$O(^LR(LRDFN,"CY",IX,2,OT,2,GMM)) Q:GMM="" D
42 . S GMI=+^LR(LRDFN,"CY",IX,2,OT,1,GMD,0)
43 . S ^TMP("LRCY",$J,IX,"OT"_OT,"M"_GMM)=$$GET1^DIQ(61.1,GMI,.01,"I")
44 . D E
45 Q
46E ; Get Etiology Field data
47 N GMI,GME,ETIOL S GME=0 F S GME=$O(^LR(LRDFN,"CY",IX,2,OT,2,GMM,1,GME)) Q:GME'>0 D
48 . S GMI=+^LR(LRDFN,"CY",IX,2,OT,2,GMM,1,GME,0)
49 . S ^TMP("LRCY",$J,IX,"OT"_OT,"M"_GMM,"E"_GME)=$$GET1^DIQ(61.2,GMI,.01,"I")
50 Q
51P ; Get Procedure Field data
52 N GMI,GMP,PROC S GMP=0 F S GMP=$O(^LR(LRDFN,"CY",IX,2,OT,4,GMP)) Q:GMP="" D
53 . S GMI=+^LR(LRDFN,"CY",IX,2,OT,4,GMP,0)
54 . S ^TMP("LRCY",$J,IX,"OT"_OT,"P"_GMP)=$$GET1^DIQ(61.5,GMI,.01,"I")
55 Q
Note: See TracBrowser for help on using the repository browser.