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

AGFACE7.m

Go to the documentation of this file.
AGFACE7 ; IHS/ASDS/EFG - FACE SHEET (PRVT INS, VET, OTHER REG, ELIG.) ;  
 ;;7.1;PATIENT REGISTRATION;**2,8**;AUG 25, 2005
 I $D(^AUPNPRVT(DFN,0)) D
 .I $Y+6>IOSL D HDR^AGFACE Q:$D(AGQUIT)
 .W !,$G(AG("-")),!,"PRIVATE INSURANCE:",!,"INS. COMPANY",?29,"NUMBER",?46,"ELIG. DATE",?60,"ELIG. END DATE"
 .S DIC=9000006.11,DR=.01,DA=DFN S AG=0 F  S AG=$O(^AUPNPRVT(DFN,11,AG)) Q:'AG  S AGL=$G(^AUPNPRVT(DFN,11,AG,0)) D PVT
 Q:$D(AGQUIT)
 I $D(^DPT(DFN,"VET")),^("VET")="Y" D VET
 S DIC=9000001.41,DR=.01,DA=DFN,AG(1)=""
 N I S I=0,AG(1)="" F  S I=$O(^AUPNPAT(DFN,41,I)) Q:'I  D  Q:$D(AGQUIT)
 .Q:I=DUZ(2)
 .I $Y+6>IOSL D HDR^AGFACE Q:$D(AGQUIT)
 .Q:$D(AGQUIT)
 .W:$D(AG(1)) !,$G(AG("-")),!,"THE PATIENT IS ALSO REGISTERED AT:"
 .W !,$P($G(^DIC(4,I,0)),U),?40,"CHART #: ",$P($G(^AUPNPAT(DFN,41,I,0)),U,2)
 .K AG(1)
 Q:$D(AGQUIT)
EMP ;PATIENT'S EMPLOYER
 S AGEMPIEN=$P($G(^AUPNPAT(DFN,0)),U,19) I AGEMPIEN]"" D
 .I $Y+6>IOSL D HDR^AGFACE Q:$D(AGQUIT)
 .S AG(0)=$G(^AUTNEMPL(AGEMPIEN,0)) I AG(0)="" Q
 .N I F I=1:1:6 S AG(I)=$P(AG(0),U,I)
 .W !,$G(AG("-")),!,"PATIENT'S EMPLOYER: ",AG(1)
 .F I=2,3 W:AG(I)]"" !?20,AG(I)
 .W:AG(4)]"" ", ",$P($G(^DIC(5,+AG(4),0)),U,2)
 .W:AG(5)]"" "  ",AG(5)
 .W:AG(6)]"" !!?13,"PHONE: ",AG(6)
 Q:$D(AGQUIT)
 K AGEMPIEN
SPEMP ;SPOUSE'S EMPLOYER
 S AGEMPIEN=$P($G(^AUPNPAT(DFN,0)),U,22) I AGEMPIEN]"" D
 .I $Y+6>IOSL D HDR^AGFACE Q:$D(AGQUIT)
 .S AG(0)=$G(^AUTNEMPL(AGEMPIEN,0)) I AG(0)="" Q
 .N I F I=1:1:6 S AG(I)=$P(AG(0),U,I)
 .W !,AG("-"),!,"SPOUSE'S EMPLOYER: ",AG(1)
 .F I=2,3 W:AG(I)]"" !?20,AG(I)
 .W:AG(4)]"" ", ",$P($G(^DIC(5,+AG(4),0)),U,2)
 .W:AG(5)]"" "  ",AG(5)
 .W:AG(6)]"" !!?13,"PHONE: ",AG(6)
 Q:$D(AGQUIT)
 K AGEMPIEN
ELIG ;ELIGIBILITY FOR CARE
 K AG("DRENT") S DIC=9000001,DA=DFN,DR=$S(AGOPT(14)="Y":1124,1:1112) D ^AGDICLK I '$D(AG("LKERR")) W !,AG("-"),! K ^TMP($J,"W") S X="***  ELIGIBILITY FOR CARE: "_AG("LKPRINT")_"  ***",DIWL=5,DIWR=75,DIWF="W" D ^DIWP,^DIWW
 K DIWF,DIWL,DIWR
 Q
PVT ;I $P(AGL,U)]"",$D(^AUTNINS($P(AGL,U),0)) Q:(($P(AGL,U,7)]"")&(+$P(AGL,U,7)<DT))  W !,$E($P(^AUTNINS($P(AGL,U),0),U),1,29),?29,$E($P(AGL,U,2),1,26),?46 S Y=$P(AGL,U,6) D DD^%DT W Y S Y=$P(AGL,U,7) D DD^%DT W ?60,Y
 ;IHS/SD/TPF 4/28/2006 AG*7.1*2 IM20635
 I $P(AGL,U)]"",$D(^AUTNINS($P(AGL,U),0)) Q:(($P(AGL,U,7)]"")&(+$P(AGL,U,7)<DT))  D
 .W !,$E($P(^AUTNINS($P(AGL,U),0),U),1,29)
 .N AGPH
 .S AGPH=$P($G(^AUPNPRVT(DFN,11,AG,2)),U)
 .I AGPH]"" W ?29,AGPH
 .I AGPH="" D                                                                        ;AG*7.1*8
 ..S AGPH=$P($G(^AUPNPRVT(DFN,11,AG,0)),U,8)
 ..I AGPH]"" W ?29,$P($G(^AUPN3PPH(AGPH,0)),U,4)
 .W ?46 S Y=$P(AGL,U,6) D DD^%DT W Y S Y=$P(AGL,U,7) D DD^%DT W ?60,Y
 Q
VET ;VETERAN
 I $Y+6>IOSL D HDR^AGFACE Q:$D(AGQUIT)
 W !,AG("-")
 K ^UTILITY("DIQ1",$J)
 K DIC,DIE,DIR,DIQ,DR
 S DIC=2,DA=DFN,AGSCRN=$P($T(@1),";;",2)
 F AG=2,3,4,6,7 D
 .S X=$P(AGSCRN,";",AG),DR=$P(X,U,4)
 .W !,"  ",?$P(X,U,2),$P(^DD(2,DR,0),U)," :  "
 .D EN^DIQ1
 .W $G(^UTILITY("DIQ1",$J,2,DA,DR))
 .K ^UTILITY("DIQ1",$J)
 K ^UTILITY("DIQ1",$J),DR,AGSCRN,X
 K DIC,DIE,DIR,DIQ,DR
 Q
1 ;;^20^^1901;^13^^.325;^9^^.326;^4^^.327;^8^^.32101;^16^^.301;^22^^.313