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

AGEDMCD.m

Go to the documentation of this file.
AGEDMCD ; IHS/ASDS/TPF - NEW EDIT/DISP MCD SCREEN - REPLACES AGED5 AND AGED51 ;    
 ;;7.1;PATIENT REGISTRATION;**1,2,11**;AUG 25, 2005;Build 1
 ;IHS/OIT/NKD AG*7.1*11 MU2 UNKNOWN SEX
 ;
EN(WD0,WD1,NEWENTRY,AGSELECT,AGOPTION) ;EP
 S AG("PG")="4MCDA"
 K DEFEDDT
 S EXIT=0
 I NEWENTRY D  Q:EXIT
 .S EXIT=0
 .D DRAW,NEWENTRY I +$G(Y)<0 S EXIT=1 W !,"Entry could not be created." H 2 D END Q
 .D MSG,MEDSTATE
 .D AEFFDT I +$G(Y)<0 D CLEANZER(WD0) S EXIT=1 W !,"New entry not made" H 2 D END Q
 .D MEDNUM
 .D MEDNAME
 .D MEDDOB
 .D:$G(^AGFAC(DUZ(2),"NEWADDINS"))&($P($G(AGOPTION),U)="AGADD") PCP,GRPNAME,PLANNM,RATECD,CCONFILE
 .S COMPIEN=WD0_",11,"_WD1_","_0
 .;S AGSELECT=$$UPDTSEL^AGUTILS("FINDMCD",.AGINS,COMPIEN)
 .S AGSELECT=$$UPDTSEL^AGUTILS(.AGINS,COMPIEN,AGELP("INS"))  ;AG*7.1*1 IM18549 ERROR IN ERROR MSG UPDATE
 .S NEWENTRY=0
 S COMPIEN=WD0_",11,"_WD1_","_0
