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

AGBIC1A.m

Go to the documentation of this file.
AGBIC1A ; IHS/ASDS/EFG - BUILD FILE OF PT DEMOGRAPHIC DATA TO BE BIC'D ; 
 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
 S AGTMP="^AGBICP" K @AGTMP S ^AGBICP(0)="BIC PRINT^9009061.1^0^0",AGDFN1=0
BICLOOP S AGDFN1=$O(^AGBICH(AGDFN1)) G:AGDFN1'=+AGDFN1 END
 S AGDFN2=$P(^AGBICH(AGDFN1,0),U),DR="1126///"_"Y",DA=AGDFN2,DIE="^AUPNPAT(" D ^DIE
 D EXPIRE I $P(^DPT(AGDFN2,0),U)="" G BICLOOP
 S DIC("DR")=".02////"_DT
 I $P(^DPT(AGDFN2,0),U,9)]"" S DIC("DR")=DIC("DR")_";.03////"_$P(^DPT(AGDFN2,0),U,9) ; SSN
 I $P(^DPT(AGDFN2,0),U,3)]"" S DIC("DR")=DIC("DR")_";.04////"_$P(^DPT(AGDFN2,0),U,3) ; DOB
 I $P(^DPT(AGDFN2,0),U,2)]"" S DIC("DR")=DIC("DR")_";.05////"_$P(^DPT(AGDFN2,0),U,2) ; SEX
 I $D(^AUPNPAT(AGDFN2,11)),$P(^AUPNPAT(AGDFN2,11),U,8)]"" S DIC("DR")=DIC("DR")_";.06////"_$P(^AUTTTRI($P(^AUPNPAT(AGDFN2,11),U,8),0),U,2) ; TRIBE
 I AGXPIRE]"" S DIC("DR")=DIC("DR")_";.08////"_AGXPIRE
 I $P(^AGBICH(AGDFN1,0),U,2)]"" S DIC("DR")=DIC("DR")_";.09////"_$P(^DIC(4,$P(^AGBICH(AGDFN1,0),U,2),0),U) ; ISSUING FACILITY
 I $P(^AUTTLOC($P(^AGBICH(AGDFN1,0),U,2),0),U,11)]"" S DIC("DR")=DIC("DR")_";.11////"_$P(^AUTTLOC($P(^AGBICH(AGDFN1,0),U,2),0),U,11) ; PHONE
 S DIC="^AGBICP(",DIC(0)="L",X=$P(^DPT(AGDFN2,0),U)
 K DD,DO D FILE^DICN
 G BICLOOP
END K AG,AGDFN1,AGDFN2,AGXPIRE
 Q
EXPIRE S AGXPIRE="" Q:$P(^DPT(AGDFN2,0),U,3)=""
 S DA=AGDFN2,DIC=9000001,DR=1102.99 D ^AGDICLK Q:AG("LKPRINT")'<18
 Q:$P(^AUPNPAT(AGDFN2,11),U,25)'="Y"
 S AGXPIRE=$P(^DPT(AGDFN2,0),U,3)+180000
 Q