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

APCDR02.m

Go to the documentation of this file.
APCDR02 ; IHS/CMI/LAB - V HOSPITALIZATION REVIEW ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 S APCDEREC=^AUPNVINP(APCDEDFN,0)
ADMTYPE ; Admission Type
 I $P(APCDEREC,U,7)="" S APCDE="E031" D ERR G DISP
 I $P(^DD(9000010.02,.07,0),U,2)[42.1 S X=$$VAL^XBDIQ1(42.1,$P(APCDEREC,U,7),9999999.01)
 I $P(^DD(9000010.02,.07,0),U,2)[405.1 S X=$$VAL^XBDIQ1(405.1,$P(APCDEREC,U,7),9999999.1)
 I X="" S APCDE="E031" D ERR
DISP ; Disposition Type-CP 60 
 S APCDDISP=""
 I $P(APCDEREC,U,6)="" S APCDE="E034" D ERR G UCAUS
 I $P(^DD(9000010.02,.06,0),U,2)[42.2 S APCDDISP=$$VAL^XBDIQ1(42.2,$P(APCDEREC,U,6),9999999.01)
 I $P(^DD(9000010.02,.06,0),U,2)[405.1 S APCDDISP=$$VAL^XBDIQ1(405.1,$P(APCDEREC,U,6),9999999.1)
 I $L(APCDDISP)'=1 S APCDE="E039" D ERR
 ;
 ;
UCAUS ; Underlying cause of death-CP 76-80.
 I APCDDISP<4 G XIT
 I '$D(^AUPNPAT(AUPNPAT,11)) S APCDE="E602" D ERR G XIT
 S APCDICDP=$P(^AUPNPAT(AUPNPAT,11),U,14) I APCDICDP="" S APCDE="E030" D ERR G XIT
 S APCDICD=$$CODEC^ICDEX(80,APCDICDP)
 K APCDE,APCDAGEE
 D ^APCDRICD
 I $D(APCDE) D ERR
 ;
 ;
XIT ; Clean up and exit
 K APCDDISP,APCDICDP,APCDICD,APCDAGEE,APCDEREC,APCDE
 Q
ERR ;
 S APCDE("FILE")=9000010.02,APCDE("ENTRY")=APCDEDFN
 D ERR^APCDRV
 Q