DG53P936 ;KUM - HEALTH BENEFIT PLANS UPDATE ;1/08/17 9:18am
;;5.3;Registration;**936**;Aug 13, 1993;Build 20
;;Per VHA Directive 2004-038, this routine should not be modified.
;
; KUM; DG*5.3*936 Post Install routine to add data about 6 new plans
; Integration Agreements:
; 10141 : BMES^XPDUTL
; : MES^XPDUTL
; 10018 : UPDATE^DIE
;
Q
;
POST ;Update 6 Health Benefit Plans
;
L +^DGHBP(25.11,0):10 I '$T D BMES^XPDUTL(" Health Benefit Plan (#25.11) File is locked by another user. Try later. ") Q
N HBPERR
S HBPERR=""
D BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Basic ")
D UPDPS1
D BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Mileage ")
D UPDPS2
D BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Wait Time ")
D UPDPS3
D BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - VC Unusual and Excessive Burden ")
D UPDPS4
D BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Air, Boat, or Ferry ")
D UPDPS5
D BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Military Sexual Trauma ")
D UPDPS6
L -^DGHBP(25.11,0)
Q
;
UPDPS1 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Basic
;
N FIELDS,ERR
S ERR=""
S FIELDS("NAME")="Veteran Plan - Veterans Choice Basic"
S FIELDS("PLANCODE")=200
S FIELDS("COVERAGECODE")="VC01001"
S FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system and does not "
S FIELDS("SD",2)="qualify for the Services at this time."
S FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system and does not "
S FIELDS("LD",2)="qualify for the Services at this time."
D UPDREQ(.FIELDS,1,.ERR)
I ERR'="" D
. D BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Basic.")
. D MES^XPDUTL(" Please log CA SDM ticket.")
. S HBPERR=ERR
. Q
;
Q
UPDPS2 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Mileage
;
N FIELDS,ERR
S ERR=""
S FIELDS("NAME")="Veteran Plan - Veterans Choice Mileage"
S FIELDS("PLANCODE")=201
S FIELDS("COVERAGECODE")="VC01002"
S FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. The Veteran meets "
S FIELDS("SD",2)="mileage criteria as described by legislation. This is calculated from the "
S FIELDS("SD",3)="VA medical facility that is closest to the residence of the Veteran, defined "
S FIELDS("SD",4)="as a VA hospital, community-based outpatient clinic, or VA health care center "
S FIELDS("SD",5)="with at least one full-time primary care physician. The distance is calculated "
S FIELDS("SD",6)="using driving distance."
S FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. The Veteran meets "
S FIELDS("LD",2)="mileage criteria as described by legislation. This is calculated from the "
S FIELDS("LD",3)="VA medical facility that is closest to the residence of the Veteran, defined "
S FIELDS("LD",4)="as a VA hospital, community-based outpatient clinic, or VA health care center "
S FIELDS("LD",5)="with at least one full-time primary care physician. The distance is calculated "
S FIELDS("LD",6)="using driving distance."
D UPDREQ(.FIELDS,1,.ERR)
I ERR'="" D
. D BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Mileage.")
. D MES^XPDUTL(" Please log CA SDM ticket.")
. S HBPERR=ERR
. Q
;
Q
UPDPS3 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Wait Time
;
N FIELDS,ERR
S ERR=""
S FIELDS("NAME")="Veteran Plan - Veterans Choice Wait Time"
S FIELDS("PLANCODE")=202
S FIELDS("COVERAGECODE")="VC01003"
S FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. Veteran is told "
S FIELDS("SD",2)="by his/her local VA medical facility that he/she will need to wait more than "
S FIELDS("SD",3)="30 days for an appointment from the date clinically determined by his/her "
S FIELDS("SD",4)="VA health care provider or the date they wish to be seen if there is no "
S FIELDS("SD",5)="clinically determined date."
S FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. Veteran is told "
S FIELDS("LD",2)="by his/her local VA medical facility that he/she will need to wait more than "
S FIELDS("LD",3)="30 days for an appointment from the date clinically determined by his/her "
S FIELDS("LD",4)="VA health care provider or the date they wish to be seen if there is no "
S FIELDS("LD",5)="clinically determined date."
D UPDREQ(.FIELDS,1,.ERR)
I ERR'="" D
. D BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Wait Time")
. D MES^XPDUTL(" Please log CA SDM ticket.")
. S HBPERR=ERR
. Q
;
Q
UPDPS4 ;Setup new Health Benefit Plan - Veteran Plan - VC Unusual and Excessive Burden
;
N FIELDS,ERR
S ERR=""
S FIELDS("NAME")="Veteran Plan - VC Unusual and Excessive Burden"
S FIELDS("PLANCODE")=203
S FIELDS("COVERAGECODE")="VC01004"
S FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
S FIELDS("SD",2)="resides 40 miles or less from the nearest VA medical facility may face an "
S FIELDS("SD",3)="unusual or excessive burden in accessing such a facility based on: "
S FIELDS("SD",4)=". Geographical challenges"
S FIELDS("SD",5)=". Environmental factors such as:"
S FIELDS("SD",6)=" o Roads that are not accessible to the general public, such as a road through "
S FIELDS("SD",7)=" a military base or restricted area"
S FIELDS("SD",8)=" o Traffic, or"
S FIELDS("SD",9)=" o Hazardous weather conditions"
S FIELDS("SD",10)=". A medical condition that impacts the ability to travel"
S FIELDS("SD",11)=". Other factors (as determined by the Secretary of VA)"
S FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
S FIELDS("LD",2)="resides 40 miles or less from the nearest VA medical facility may face an "
S FIELDS("LD",3)="unusual or excessive burden in accessing such a facility based on: "
S FIELDS("LD",4)=". Geographical challenges"
S FIELDS("LD",5)=". Environmental factors such as:"
S FIELDS("LD",6)=" o Roads that are not accessible to the general public, such as a road through "
S FIELDS("LD",7)=" a military base or restricted area"
S FIELDS("LD",8)=" o Traffic, or"
S FIELDS("LD",9)=" o Hazardous weather conditions"
S FIELDS("LD",10)=". A medical condition that impacts the ability to travel"
S FIELDS("LD",11)=". Other factors (as determined by the Secretary of VA)"
D UPDREQ(.FIELDS,1,.ERR)
I ERR'="" D
. D BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Wait Time")
. D MES^XPDUTL(" Please log CA SDM ticket.")
. S HBPERR=ERR
. Q
;
Q
UPDPS5 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Air, Boat, or Ferry
;
N FIELDS,ERR
S ERR=""
S FIELDS("NAME")="Veteran Plan - Veterans Choice Air, Boat, or Ferry"
S FIELDS("PLANCODE")=204
S FIELDS("COVERAGECODE")="VC01005"
S FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
S FIELDS("SD",2)="resides 40 miles or less from the nearest VA medical facility and must travel "
S FIELDS("SD",3)="by air, boat, or ferry to reach such a facility."
S FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
S FIELDS("LD",2)="resides 40 miles or less from the nearest VA medical facility and must travel "
S FIELDS("LD",3)="by air, boat, or ferry to reach such a facility."
D UPDREQ(.FIELDS,1,.ERR)
I ERR'="" D
. D BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Air, Boat, or Ferry ;")
. D MES^XPDUTL(" Please log CA SDM ticket.")
. S HBPERR=ERR
. Q
;
Q
UPDPS6 ;Setup new Health Benefit Plan - Veteran Plan - Military Sexual Trauma
;
N FIELDS,ERR
S ERR=""
S FIELDS("NAME")="Veteran Plan - Military Sexual Trauma"
S FIELDS("PLANCODE")=205
S FIELDS("COVERAGECODE")="MS01001"
S FIELDS("SD",1)=""
S FIELDS("LD",1)=""
D UPDREQ(.FIELDS,1,.ERR)
I ERR'="" D
. D BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Military Sexual Trauma ;")
. D MES^XPDUTL(" Please log CA SDM ticket.")
. S HBPERR=ERR
. Q
;
Q
UPDREQ(FIELDS,NEW,ERR) ; Update entries in the HEALTH BENEFIT PLAN File (25.11)
;
; Input: FIELDS - Array of Field Values
; NEW - 0 to edit, 1 to create new entry
;
; Output: ERR - Error Text
;
N IEN,NAME,PLANCODE,COVERAGECODE,SD,LD,FDA,DGPFMSG,DGPFMS1
K ERR
S ERR=""
S NAME=$G(FIELDS("NAME"))
S PLANCODE=$G(FIELDS("PLANCODE"))
M SD=FIELDS("SD")
M LD=FIELDS("LD")
S COVERAGECODE=$G(FIELDS("COVERAGECODE"))
I NAME="" S ERR="Missing Health Benefit Plan Name" Q
I NEW D Q:ERR'=""
. I PLANCODE="" S ERR="Missing Plan Code" Q
. I '$D(SD) S ERR="Missing Short Description" Q
. I '$D(LD) S ERR="Missing Long Description" Q
. I COVERAGECODE="" S ERR="Missing Coverage Code" Q
. Q
;
; Check if entry exists, use it if it does
S IEN=$O(^DGHBP(25.11,"B",NAME,0))
I IEN D BMES^XPDUTL(" "_NAME_" already exists, no action is taken. ") Q
I NEW,'IEN S IEN="+1"
I 'NEW,'IEN S ERR="Health Benefit Plan Not Defined" Q 0
S IEN=IEN_","
;
S FDA(25.11,IEN,.01)=NAME
S:PLANCODE'="" FDA(25.11,IEN,.02)=PLANCODE
S:COVERAGECODE'="" FDA(25.11,IEN,.05)=COVERAGECODE
D UPDATE^DIE("E","FDA","","ERR")
I $D(ERR("DIERR")) S ERR=$G(ERR("DIERR",1,"TEXT",1)) Q
S IEN=$O(^DGHBP(25.11,"B",NAME,0))
I 'IEN D BMES^XPDUTL(" "_IEN_" entry is not found to update Short and Long Descripton fields. ") Q
D WP^DIE(25.11,IEN_",",.03,"","SD","DGPFMSG") ; SHORT DESCRIPTION
I $D(DGPFMSG) S ERR=$G(DGPFMSG("DIERR",1,"TEXT",1)) Q
D WP^DIE(25.11,IEN_",",.04,"","LD","DGPFMS1") ; LONG DESCRIPTION
I $D(DGPFMS1) S ERR=$G(DGPFMS1("DIERR",1,"TEXT",1)) Q
D BMES^XPDUTL(" "_NAME_" is added in HEALTH BENEFIT PLAN File. ")
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDG53P936 10315 printed Oct 16, 2024@18:41:03 Page 2
DG53P936 ;KUM - HEALTH BENEFIT PLANS UPDATE ;1/08/17 9:18am
+1 ;;5.3;Registration;**936**;Aug 13, 1993;Build 20
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ; KUM; DG*5.3*936 Post Install routine to add data about 6 new plans
+5 ; Integration Agreements:
+6 ; 10141 : BMES^XPDUTL
+7 ; : MES^XPDUTL
+8 ; 10018 : UPDATE^DIE
+9 ;
+10 QUIT
+11 ;
POST ;Update 6 Health Benefit Plans
+1 ;
+2 LOCK +^DGHBP(25.11,0):10
IF '$TEST
DO BMES^XPDUTL(" Health Benefit Plan (#25.11) File is locked by another user. Try later. ")
QUIT
+3 NEW HBPERR
+4 SET HBPERR=""
+5 DO BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Basic ")
+6 DO UPDPS1
+7 DO BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Mileage ")
+8 DO UPDPS2
+9 DO BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Wait Time ")
+10 DO UPDPS3
+11 DO BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - VC Unusual and Excessive Burden ")
+12 DO UPDPS4
+13 DO BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Veterans Choice Air, Boat, or Ferry ")
+14 DO UPDPS5
+15 DO BMES^XPDUTL(" Checking Entry in HEALTH BENEFIT PLAN File - Veteran Plan - Military Sexual Trauma ")
+16 DO UPDPS6
+17 LOCK -^DGHBP(25.11,0)
+18 QUIT
+19 ;
UPDPS1 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Basic
+1 ;
+2 NEW FIELDS,ERR
+3 SET ERR=""
+4 SET FIELDS("NAME")="Veteran Plan - Veterans Choice Basic"
+5 SET FIELDS("PLANCODE")=200
+6 SET FIELDS("COVERAGECODE")="VC01001"
+7 SET FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system and does not "
+8 SET FIELDS("SD",2)="qualify for the Services at this time."
+9 SET FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system and does not "
+10 SET FIELDS("LD",2)="qualify for the Services at this time."
+11 DO UPDREQ(.FIELDS,1,.ERR)
+12 IF ERR'=""
Begin DoDot:1
+13 DO BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Basic.")
+14 DO MES^XPDUTL(" Please log CA SDM ticket.")
+15 SET HBPERR=ERR
+16 QUIT
End DoDot:1
+17 ;
+18 QUIT
UPDPS2 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Mileage
+1 ;
+2 NEW FIELDS,ERR
+3 SET ERR=""
+4 SET FIELDS("NAME")="Veteran Plan - Veterans Choice Mileage"
+5 SET FIELDS("PLANCODE")=201
+6 SET FIELDS("COVERAGECODE")="VC01002"
+7 SET FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. The Veteran meets "
+8 SET FIELDS("SD",2)="mileage criteria as described by legislation. This is calculated from the "
+9 SET FIELDS("SD",3)="VA medical facility that is closest to the residence of the Veteran, defined "
+10 SET FIELDS("SD",4)="as a VA hospital, community-based outpatient clinic, or VA health care center "
+11 SET FIELDS("SD",5)="with at least one full-time primary care physician. The distance is calculated "
+12 SET FIELDS("SD",6)="using driving distance."
+13 SET FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. The Veteran meets "
+14 SET FIELDS("LD",2)="mileage criteria as described by legislation. This is calculated from the "
+15 SET FIELDS("LD",3)="VA medical facility that is closest to the residence of the Veteran, defined "
+16 SET FIELDS("LD",4)="as a VA hospital, community-based outpatient clinic, or VA health care center "
+17 SET FIELDS("LD",5)="with at least one full-time primary care physician. The distance is calculated "
+18 SET FIELDS("LD",6)="using driving distance."
+19 DO UPDREQ(.FIELDS,1,.ERR)
+20 IF ERR'=""
Begin DoDot:1
+21 DO BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Mileage.")
+22 DO MES^XPDUTL(" Please log CA SDM ticket.")
+23 SET HBPERR=ERR
+24 QUIT
End DoDot:1
+25 ;
+26 QUIT
UPDPS3 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Wait Time
+1 ;
+2 NEW FIELDS,ERR
+3 SET ERR=""
+4 SET FIELDS("NAME")="Veteran Plan - Veterans Choice Wait Time"
+5 SET FIELDS("PLANCODE")=202
+6 SET FIELDS("COVERAGECODE")="VC01003"
+7 SET FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. Veteran is told "
+8 SET FIELDS("SD",2)="by his/her local VA medical facility that he/she will need to wait more than "
+9 SET FIELDS("SD",3)="30 days for an appointment from the date clinically determined by his/her "
+10 SET FIELDS("SD",4)="VA health care provider or the date they wish to be seen if there is no "
+11 SET FIELDS("SD",5)="clinically determined date."
+12 SET FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. Veteran is told "
+13 SET FIELDS("LD",2)="by his/her local VA medical facility that he/she will need to wait more than "
+14 SET FIELDS("LD",3)="30 days for an appointment from the date clinically determined by his/her "
+15 SET FIELDS("LD",4)="VA health care provider or the date they wish to be seen if there is no "
+16 SET FIELDS("LD",5)="clinically determined date."
+17 DO UPDREQ(.FIELDS,1,.ERR)
+18 IF ERR'=""
Begin DoDot:1
+19 DO BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Wait Time")
+20 DO MES^XPDUTL(" Please log CA SDM ticket.")
+21 SET HBPERR=ERR
+22 QUIT
End DoDot:1
+23 ;
+24 QUIT
UPDPS4 ;Setup new Health Benefit Plan - Veteran Plan - VC Unusual and Excessive Burden
+1 ;
+2 NEW FIELDS,ERR
+3 SET ERR=""
+4 SET FIELDS("NAME")="Veteran Plan - VC Unusual and Excessive Burden"
+5 SET FIELDS("PLANCODE")=203
+6 SET FIELDS("COVERAGECODE")="VC01004"
+7 SET FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
+8 SET FIELDS("SD",2)="resides 40 miles or less from the nearest VA medical facility may face an "
+9 SET FIELDS("SD",3)="unusual or excessive burden in accessing such a facility based on: "
+10 SET FIELDS("SD",4)=". Geographical challenges"
+11 SET FIELDS("SD",5)=". Environmental factors such as:"
+12 SET FIELDS("SD",6)=" o Roads that are not accessible to the general public, such as a road through "
+13 SET FIELDS("SD",7)=" a military base or restricted area"
+14 SET FIELDS("SD",8)=" o Traffic, or"
+15 SET FIELDS("SD",9)=" o Hazardous weather conditions"
+16 SET FIELDS("SD",10)=". A medical condition that impacts the ability to travel"
+17 SET FIELDS("SD",11)=". Other factors (as determined by the Secretary of VA)"
+18 SET FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
+19 SET FIELDS("LD",2)="resides 40 miles or less from the nearest VA medical facility may face an "
+20 SET FIELDS("LD",3)="unusual or excessive burden in accessing such a facility based on: "
+21 SET FIELDS("LD",4)=". Geographical challenges"
+22 SET FIELDS("LD",5)=". Environmental factors such as:"
+23 SET FIELDS("LD",6)=" o Roads that are not accessible to the general public, such as a road through "
+24 SET FIELDS("LD",7)=" a military base or restricted area"
+25 SET FIELDS("LD",8)=" o Traffic, or"
+26 SET FIELDS("LD",9)=" o Hazardous weather conditions"
+27 SET FIELDS("LD",10)=". A medical condition that impacts the ability to travel"
+28 SET FIELDS("LD",11)=". Other factors (as determined by the Secretary of VA)"
+29 DO UPDREQ(.FIELDS,1,.ERR)
+30 IF ERR'=""
Begin DoDot:1
+31 DO BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Wait Time")
+32 DO MES^XPDUTL(" Please log CA SDM ticket.")
+33 SET HBPERR=ERR
+34 QUIT
End DoDot:1
+35 ;
+36 QUIT
UPDPS5 ;Setup new Health Benefit Plan - Veteran Plan - Veterans Choice Air, Boat, or Ferry
+1 ;
+2 NEW FIELDS,ERR
+3 SET ERR=""
+4 SET FIELDS("NAME")="Veteran Plan - Veterans Choice Air, Boat, or Ferry"
+5 SET FIELDS("PLANCODE")=204
+6 SET FIELDS("COVERAGECODE")="VC01005"
+7 SET FIELDS("SD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
+8 SET FIELDS("SD",2)="resides 40 miles or less from the nearest VA medical facility and must travel "
+9 SET FIELDS("SD",3)="by air, boat, or ferry to reach such a facility."
+10 SET FIELDS("LD",1)="The Veteran must be enrolled in the VA health care system. The Veteran who "
+11 SET FIELDS("LD",2)="resides 40 miles or less from the nearest VA medical facility and must travel "
+12 SET FIELDS("LD",3)="by air, boat, or ferry to reach such a facility."
+13 DO UPDREQ(.FIELDS,1,.ERR)
+14 IF ERR'=""
Begin DoDot:1
+15 DO BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Veterans Choice Air, Boat, or Ferry ;")
+16 DO MES^XPDUTL(" Please log CA SDM ticket.")
+17 SET HBPERR=ERR
+18 QUIT
End DoDot:1
+19 ;
+20 QUIT
UPDPS6 ;Setup new Health Benefit Plan - Veteran Plan - Military Sexual Trauma
+1 ;
+2 NEW FIELDS,ERR
+3 SET ERR=""
+4 SET FIELDS("NAME")="Veteran Plan - Military Sexual Trauma"
+5 SET FIELDS("PLANCODE")=205
+6 SET FIELDS("COVERAGECODE")="MS01001"
+7 SET FIELDS("SD",1)=""
+8 SET FIELDS("LD",1)=""
+9 DO UPDREQ(.FIELDS,1,.ERR)
+10 IF ERR'=""
Begin DoDot:1
+11 DO BMES^XPDUTL(" *** An Error occurred during updating Plan: Veteran Plan - Military Sexual Trauma ;")
+12 DO MES^XPDUTL(" Please log CA SDM ticket.")
+13 SET HBPERR=ERR
+14 QUIT
End DoDot:1
+15 ;
+16 QUIT
UPDREQ(FIELDS,NEW,ERR) ; Update entries in the HEALTH BENEFIT PLAN File (25.11)
+1 ;
+2 ; Input: FIELDS - Array of Field Values
+3 ; NEW - 0 to edit, 1 to create new entry
+4 ;
+5 ; Output: ERR - Error Text
+6 ;
+7 NEW IEN,NAME,PLANCODE,COVERAGECODE,SD,LD,FDA,DGPFMSG,DGPFMS1
+8 KILL ERR
+9 SET ERR=""
+10 SET NAME=$GET(FIELDS("NAME"))
+11 SET PLANCODE=$GET(FIELDS("PLANCODE"))
+12 MERGE SD=FIELDS("SD")
+13 MERGE LD=FIELDS("LD")
+14 SET COVERAGECODE=$GET(FIELDS("COVERAGECODE"))
+15 IF NAME=""
SET ERR="Missing Health Benefit Plan Name"
QUIT
+16 IF NEW
Begin DoDot:1
+17 IF PLANCODE=""
SET ERR="Missing Plan Code"
QUIT
+18 IF '$DATA(SD)
SET ERR="Missing Short Description"
QUIT
+19 IF '$DATA(LD)
SET ERR="Missing Long Description"
QUIT
+20 IF COVERAGECODE=""
SET ERR="Missing Coverage Code"
QUIT
+21 QUIT
End DoDot:1
if ERR'=""
QUIT
+22 ;
+23 ; Check if entry exists, use it if it does
+24 SET IEN=$ORDER(^DGHBP(25.11,"B",NAME,0))
+25 IF IEN
DO BMES^XPDUTL(" "_NAME_" already exists, no action is taken. ")
QUIT
+26 IF NEW
IF 'IEN
SET IEN="+1"
+27 IF 'NEW
IF 'IEN
SET ERR="Health Benefit Plan Not Defined"
QUIT 0
+28 SET IEN=IEN_","
+29 ;
+30 SET FDA(25.11,IEN,.01)=NAME
+31 if PLANCODE'=""
SET FDA(25.11,IEN,.02)=PLANCODE
+32 if COVERAGECODE'=""
SET FDA(25.11,IEN,.05)=COVERAGECODE
+33 DO UPDATE^DIE("E","FDA","","ERR")
+34 IF $DATA(ERR("DIERR"))
SET ERR=$GET(ERR("DIERR",1,"TEXT",1))
QUIT
+35 SET IEN=$ORDER(^DGHBP(25.11,"B",NAME,0))
+36 IF 'IEN
DO BMES^XPDUTL(" "_IEN_" entry is not found to update Short and Long Descripton fields. ")
QUIT
+37 ; SHORT DESCRIPTION
DO WP^DIE(25.11,IEN_",",.03,"","SD","DGPFMSG")
+38 IF $DATA(DGPFMSG)
SET ERR=$GET(DGPFMSG("DIERR",1,"TEXT",1))
QUIT
+39 ; LONG DESCRIPTION
DO WP^DIE(25.11,IEN_",",.04,"","LD","DGPFMS1")
+40 IF $DATA(DGPFMS1)
SET ERR=$GET(DGPFMS1("DIERR",1,"TEXT",1))
QUIT
+41 DO BMES^XPDUTL(" "_NAME_" is added in HEALTH BENEFIT PLAN File. ")
+42 QUIT
+43 ;