Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMTSPXSK

GMTSPXSK.m

Go to the documentation of this file.
GMTSPXSK ; SLC/SBW,KER - PCE Skin Test comp ; 08/27/2002
 ;;2.7;Health Summary;**8,10,28,56**;Oct 20, 1995
 ;
 ; External References
 ;   DBIA  1240  SKIN^PXRHS04
 ;   DBIA 10011  ^DIWP
 ;                      
SKIN ; Main Entry Point
 K ^TMP("PXS",$J) D SKIN^PXRHS04(DFN) Q:'$D(^TMP("PXS",$J))
 D CKP^GMTSUP Q:$D(GMTSQIT)  D HDR
 N GMSK,GMDT,GMIFN,GMW,GMSITE,GMSKIN,GMN0,GMN1,GMRDG,X,GMTSDAT,GMRES
 N COMMENT,GMICL,GMRDT,GMTSLN,GMTAB S GMSK=""
 F  S GMSK=$O(^TMP("PXS",$J,GMSK)) Q:GMSK=""  D  Q:$D(GMTSQIT)
 . S (GMDT,GMW)=0
 . F  S GMDT=$O(^TMP("PXS",$J,GMSK,GMDT)) Q:GMDT'>0  D  Q:$D(GMTSQIT)
 . . S GMIFN=0
 . . F  S GMIFN=$O(^TMP("PXS",$J,GMSK,GMDT,GMIFN)) Q:GMIFN'>0  D SKINDSP Q:$D(GMTSQIT)
 K ^TMP("PXS",$J)
 Q
HDR ; Display Header
 W ?38," -  Date  - ",!
 W "Skin Test",?15,"Reading",?24,"Results",?37,"Admin.",?45,"Reading",?60,"Facility",!!
 Q
SKINDSP ; Display Skin Test Data
 S GMN0=$G(^TMP("PXS",$J,GMSK,GMDT,GMIFN,0)) Q:GMN0']""
 S GMN1=$G(^TMP("PXS",$J,GMSK,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 GMSKIN=$P(GMN0,U),GMRDG=$P(GMN0,U,5)
 S X=$P(GMN0,U,6) D REGDT4^GMTSU S GMRDT=X
 I GMRDG]"" S GMRDG=$J(GMRDG,2)_" mm"
 S GMRES=$P(GMN0,U,4)
 I GMRDG']"",GMRES']"" S GMRES="UNREPORTED"
 D CKP^GMTSUP Q:$D(GMTSQIT)  D:GMTSNPG HDR W:GMW'>0!GMTSNPG GMSKIN W ?15,GMRDG,?24,GMRES,?35,GMTSDAT,?47,GMRDT,?62,$E(GMSITE,1,17),!
 S COMMENT=$P($G(^TMP("PXS",$J,GMSK,GMDT,GMIFN,"COM")),U)
 I COMMENT]"" S GMICL=15,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 ?15,^UTILITY($J,"W",DIWL,GMTSLN,0),!
 Q