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

AGED4A.m

Go to the documentation of this file.
AGED4A ; IHS/ASDS/EFG - PAGE 4 - INSURANCE SUMMARY ; MAR 19, 2010
 ;;7.1;PATIENT REGISTRATION;**1,2,7,11**;AUG 25, 2005;Build 1
 ;
 ;AG*7.1*7 - Modified code to allow the new page 10 to be called
 ;IHS/OIT/NKD AG*7.1*11 REMOVED SITE SPECIFIC CHECK
 ;
VAR ;PEP FOR PCC+
 K CATPTR,CATHD,AGINS,AGCAT,AGNEWINS,AGTOUT
 ;S CATPTR="M"
 S CATPTR="U"  ;AG*7.1*2 AG/SD/TPF 6/26/2006 PG 34 TASK
 S SHOWINAC=0  ;IHS/SD/TPF 6/27/2006 AG*7.1*2 ATTACHMENT VIII.1
 D ^AGINS
 I $D(AGPHFLAG) D ^AGINS
 I $D(^AUPNICP("C",DFN)) D LOADCAT^AGCAT
VAR2 S AG("PG")="4",ROUTID=$P($T(+1)," "),AGANS=""
 I '$D(AGSEENLY) D DRAW
 K DLOUT
 I $D(AGCAT) D LOADICP^AGCAT
 I $D(AGSEENLY) D DRAW2
 Q:$D(AGTOUT)!$D(DTOUT)
 G END:'$D(AGANS)
 S:AGANS="/.,"!(AGANS="^^") DFOUT=""
 S:AGANS="" DLOUT=""
 S:AGANS=U (DUOUT,Y)=""
 S:AGANS?1"?".E!(AGANS[U) (DQOUT,Y)=""
 Q:$D(DTOUT)!$D(DFOUT)
 I (U_"P"_U_"p"_U)[(U_$E(AGANS,1)_U)&($P($G(^AUPNPAT(DFN,11)),U,12)'="") D
 .S AG("ED")=+$P($E(AGANS,2,99),".")
 .I AG("ED")<1!(AG("ED")>10) W *7,!!,"Use only pages 1 through 10." H 2 K AG("ED") S AG("ERR")=""  ;AG*7.1*7
 .I $D(AG("ED")) D
 ..I AG("ED")>0&(AG("ED")<11) D  ;AG*7.1*7
 ...I AG("ED")=4 S AG("ED")="4A"
 ...I AG("ED")=5 S AG("ED")="BEA"
 ...I AG("ED")=6 S AG("ED")=13
 ...I AG("ED")=9 S AG("ED")="11A"
 ...I AG("ED")=8 S AG("ED")=11
 ...I AG("ED")=7 S AG("ED")=8
 ...I AG("ED")=10 S AG("ED")="10A"  ;AG*7.1*7
 I $E(AGANS,1)="P"&($P($G(^AUPNPAT(DFN,11)),U,12)="") W *7,!!,"Eligibility Status must be entered." H 2
 I $D(AG("ED"))&'$D(AGXTERN) D LOADICP^AGCAT G @("^AGED"_AG("ED"))
 G END:$D(DLOUT)!$D(DUOUT),VAR:$D(AG("ERR"))
 K AGINS D ^AGINS
 G VAR2
END K AG,DFOUT,DQOUT,DTOUT,DLOUT,DA,DIC,DIE,DR,AGSCRN,Y,CATHD,AGANS,AGTOUT,AGA,AGDT,AGB,CNT,MCDREC,RECPTR,SEL,ST,STPTR,AGADDINS,AGSEL,AGINSPTR,AGINSREC,AGMCDREC,CATPTR,COV,COVPTR
 K CPTR,EFF,END,INS,INSPTR,PH,PHPTR,POLNUM,RECNO,RECORD,SEQEFDT,SEQFLG,SQDT,ROUTID
 Q:$D(AGSEENLY)
 K AGCAT,AGINS
 Q:$D(AGXTERN)
 Q:$D(DIROUT)
 G ^AGED3:$D(DUOUT)
 G ^AGEDBEA
CPROMPT ;EP - CALLED FROM AGED4A1
 ;K DFOUT,DTOUT,DUOUT,DLOUT,DIROUT,CATPTR,DIR
 K DFOUT,DTOUT,DUOUT,DLOUT,DIROUT,DIR  ;AG*7.1*2 AG/SD/TPF 6/26/2006 PAGE 37 OF TASK ORDER
 I '$D(AGINS) W !,"This patient has NO insurers to sequence!" H 2 Q
 ;S DIR(0)="S^M:MEDICAL COVERAGE;D:DENTAL COVERAGE;O:OPTOMETRY COVERAGE;R:PHARMACY COVERAGE;P:MENTAL HEALTH COVERAGE;T:THIRD PARTY LIABILITY COVERAGE;W:WORKMAN'S COMP COVERAGE"
 S DIR(0)="SO^M:MEDICAL COVERAGE;D:DENTAL COVERAGE;O:OPTOMETRY COVERAGE;R:PHARMACY COVERAGE;P:MENTAL HEALTH COVERAGE;T:THIRD PARTY LIABILITY COVERAGE;W:WORKMAN'S COMP COVERAGE;U:SUMMARY PAGE"  ;IHS/SD/TPF 4/12/2006 AG*7.1*2 ITEM 5 PAGE 35
 ;S DIR(0)="SO^M:MEDICAL COVERAGE"_$S($D(AGCAT("M")):"*",1:"")
 ;S DIR(0)=DIR(0)_";D:DENTAL COVERAGE"_$S($D(AGCAT("D")):"*",1:"")
 ;S DIR(0)=DIR(0)_";O:OPTOMETRY COVERAGE"_$S($D(AGCAT("O")):"*",1:"")
 ;S DIR(0)=DIR(0)_";R:PHARMACY COVERAGE"_$S($D(AGCAT("R")):"*",1:"")
 ;S DIR(0)=DIR(0)_";P:MENTAL HEALTH COVERAGE"_$S($D(AGCAT("P")):"*",1:"")
 ;S DIR(0)=DIR(0)_";T:THIRD PARTY LIABILITY COVERAGE"_$S($D(AGCAT("T")):"*",1:"")
 ;S DIR(0)=DIR(0)_";W:WORKMAN'S COMP COVERAGE"_$S($D(AGCAT("T")):"*",1:"")
 ;S DIR(0)=DIR(0)_";U:SUMMARY PAGE"
 ;D ^DIR Q:$D(DUOUT)
 D ^DIR Q:$D(DUOUT)!$D(DTOUT)  ;IHS/SD/TPF AG*7.1*1 9/6/2005
 I Y'="" D  ;AG*7.1*2 AG/SD/TPF 6/26/2006 PAGE 37 OF TASK ORDER
 .S X=Y,Y=$$UP^XLFSTR(X),CATPTR=Y
 .S CATHD=$S(CATPTR="D":"DENTAL COVERAGE",CATPTR="O":"OPTOMETRY COVERAGE",CATPTR="R":"PHARMACY COVERAGE",CATPTR="P":"MENTAL HEALTH COVERAGE",CATPTR="T":"THIRD PARTY LIABILITY COVERAGE",CATPTR="W":"WORKMAN'S COMP COVERAGE",1:"MEDICAL COVERAGE")
 E  S CATPTR="U"
 ;S CATHD=$S(CATPTR="D":"DENTAL COVERAGE",CATPTR="O":"OPTOMETRY COVERAGE",CATPTR="R":"PHARMACY COVERAGE",CATPTR="P":"MENTAL HEALTH COVERAGE",CATPTR="T":"THIRD PARTY LIABILITY COVERAGE",CATPTR="W"
 ;:"WORKMAN'S COMP COVERAGE","M":"MEDICAL COVERAGE",1:"SUMMARY COVERAGE")  ;IHS/SD/TPF 4/12/2006 AG*7.1*2 ITEM 5 PAGE 35
 I $D(DIRUT),$$NEEDTOSQ^AGUTILS(DFN,DUZ(2)) W !!,"THIS PATIENT HAS NOT BEEN SEQUENCED. YOUR SITE REQUIRES SEQUENCING!! PLEASE CHOOSE A CATEGORY" G CPROMPT
 ;Q:CATPTR="S"!(CATPTR="")  ;IHS/SD/TPF 4/12/2006 AG*7.1*2 ITEM 5 PAGE 35
 ;I AGANS="V" D VPROMPT^AGED4A1(CATPTR) Q  ;VIEW PROMPT AG*7.1*2 IHS/SD/TPF 6/26/2006 PAGE 37
 ;I AGANS="T" D DISPCAT^AGED4A1 Q  ;TO ACCOMODATE CHNAGE TO DEFAULT DISPLAY IHS/SD/TPF 4/12/2006 AG*7.1*2 ITEM 2 PAGE 35
 ;I AGANS="S" D SPROMPT
 Q
SPROMPT ;EP - ASK SEQUENCING QUESTIONS
 S AG("PG")=4,ROUTID=$P($T(+1)," ")
 D HEADING^AGED4A1
 K DIR,DFOUT,DTOUT,DUOUT,DLOUT,DIROUT,PRSEQ,Y,DIRUT
 Q:$G(CATPTR)=""  ;IHS/SD/TPF AG*7.1*1 10/24/2005
 I '$D(AGCAT(CATPTR)) W !?16,"THIS PATIENT HAS NO INSURERS IN THIS CATEGORY."
 ;D DISPINS
 D DISPINS^AGED4A1  ;AG*7.1*2 HAD TO MOVE BECAUSE RTN TOO LARGE FOR SAC
 I '$D(AGINS) W !,"This patient has NO insurers to sequence!" H 2 Q
 Q:AGANS=""!(AGANS=U)
 K DIR,AGSEQ,PRSEQ,DASHSEQ,AGTST,AGMIN,AGMAX
 S DIR(0)="L^1:"_MAX_":0"
 D ^DIR
 S X=Y,Y=$$UP^XLFSTR(X)
 I $D(DIRUT) I $$NEEDTOSQ^AGUTILS(DFN,DUZ(2)) W !,"CANNOT EXIT WITHOUT SEQUENCING! YOUR SITE REQUIRES SEQUENCING!!" H 2 G SPROMPT
 ;Q:$D(DIRUT)!$D(DUOUT)
 I $D(DIRUT)!$D(DUOUT)!$D(DTOUT) K CATHD S CATPTR="U" Q  ;IHS/SD/TPF 4/12/2006 AG*7.1*2 ITEM 5 PAGE 35
 S PRSEQ=Y
 K DIR,DFOUT,DTOUT,DUOUT,DLOUT,DIROUT,DIRUT
 S DIR("A")="YOU ENTERED THE SEQUENCE "_PRSEQ_" IS THIS CORRECT (Y/N) "
 S DIR(0)="Y"
 D ^DIR
 S X=Y,Y=$$UP^XLFSTR(X)
 I $D(DIRUT) G SPROMPT
 G SPROMPT:Y=0
 K DIR,DFOUT,DTOUT,DUOUT,DLOUT,DIROUT,DIRUT
 S DIR("A")="WHAT IS THE EFFECTIVE DATE OF THIS PRIORITY SEQUENCE ? "
 S DIR(0)="D"
 D ^DIR
 S SEQEFDT=Y
 X ^DD("DD")
 S ESEQEFDT=Y
 S X=Y,Y=$$UP^XLFSTR(X)
 G:$D(DIRUT) SPROMPT
 ;BEGIN NEW CODE ;AG*7.1*2 IM20494
 I Y>DT D  G:Y=0 SPROMPT
 .W !!,"YOU ARE ADDING A EFFECTIVE SEQUENCING DATE OF "_ESEQEFDT
 .K DIR
 .S DIR(0)="Y"
 .S DIR("A")="ARE YOU SURE YOU WANT TO ENTER THIS AS THE CORRECT DATE"
 .S DIR("B")="N"
 .D ^DIR
 ;END NEW CODE
 K ESEQEFDT
 K DIR
 I SEQEFDT="" G SPROMPT
 D BLDAGCAT^AGCAT,LOADICP^AGCAT
 Q
DRAW ;EP
 I $D(ADDCHK) D ADDMSG^AGED4A1
 S ROUTID=$P($T(+1)," "),AG("PG")="4",DA=DFN
 D HEADING^AGED4A1
 K DFOUT,DTOUT,DUOUT,DQOUT,DLOUT,AG("ED"),AG("ERR"),DIROUT,DIR
 K DIRUT
 ;IHS/SD/TPF 4/12/2006 AG*7.1*2 ITEM 2 PAGE 35
 ;SUM SCR DEFAULT
 ;I $D(AGCAT) D
 ;.D LOADCAT^AGCAT
 ;.;D DISPCAT
 ;.D DISPCAT^AGED4A1  ;AG*7.1*1 SAC REQ RTN TOO LARGE
 ;.;I AGANS="T"!(AGANS="S") D CPROMPT
 ;.I $G(AGANS)="T"!($G(AGANS)="S") D CPROMPT
 ;I '$D(AGCAT) W !?20,"*** PATIENT HAS NO CATEGORIES SET UP ***" D
 ;.;D DISPLAYN
 ;.D DISPLAYN^AGED4A1  ;AG*7.1*1 SAC REQ TOO LRG
 ;.;I AGANS="T"!(AGANS="S") D CPROMPT
 ;.I $G(AGANS)="T"!($G(AGANS)="S") D CPROMPT
 ;S AGADDINS=AGANS
 D DISPLAYN^AGED4A1
 ;I $G(AGANS)="T"!($G(AGANS)="S") D CPROMPT
 ;I $G(AGANS)="T"!($G(AGANS)="S")!($G(AGANS)="V") D CPROMPT  ;AG*7.1*2 PAGE 37
 ;END NEW CODING AG*7.1*2
 S AGADDINS=$G(AGANS)
 ;I $G(AGVIEWSQ) D DISPINS^AGED4A1 K AGVIEWSQ ;AG*7.1*2 CAME BACK FROM SEQ VIEWING SO NEED TO DISPLAY AGAIN
 I $G(AGANS)="A" D ADDINS I $D(DUOUT) K DUOUT G DRAW
 ;I $G(AGANS)="E" D EDITINS I $D(DUOUT) K DUOUT G DRAW
 I $G(AGANS)="E" D EDITINS^AGED4A01 I $D(DUOUT) K DUOUT G DRAW  ;MOVE SUB RTN TO COMPLY WITH SAC RTN SIZE
 I $G(AGANS)="REQSEQ" K AGANS G DRAW
 Q
DRAW2 ;EP
 S AG("PG")="4",ROUTID=$P($T(+1)," "),DA=DFN
 D HEADING^AGED4A1
 K DFOUT,DTOUT,DUOUT,DQOUT,DLOUT,AG("ED"),AG("ERR"),DIROUT,DIR
 ;D DISPLAYN
 D DISPLAYN^AGED4A1  ;AG*7.1*1 SAC REQ TOO LRG
 I $G(AGANS)'=""&($G(AGANS)'=U)&($G(AGANS)'=U_U)&($G(AGANS)'="/.,") D
 .;HANDLE RR AND MCR A & B
 .I $D(AGINSNN(AGANS))=10 S AGINSREC=$G(AGINSNN(AGANS,1))
 .E  S AGINSREC=$G(AGINSNN(AGANS))
 .S AGTYPE=$P(AGINSREC,U,10),AGELPTR=$P($P(AGINSREC,U,11),","),ISACTIVE=$P(AGINSREC,U,13)
 .;AG/SD/TPF 12/20/2005 AG*7.1*1 ITEM 2
 .I AGTYPE="MD" D EN^AGED4(AGINSREC) Q:$G(Y)=AGOPT("ESCAPE")  D EN^AGED42(DFN,,0,AGINSREC) Q
 .I AGTYPE="R"&($P(AGINSREC,U,2)'=1) D EN^AGED4(AGINSREC) Q:$G(Y)=AGOPT("ESCAPE")  D EN^AGED42(DFN,,0,AGINSREC) Q
 .I AGTYPE="R"&($P(AGINSREC,U,2)=1) D EN^AGED6(AGINSREC) Q:$G(Y)=AGOPT("ESCAPE")  D EN^AGED62(DFN,,0,AGINSREC) Q
 .I AGTYPE="D"!(AGTYPE="K") D
 ..S PARDFN=$P($P(AGINSREC,U,11),",")
 ..S PARDT=$P($P(AGINSREC,U,11),",",2)
 ..S NEWENTRY=0
 ..D EN^AGEDMCD(PARDFN,PARDT,NEWENTRY,AGINSREC)
 .;I AGTYPE="P" S:$G(AGINSREC)'="" AGSELECT=AGINSREC D ^AGED7 K AGSELECT Q:$G(Y)=AGOPT("ESCAPE")  I $G(AGINSPTR)'="",($P($G(^AUTNINS(AGINSPTR,2)),U)'="K"),$D(AGELP("PH")) S INSPTR=AGINSPTR D ^AGED7B
 .I AGTYPE="P" D  ;IHS/SD/TPF AG*7.1*1 USE NEW PRVT SCREEN RTNS
 ..S PARDFN=$P($P(AGINSREC,U,11),",")
 ..S PARREC=$P($P(AGINSREC,U,11),",",3)
 ..;S INSPTR=$P(AGINSREC,U,2)
 ..S AGINSPTR=$P(AGINSREC,U,2)  ;IHS/SD/TPF 3/8/2006 AG*7.1*1
 ..S POLHPTR=$E($P(AGINSREC,U,7),2,99)
 ..S COVPTR=$P(AGINSREC,U,3)
 ..S:$G(AGINSREC)'="" AGSELECT=AGINSREC
 ..;D EN^AGEDPRV(PARDFN,PARREC,0,AGSELECT,INSPTR,POLHPTR,COVPTR)
 ..D EN^AGEDPRV(PARDFN,PARREC,0,AGSELECT,AGINSPTR,POLHPTR,COVPTR)  ;IHS/SD/TPF 3/8/2006 AG*7.1*1
 ..K AGSELECT Q:$G(Y)=AGOPT("ESCAPE")
 ..;I ($P($G(^AUTNINS(INSPTR,2)),U)'="K") D EN^AGEDPRVB(PARDFN,PARREC,0,AGINSREC,INSPTR,POLHPTR,COVPTR)
 ..;I ($P($G(^AUTNINS(INSPTR,2)),U)'="K") D EN^AGEDPRVB(PARDFN,PARREC,0,AGINSREC,AGINSPTR,POLHPTR,COVPTR)  ;IHS/SD/TPF 3/8/2006 AG*7.1*1
 ..I ($P($G(^AUTNINS(AGINSPTR,2)),U)'="K") D EN^AGEDPRVB(PARDFN,PARREC,0,AGINSREC,AGINSPTR,POLHPTR,COVPTR)  ;IHS/SD/TPF 3/8/2006 AG*7.1*2
 .I AGTYPE="T" D
 ..S PARDFN=$P($P(AGINSREC,U,11),",")
 ..S PARDT=$P($P(AGINSREC,U,11),",",2)
 ..S NEWENTRY=0
 ..D EN^AGEDTPL(PARDFN,PARDT,NEWENTRY,AGINSREC)
 .I AGTYPE="W" D
 ..S PARDFN=$P($P(AGINSREC,U,11),",")
 ..S PARDT=$P($P(AGINSREC,U,11),",",2)
 ..S NEWENTRY=0
 ..D EN^AGEDWC(PARDFN,PARDT,NEWENTRY)
 .I AGTYPE="G" D
 ..S PARDFN=$P($P(AGINSREC,U,11),",")
 ..;S PARDT=$P($P(AGINSREC,U,11),",",3)
 ..;S PARFIL=$P($P(AGINSREC,U,11),",",2)
 ..S PARDT=$P($P(AGINSREC,U,11),",",2)
 ..S PARFIL=$P($P(AGINSREC,U,11),",",3)
 ..S NEWENTRY=0
 ..D EN^AGEDGUAR(PARDFN,PARFIL,PARDT,NEWENTRY,AGINSREC)
 ..K PARDFN,PARFIL,PARDT,NEWENTRY
 Q
ADDINS ;EP
 N DIC,AGANS,AGMEANT
 K ADDCHK,AGNEWINS
 S DIC="^AUTNINS("
 ;IHS/OIT/NKD AG*7.1*11 REMOVED SITE SPECIFIC CHECK - START OLD CODE
 ;X ^%ZOSF("UCI")
 ;AG*7.1*2 IM21372 ;PER ADRIAN/SANDRA SITE SPECIFIC CHECK
 ;THE SPECIAL LOOKUP ROTUINE DOES NT WORK RIGHT AT WWH (TALEQUAH/WWHASTINGS)
 ;I $P(Y,",")="WWH" D
 ;.S DIC(0)="AEMQZI"
 ;.S DIC("W")="S ZIP=$P(^(0),U,5),ST=$P(^(0),U,2),CITY=$P(^(0),U,3) S:$P(^(0),U,4)'="""" STA=$P($G(^DIC(5,$P(^(0),U,4),0)),U,2) W ?40,ST,!?40,CITY,"", "",$G(STA),"" "",ZIP,!"
 ;E  D
 ;.S DIC(0)="AEMQZ"
 ;.S DIC("S")="I $P($G(^(1)),U,7)'=0"
 ;END OLD CODE - START NEW CODE
 S DIC(0)="AEMQZ"
 S DIC("S")="I $P($G(^(1)),U,7)'=0"
 ;END NEW CODE
 D ^DIC
 I +Y<1 W !!,"Must enter an existing insurer" K DIC H 2 Q
 S AGELP("INS")=+Y
 K DIC
 ;BEGIN NEW CODE IHS/SD/TPF AG*7.1*1 ITEM 18
 N NOADD
 I $$ISMINOR^AGUTILS(DFN) D  I NOADD K NOADD Q
 .N INSNM,INSTYP
 .S NOADD=0
 .S INSNM=$P($G(^AUTNINS(AGELP("INS"),0)),U)
 .S INSTYP=$P($G(^AUTNINS(AGELP("INS"),2)),U)
 .I INSNM[("MEDICARE")!(INSNM[("RAILROAD RETIREMENT")) S NOADD=1
 .I INSTYP="R" S NOADD=1
 .I AGELP("INS")=1 S NOADD=1
 .;I NOADD W !,"A MINOR CANNOT BE THE POLICY HOLDER FOR "_$G(INSNM) H 3 Q
 .Q:'NOADD
 .K DIR
 .S DIR(0)="Y"
 .S DIR("A")="A MINOR CANNOT BE THE POLICY HOLDER FOR "_$G(INSNM)_"..DO YOU WISH TO ADD ENTRY?//"  ;IHS/SD/TPF 4/28/2006 AG*7.1*2 IM20637
 .S DIR("B")="N"
 .D ^DIR
 .I Y S NOADD=0
 K NOADD
 ;END NEW CODE
 S AGNEWINS=""
 S AGTYPE=$P($G(^AUTNINS(AGELP("INS"),2)),U)
 ;AG/SD/TPF 12/20/2005 AG*7.1*1 ITEM 2
 I AGTYPE="MD" D  G:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) ADDINS
 .K DIR,DIE,DR,DIC
 .W !!,"YOU HAVE CHOSEN A MEDICARE PART D INSURER."
 .S DIR("A")="IS THIS FOR MEDICARE OR RAILROAD RETIREMENT?"
 .S DIR("B")="MEDICARE"
 .S DIR(0)="SBO^M:MEDICARE;R:RAILROAD"
 .D ^DIR
 .S AGMEANT=Y
 ;NEXT TWO LINES FOR AG*7.1*1 ITEM 2
 I AGTYPE="MD",(AGMEANT="M") S AGELDT=0 D EN^AGED4("") Q:'$O(^AUPNMCR(DFN,11,0))  D EN^AGED42(DFN,,0) Q
 I AGTYPE="MD",(AGMEANT="R") S AGELDT=0 D EN^AGED6("") Q:'$O(^AUPNRRE(DFN,11,0))  D EN^AGED62(DFN,,0) Q
 I AGTYPE="R"&(AGELP("INS")'=1) S AGELDT=0 D EN^AGED4("") Q:'$O(^AUPNMCR(DFN,11,0))  D EN^AGED42(DFN,,0) Q
 I AGTYPE="R"&(AGELP("INS")=1) S AGELDT=0 D EN^AGED6("") Q:'$O(^AUPNRRE(DFN,11,0))  D EN^AGED62(DFN,,0) Q
 I AGTYPE="K",$$GET1^DIQ(9999999.18,AGELP("INS"),.38,"I")="P" S AGTYPE="P",AGKIDS=""
 I AGTYPE="D"!(AGTYPE="K") D  Q
 .S PARDFN=""
 .S PARDT=""
 .S NEWENTRY=1
 .D EN^AGEDMCD(PARDFN,PARDT,NEWENTRY)
 I AGTYPE="T" D  Q
 .S PARDFN=""
 .S PARDT=""
 .S NEWENTRY=1
 .S AGSELECT=""
 .D EN^AGEDTPL(PARDFN,PARDT,NEWENTRY,AGSELECT,AGELP("INS"))
 .K PARDFN,PARDT,NEWENTRY,AGSELECT
 I AGTYPE="W" D  Q
 .S PARDFN=""
 .S PARDT=""
 .S NEWENTRY=1
 .D EN^AGEDWC(PARDFN,PARDT,NEWENTRY)
 .K PARDFN,PARDT,NEWENTRY,AGSELECT
 I AGTYPE="G" D  Q
 .S PARDFN=""
 .S PARDT=""
 .S PARFIL=""
 .S NEWENTRY=1
 .D EN^AGEDGUAR(PARDFN,PARFIL,PARDT,NEWENTRY)
 .K PARDFN,PARFIL,PARDT,NEWENTRY
 ;IHS/SD/TPF AG*7.1*1 REPLACE OLD GOTO CODE FOR PRVT INS/ EDIT SCREENS
 ;D ^AGED7  ;OLD PRVT INSURANCE SCREEN
 D
 .S ID0=DFN
 .;S INSPTR=$G(AGELP("INS"))
 .S AGINSPTR=$G(AGELP("INS"))  ;IHS/SD/TPF 3/8/2006 AG*7.1*1
 .S POLHPTR=""
 .D EN^AGEDPRV(ID0,.ID1,1,"",AGINSPTR,.POLHPTR,.COVPTR)
 .Q:$G(ID1)=""
 .K PARDFN,PARFIL,PARINS,NEWENTRY,AGSELECT
 .Q:$G(Y)=AGOPT("ESCAPE")
 .I '$O(^AUPNPRVT(ID0,11,0)) Q
 .;D:$G(INSPTR)'=""&('$D(AGKIDS))&($G(POLHPTR)'="")&($G(COVPTR)'="") EN^AGEDPRVB(ID0,ID1,1,"",$G(INSPTR),$G(POLHPTR),$G(COVPTR))
 .D:$G(AGINSPTR)'=""&('$D(AGKIDS))&($G(POLHPTR)'="")&($G(COVPTR)'="") EN^AGEDPRVB(ID0,ID1,1,"",$G(AGINSPTR),$G(POLHPTR),$G(COVPTR))
 ;Q:$G(Y)=AGOPT("ESCAPE")
 ;I '$O(^AUPNPRVT(DFN,11,0)) Q
 ;D:$G(INSPTR)'=""&('$D(AGKIDS))&($G(AGELP("PH"))'="") ^AGED7B
 ;END IHS/SD/TPF AG*7.1*1
 K AGINS
 D ^AGINS
 Q