source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSLRC.m@ 1800

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1GMTSLRC ; SLC/JER,KER - Chemistry & Hematology Comp Dvr ; 01/06/2003
2 ;;2.7;Health Summary;**28,47,58**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 525 ^LR( all fields
6 ; DBIA 10035 ^DPT( field 63 Read w/Fileman
7 ; DBIA 2056 $$GET1^DIQ (file 2)
8 ;
9MAIN ; Chemisty and Hematology
10 N GMCFLAG,GMCMNT,IX0,IX,LRDFN,MAX,CNT,PTR,RWIDTH
11 S LRDFN=+($$GET1^DIQ(2,(+($G(DFN))_","),63,"I")) Q:+LRDFN=0 Q:'$D(^LR(LRDFN))
12 I $D(GMTSNDM),(GMTSNDM>0) S MAX=GMTSNDM
13 E S MAX=999
14 S RWIDTH=8 ;Optional variable used in ^GMTSLRCE
15 D ^GMTSLRCE
16 I '$D(^TMP("LRC",$J)) Q
17 D WRTHDR S GMCMNT=$S($P($G(^GMT(142.99,1,0)),U,3)="Y":1,1:0)
18 S IX=GMTS1 F IX0=1:1:MAX S IX=$O(^TMP("LRC",$J,IX)) Q:IX=""!(IX>GMTS2) S (PTR,CNT)=0 F S PTR=$O(^TMP("LRC",$J,IX,PTR)) Q:PTR="" S CNT=CNT+1 D WRT
19 I +$G(GMCFLAG) D
20 . D CKP^GMTSUP Q:$D(GMTSQIT) W !
21 . D CKP^GMTSUP Q:$D(GMTSQIT) W "!! Indicates COMMENTS AVAILABLE...Refer to Interim Lab Report.",!
22 K ^TMP("LRC",$J)
23 Q
24WRTHDR ; Prints columnar header
25 D CKP^GMTSUP Q:$D(GMTSQIT) W "Collection DT",?18,"Specimen",?29
26 W "Test Name",?48,"Result",?58,"Units",?68,"Ref Range",!
27 W:'$D(GMTSOBJ) !
28 S GMTSNPG=1
29 Q
30WRT ; Writes Chemistry & Hematology Component
31 N GMI,GMX,GMTSI
32 I PTR="C",'+$G(GMCMNT) Q
33 I PTR="C",($D(^TMP("LRC",$J,IX,"C"))>9),+$G(GMCMNT) D Q
34 . S GMI=0 F S GMI=$O(^TMP("LRC",$J,IX,"C",GMI)) Q:GMI'>0 D
35 . . D CKP^GMTSUP Q:$D(GMTSQIT) W "Comment: ",^TMP("LRC",$J,IX,"C",GMI),!
36 S GMX=^TMP("LRC",$J,IX,PTR)
37 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG WRTHDR
38 W:CNT=1!(GMTSNPG) $P(GMX,U),?18,$E($P(GMX,U,2),1,10)
39 W:CNT>1&'(GMTSNPG) ?3,"""",?12,"""",?20,""""
40 I $D(^TMP("LRC",$J,IX,"C"))>9,'+$G(GMCMNT) W ?24,"!! " S GMCFLAG=1
41 W ?29,$E($P(GMX,U,3),1,17),?46,$P(GMX,U,4)," ",$P(GMX,U,5)
42 W ?58,$P(GMX,U,6)
43 S GMTSI=$P(GMX,U,8) S:GMTSI="NEGATIVE" GMTSI="NEG"
44 W ?68,$J($P(GMX,U,7),4),?73,"-",?74,$J(GMTSI,4),!
45 Q
Note: See TracBrowser for help on using the repository browser.