GMTSPXXP ; SLC/SBW,KER - PCE Examination Comp ; 08/27/2002
;;2.7;Health Summary;**8,10,28,56**;Oct 20, 1995
;
; External References
; DBIA 3063 EXAM^PXRHS05
; DBIA 10011 ^DIWP
;
MRE ; Most Recent Examination
K ^TMP("PXE",$J)
N MAX S MAX=1
;
; This routine could be expanded to included
; occurrence limits by setting max to GMTSNDM
; and enabling occurrence limit for the
; component. Component name would have to
; change also.
;
D EXAM^PXRHS05(DFN,GMTSEND,GMTSBEG,MAX) Q:'$D(^TMP("PXE",$J))
N GMEXAM,GMDT,GMIFN,GMW,GMSITE,GMN0,GMN1,X,GMTSDAT,EXAM,RESULT
N COMMENT,GMICL,GMTAB,GMTSLN
S GMEXAM="" D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
F S GMEXAM=$O(^TMP("PXE",$J,GMEXAM)) Q:GMEXAM="" D Q:$D(GMTSQIT)
. S (GMDT,GMW)=0
. F S GMDT=$O(^TMP("PXE",$J,GMEXAM,GMDT)) Q:GMDT'>0 D Q:$D(GMTSQIT)
. . S GMIFN=0
. . F S GMIFN=$O(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN)) Q:GMIFN'>0 D EXAMDSP Q:$D(GMTSQIT)
K ^TMP("PXE",$J)
Q
HDR ; Header
W ?5,"Exam",?32,"Result",?47,"Date",?55,"Facility",!!
Q
EXAMDSP ; Display Exam Data
S GMN0=$G(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN,0)) Q:GMN0']""
S GMN1=$G(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN,1))
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")
S X=$P(GMN0,U,2) D REGDT4^GMTSU S GMTSDAT=X
S EXAM=$P(GMN0,U),RESULT=$P(GMN0,U,4)
D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR W:GMW'>0!GMTSNPG EXAM
W ?32,RESULT,?45,GMTSDAT,?57,GMSITE,!
S COMMENT=$P($G(^TMP("PXE",$J,GMEXAM,GMDT,GMIFN,"COM")),U)
I COMMENT]"" S GMICL=13,GMTAB=2 D FORMAT I $D(^UTILITY($J,"W")) D
. F GMTSLN=1:1:^UTILITY($J,"W",DIWL) D LINE Q:$D(GMTSQIT)
S GMW=1
Q
FORMAT ; Format Line
N DIWR,DIWF,X S DIWL=3,DIWR=80-(GMICL+GMTAB) K ^UTILITY($J,"W")
S X=COMMENT D ^DIWP
Q
LINE ; Write Line
D CKP^GMTSUP Q:$D(GMTSQIT) W ?13,^UTILITY($J,"W",DIWL,GMTSLN,0),!
Q
GMTSPXXP ; SLC/SBW,KER - PCE Examination Comp ; 08/27/2002
+1 ;;2.7;Health Summary;**8,10,28,56**;Oct 20, 1995
+2 ;
+3 ; External References
+4 ; DBIA 3063 EXAM^PXRHS05
+5 ; DBIA 10011 ^DIWP
+6 ;
MRE ; Most Recent Examination
+1 KILL ^TMP("PXE",$JOB)
+2 NEW MAX
SET MAX=1
+3 ;
+4 ; This routine could be expanded to included
+5 ; occurrence limits by setting max to GMTSNDM
+6 ; and enabling occurrence limit for the
+7 ; component. Component name would have to
+8 ; change also.
+9 ;
+10 DO EXAM^PXRHS05(DFN,GMTSEND,GMTSBEG,MAX)
IF '$DATA(^TMP("PXE",$JOB))
QUIT
+11 NEW GMEXAM,GMDT,GMIFN,GMW,GMSITE,GMN0,GMN1,X,GMTSDAT,EXAM,RESULT
+12 NEW COMMENT,GMICL,GMTAB,GMTSLN
+13 SET GMEXAM=""
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
IF GMTSNPG
DO HDR
+14 FOR
SET GMEXAM=$ORDER(^TMP("PXE",$JOB,GMEXAM))
IF GMEXAM=""
QUIT
Begin DoDot:1
+15 SET (GMDT,GMW)=0
+16 FOR
SET GMDT=$ORDER(^TMP("PXE",$JOB,GMEXAM,GMDT))
IF GMDT'>0
QUIT
Begin DoDot:2
+17 SET GMIFN=0
+18 FOR
SET GMIFN=$ORDER(^TMP("PXE",$JOB,GMEXAM,GMDT,GMIFN))
IF GMIFN'>0
QUIT
DO EXAMDSP
IF $DATA(GMTSQIT)
QUIT
End DoDot:2
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
IF $DATA(GMTSQIT)
QUIT
+19 KILL ^TMP("PXE",$JOB)
+20 QUIT
HDR ; Header
+1 WRITE ?5,"Exam",?32,"Result",?47,"Date",?55,"Facility",!!
+2 QUIT
EXAMDSP ; Display Exam Data
+1 SET GMN0=$GET(^TMP("PXE",$JOB,GMEXAM,GMDT,GMIFN,0))
IF GMN0']""
QUIT
+2 SET GMN1=$GET(^TMP("PXE",$JOB,GMEXAM,GMDT,GMIFN,1))
+3 SET GMSITE=$SELECT($PIECE(GMN1,U,3)]"":$EXTRACT($PIECE(GMN1,U,3),1,10),$PIECE(GMN1,U,4)]"":$EXTRACT($PIECE(GMN1,U,4),1,10),1:"No Site")
+4 SET X=$PIECE(GMN0,U,2)
DO REGDT4^GMTSU
SET GMTSDAT=X
+5 SET EXAM=$PIECE(GMN0,U)
SET RESULT=$PIECE(GMN0,U,4)
+6 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
IF GMTSNPG
DO HDR
IF GMW'>0!GMTSNPG
WRITE EXAM
+7 WRITE ?32,RESULT,?45,GMTSDAT,?57,GMSITE,!
+8 SET COMMENT=$PIECE($GET(^TMP("PXE",$JOB,GMEXAM,GMDT,GMIFN,"COM")),U)
+9 IF COMMENT]""
SET GMICL=13
SET GMTAB=2
DO FORMAT
IF $DATA(^UTILITY($JOB,"W"))
Begin DoDot:1
+10 FOR GMTSLN=1:1:^UTILITY($JOB,"W",DIWL)
DO LINE
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
+11 SET GMW=1
+12 QUIT
FORMAT ; Format Line
+1 NEW DIWR,DIWF,X
SET DIWL=3
SET DIWR=80-(GMICL+GMTAB)
KILL ^UTILITY($JOB,"W")
+2 SET X=COMMENT
DO ^DIWP
+3 QUIT
LINE ; Write Line
+1 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
WRITE ?13,^UTILITY($JOB,"W",DIWL,GMTSLN,0),!
+2 QUIT