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

APCHS11A.m

Go to the documentation of this file.
APCHS11A ; IHS/CMI/LAB -- CONTINUATION OF ROUTINES ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;IHS/CMI/LAB - uncommented age limit on pap smear
 ;
 ;cmi/anch/maw 8/28/2007 code set versioning in PAP
 ;
 ; ******************** SURVEILLANCE - HARD CODE ********************
ENTB ;ENDEMIC TB, I.E. ALASKA
 Q:APCHSAGE'<35
 K APCHSKDT
 I $D(^ATXAX("B","SURVEILLANCE TB")) S APCHSURD=$O(^ATXAX("B","SURVEILLANCE TB","")) Q:$D(^ATXPAT(APCHSURD,11,APCHSPAT))
 S APCHSDIS="TB SKIN TEST"
 S APCHSKN=24 D SKINTEST D:APCHSKND MULTSKIN ;MONO-VAC
 S APCHSKN=21 D SKINTEST D:APCHSKND MULTSKIN ;PPD
 S APCHSKN=20 D SKINTEST D:APCHSKND MULTSKIN ;TINE
 I '$D(APCHSKDT),APCHSAGE'>(10/12) S X1=APCHSDOB,X2=300 D C^%DTC S Y=X X APCHSCVD S APCHSDUE=Y,APCHSDAT="" D DISPLAY^APCHS11 Q
 I '$D(APCHSKDT) S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 S APCHSIVD=$O(APCHSKDT("")),APCHSKD=APCHSKDT(APCHSIVD),APCHSDAT=$P($P(^AUPNVSIT($P(^AUPNVSK(APCHSKD,0),U,3),0),U),".")
 I $P(^AUPNVSK(APCHSKD,0),U,4)'="P" S APCHSINT=365 D GETDATE^APCHS11,COMPARE^APCHS11,DISPLAY^APCHS11
 Q
 ;
NONTB ;NONENDEMIC TB AREAS
 Q:APCHSAGE'<13
 K APCHSKDT
 I $D(^ATXAX("B","SURVEILLANCE TB")) S APCHSURD=$O(^ATXAX("B","SURVEILLANCE TB","")) Q:$D(^ATXPAT(APCHSURD,11,APCHSPAT))
 S APCHSDIS="TB SKIN TEST"
 S APCHSKN=24 D SKINTEST D:APCHSKND MULTSKIN ;MONO-VAC
 S APCHSKN=21 D SKINTEST D:APCHSKND MULTSKIN ;PPD
 S APCHSKN=20 D SKINTEST D:APCHSKND MULTSKIN ;TINE
 I '$D(APCHSKDT),APCHSAGE'>1 S X1=APCHSDOB,X2=360 D C^%DTC S Y=X X APCHSCVD S APCHSDUE=Y,APCHSDAT="" D DISPLAY^APCHS11 Q
 I '$D(APCHSKDT) S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 S APCHSIVD=$O(APCHSKDT("")),APCHSKD=APCHSKDT(APCHSIVD)
 I $P(^AUPNVSK(APCHSKD,0),U,4)="P" Q
 D PASTAGE^APCHS11
 I APCHSOLD<(9/12) S APCHSDUE="MAY BE DUE NOW" D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 I APCHSAGE'<5,APCHSOLD<4 S APCHSDUE="MAY BE DUE NOW" D GETDATE^APCHS11,DISPLAY^APCHS11
 Q
 ;
MULTSKIN ;
 K APCHSDT
 S APCHSDT=$O(^AUPNVSK("AA",APCHSPAT,APCHSKND,"")) I APCHSDT S APCHSKDT(APCHSDT)=$O(^(APCHSDT,""))
 Q
 ;
PAP ;
 K APCHSTP
 Q:APCHSAGE<18!(APCHSEX="M")  ;IHS/CMI/LAB - uncommented
 K APCHSEXD,APCHSDF1
 Q:APCHSEX="M"
 K APCHSTEX
 S APCHSTXN=0
 S APCHSBWR=0 S:$D(X) APCHSAVX=X S X="BWUTL1" X ^%ZOSF("TEST") S:$D(APCHSAVX) X=APCHSAVX K APCHSAVX I $T S APCHSBWR=1
 I APCHSBWR,$D(^BWP(APCHSPAT,0)) S APCHSTXN=APCHSTXN+1,APCHSTEX(APCHSTXN)=$$CNEED^BWUTL1(APCHSPAT) I APCHSTEX(1)="UNKNOWN" K APCHSTEX(1) S APCHSTXN=0
 ;cmi/anch/maw 8/27/2007 mods for code set versioning
 N APCHSVDT
 ;I $D(^AUPNVPRC("AC",APCHSPAT)) S APCHSDF=0 F APCHSLP=0:0 S APCHSDF=$O(^AUPNVPRC("AC",APCHSPAT,APCHSDF)) Q:APCHSDF'=+APCHSDF!($D(APCHSTP))  S APCHSPRC=$P(^ICD0(+^AUPNVPRC(APCHSDF,0),0),U) D PAP2
 I $D(^AUPNVPRC("AC",APCHSPAT)) S APCHSDF=0 F APCHSLP=0:0 S APCHSDF=$O(^AUPNVPRC("AC",APCHSPAT,APCHSDF)) Q:APCHSDF'=+APCHSDF!($D(APCHSTP))  D
 .S APCHSVDT=$P(+^AUPNVSIT($P(^AUPNVPRC(APCHSDF,0),U,3),0),"."),APCHSPRC=$P($$ICDOP^ICDEX(+^AUPNVPRC(APCHSDF,0),APCHSVDT,,"I"),U,2) D PAP2
 ;cmi/anch/maw 8/27/2007 end of mods
 I $D(APCHSTP) S APCHSTXN=APCHSTXN+1,APCHSTEX(APCHSTXN)="Pt had hysterectomy.  Pap may be necessary",APCHSTXN=APCHSTXN+1,APCHSTEX(APCHSTXN)="based on individual followup."
 K APCHSTXN
 S APCHSLAB="PAP SMEAR"
 S APCHSDIS="PAP SMEAR"
 S APCHSINT=365
 D REGLAB^APCHS11
 K APCHSBWR
 Q
 ;
