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

APCLRAPC.m

Go to the documentation of this file.
APCLRAPC ; IHS/CMI/LAB - recode ICD Diagnosis Code into APC code ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 S APCLXHOL=APCLX
 I '$D(APCLX) S APCLERR=1,APCLMSG="APCLX VARIABLE NOT DEFINED" Q
 I APCLX="" S APCLERR=1,APCLMSG="APCLX VARIABLE IS NULL" Q
 I $E(APCLX)="." D CODE10 G HIGH
 S APCLICD="09"_($P(APCLX,".")_$P(APCLX,".",2))_" "
 I $E(APCLX)="V" S APCLX=9_$E(APCLX,2,9999),APCLX=APCLX-.000001,APCLX="09V"_$E(APCLX,2,9999),APCLX=$P(APCLX,".")_$P(APCLX,".",2)_" " G HIGH
 S APCLX="09"_APCLX-.000001
 S APCLY="",APCLX="0"_($P(APCLX,".")_$P(APCLX,".",2))_" "
HIGH S APCLHIGH=$O(^AUTTRCD("AH",APCLX)) I APCLHIGH="" S APCLY=999 G XIT
 S APCLDA1=$O(^AUTTRCD("AH",APCLHIGH,"")) I APCLDA1="" S APCLERR=1,APCLMSG="E99-ERROR IN APC RECODE XREF" Q
 S APCLDA2=$O(^AUTTRCD("AH",APCLHIGH,APCLDA1,""))
 S APCLLOW=$P(^AUTTRCD(APCLDA1,11,APCLDA2,0),U)_" "
 I APCLLOW]APCLICD S APCLY=999 G XIT
 S APCLY=$P(^AUTTRCD(APCLDA1,0),U),APCLAPC=APCLDA1
XIT ;
 K APCLICD,APCLLOW,APCLHIGH,APCLDA2,APCLDA1
 S APCLX=APCLXHOL K APCLXHOL
 Q
CODE10 ;
 S APCLICD="10"_$P(APCLX,".",2)_" "
 S APCLX="10"_APCLX,APCLX=APCLX-.000001,APCLX=$P(APCLX,".")_$P(APCLX,".",2)_" "
 Q
 ;