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

AG8B.m

Go to the documentation of this file.
AG8B ; IHS/ASDS/EFG - NEXT OF KIN DATA ENTRY ;  
 ;;7.1;PATIENT REGISTRATION;**2**;JAN 31, 2007
NKNAME ;EP - NOK NAME
NAME1 W !!,"Name of NEXT-OF-KIN (NOK).",!,"  (if same as Emerg. Contact, enter SAME): " D NAMED W:$D(AG("EMNM")) AG("EMNM"),"// "
 D READ^AG Q:$D(DUOUT)!$D(DFOUT)!$D(DTOUT)!$D(DLOUT)  G QUES:$D(DQOUT),SAME:Y="SAME"
 D S2
 S DR=".211///"_Y
 D ^DIE G NAME1:$D(Y)
 ;I $P(^DPT(DFN,.21),U,2)="" S $P(^AUPNPAT(DFN,28),U,2)=""
 I $P($G(^DPT(DFN,.21)),U,2)="" S $P(^AUPNPAT(DFN,28),U,2)=""  ;AG*7.1*2 FOUND DURING ALPHA
 Q
NKREL ;EP - NOK RELATIONSHIP
 D S1 S DR=2802 G END
NKSTR ;EP - NOK STREET
 D S2 S DR=.213 G END
NKCITY ;EP - NOK CITY
 D S2 S DR=.216 G END
NKST ;EP - NOK STATE
 D S2 S DR=.217 G END
NKZIP ;EP - NOK ZIP
 D S2
 I $D(DPTFLAG) S DR=.2207
 E  S DR=.218
 G END
NKPH ;EP - NOK PHONE #
 D S2 S DR=.219 G END
S1 K DUOUT S DIE="^AUPNPAT(",DA=DFN W ! Q
S2 K DUOUT S DIE="^DPT(",DA=DFN W ! Q
END D ^DIE S:$D(Y) DUOUT="" Q
QUES W !!,"Enter the next-of-kin's full name.",!! G NKNAME
NAMED K AG("EMNM") I $D(^DPT(DFN,.21)),$P(^DPT(DFN,.21),U)]"" S AG("EMNM")=$P(^DPT(DFN,.21),U)
 Q
SAME I $D(^DPT(DFN,.33)),$P(^DPT(DFN,.33),U)]"" G SAME1
 W !!,*7,"EMERGENCY CONTACT NOT ON FILE.",! G NKNAME
SAME1 ;
 F I=1:1:10 S AGS(I)=$P(^DPT(DFN,.33),"^",I)
 S AGDR(1)=".211///"_AGS(1)_";.212///"_AGS(2)_";.213///"_AGS(3)_";.214///"_AGS(4)_";.215///"_AGS(5)
 S AGDR(2)=".216///"_AGS(6)_";.217///`"_AGS(7)_";.218///"_AGS(8)_";.219///"_AGS(9)_";.2125////"_AGS(10)
 K DR,DIC S DA=DFN,DR=AGDR(1),DIE="^DPT(" D ^DIE
 K DR,DIC S DA=DFN,DR=AGDR(2),DIE="^DPT(" D ^DIE
 K AGS,AGDR
 I $D(^AUPNPAT(DFN,31)) S DA=DFN,DIE="^AUPNPAT(",DR="2802////"_$P(^AUPNPAT(DFN,31),U,2) K DIC D ^DIE
 Q
NKRELD ;CALLED FROM DGDDC RTN WHICH IS CALLED BY XREF ON FIELD .211 OF ^DPT
 I '$D(XDRMRG) S $P(^AUPNPAT(DA,28),"^",2)=""
 Q