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

AGBIC2P.m

Go to the documentation of this file.
AGBIC2P ; IHS/ASDS/EFG - ENTRY UTILITY FOR MANDATORY DATA ; 
 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
L1 D S1,^AG1 G K^AG0:$D(DFOUT)!$D(DTOUT),UP:$D(DUOUT)
 I $D(AG("TEMP CHART")) D S1,DOB^AG2A Q
L4 D S1,^AGBIC2B G L1:$D(DUOUT)!$D(DTOUT),K^AG0:$D(DFOUT) I $P(^AUPNPAT(DFN,11),U,21)'="Y"&($P(^(11),U,22)'="Y") D CKMNRRES G L4:$D(DUOUT),K^AG0:$D(DFOUT)!$D(DTOUT)
L5 D S1,TRIBE^AG2A G L4:$D(DUOUT),K^AG0:$D(DFOUT)!$D(DTOUT) I $D(^AUPNPAT(DFN,11)),$P(^(11),U,8)]"",$P(^AUTTTRI($P(^AUPNPAT(DFN,11),U,8),0),U,4)="Y" W !,"That TRIBE no longer valid" G L5
 S AG("TRIBE")=$S($P(^AUPNPAT(DFN,11),U,8)="":"N",1:"Y") I $P(^(11),U,8)]"" I $P(^AUTTTRI($P(^AUPNPAT(DFN,11),U,8),0),U,2)="000"!($P(^AUTTTRI($P(^AUPNPAT(DFN,11),U,8),0),U,2)>"979") S AG("TRIBE")="N"
 I AG("TRIBE")="N" D CKMNRTRB G L5:$D(DUOUT),K^AG0:$D(DFOUT)!$D(DTOUT) D TRBFLG^AG2A G L5B
TRBVER S AG("TRBVER")=" " S:$D(^AUPNPAT(DFN,11)) AG("TRBVER")=$P(^AUPNPAT(DFN,11),U,19)
 W !!,"HAS TRIBAL MEMBERSHIP BEEN VERIFIED? (Y/N/U): " W:(AG("TRBVER")["Y")!(AG("TRBVER")["N")!(AG("TRBVER")["U") AG("TRBVER")_" // " S Y=AG("TRBVER") D READ^AG
 S:$D(DLOUT)&(AG("TRBVER")'=" ") Y=AG("TRBVER") G L5:$D(DUOUT) I (Y'["Y")&(Y'["N")&(Y'["U") W !!,"Enter a ""Y"" for YES or an ""N"" for NO OR A ""U"" for UNABLE." G TRBVER
 S:Y["N" AG("TRIBE")="N"
SETRBFLG D S1,TRBFLG^AG2A I AG("TRIBE")'="Y" D CKMNRTRB G TRBVER:$D(DUOUT) G:$D(DFOUT)!$D(DTOUT) K^AG0 D TRBFLG^AG2A
L5B D S1,IQTM^AG2A G L5:$D(DUOUT),K^AG0:$D(DFOUT)!$D(DTOUT)
L5ELIG D S1,^AGBIC2C,CALCELIG^AGBIC2
L5AOPT I AGOPT(2)="Y" D S1,TRINUM^AGOPT2 G L5:$D(DUOUT) I 1
 E  G L5:$D(DUOUT)
L5OPT I AGOPT(1)="Y" D S1,TQTM^AGOPT2 G L5AOPT:$D(DUOUT) I 1
 E  G L5AOPT:$D(DUOUT)
L6OPT I AGOPT(8)="Y" D S1,OTHRTR^AGOPT2 G L5OPT:$D(DUOUT) I 1
 E  G L5OPT:$D(DUOUT)
L7 D S1,BEN^AG2A G L6OPT:$D(DUOUT),K^AG0:$D(DFOUT)!$D(DTOUT)
L8 D S1,ELIG^AG2A G L7:$D(DUOUT),K^AG0:$D(DFOUT)!$D(DTOUT)
END K AG
 G ^AG3
S1 K DFOUT,DTOUT,DUOUT,DLOUT,DQOUT
 Q
UP S AG("EDIT")="" W !!,*7,*7,"Deleting Patient ",$P(^DPT(DFN,0),U)," ...." D Z1^AGKPAT,DFN^AGKPAT
 G L1^AG0
CKMNRRES S DA=DFN,DIC=9000001,DR=1102.99 D ^AGDICLK I $D(AG("LKPRINT")) S Y="N" D:AG("LKPRINT")<18 ASKMNRES
 S:Y="N" Y="" S:Y="Y" Y="C" Q:Y=""
 S:$P(^AUPNPAT(DFN,11),U,25)="T" Y="B"
 S DA=DFN,DR="1125///"_Y,DIE="^AUPNPAT(" D ^DIE
 Q
ASKMNRES W *7,!!,"IS EITHER PARENT ELIGIBLE FOR ""CHS"" OR ""DIRECT"" CARE? (Y/N) N// " D READ^AG S:$D(DLOUT) Y="N" I '$D(DUOUT)&'$D(DFOUT)&'$D(DTOUT)&(Y'["Y")&(Y'["N") D YN^AG G ASKMNRES
 Q
CKMNRTRB S AG("MINOR")="" S DA=DFN,DIC=9000001,DR=1102.99 D ^AGDICLK S Y="N" I $D(AG("LKPRINT")) D:AG("LKPRINT")<18 ASKMNRTB
 S:Y="N" Y="" S:Y="Y" Y="T" Q:Y=""
 S:$P(^AUPNPAT(DFN,11),U,25)="C" Y="B"
 S DA=DFN,DR="1125///"_Y,DIE="^AUPNPAT(" D ^DIE
 Q
ASKMNRTB W *7,!!,"IS EITHER PARENT A MEMBER OF A RECOGNIZED TRIBE? (Y/N) N// " D READ^AG S:$D(DLOUT) Y="N" I '$D(DUOUT)&'$D(DFOUT)&'$D(DTOUT)&(Y'["Y")&(Y'["N") D YN^AG G ASKMNRTB
 Q