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

APCLOS41.m

Go to the documentation of this file.
APCLOS41 ; IHS/CMI/LAB - ambulatory continued ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;
 ;cmi/anch/maw 9/10/2007 code set versioning in APC
 ;
 D PROV
 D POV
 Q
COUNT ;
 I '$D(@X) S @X=0
 S %=@X,%=%+1,@X=%
 Q
PROV ;provider type
 S APCLX=0 F  S APCLX=$O(^AUPNVPRV("AD",APCLVDFN,APCLX)) Q:APCLX'=+APCLX  I $D(^AUPNVPRV(APCLX,0)) D PROV1
 Q
PROV1 ;
 S APCLPROV=$P(^AUPNVPRV(APCLX,0),U)
 ;Q:'$D(^DIC(6,APCLPROV))
 ;Q:'$D(^DIC(16,APCLPROV))
CHKDISC ;
 I $P(^DD(9000010.06,.01,0),U,2)[200 S APCLDISC=$$PROVCLS^XBFUNC1(APCLPROV) G CHKDISC1
 S APCLY=$P(^DIC(6,APCLPROV,0),U,4)
 I APCLY="" S APCLDISC="DISCIPLINE UNAVAILABLE" G CHKDISC1
 S APCLDISC=$P(^DIC(7,APCLY,0),U) Q:APCLDISC=""
CHKDISC1 S X=APCLP D COUNT
 Q
 ;
POV ;
 S APCLPDFN=0 F  S APCLPDFN=$O(^AUPNVPOV("AD",APCLVDFN,APCLPDFN)) Q:APCLPDFN'=+APCLPDFN  I $D(^AUPNVPOV(APCLPDFN,0)) D POV1
 Q
POV1 ;
 S APCLPOV=$P(^AUPNVPOV(APCLPDFN,0),U)
 I APCLEXCL=1,$D(APCLDXT(APCLPOV)) Q
 Q:'$D(^ICD9(APCLPOV,0))
 ;
 S X=APCLA D COUNT
APC ;
 ;S APCLX=$P(^ICD9(APCLPOV,0),U),APCLAPC=APCLAPCD  ;D ^APCLRAPC cmi/anch/maw 9/10/2007 orig line
 S APCLX=$$ICDDX^ICDEX(APCLPOV),APCLAPC=APCLAPCD  ;D ^APCLRAPC cmi/anch/maw 9/10/2007 csv
 S APCLCS=$P(APCLX,U,20) ;CODING SYSTEM
 S APCLCO=$P(APCLX,U,2) ;CODE
 S APCLX=$P(APCLX,U,1) ;IEN
 ;S X=APCLH D COUNT
ALCH ;
 G:APCLCLNC'=30 INJURY
 G:$D(APCLALCH) INJURY
 S:$$ICD^ATXAPI(APCLX,$O(^ATXAX("B","BGP ALCOHOL DXS",0)),9) ^("ERALCHCOUNT")=$S($D(^XTMP(APCLOS,APCLJOB,APCLBTH,"ERALCHCOUNT")):^("ERALCHCOUNT")+1,1:1),APCLALCH=""
INJURY ;
 Q:$D(APCLINJF)
 Q:APCLX=""
 Q:'$$INJ^APCDAPOV(APCLCO,APCLCS)
 S ^("INJCOUNT")=$S($D(^XTMP(APCLOS,APCLJOB,APCLBTH,"INJCOUNT")):^("INJCOUNT")+1,1:1)
 I APCLCLNC=30 S ^("ERINJCOUNT")=$S($D(^XTMP(APCLOS,APCLJOB,APCLBTH,"ERINJCOUNT")):^("ERINJCOUNT")+1,1:1)
 I $P(^AUPNVPOV(APCLPDFN,0),U,8)=1 S ^("INJFIRST")=$S($D(^XTMP(APCLOS,APCLJOB,APCLBTH,"INJFIRST")):^("INJFIRST")+1,1:1)
 S APCLINJF=""
CAUSE S APCLINJ=$P(^AUPNVPOV(APCLPDFN,0),U,9) Q:APCLINJ=""
 S X=APCLD D COUNT
 Q
 ;