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

APCLAP0.m

Go to the documentation of this file.
APCLAP0 ; IHS/CMI/LAB - INFO FOR APCLAP1 AND APCLAP2 REPORTS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
GETINFO ;EP
 I $T(@(APCLRPT))="" W !!,$C(7),$C(7),"REPORT INFORMATION MISSING!! NOTIFY PROGRAMMER!",!! S APCLQUIT="" Q
 S APCLINFO=$T(@(APCLRPT)),APCLSORT=$P(APCLINFO,";;",2),APCLPROC=$P(APCLINFO,";;",4),APCLINF=$P(APCLINFO,";;",3),APCLTITL=$P(APCLINFO,";;",5),APCLHD1=$P(APCLINFO,";;",6),APCLHD2=$P(APCLINFO,";;",7)
 Q
 ;
P ;;APCLPROV;;Provider of Service;;PROV;;PROVIDER OF SERVICE;;PROVIDER;;PROVIDER DISCIPLINE
DIS ;;APCLDISC;;Discipline of Provider;;DISC;;DISCIPLINE OF PROVIDER;;DISCIPLINE;;DISCPLINE CODE
C ;;APCLCLIN;;Clinic Type;;CLIN;;CLINIC TYPE;;TYPE OF CLINIC;;CLINIC CODE
ALLDISC ;;APCLADIS;;Provider Discipline (All Providers);;ALLDISC;;ALL PROVIDER DISCIPLINES;;PROVIDER DISCIPLINE;;DISCIPLINE CODE
ALLP ;;APCLSEC;;All Providers of Service;;ALLP;;ALL PROVIDERS OF SERVICE;;PROVIDER OF SERVICE;;DISCIPLINE OF PROV
DISC ;;APCLDISC;;Primary Provider Discipline;;DISC;;PRIMARY PROVIDER DISCIPLINE;;PROVIDER DISCIPLINE;;DISCIPLINE CODE
D ;;APCLDATE;;Date of Visit;;DATE;;DATE OF VISIT;;DATE OF VISIT;;DAY OF WEEK
PROV ;;APCLPROV;;Primary Provider of Service;;PROV;;PRIMARY PROVIDER OF SERVICE;;PROVIDER OF SERVICE;;DISCIPLINE OF PROV
DX ;;APCLDX;;Primary Diagnosis (APC Code);;DX;;PRIMARY DX (APC CODE);;APC DX NARRATIVE;;APC DX CODE
ICD ;;APCLDX;;Primary Diagnosis (ICD Code);;DX;;PRIMARY DX (ICD CODE);;ICD DX NARRATIVE;;ICD DX CODE
LOS ;;APCLVLOC;;Location of Service;;LOS;;LOCATION OF SERVICE;;LOCATION OF SERVICE;;LOCATION CODE
SC ;;APCLCAT;;Service Category of Visit;;SC;;SERVICE CATEGORY OF VISIT;;SERVICE CATEGORY;;CODE
APCC ;;APCLAPCC;;Primary Diagnosis (APC Category);;APCC;;PRIMARY DX (APC CATEGORY);; APC DX CATEGORY NARRATIVE;;  
 Q
DXX ;ENTRY POINT
GETCODE ;
 I $E(APCLX)="." D CODE10 G HIGH
 S APCLICD="09"_($P(APCLICD,".")_$P(APCLICD,".",2))_" "
 I $E(APCLX)="V" S APCLX=(9_$E(APCLX,2,9999)-.000001),APCLX="09V"_$E(APCLX,2,9999),APCLX=$P(APCLX,".")_$P(APCLX,".",2)_" " G HIGH
 S APCLX="09"_APCLX-.000001
 S APCLDX="",APCLX="0"_($P(APCLX,".")_$P(APCLX,".",2))_" "
HIGH S APCLHIGH=$O(^AUTTRCD("AH",APCLX)) I APCLHIGH="" S APCLDX=999 G DX2
 S APCLDA1=$O(^AUTTRCD("AH",APCLHIGH,"")) I APCLDA1="" Q
 S APCLDA2=$O(^AUTTRCD("AH",APCLHIGH,APCLDA1,""))
 S APCLLOW=$P(^AUTTRCD(APCLDA1,11,APCLDA2,0),U)_" "
 I APCLLOW]APCLICD S APCLDX=999 G DX2
 S APCLDX=$P(^AUTTRCD(APCLDA1,0),U,3)
DX2 S APCLSRT2=$P(^AUTTRCD(APCLDA1,0),U)
 Q
 ;
CODE10 ;
 S APCLICD="10"_$P(APCLICD,".",2)_" "
 S APCLX="10"_APCLX,APCLX=APCLX-.000001,APCLX=$P(APCLX,".")_$P(APCLX,".",2)_" "
 Q