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

BHSSKIN.m

Go to the documentation of this file.
BHSSKIN ; IHS/TUCSON/LAB -- SUMMARY PRODUCTION COMPONENTS ;27-May-2008 14:22;MGH
 ;;1.0;HEALTH SUMMARY COMPONENTS;**1,2**;March 17,2006
 ;===================================================================
 ;Taken from APCHS2E
 ;IHS RPMS/PCC Health Summary;**11,14**;JUN 24, 1997
 ;
SKIN ; ******************* EP; SKIN TESTS - ALL * 9000010.12 *******
 ; <SETUP>
 N BHSPAT
 S BHSPAT=DFN
 Q:'$D(^AUPNVSK("AA",BHSPAT))
 D CKP^GMTSUP Q:$D(GMTSQIT)
 ; <DISPLAY>
 S BHST="" F BHSQ=0:0 S BHST=$O(^AUPNVSK("AA",BHSPAT,BHST)) Q:BHST=""  S BHSTX=$P(^AUTTSK(BHST,0),U,1),BHSTL=$L(BHSTX) D CKP^GMTSUP Q:$D(GMTSQIT)  D SKDSP
 ; <CLEANUP>
SKINX K BHST,BHSTX,BHSTL,BHSIVD,BHSDFN,BHSRDG,BHSVDF,BHSDAT,X,Y
 K BHSNFL,BHSNSH,BHSNAB,BHSVSC,BHSITE
 Q
SKDSP W ! D CKP^GMTSUP Q:$D(GMTSQIT)  W BHSTX S BHSIVD="" F BHSQ=0:0 S BHSIVD=$O(^AUPNVSK("AA",BHSPAT,BHST,BHSIVD)) Q:BHSIVD=""  D SKDSP1
 Q
SKDSP1 S X=-BHSIVD\1+9999999 D REGDT4^GMTSU S BHSDAT=X
 S BHSDFN=0 F BHSQ=0:0 S BHSDFN=$O(^AUPNVSK("AA",BHSPAT,BHST,BHSIVD,BHSDFN)) Q:'BHSDFN  D SKDSP2
 Q
SKDSP2 S X=-BHSIVD\1+9999999 D REGDT4^GMTSU S BHSDAT=X
 Q:'$D(^AUPNVSK(BHSDFN,0))
 S BHSVDF=$P(^AUPNVSK(BHSDFN,0),U,3) D GETSITEV^BHSUTL S BHSITE=BHSNSH
 S BHSRDG=$P(^AUPNVSK(BHSDFN,0),U,5)
 I BHSRDG]"" S BHSRDG=$J(BHSRDG,2)_" mm"
 I BHSRDG="" S BHSRDG=$P(^AUPNVSK(BHSDFN,0),U,4) I BHSRDG]"" S BHSRDG=" "_$$VAL^XBDIQ1(9000010.12,BHSDFN,.04)
 I BHSRDG="" S BHSRDG="unrep"
 D CKP^GMTSUP Q:$D(GMTSQIT)  W:GMTSNPG BHSTX W ?15,BHSDAT,?26,BHSRDG,?42,BHSITE,!
 Q
 ;
 ;
SKIN3 ; ******************* ;EP SKIN TESTS - LAST 3 OF EACH * 9000010.12 *******
 ; <SETUP>
 Q:'$D(^AUPNVSK("AA",BHSPAT))
 D CKP^GMTSUP Q:$D(GMTSQIT)
 ; <DISPLAY>
 S BHST="" F BHSQ=0:0 S BHST=$O(^AUPNVSK("AA",BHSPAT,BHST)) Q:BHST=""  S BHSTX=$P(^AUTTSK(BHST,0),U,1),BHSTL=$L(BHSTX) D CKP^GMTSUP Q:$D(GMTSQIT)  D SKDSP3
 ; <CLEANUP>
SKIN3X K BHST,BHSTX,BHSTL,BHSIVD,BHSDFN,BHSRDG,BHSVDF,BHSDAT,BHSCNT,BHS,X,Y
 K BHSNFL,BHSNSH,BHSNAB,BHSVSC,BHSITE,BHSQ
 Q
SKDSP3 ;get skin type
 S BHSCNT=0
 W ! D CKP^GMTSUP Q:$D(GMTSQIT)  W BHSTX S BHSIVD="" F BHSQ=0:0 S BHSIVD=$O(^AUPNVSK("AA",BHSPAT,BHST,BHSIVD)) S BHSCNT=BHSCNT+1 Q:BHSIVD=""!(BHSCNT>3)  D SKDSP13
 Q
SKDSP13 ;get skin test DFN
 S X=-BHSIVD\1+9999999 D REGDT4^GMTSU S BHSDAT=X
 S BHSDFN=0 F BHSQ=0:0 S BHSDFN=$O(^AUPNVSK("AA",BHSPAT,BHST,BHSIVD,BHSDFN)) Q:'BHSDFN!(BHSCNT>3)  D SKDSP23
 Q
SKDSP23 ;compile data & display skin test
 S X=-BHSIVD\1+9999999 D REGDT4^GMTSU S BHSDAT=X
 Q:'$D(^AUPNVSK(BHSDFN,0))
 S BHSVDF=$P(^AUPNVSK(BHSDFN,0),U,3) D GETSITEV^BHSUTL S BHSITE=BHSNSH
 S BHSRDG=$P(^AUPNVSK(BHSDFN,0),U,5)
 I BHSRDG]"" S BHSRDG=$J(BHSRDG,2)_" mm"
 I BHSRDG="" S BHSRDG=$P(^AUPNVSK(BHSDFN,0),U,4) I BHSRDG]"" S BHSRDG=" "_$$VAL^XBDIQ1(9000010.12,BHSDFN,.04)
 I BHSRDG="" S BHSRDG="unrep"
 D CKP^GMTSUP Q:$D(GMTSQIT)  W:GMTSNPG BHSTX W ?15,BHSDAT,?24,BHSRDG,?40,BHSITE,!
 Q