source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPXXP.m

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1GMTSPXXP ; SLC/SBW,KER - PCE Examination Comp ; 08/27/2002
2 ;;2.7;Health Summary;**8,10,28,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 3063 EXAM^PXRHS05
6 ; DBIA 10011 ^DIWP
7 ;
8MRE ; Most Recent Examination
9 K ^TMP("PXE",$J)
10 N MAX S MAX=1
11 ;
12 ; This routine could be expanded to included
13 ; occurrence limits by setting max to GMTSNDM
14 ; and enabling occurrence limit for the
15 ; component. Component name would have to
16 ; change also.
17 ;
18 D EXAM^PXRHS05(DFN,GMTSEND,GMTSBEG,MAX) Q:'$D(^TMP("PXE",$J))
19 N GMEXAM,GMDT,GMIFN,GMW,GMSITE,GMN0,GMN1,X,GMTSDAT,EXAM,RESULT
20 N COMMENT,GMICL,GMTAB,GMTSLN
21 S GMEXAM="" D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
22 F S GMEXAM=$O(^TMP("PXE",$J,GMEXAM)) Q:GMEXAM="" D Q:$D(GMTSQIT)
23 . S (GMDT,GMW)=0
24 . F S GMDT=$O(^TMP("PXE",$J,GMEXAM,GMDT)) Q:GMDT'>0 D Q:$D(GMTSQIT)
25 . . S GMIFN=0
26 . . F S GMIFN=$O(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN)) Q:GMIFN'>0 D EXAMDSP Q:$D(GMTSQIT)
27 K ^TMP("PXE",$J)
28 Q
29HDR ; Header
30 W ?5,"Exam",?32,"Result",?47,"Date",?55,"Facility",!!
31 Q
32EXAMDSP ; Display Exam Data
33 S GMN0=$G(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN,0)) Q:GMN0']""
34 S GMN1=$G(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN,1))
35 S GMSITE=$S($P(GMN1,U,3)]"":$E($P(GMN1,U,3),1,10),$P(GMN1,U,4)]"":$E($P(GMN1,U,4),1,10),1:"No Site")
36 S X=$P(GMN0,U,2) D REGDT4^GMTSU S GMTSDAT=X
37 S EXAM=$P(GMN0,U),RESULT=$P(GMN0,U,4)
38 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR W:GMW'>0!GMTSNPG EXAM
39 W ?32,RESULT,?45,GMTSDAT,?57,GMSITE,!
40 S COMMENT=$P($G(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN,"COM")),U)
41 I COMMENT]"" S GMICL=13,GMTAB=2 D FORMAT I $D(^UTILITY($J,"W")) D
42 . F GMTSLN=1:1:^UTILITY($J,"W",DIWL) D LINE Q:$D(GMTSQIT)
43 S GMW=1
44 Q
45FORMAT ; Format Line
46 N DIWR,DIWF,X S DIWL=3,DIWR=80-(GMICL+GMTAB) K ^UTILITY($J,"W")
47 S X=COMMENT D ^DIWP
48 Q
49LINE ; Write Line
50 D CKP^GMTSUP Q:$D(GMTSQIT) W ?13,^UTILITY($J,"W",DIWL,GMTSLN,0),!
51 Q
Note: See TracBrowser for help on using the repository browser.