source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSLRS.m@ 1336

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1GMTSLRS ; SLC/JER,KER - Sel Lab Component w/Selection Items ; 01/06/2003
2 ;;2.7;Health Summary;**16,28,47,58**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 67 ^LAB(60
6 ; DBIA 525 ^LR( all fields
7 ; DBIA 10035 ^DPT( field 63 Read w/Fileman
8 ; DBIA 2056 $$GET1^DIQ (file 2)
9 ;
10MAIN ; Selected Lab w/Selection Items
11 N GMTSI,GMW,GMX,LRDFN,MAX,IT,IX,PTEST,TEST,BEGIN,END,CNT,RWIDTH,GMLINE,GMCMNT,GMCFLAG
12 S RWIDTH=8,LRDFN=+($$GET1^DIQ(2,(+($G(DFN))_","),63,"I")) Q:+LRDFN=0 Q:'$D(^LR(LRDFN))
13 S MAX=$S(+($G(GMTSNDM))>0:+($G(GMTSNDM)),1:999) Q:'$O(GMTSEG(GMTSEGN,60,0))
14 S GMCMNT=$S($P($G(^GMT(142.99,1,0)),U,3)="Y":1,1:0)
15 S GMTSI=0 F S GMTSI=$O(GMTSEG(GMTSEGN,60,GMTSI)) Q:GMTSI'>0 D Q:$D(GMTSQIT)
16 . S (PTEST,TEST)=GMTSEG(GMTSEGN,60,GMTSI)
17 . D @$S($L($P(^LAB(60,TEST,0),U,5)):"^GMTSLRSE",1:"PANEL")
18 Q:'$D(^TMP("LRS",$J)) D WRTHDR Q:$D(GMTSQIT)
19 S IT=0 F S IT=$O(^TMP("LRS",$J,IT)) Q:+IT'>0 D Q:$D(GMTSQIT)
20 . S IX="" F S IX=$O(^TMP("LRS",$J,IT,IX)) Q:'IX!(IX>GMTS2) D Q:$D(GMTSQIT)
21 . . S GMX=^TMP("LRS",$J,IT,IX) D WRT
22 I +$G(GMCFLAG) D
23 . D CKP^GMTSUP Q:$D(GMTSQIT) W !
24 . D CKP^GMTSUP Q:$D(GMTSQIT)
25 . W "!! Indicates COMMENTS AVAILABLE...Refer to Interim Lab Report.",!
26 K ^TMP("LRS",$J)
27 Q
28PANEL ; Visits "PANEL" multiple to get pointers to atomic tests
29 N TEST,GMW,INDX
30 S INDX=0 F S INDX=$O(^LAB(60,PTEST,2,INDX)) Q:'INDX S TEST=^(INDX,0) S:'$L($P(^LAB(60,TEST,0),U,5)) PTEST=TEST D @$S($L($P(^LAB(60,TEST,0),U,5)):"^GMTSLRSE",1:"PANEL")
31 Q
32WRTHDR ; Prints columnar header
33 D CKP^GMTSUP Q:$D(GMTSQIT) W "Collection DT",?18,"Specimen"
34 W ?29,"Test Name",?48,"Result",?58,"Units",?68,"Ref Range",!
35 W:'$D(GMTSOBJ) !
36 Q
37WRT ; Writes the Lab Record
38 D CKP^GMTSUP Q:$D(GMTSQIT) D
39 . D:GMTSNPG WRTHDR N GMTSI
40 . W $P(GMX,U),?18,$P($P(GMX,U,2),";",2)
41 . I $D(^TMP("LRS",$J,"C",IX))>9,'+$G(GMCMNT) W ?24,"!! " S GMCFLAG=1
42 . S GMTSI=$P(GMX,U,8) S:GMTSI="NEGATIVE" GMTSI="NEG"
43 . W ?29,$E($P($P(GMX,U,3),";",2),1,17),?46,$P(GMX,U,4)," ",$P(GMX,U,5)
44 . W ?58,$P(GMX,U,6),?68,$J($P(GMX,U,7),4),?73,"-",?74,$J(GMTSI,4),!
45 I +$G(GMCMNT),$D(^TMP("LRS",$J,"C",IX))>9,'$D(^TMP("LRS",$J,+$O(^TMP("LRS",$J,IT)),IX)) D Q
46 . S GMLINE=0
47 . F S GMLINE=$O(^TMP("LRS",$J,"C",IX,GMLINE)) Q:GMLINE'>0 D
48 . . D CKP^GMTSUP Q:$D(GMTSQIT)
49 . . W "Comment: ",^TMP("LRS",$J,"C",IX,GMLINE),!
50 Q
Note: See TracBrowser for help on using the repository browser.