PAP2 ;CHECKS TO SEE IF PATIENT HAD A HYSTERECTOMY
 S:APCHSPRC=68.3!(APCHSPRC=68.4)!(APCHSPRC=68.5)!(APCHSPRC=68.6)!(APCHSPRC=68.7)!(APCHSPRC=68.9) APCHSTP=""
 Q
 ;
BRST ;BREAST EXAM
 K APCHSEXD,APCHSDF1
 Q:APCHSAGE<20!(APCHSEX="M")
 S APCHSEXN="06"
 S APCHSDIS="BREAST EXAM"
 ;---> NEXT LINE DISPLAYS WOMEN'S HEALTH BREAST TX NEED per WOMEN'S HEALTH PACKAGE
 K APCHSTEX
 S APCHSBWR=0 S:$D(X) APCHSAVX=X S X="BWUTL1" X ^%ZOSF("TEST") S:$D(APCHSAVX) X=APCHSAVX K APCHSAVX I $T S APCHSBWR=1
 I APCHSBWR,$D(^BWP(APCHSPAT,0)) S BWDFN=APCHSPAT S APCHSTEX(1)=$$BNEED^BWUTL1(APCHSPAT) K BWDFN I APCHSTEX(1)="UNKNOWN" K APCHSTEX(1)
 S APCHSINT=365
 D REGEXAM^APCHS11
 K APCHSBWR
 Q
 ;
GLUCOSE ;
 K APCHSEXD,APCHSDF1
 I $D(^ATXAX("B","SURVEILLANCE DIABETES")) S APCHSURD=$O(^ATXAX("B","SURVEILLANCE DIABETES","")) Q:$D(^ATXPAT(APCHSURD,11,APCHSPAT))
 Q:APCHSAGE'>20
 S APCHSLAB="GLUCOSE"
 D LABDFN^APCHS11
 Q:'APCHSLBD
 S APCHSDIS="BLOOD GLUCOSE"
 S APCHSINT=365*2
 D REGLAB^APCHS11
 Q
 ;
PELVIC ;
 K APCHSEXD,APCHSDF1,APCHSTEX
 Q:APCHSAGE<18!(APCHSEX="M")
 S APCHSEXN="15"
 S APCHSDIS="PELVIC EXAM"
 S APCHSINT=365
 D REGEXAM^APCHS11
 Q
 ;
MAMGRAM ; MAMMOGRAM
 Q:APCHSEX="M"
 ;---> NEXT LINE DISPLAYS WOMEN'S HEALTH BREAST TX NEED per WOMEN'S HEALTH PACKAGE
 K APCHSTEX
 S APCHSBWR=0 S:$D(X) APCHSAVX=X S X="BWUTL1" X ^%ZOSF("TEST") S:$D(APCHSAVX) X=APCHSAVX K APCHSAVX I $T S APCHSBWR=1
 I APCHSBWR,$D(^BWP(APCHSPAT,0)) S BWDFN=APCHSPAT S APCHSTEX(1)=$$BNEED^BWUTL1(APCHSPAT) K BWDFN I APCHSTEX(1)="UNKNOWN" K APCHSTEX(1)
 I $D(APCHSTEX(1)) G MAM1
 Q:APCHSAGE<50
 Q:APCHSAGE>69
MAM1 K APCHSMDT
 S APCHSDIS="MAMMOGRAM"
 S APCHSMAM=0 F  S APCHSMAM=$O(^RAMIS(71,"D",76090,APCHSMAM)) Q:APCHSMAM=""  D MULTMAM
 S APCHSMAM=0 F  S APCHSMAM=$O(^RAMIS(71,"D",76091,APCHSMAM)) Q:APCHSMAM=""  D MULTMAM
 S APCHSMAM=0 F  S APCHSMAM=$O(^RAMIS(71,"D",76092,APCHSMAM)) Q:APCHSMAM=""  D MULTMAM
 I '$D(APCHSMDT) S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 S APCHSIVD=$O(APCHSMDT("")),APCHSINT=365*2
 D GETDATE^APCHS11,COMPARE^APCHS11
 S APCHSEXD=$O(^RAMIS(71,"D",76090,0)),APCHSDF1=71 D REFDF^APCHS11
 S APCHSEXD=$O(^RAMIS(71,"D",76091,0)),APCHSDF1=71 D REFDF^APCHS11
 S APCHSEXD=$O(^RAMIS(71,"D",76092,0)),APCHSDF1=71 D REFDF^APCHS11
 D DISPLAY^APCHS11
 I '$D(APCHSMDT) S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 Q
 ;
MULTMAM ;
 K APCHSDT
 S APCHSDT=$O(^AUPNVRAD("AA",APCHSPAT,APCHSMAM,"")) I APCHSDT S APCHSMDT(APCHSDT)=$O(^(APCHSDT,""))
 Q
 ;
SKINTEST ;LOOKS UP THE DFN OF THE SKIN TEST
 S APCHSKND=$O(^AUTTSK("C",APCHSKN,""))
 Q
 ;