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

APCDRRQ.m

Go to the documentation of this file.
APCDRRQ ; IHS/CMI/LAB - CHECK REQUIRED DATA ITEMS OF PATIENT ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
DOB ;
 I AUPNDOB="" S APCDE="E600" D ERR Q
SEX ;
 I AUPNSEX="" S APCDE="E601" D ERR Q
 D HRN
 I '$D(^AUPNPAT(AUPNPAT,11)) S APCDE="E602" D ERR Q
 D TRIBE
 D COMM
 D QUANT
 D BEN
 D ELIG
EOJ ;
 K APCDE,APCDHASF,APCDHRN,APCDPX,APCDX
 Q
 ;
ERR ;
 S APCDE("FILE")=9000001,APCDE("ENTRY")=AUPNPAT
 D ERR^APCDRV
 Q
HRN ;
 S APCDHRN=""
 D CHART
 I APCDHRN="" S APCDE="E603" D ERR Q
 I $E(APCDHRN)="T"!($L(APCDHRN)=7) S APCDE="E604" D ERR Q
 Q
CHART ;
 I $D(^AUPNPAT(AUPNPAT,41,APCDLDFN,0))#2,$P(^(0),U)]"",$P(^(0),U,2)]"" S APCDHRN=$P(^(0),U,2) Q
 I $D(DUZ(2)),DUZ(2)>0,$D(^AUPNPAT(AUPNPAT,41,DUZ(2),0))#2,$P(^(0),U)]"",$P(^(0),U,2)]"" S APCDHRN=$P(^(0),U,2) Q
 S APCDHASF=$O(^AUPNPAT(AUPNPAT,41,0))
 I 'APCDHASF S APCDHRN="" Q
 I APCDHASF S APCDHRN=$P(^AUPNPAT(AUPNPAT,41,APCDHASF,0),U,2)
 Q
 ;
TRIBE ;
 I $P(^AUPNPAT(AUPNPAT,11),U,8)="" S APCDE="E605" D ERR Q
 I '$D(^AUTTTRI($P(^AUPNPAT(AUPNPAT,11),U,8))) S APCDE="E606" D ERR Q
OLDTRIBE I $P(^AUTTTRI($P(^AUPNPAT(AUPNPAT,11),U,8),0),U,4)="Y" S APCDE="E607" D ERR Q
 Q
QUANT I $P(^AUPNPAT(AUPNPAT,11),U,10)="" S APCDE="E616" D ERR
 Q
COMM ;
 S APCDX=0,APCDPX="" F  S APCDX=$O(^AUPNPAT(AUPNPAT,51,APCDX)) Q:APCDX'=+APCDX  S APCDPX=APCDX
 I APCDPX="" S APCDE="E610" D ERR Q
 S APCDPX=$P(^AUPNPAT(AUPNPAT,51,APCDPX,0),U,3) I APCDPX="" S APCDE="E611" D ERR Q
 I '$D(^AUTTCOM(APCDPX,0)) S APCDE="E611" D ERR Q
 I APCDPX]"" S APCDX=$P(^AUTTCOM(APCDPX,0),U,8) I APCDX="" S APCDE="E612" D ERR Q
 Q
BEN I $P(^AUPNPAT(AUPNPAT,11),U,11)="" S APCDE="E613" D ERR Q
 I '$D(^AUTTBEN($P(^AUPNPAT(AUPNPAT,11),U,11),0)) S APCDE="E614" D ERR Q
 Q
ELIG I $P(^AUPNPAT(AUPNPAT,11),U,12)="" S APCDE="E615" D ERR Q
 Q