VAR D DRAW
 Q:$D(AGSEENLY)
 W !,AGLINE("EQ")
 K DIR
 S DIR("A")="ENTER <E>dit a field OR <D>elete an eligibility date :"
 S DIR(0)="SAO^E:EDIT;D:DELETE"
 D ^DIR
 I Y="",'$O(^AUPNMCD(WD0,11,0)) D CLEAN(WD0) D END Q
 I $D(MYERRS("C","E"))&(Y'?1N.N)&(Y'="E")&(Y'="D")&(Y'=AGOPT("ESCAPE")) W !,"ERRORS ON THIS PAGE. PLEASE EDIT AND FIX BEFORE EXITING!!" H 3 G VAR
 Q:Y=AGOPT("ESCAPE")
 Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
 I Y="A" D AEFFDT G VAR
 I Y="D" D  Q:'$D(^AUPNMCD(WD0))  G VAR
 .D EFFDT
 .I '$O(^AUPNMCD(WD0,11,0)) D CLEAN(WD0),END
 K DIR
 S DIR("?")="Enter your choice now."
 S DIR("?",1)="You may enter the item number of the field to edit,"
 S DIR("?",2)="OR 'P#' where P stands for 'page' and '#' stands for"
 S DIR("?",3)="the page to jump to, OR enter '^' to go back one page"
 S DIR("?",4)="OR, enter '^^' to exit the edit screens, OR RETURN to go to the next screen."
 S DIR("A")="CHANGE which item? (1-"_AG("N")_") NONE// "
 D READ^AGED1
 I Y[(",") G CONT
 I $D(MYERRS("C","E")),(Y'?1N.N),(Y'=AGOPT("ESCAPE")) W !,"ERRORS ON THIS PAGE. PLEASE FIX BEFORE EXITING!!" H 3 G VAR
 Q:Y=AGOPT("ESCAPE")
 G END:$D(DLOUT)!(Y["N")!$D(DUOUT),VAR:$D(AG("ERR"))
 Q:$D(DFOUT)!$D(DTOUT)
 I $D(DQOUT)!(+Y<1)!(+Y>AG("N")) W !!,"You must enter a number from 1 to ",AG("N") H 2 G VAR
CONT ;
 S AGY=Y
 F AGI=1:1 S AG("SEL")=+$P(AGY,",",AGI) Q:AG("SEL")<1!(AG("SEL")>AG("N"))  D @($P(AG("C"),",",AG("SEL")))
 ;S AGSELECT=$$UPDTSEL^AGUTILS("FINDMCD",.AGINS,COMPIEN)
 S AGSELECT=$$UPDTSEL^AGUTILS(.AGINS,COMPIEN,$P(AGSELECT,U,2))  ;AG*7.1*1 IM18549 ERROR IN ERROR MSG UPDATE
 D UPDATE1^AGED(DUZ(2),DFN,3,"")
 N DIE,DA,DR
 S DIE="^AUPNMCD("
 S DA=WD0
 S DR=".08///TODAY"
 D ^DIE
 K AGI,AGY
 G VAR
CLEAN(WD0) ;IF NO ELIG DTS, CLEAN EMPTY RECORD.
 D CLEANZER(WD0)
 Q
CLEANZER(WD0) ;EP - CLEAN ZERO NODE WITH NO DTS
 K DIK,DA
 S DIK="^AUPNMCD(",DA=WD0 D ^DIK
 Q
END K AG,DLOUT,DTOUT,DFOUT,DQOUT,DA,DIC,DR,AGSCRN,Y,ADA,WDA,ADT,WDT
 K ADFN,WDFN,REC,DEFEDDT,DATESORT,AGERRSOL,MYERRS,MYVARS
 Q
DRAW ;EP
 S AG("PG")="4MCDA"
 S ROUTID=$P($T(+1)," ")
 ;D HDR
 D HDR^AGEDMCD1  ;AG*7.1*1 PER SAC REQUIREMENT RTN TOO LARGE
 D GETAW
 Q
GETAW ;DISP
 K AG("C")
 ;F AG=1:1 D  Q:$G(AGSCRN)[("*END*")
 F AG=1:1 D  Q:$G(AGSCRN)[("*END*")!(EXIT)
 . S AGSCRN=$P($T(@1+AG),";;",2,15)
 . Q:AGSCRN[("*END*")
 . ;PLACE SECTION TITLES HERE
 . S CAPTION=$P(AGSCRN,U)  ;FLD CAP
 . S DIC=$P(AGSCRN,U,3)  ;FILE OR SUBFILE #
 . S DR=$P(AGSCRN,U,4)  ;FLD #
 . S NEWLINE=$P(AGSCRN,U,5)  ;NEWLINE OR INDENT
 . S CAPDENT=$P(AGSCRN,U,2)  ;CAP INDENT
 . S ITEMNUM=$P(AGSCRN,U,6)  ;ITEM #
 . S TAGCALL=$P(AGSCRN,U,7)  ;TAG TO CALL TO EDIT THIS FLD
 . S EXECUTE=$P(AGSCRN,"|",2)  ;USE TO DISP FLD WHICH IS DEPENDENT ON OTHER FLD
 . S PREEXEC=$P(AGSCRN,"|",3)  ;PLACE CODE TO BE XECUTED PRIOR TO DISP OF THE FLD
 . S PRECAPEX=$P(AGSCRN,"|",4)  ;PLACE CODE TO EXECUTE BEF CAP/FLD LBL
 . S POSTEXEC=$P(AGSCRN,"|",5)  ;PLACE CODE HERE TO BE EXECUTED AFT DISP OF THE FLD DATA
 . S:TAGCALL'="" $P(AG("C"),",",ITEMNUM)=TAGCALL  ;SELECTION STRING
 . ;WRITE THE ITEM #,CAP OR FLD LBL, AND LINE
 . W @NEWLINE
 . W ITEMNUM
 . W $S(ITEMNUM'="":". ",1:"")
 . I PRECAPEX="" W @CAPDENT,$S($G(CAPTION)'="":CAPTION_": ",$G(CAPTION)="":"",1:$P($G(^DD(DIC,DR,0)),U)_": ")
 . I PRECAPEX'="" X PRECAPEX I $T W @CAPDENT,$S($G(CAPTION)'="":CAPTION_": ",$G(CAPTION)="":"",1:$P($G(^DD(DIC,DR,0)),U)_": ")
 .;IF EDITING, DISP DATA ONLY
 .;E DISP ONLY THE CAPS
 .I 'NEWENTRY D
 .. S D0=WD0
 .. I DIC'["." D
 ... S D0=D0_","
 ... I PREEXEC'="" X PREEXEC I $T W $$GET1^DIQ(DIC,D0,DR)
 ... ;DO NOT PRINT FLD FIRST IF EXECUTE EXISTS
 ... I PREEXEC="",EXECUTE="" W $$GET1^DIQ(DIC,D0,DR)
 ... ;IHS/SD/TPF 9/27/2005 AG*7.1*1 FIX SO STATE FIELD CAN BE POPULATED IF FOUND NOT SO
 ... I DR=.04 S STATEVAL=$$GET1^DIQ(DIC,D0,DR)
 ... I AG=2 D
 .... N DIE,D0,DR
 .... S DIC=9000004
 .... S D0=WD0
 .... S DR=".08"
 .... W ?21,"("_$$GET1^DIQ(DIC,D0,DR)_")"
 ... I EXECUTE'="" S D0=$TR(D0,",") X EXECUTE
 ... I POSTEXEC'="" X POSTEXEC
 .. I DIC["."  D
 ... S D0=WD1_","_D0_","
 ... ;D GETDATES(WD0)
 ... D GETDATES^AGEDMCD1(WD0)  ;AG*7.1*1 SAC REQUIREMENT RTN TOO LARGE
 S AG("N")=$L(AG("C"),",")
 W !,$G(AGLINE("-"))
 ;IHS/SD/TPF 9/28/2005 AG*7.1*1 MANDATORY FIELD
 ;I $G(STATEVAL)="",('$G(NEWENTRY)) W !,"STATE FIELD MUST BE POPULATED" D MEDSTATE I X="" W !,"STATE NOT ENTERED, THIS RECORD WILL BE DELETED"
 I '$D(AGSEENLY),($G(STATEVAL)=""),('$G(NEWENTRY)) W !,"STATE FIELD MUST BE POPULATED" D MEDSTATE D:X'="" UPDATE1^AGED(DUZ(2),DFN,3,"") I X="" W !,"STATE NOT ENTERED, THIS RECORD WILL BE DELETED"  ;AG*7.1*2 IM21493
 K MYERRS,MYVARS
 D FETCHERR^AGEDERR(AG("PG"),.MYERRS)
 S MYVARS("DFN")=$S($G(AUPNPAT)'="":AUPNPAT,1:DFN),MYVARS("FINDCALL")="FINDMCD",MYVARS("SELECTION")=$G(AGSELECT),MYVARS("SITE")=DUZ(2)
 I '$G(NEWENTRY) D EDITCHEK^AGEDERR(.MYERRS,.MYVARS,1)
 W !,$G(AGLINE("-"))
 D VERIF^AGUTILS
 I $D(AGSEENLY) S DIR("A")="Press return: ",DIR(0)="FO" D ^DIR Q
 Q
MSG ;DISP IF NEW ENTRY
 W !,"You have entered a new record for "_$P($G(^DPT(DFN,0)),U)_" in the MEDICAID file."
 Q
 ; MCD ELIG FLDS
NEWENTRY ;NEW ENTRY
 W !!
 N TEMPDFN
 K DIC,DIE,DR,DA,DO,DD,DIR
 S DIC="^AUPNMCD("
 S DIC(0)="LN"
 S X="`"_DFN
 S TEMPDFN=DFN
 S DIC("S")="I $P(^(0),U)'=TEMPDFN,($G(Y)'=TEMPDFN)"  ;WHEN ADDING IGNORE ENTRIES ALREADY THERE, ALSO DO NOT LOOK UP ENTRIES IN AUPNMCD WHICH = DFN
 D ^DIC
 S DFN=TEMPDFN
 Q:+Y'>0
 S ADDCHK=""
 S WD0=+Y
 S NEWENTRY=0
 S DIE=DIC
 S DA=WD0
 ;FORCE INSPTR TO BE "MEDICAID"
 S AGELP("INS")=$O(^AUTNINS("B","MEDICAID",""))
 S DR=".02////^S X=AGELP(""INS"")"
 ;IHS/OIT/NKD AG*7.1*11 MU2 - STUFF PT SEX INTO ELIGIBLE SEX FIELD - START NEW CODE
 N AGSEX
 S AGSEX=$$GET1^DIQ(2,DFN,.02,"I")
 S DR=DR_";.07////^S X=AGSEX"
 ;IHS/OIT/NKD AG*7.1*11 MU2 - END NEW CODE
 D ^DIE
 Q
MEDSTATE ;MCD ST EDIT FOR NEW ENTRY
 K DIC,DIE,DR
 S DA=WD0
 S DIE="^AUPNMCD("
 S DR=".04"
 S DIE("NO^")=""
 D ^DIE
 K DIC,DR,DIE
 Q
AEFFDT ;ADD EFF DT
 K DIC,DIE,DR
 I $G(WD1)'="" S DIC("B")=WD1
 I $G(DEFEDDT)'="" S DIC("B")=DEFEDDT   ;IF DEFAULT USE IT
 I '$D(^AUPNMCD(WD0,11,0)) S ^AUPNMCD(WD0,11,0)="^9000004.11D^0^0"
 S DA(1)=WD0
 S DIC="^AUPNMCD("_DA(1)_",11,"
 S DLAYGO=9000004.11
 S DIC(0)="AEL"
 S DIC("A")="Select ELIG. DATE: "
 D ^DIC
 Q:+Y<1
 S WD1=+Y
 I $P(Y,U,3) D ENDDATE Q
 K DIC,DIE,DR,DA
EFFDT ;ELIG DTS AND COV TYPE
 K DIC,DIE,DR,DA
 I WD1="" D AEFFDT Q  ;IF WD1 IS NULL, EFF DTS WERE ALL CANCELLED
 ;BEGIN NEW CODE IHS/SD/TPF 10/11/2005 AG*7.1*1
 ;REINSTATE CHECK FOR ENTRIES IN 3PB FILES
 K IN3PB
 S IN3PB=$$USED^AGUTILS(DFN,$P($G(AGSELECT),U,2),7,WD1,WD0)
 I $L(IN3PB) D  Q:$G(CANCELED)
 .W !?15,"WARNING: This member has outstanding claims and/or bills!!!"
 .W !?24,"Deleting an eligiblity date may cause data integrity problems"
 .W !?24,"in the Third Party Billing package!!"
 .K DIR,DIE,DA,DIC,DR
 .S DIR(0)="Y"
 .S DIR("B")="N"
 .S DIR("A")="Continue?"
 .D ^DIR
 .S CANCELED=Y=0
 ;END NEW CODE
 S DA=WD1
 S DA(1)=WD0
 S DIE="^AUPNMCD("_DA(1)_",11,"
 S DR=".01"
 S DR(2,9000004.11)=".01"
 D ^DIE
 K DIC,DR,DIE
 Q:'$D(DA)  ;IF NO DA, ENTRY WAS DELETED
 ;COMPARE EFF AND EXP DTS
 I '$$GOODDT(WD0,WD1) G EFFDT
ENDDATE ;
 K DIC,DIE,DR
 S DA=WD1
 S DA(1)=WD0
 S DIE="^AUPNMCD("_DA(1)_",11,"
 S DR=".02"
 D ^DIE
 K DIC,DR,DIE
 ;COMPARE EFF AND EXP DTS
 I '$$GOODDT(WD0,WD1) G ENDDATE
COVTYPE ;
 K DIC,DIE,DR
 S DA=WD1
 S DA(1)=WD0
 S DIE="^AUPNMCD("_DA(1)_",11,"
 ;CHK INSURER FILE. IS COV TYPE REQ'D
 ;I '$$30^AGEROVR(30,$G(AGSELECT)) D   ;AG*7.1*1 IM20154
 I '$$30^AGEROVR(30,$S($G(AGSELECT)'="":$G(AGSELECT),1:U_$G(AGELP("INS"))_U)) D
 . S DR=".03R"
 . S DIE("NO^")=""
 E  S DR=".03"
 D ^DIE
 K DIC,DR,DIE
 D OVERLAP(WD0,WD1)
 Q
OVERLAP(WD0,WD1) ;EP - DETERMINE OVERLAPPING ELIG RANGES
 ;GET TARGET INFO
 S TDT1=WD1
 S TDT2=$P($G(^AUPNMCD(WD0,11,WD1,0)),U,2)
 S TTYP=$P($G(^AUPNMCD(WD0,11,WD1,0)),U,3)
 S OVERLAP=0
 S DT1=""
 S OPENEND=0
 S DT1=0
 F  S DT1=$O(^AUPNMCD(WD0,11,DT1)) Q:DT1=""!(OVERLAP)  D
 .Q:DT1=TDT1  ;IF ITS THE SAME ENTRY THEY JUST PUT IN SKIP
 .S TYP=$P($G(^AUPNMCD(WD0,11,DT1,0)),U,3)
 .Q:TYP'=TTYP  ;IF THE TYPE OF COV NOT THE SAME IT DOESN'T MATTER
 .S DT2=$P($G(^AUPNMCD(WD0,11,DT1,0)),U,2)
 .I DT2="" S DT2=9999999
 .I TDT1=DT2 S OVERLAP=1 Q
 .I TDT1>DT1,(TDT1<DT2) S OVERLAP=1 Q
 I OVERLAP D
 .W !!,"YOU HAVE ENTERED A COVERAGE DATE RANGE WHICH OVERLAPS WITH ANOTHER ALREADY"
 .W !,"EXISTING FOR THIS PATIENT! THE ENTRY WILL NOT BE ALLOWED!" H 3
 .;ELIG DTS AND COV TYPE
 .K DIC,DIE,DR
 .I WD1="" D AEFFDT Q  ;IF WD1 IS NULL, EFF DTS WERE ALL CANCELLED
 .S DA=WD1
 .S DA(1)=WD0
 .S DIE="^AUPNMCD("_DA(1)_",11,"
 .S DR=".01////@"
 .S DR(2,9000004.11)=".01"
 .D ^DIE
 .K DIC,DR,DIE
 Q
MEDNUM ;MCD #
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 S DR=".03"
 S DIE("NO^")=""
 D ^DIE
 K DIC,DR,DIE,DA
 Q
MEDNAME ;MCD NAME
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 S DR="2101"
 I $G(NEWENTRY)!($P($G(^AUPNMCD(WD0,21)),U)="") S DR=DR_"//"_$P($G(^DPT(DFN,0)),U)
 D ^DIE
 K DIC,DR,DIE,DA
 Q
MEDDOB ;MCD DOB
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 S DR="2102"
 I $G(NEWENTRY)!($P($G(^AUPNMCD(WD0,21)),U,2)="") N AGDOB,Y S Y=$P($G(^DPT(DFN,0)),U,3) X ^DD("DD") S AGDOB=Y S DR=DR_"//"_AGDOB
 D ^DIE
 K DIC,DR,DIE,DA,AGDOB
 Q
PCP ;PRIM CARE PROV
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 S DR=".14"
 D ^DIE
 K DIC,DR,DIE,DA
 Q
GRPNAME ;GRP NAME
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 S DR=".17"
 D ^DIE
 K DIC,DR,DIE,DA
 Q
PLANNM ;PLAN NAME
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 ;CHK INSURER FILE. IS PLAN NAME REQ'D
 ;I '$$20^AGEROVR(20,$G(AGSELECT)) D  ;AG*7.1*1 IM20154 
 I '$$20^AGEROVR(20,$S($G(AGSELECT)'="":$G(AGSELECT),1:U_$G(AGELP("INS"))_U)) D
 . S DR=".11R"
 . S DIE("NO^")=""
 E  S DR=".11"
 D ^DIE
 K DIC,DR,DIE,DA
 Q
RATECD ;RATE CODE
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 ;CHK INSURER FILE. IS RATE REQ'D
 ;I '$$31^AGEROVR(31,$G(AGSELECT)) D  ;AG*7.1*1 IM20154
 I '$$31^AGEROVR(31,$S($G(AGSELECT)'="":$G(AGSELECT),1:U_$G(AGELP("INS"))_U)) D
 . S DR=".12R"
 . S DIE("NO^")=""
 E  S DR=".12"
 D ^DIE
 K DIC,DR,DIE,DA
 Q
CCONFILE ;CC ON FILE
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DA=WD0
 S DIE="^AUPNMCD("
 ;S DR=".15;.16"
 ;BEGIN NEW CODE IHS/SD/TPF AG*7.1*1 ITEM 5
 S DR=.15
 D ^DIE
 I $P($G(^AUPNMCD(WD0,0)),U,15)[("Y") D
 .K DIC,DR,DIE,DA
 .S DA=WD0
 .S DIE="^AUPNMCD("
 .S DR=".16R",DIE("NO^")=""
 .D ^DIE
 I $P($G(^AUPNMCD(WD0,0)),U,15)[("N") D
 .K DIC,DR,DIE,DA
 .S DA=WD0
 .S DIE="^AUPNMCD("
 .S DR=".16////@"
 .D ^DIE
 ;END NEW CODE
 K DIC,DR,DIE,DA
 Q
GOODDT(AD0,AD1) ;EP -
 N BDT,EDT
 S BDT=$P($G(^AUPNMCD(WD0,11,WD1,0)),U)
 S EDT=$P($G(^AUPNMCD(WD0,11,WD1,0)),U,2)
 I EDT,'BDT W !,"CANNOT HAVE AN ENDING DATE WITHOUT A BEGINNING DATE! TRY AGAIN" Q 0
 I EDT<BDT&(+EDT'=0) W !,"ENDING DATE IS LESS THAN THE EFFECTIVE DATE! TRY AGAIN" Q 0
 I BDT>EDT&(+EDT'=0) W !,"EFFECTIVE DATE IS GREATER THAN THE ENDING DATE! TRY AGAIN" Q 0
 Q 1
 ; ****************************************************************
 ; ON LINES BELOW:
 ; U "^" DELIMITED
 ; PIEC  1= FLD LBL
 ; PIECE 2= POS ON LINE TO DISP ITEM #
 ; PIECE 3= FILE #
 ; PIECE 4= FLD #
 ; PIECE 5= NEW LINE OR NOT (MUST BE EITHER A '!' OR '?#') USE THIS TO INDENT THE CAP
 ; PIECE 6= ITEM # OVERIDE. USE THIS TO ASSIGN THE ITEM # TO CHOOSE THIS
 ;          FLD ON THE SCREEN
 ; PIECE 7= TAG TO CALL WHEN THIS FLD IS CHOSEN TO EDIT
 ;
 ; BAR "|" DELIMITED
 ; PIECE 2= EXECUTE CODE TO GET FLD THAT ANOTHER IS POINTING TO. EXECUTED AFT FLD PRINT
 ; PIECE 3= EXECUTE CODE TO DO BEF FLD DATA PRINTS. USE TO SCREEN OUT PRINTING A FLDS DATA
 ; PIECE 4= EXECUTE CODE TO DO BEF PRINTING THE CAP OR FLD LBL. USE TO SCREEN OUT PRINTING A CAP/FLD LBL
 ; PIECE 5= EXECUTE CODE TO DO AFT PRINTING THE FLD DATA
 ;;^?3^9000004.11^.03^?59^^^
 ;;^?3^9000004.11^.02^?68^^
1 ;
 ;;STATE^?3^9000004^.04^!^^
 ;;^?0^9000004^.03^!^1^MEDNUM
 ;;^?3^9000004.11^.01^?36^2^AEFFDT
 ;;MEDICAID NAME^?3^9000004^2101^!!^3^MEDNAME
 ;;MED. DATE OF BIRTH^?3^9000004^2102^?45^4^MEDDOB
 ;;PRIM CARE PROVIDER^?3^9000004^.14^!^5^PCP
 ;;GROUP NAME^?3^9000004^.17^!^6^GRPNAME
 ;;GROUP NUMBER^?3^9000004^.17^?45^^^|W $S($$GET1^DIQ(DIC,D0,DR,"I"):$P($G(^AUTNEGRP($$GET1^DIQ(DIC,D0,DR,"I"),0)),U,2),1:"")
 ;;PLAN NAME^?3^9000004^.11^!^7^PLANNM
 ;;RATE CODE^?3^9000004^.12^!^8^RATECD
 ;;CC ON FILE^?3^9000004^.15^!^9^CCONFILE
 ;;DATE^?3^9000004^.16^?28^^^||I $D(D0),$$GET1^DIQ(DIC,D0,.15,"I")="Y"|I $D(D0),$$GET1^DIQ(DIC,D0,.15,"I")="Y"
 ;;*END*