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

APCDR001.m

Go to the documentation of this file.
APCDR001 ; IHS/CMI/LAB - cont. review visit data ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
VISIT ;EP;check fields in visit file
 D 06
 D 05
 D 01
 Q
 ;
06 ;check for valid location of visit and code
 S APCDLDFN=$P(APCDVREC,U,6) I APCDLDFN="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E111" D ERR^APCDRV Q
 I '$D(^AUTTLOC(APCDLDFN,0)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E112" D ERR^APCDRV Q
 I '$D(^DIC(4,APCDLDFN,0)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E112" D ERR^APCDRV Q
 I $P(^AUTTLOC(APCDLDFN,0),U,10)="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E113" D ERR^APCDRV Q
 I $L($P(^AUTTLOC(APCDLDFN,0),U,10))'=6 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E114" D ERR^APCDRV
 Q
 ;
05 ; check patient
 S Y=$P(APCDVREC,U,5) I Y="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E104" D ERR^APCDRV Q
 I '$D(^AUPNPAT(Y)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E109" D ERR^APCDRV Q
 I '$D(^DPT(Y)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E110" D ERR^APCDRV Q
 D ^AUPNPAT
 I AUPNDOB]"" S X2=AUPNDOB,X1=$P(APCDVREC,U)\1 D ^%DTC S AUPNDAYS=X ; re-set days of age to visit date-dob
 I $G(DUZ("AG"))="I"!($G(DUZ("AG")))="" D ^APCDRRQ
 K Y,%DT,X,X1,X2
 Q
01 ;check .01 field
 S X=$P(APCDVREC,U)
 S %DT="TRPXN" D ^%DT I X=-1 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E128" D ERR^APCDRV Q
 D VSIT01^AUPNVSIT I '$D(X) D  I $G(APCDE)]"" Q
 .I $P(APCDVREC,U,7)="C",$$DOD^AUPNPAT($P(APCDVREC,U,5))<$P($P(APCDVREC,U),".") Q  ;if it is a chart review and after DOD then no error
 .S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E128" D ERR^APCDRV Q
02 ;
 I $P(APCDVREC,U,2)="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E129" D ERR^APCDRV Q
 S X=$P(APCDVREC,U,2)
 S %DT="TRXPN" D ^%DT I X=-1 S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E129" D ERR^APCDRV
03 ;
 I $P(APCDVREC,U,3)="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E130" D ERR^APCDRV
 ;I $P(APCDVREC,U,3)="C",$P(APCDVREC,U,8)'=APCDDCHS,'$D(^AUPNVCHS("AD",APCDVSIT)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E131" D ERR^APCDRV
07 ;
 I $P(APCDVREC,U,7)="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E132" D ERR^APCDRV
08 ;
 S APCDCLN=$P(APCDVREC,U,8)
 Q:APCDCLN=""
 I '$D(^DIC(40.7,APCDCLN,0)) S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E133" D ERR^APCDRV
 I $P(^DIC(40.7,APCDCLN,0),U,2)="" S APCDE("FILE")=9000010,APCDE("ENTRY")=APCDVSIT,APCDE="E134" D ERR^APCDRV
 Q