DGOTHD1 ;SLC/SS,RM,MKN - OTHD (OTHER THAN HONORABLE DISCHARGE) APIs ; 12/27/17
;;5.3;Registration;**952,977,1016**;Aug 13, 1993;Build 6
;
Q
;
;ICR# TYPE DESCRIPTION
;----- ---- ---------------------
;10103 Sup ^XLFDT : $$FMADD,$$FMTE,$$FMDIFF
;10142 Sup ^DDIOL : EN
; 2053 Sup ^DIE : FILE, HELP
; 2056 Sup ^DIQ : GET1
; 2050 Sup ^DIALOG : MSG
;
;
;Set the first entry in file #33 (OTH ELIGIBILITY)
;Parameters:
; DGDFN - patient IEN
; DGSTRTDT - starting date
;Return values:
; <0 if error
; 1 if everything was created properly
FRSTNTRY(DGDFN,DGSTRDT,DGEXPMH) ;
N DGIEN33,DGIEN365,DGIEN90,OTHDATA
;does the patient already have an entry in file #33 (OTH ELIGIBILITY)?
S DGIEN33=$$HASENTRY^DGOTHD2(DGDFN) D:DGIEN33&('$D(^DGOTH(33,DGIEN33,1)))&($$GETEXPMH^DGOTHD(DGDFN)="OTH-90") OTHDATA(1,1),FILAUTH^DGOTHUT1(DGDFN,OTHDATA) I DGIEN33>0 Q -2 ;already has an entry
;if no entry in file 33
I DGIEN33=0 D
. ;create the top level of file 33
. S DGIEN33=$$CROTHENT^DGOTHD2(DGDFN)
. ;if not OTH-90, do not create 365 and 90 day entry
. Q:DGEXPMH=1
. ;create the very first 365 and 90 day clock
. D OTHDATA(1,1)
. D FILAUTH^DGOTHUT1(DGDFN,OTHDATA)
;if error then return error
I DGIEN33<0 Q DGIEN33
Q 1
;
OTHDATA(DG365,DG90) ;
K OTHDATA
S $P(OTHDATA,U)=DG365
S $P(OTHDATA,U,2)=DG90
S $P(OTHDATA,U,6)=DT
S $P(OTHDATA,U,7)=$S($G(DUZ)>0:$$UP^XLFSTR($$NAME^XUSER(DUZ,"F")),1:"POSTMASTER")
S $P(OTHDATA,U,8)=$$GETSITE^DGOTHD2(.DUZ)
S $P(OTHDATA,U,9)=$$NOW^XLFDT()
Q
;
;Build 6 Sprint 3
;DG*5.3*952
;prompt for EXPANDED MH CARE TYPE
;called from input template [DG LOAD EDIT SCREEN 7]
XPANDED(DGDFN) ;
;
; Input :
; DGDFN - Patient IEN
; Output:
; 1. Display warning message related to the patient's
; primary eligibility code EXPANDED MH CARE NON-ENROLLEE
; 2. Create a new entry in field #.5501 node #.55 in Patient File (#2)
; 3. Create a new OTH ELIGIBILITY PATIENT (#33) entry.
;
S DGEMHCNVT=0
Q:'$G(DGDFN)
N EMHCNV,DGMSG,DGQUIT,DGIEN33,DGERR,DGYN,DGARR
N DA,DGXRF,SVX ; for ^DGDDC
S SVX=$G(X) ; save X, needed for ^DGDDC call below
S EMHCNV=$$ISOTHD^DGOTHD(DGDFN) ;check if primary eligibility is EXPANDED MH CARE NON-ENROLLEE
I 'EMHCNV D INACT33^DGOTHEL(DGDFN) Q
;display EXPANDED MH CARE warning message
S DGMSG(1)=" "
S DGMSG(2)=" This code is used ONLY for Other Than Honorable veterans"
S DGMSG(3)=" seeking mental healthcare prior to VBA ADJUDICATION."
S DGMSG(4)=" "
D EN^DDIOL(.DGMSG)
;
;before prompting for EXPANDED MH CARE TYPE check if patient is a former OTH patient
;if true, prompt user if they wish to continue editing the patient's primary eligibility
I $$HASENTRY^DGOTHD2(DGDFN) S DGYN=1 D Q:'$G(DGYN)
. ;compare the previous and current primary eligibility of the patient
. I $G(DGPRVSPE)'=$$GET1^DIQ(2,DGDFN_",",.361,"I") D
. . ;patient has been INACTIVATED, presumably patient has received adjudication
. . W !," *** A record on file indicates that this patient was previously"
. . W !," defined as OTH.",!
. . S DGYN=$$QUITYN("Do you still want to continue (Y/N)")
. . I 'DGYN D Q
. . . W !!," NO ACTION TAKEN!!!",!
. . . ;restore the previous primary eligibility code of the patient
. . . D PREVSEL(DGDFN)
. . . S Y=$S($G(DGECODE)'="":.323,1:"@7031")
. . E W !
;prompt for EXPANDED MH CARE TYPE
;Create a new entry in field #.5501 node #.55 in Patient File (#2)
;DGEMHC = 0 No entry created
;DGEMHC = 1 Create/Change EXPANDED MH CARE TYPE entry
N DGEMHC
S DGEMHC=$$EMHCTYP(DGDFN)
I DGEMHC D
.D UPDTEMHT(DGDFN)
.;Call point to create a new OTH ELIGIBILITY PATIENT (#33) entry.
.D STRDATE^DGOTHD(DGDFN)
.; clear ELIGIBILITY STATUS field (2/.3611)
.S DA=DGDFN,DGXRF=.361,X=.361 D ^DGDDC S X=SVX
.Q
S Y=$S(Y=U:"",$G(DGECODE)'="":.323,1:"@7031")
Q
;
EMHCTYP(DGDFN) ;prompt for EXPANDED MH CARE TYPE
;field #.5501 node #.55 in Patient File (#2)
; Input :
; DGDFN - Patient IEN
; Output:
; 0 - No entry created
; 1 - Create/Change EXPANDED MH CARE TYPE entry
;
N DA,DGDIRB,DIR,DTOUT,DUOUT,DIROUT,DIRUT
N DONE,FILE,FIELD,DGTYPHLP
S FILE=2,FIELD=.5501
S DIR(0)=FILE_","_FIELD_"AO",DONE=0 S:DGDFN DA=DGDFN
S DGDIRB=$$GET1^DIQ(2,DGDFN_",",.5501,"I")
I DGDIRB'="" S DIR("B")=$$OTHSOC^DGOTHD1(DGDIRB)
S DIR("T")=1200 ;time specification to be used instead of DTIME
F D Q:DONE
. ;keep prompting until user enter a valid entry
. K DGTYPHLP
. D ^DIR
. ;if the user times out
. I $D(DTOUT) D Q
. . S DONE=1,DGQUIT=0
. . I $G(DGDIRB)'="" Q ;do not remove what is already there
. . D PREVSEL(DGDFN)
. ;if the user entered a caret (^) or two carets (^^)
. I $D(DUOUT)!$D(DIROUT) D Q
. . S (DONE,DGEMHCNVT)=1,DGQUIT=0
. . ;new patient
. . I '$$HASENTRY^DGOTHD2(DGDFN),DGEMHCNVT D PREVSEL(DGDFN)
. . ;existing patient
. . I '$$ISOTH^DGOTHD(DGDIRB),$$HASENTRY^DGOTHD2(DGDFN) D PREVSEL(DGDFN)
. ;if the user pressed Enter, or entering the at-sign (@), signifying deletion
. I $D(DIRUT) D Q
. . I $$ISOTH^DGOTHD(DGDIRB),$$HASENTRY^DGOTHD2(DGDFN) D Q
. . . W !!," DELETION NOT ALLOWED!!!",!
. . . S (DONE,DGQUIT)=0
. . I X=Y D Q
. . . W ! D HELP^DIE(FILE,"",FIELD,"?","DGTYPHLP(1)"),MSG^DIALOG("WH","","","","DGTYPHLP(1)")
. . . W ! S (DONE,DGQUIT)=0
. . W !," No Expanded MH Care Type found."
. . W !," Nothing to delete.",!
. ;DG*5.3*977 OTH-EXT
. D:Y="OTH-EXT"
. . S DGMSG(1)=" "
. . S DGMSG(2)=" Note: this Expanded Mental Health Care Type selection is only to be used"
. . S DGMSG(3)=" prior to VBA Adjudication for OTH patients."
. . S DGMSG(4)=" "
. . D EN^DDIOL(.DGMSG)
. S DONE=1,DGQUIT=$S(DGDIRB=Y:0,1:1)
K DIR
Q DGQUIT
;
QUITYN(QUESTION) ;
N DIR,Y
S DIR(0)="Y"
S DIR("A")=QUESTION
S DIR("?")=" "
S DIR("?",1)="Enter 'Y'es if you want to change the patient's primary eligibility code."
S DIR("?",2)="Otherwise, enter 'N'o"
D ^DIR
Q +Y
;
UPDTEMHT(DGDFN) ;set the associated EXPANDED MH CARE TYPE
; Input :
; DGDFN - Patient IEN
; Output:
; Create EXPANDED MH CARE TYPE entry in field #.5501 node #.55 in Patient File (#2)
N DGFDA,DGERR
I $$CHCKPAT^DGOTHD2(DGDFN)'>0 Q -2 ;patient does not exist
S DGFDA(2,DGDFN_",",.5501)=Y
D FILE^DIE("K","DGFDA","DGERR")
D CRTEELCH^DGOTHEL(DGDFN,$$HASENTRY^DGOTHD2(DGDFN),$$NOW^XLFDT())
Q
;
OTHSOC(EMHCT) ;Extract OTHER THAN HONORABLE set of codes
;
; Input : EMHCT - The internal set of code value
; Output: The external set of code value
;
N DGERR,I,DGOTHSOC,YY
S DGOTHSOC=$$GET1^DID(2,.5501,,"SET OF CODES",,"DGERR")
Q:$D(DGERR)
F I=1:1:$L(DGOTHSOC,";") S YY=$P(DGOTHSOC,";",I) Q:YY="" S DGOTHSOC($P(YY,":"))=$P(YY,":",2)
Q $S($D(DGOTHSOC(EMHCT)):DGOTHSOC(EMHCT),1:"Expanded Type Not Found")
;
EMHCT(DGDFN) ;EXPANDED MH CARE TYPE 'OTH' in Patient file #2
; Input :
; DGDFN - Patient IEN
; Output:
; Remove EXPANDED MH CARE TYPE entry in field #.5501 node #.55 in Patient File (#2)
Q:'$G(DGDFN)
N DGFDART,DGOTHERR,IENS
S IENS=DGDFN_"," ; DG*5.3*1016
S DGFDART($J,2,IENS,.5501)="" ; DG*5.3*1016
S DGFDART($J,2,IENS,.5502)="" ; DG*5.3*1016
D FILE^DIE("U","DGFDART($J)","DGOTHERR")
I $D(DGOTHERR) W !!,"An error occurred during filing."
Q
;
PREVSEL(DGDFN) ;put back the patient's previous primary eligibility code
; Input :
; DGDFN - Patient IEN
N DA,DGEH,DGFDART,DGIEN33,DIK,DGOTHERR,DGPREEL
S DGFDART($J,2,DGDFN_",",.361)=$S($G(DGPRVSPE)>0:DGPRVSPE,1:"")
D FILE^DIE("U","DGFDART($J)","DGOTHERR")
I $D(DGOTHERR) W !!,"An error occurred during filing."
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGOTHD1 7726 printed Dec 13, 2024@02:46:46 Page 2
DGOTHD1 ;SLC/SS,RM,MKN - OTHD (OTHER THAN HONORABLE DISCHARGE) APIs ; 12/27/17
+1 ;;5.3;Registration;**952,977,1016**;Aug 13, 1993;Build 6
+2 ;
+3 QUIT
+4 ;
+5 ;ICR# TYPE DESCRIPTION
+6 ;----- ---- ---------------------
+7 ;10103 Sup ^XLFDT : $$FMADD,$$FMTE,$$FMDIFF
+8 ;10142 Sup ^DDIOL : EN
+9 ; 2053 Sup ^DIE : FILE, HELP
+10 ; 2056 Sup ^DIQ : GET1
+11 ; 2050 Sup ^DIALOG : MSG
+12 ;
+13 ;
+14 ;Set the first entry in file #33 (OTH ELIGIBILITY)
+15 ;Parameters:
+16 ; DGDFN - patient IEN
+17 ; DGSTRTDT - starting date
+18 ;Return values:
+19 ; <0 if error
+20 ; 1 if everything was created properly
FRSTNTRY(DGDFN,DGSTRDT,DGEXPMH) ;
+1 NEW DGIEN33,DGIEN365,DGIEN90,OTHDATA
+2 ;does the patient already have an entry in file #33 (OTH ELIGIBILITY)?
+3 ;already has an entry
SET DGIEN33=$$HASENTRY^DGOTHD2(DGDFN)
if DGIEN33&('$DATA(^DGOTH(33,DGIEN33,1)))&($$GETEXPMH^DGOTHD(DGDFN)="OTH-90")
DO OTHDATA(1,1)
DO FILAUTH^DGOTHUT1(DGDFN,OTHDATA)
IF DGIEN33>0
QUIT -2
+4 ;if no entry in file 33
+5 IF DGIEN33=0
Begin DoDot:1
+6 ;create the top level of file 33
+7 SET DGIEN33=$$CROTHENT^DGOTHD2(DGDFN)
+8 ;if not OTH-90, do not create 365 and 90 day entry
+9 if DGEXPMH=1
QUIT
+10 ;create the very first 365 and 90 day clock
+11 DO OTHDATA(1,1)
+12 DO FILAUTH^DGOTHUT1(DGDFN,OTHDATA)
End DoDot:1
+13 ;if error then return error
+14 IF DGIEN33<0
QUIT DGIEN33
+15 QUIT 1
+16 ;
OTHDATA(DG365,DG90) ;
+1 KILL OTHDATA
+2 SET $PIECE(OTHDATA,U)=DG365
+3 SET $PIECE(OTHDATA,U,2)=DG90
+4 SET $PIECE(OTHDATA,U,6)=DT
+5 SET $PIECE(OTHDATA,U,7)=$SELECT($GET(DUZ)>0:$$UP^XLFSTR($$NAME^XUSER(DUZ,"F")),1:"POSTMASTER")
+6 SET $PIECE(OTHDATA,U,8)=$$GETSITE^DGOTHD2(.DUZ)
+7 SET $PIECE(OTHDATA,U,9)=$$NOW^XLFDT()
+8 QUIT
+9 ;
+10 ;Build 6 Sprint 3
+11 ;DG*5.3*952
+12 ;prompt for EXPANDED MH CARE TYPE
+13 ;called from input template [DG LOAD EDIT SCREEN 7]
XPANDED(DGDFN) ;
+1 ;
+2 ; Input :
+3 ; DGDFN - Patient IEN
+4 ; Output:
+5 ; 1. Display warning message related to the patient's
+6 ; primary eligibility code EXPANDED MH CARE NON-ENROLLEE
+7 ; 2. Create a new entry in field #.5501 node #.55 in Patient File (#2)
+8 ; 3. Create a new OTH ELIGIBILITY PATIENT (#33) entry.
+9 ;
+10 SET DGEMHCNVT=0
+11 if '$GET(DGDFN)
QUIT
+12 NEW EMHCNV,DGMSG,DGQUIT,DGIEN33,DGERR,DGYN,DGARR
+13 ; for ^DGDDC
NEW DA,DGXRF,SVX
+14 ; save X, needed for ^DGDDC call below
SET SVX=$GET(X)
+15 ;check if primary eligibility is EXPANDED MH CARE NON-ENROLLEE
SET EMHCNV=$$ISOTHD^DGOTHD(DGDFN)
+16 IF 'EMHCNV
DO INACT33^DGOTHEL(DGDFN)
QUIT
+17 ;display EXPANDED MH CARE warning message
+18 SET DGMSG(1)=" "
+19 SET DGMSG(2)=" This code is used ONLY for Other Than Honorable veterans"
+20 SET DGMSG(3)=" seeking mental healthcare prior to VBA ADJUDICATION."
+21 SET DGMSG(4)=" "
+22 DO EN^DDIOL(.DGMSG)
+23 ;
+24 ;before prompting for EXPANDED MH CARE TYPE check if patient is a former OTH patient
+25 ;if true, prompt user if they wish to continue editing the patient's primary eligibility
+26 IF $$HASENTRY^DGOTHD2(DGDFN)
SET DGYN=1
Begin DoDot:1
+27 ;compare the previous and current primary eligibility of the patient
+28 IF $GET(DGPRVSPE)'=$$GET1^DIQ(2,DGDFN_",",.361,"I")
Begin DoDot:2
+29 ;patient has been INACTIVATED, presumably patient has received adjudication
+30 WRITE !," *** A record on file indicates that this patient was previously"
+31 WRITE !," defined as OTH.",!
+32 SET DGYN=$$QUITYN("Do you still want to continue (Y/N)")
+33 IF 'DGYN
Begin DoDot:3
+34 WRITE !!," NO ACTION TAKEN!!!",!
+35 ;restore the previous primary eligibility code of the patient
+36 DO PREVSEL(DGDFN)
+37 SET Y=$SELECT($GET(DGECODE)'="":.323,1:"@7031")
End DoDot:3
QUIT
+38 IF '$TEST
WRITE !
End DoDot:2
End DoDot:1
if '$GET(DGYN)
QUIT
+39 ;prompt for EXPANDED MH CARE TYPE
+40 ;Create a new entry in field #.5501 node #.55 in Patient File (#2)
+41 ;DGEMHC = 0 No entry created
+42 ;DGEMHC = 1 Create/Change EXPANDED MH CARE TYPE entry
+43 NEW DGEMHC
+44 SET DGEMHC=$$EMHCTYP(DGDFN)
+45 IF DGEMHC
Begin DoDot:1
+46 DO UPDTEMHT(DGDFN)
+47 ;Call point to create a new OTH ELIGIBILITY PATIENT (#33) entry.
+48 DO STRDATE^DGOTHD(DGDFN)
+49 ; clear ELIGIBILITY STATUS field (2/.3611)
+50 SET DA=DGDFN
SET DGXRF=.361
SET X=.361
DO ^DGDDC
SET X=SVX
+51 QUIT
End DoDot:1
+52 SET Y=$SELECT(Y=U:"",$GET(DGECODE)'="":.323,1:"@7031")
+53 QUIT
+54 ;
EMHCTYP(DGDFN) ;prompt for EXPANDED MH CARE TYPE
+1 ;field #.5501 node #.55 in Patient File (#2)
+2 ; Input :
+3 ; DGDFN - Patient IEN
+4 ; Output:
+5 ; 0 - No entry created
+6 ; 1 - Create/Change EXPANDED MH CARE TYPE entry
+7 ;
+8 NEW DA,DGDIRB,DIR,DTOUT,DUOUT,DIROUT,DIRUT
+9 NEW DONE,FILE,FIELD,DGTYPHLP
+10 SET FILE=2
SET FIELD=.5501
+11 SET DIR(0)=FILE_","_FIELD_"AO"
SET DONE=0
if DGDFN
SET DA=DGDFN
+12 SET DGDIRB=$$GET1^DIQ(2,DGDFN_",",.5501,"I")
+13 IF DGDIRB'=""
SET DIR("B")=$$OTHSOC^DGOTHD1(DGDIRB)
+14 ;time specification to be used instead of DTIME
SET DIR("T")=1200
+15 FOR
Begin DoDot:1
+16 ;keep prompting until user enter a valid entry
+17 KILL DGTYPHLP
+18 DO ^DIR
+19 ;if the user times out
+20 IF $DATA(DTOUT)
Begin DoDot:2
+21 SET DONE=1
SET DGQUIT=0
+22 ;do not remove what is already there
IF $GET(DGDIRB)'=""
QUIT
+23 DO PREVSEL(DGDFN)
End DoDot:2
QUIT
+24 ;if the user entered a caret (^) or two carets (^^)
+25 IF $DATA(DUOUT)!$DATA(DIROUT)
Begin DoDot:2
+26 SET (DONE,DGEMHCNVT)=1
SET DGQUIT=0
+27 ;new patient
+28 IF '$$HASENTRY^DGOTHD2(DGDFN)
IF DGEMHCNVT
DO PREVSEL(DGDFN)
+29 ;existing patient
+30 IF '$$ISOTH^DGOTHD(DGDIRB)
IF $$HASENTRY^DGOTHD2(DGDFN)
DO PREVSEL(DGDFN)
End DoDot:2
QUIT
+31 ;if the user pressed Enter, or entering the at-sign (@), signifying deletion
+32 IF $DATA(DIRUT)
Begin DoDot:2
+33 IF $$ISOTH^DGOTHD(DGDIRB)
IF $$HASENTRY^DGOTHD2(DGDFN)
Begin DoDot:3
+34 WRITE !!," DELETION NOT ALLOWED!!!",!
+35 SET (DONE,DGQUIT)=0
End DoDot:3
QUIT
+36 IF X=Y
Begin DoDot:3
+37 WRITE !
DO HELP^DIE(FILE,"",FIELD,"?","DGTYPHLP(1)")
DO MSG^DIALOG("WH","","","","DGTYPHLP(1)")
+38 WRITE !
SET (DONE,DGQUIT)=0
End DoDot:3
QUIT
+39 WRITE !," No Expanded MH Care Type found."
+40 WRITE !," Nothing to delete.",!
End DoDot:2
QUIT
+41 ;DG*5.3*977 OTH-EXT
+42 if Y="OTH-EXT"
Begin DoDot:2
+43 SET DGMSG(1)=" "
+44 SET DGMSG(2)=" Note: this Expanded Mental Health Care Type selection is only to be used"
+45 SET DGMSG(3)=" prior to VBA Adjudication for OTH patients."
+46 SET DGMSG(4)=" "
+47 DO EN^DDIOL(.DGMSG)
End DoDot:2
+48 SET DONE=1
SET DGQUIT=$SELECT(DGDIRB=Y:0,1:1)
End DoDot:1
if DONE
QUIT
+49 KILL DIR
+50 QUIT DGQUIT
+51 ;
QUITYN(QUESTION) ;
+1 NEW DIR,Y
+2 SET DIR(0)="Y"
+3 SET DIR("A")=QUESTION
+4 SET DIR("?")=" "
+5 SET DIR("?",1)="Enter 'Y'es if you want to change the patient's primary eligibility code."
+6 SET DIR("?",2)="Otherwise, enter 'N'o"
+7 DO ^DIR
+8 QUIT +Y
+9 ;
UPDTEMHT(DGDFN) ;set the associated EXPANDED MH CARE TYPE
+1 ; Input :
+2 ; DGDFN - Patient IEN
+3 ; Output:
+4 ; Create EXPANDED MH CARE TYPE entry in field #.5501 node #.55 in Patient File (#2)
+5 NEW DGFDA,DGERR
+6 ;patient does not exist
IF $$CHCKPAT^DGOTHD2(DGDFN)'>0
QUIT -2
+7 SET DGFDA(2,DGDFN_",",.5501)=Y
+8 DO FILE^DIE("K","DGFDA","DGERR")
+9 DO CRTEELCH^DGOTHEL(DGDFN,$$HASENTRY^DGOTHD2(DGDFN),$$NOW^XLFDT())
+10 QUIT
+11 ;
OTHSOC(EMHCT) ;Extract OTHER THAN HONORABLE set of codes
+1 ;
+2 ; Input : EMHCT - The internal set of code value
+3 ; Output: The external set of code value
+4 ;
+5 NEW DGERR,I,DGOTHSOC,YY
+6 SET DGOTHSOC=$$GET1^DID(2,.5501,,"SET OF CODES",,"DGERR")
+7 if $DATA(DGERR)
QUIT
+8 FOR I=1:1:$LENGTH(DGOTHSOC,";")
SET YY=$PIECE(DGOTHSOC,";",I)
if YY=""
QUIT
SET DGOTHSOC($PIECE(YY,":"))=$PIECE(YY,":",2)
+9 QUIT $SELECT($DATA(DGOTHSOC(EMHCT)):DGOTHSOC(EMHCT),1:"Expanded Type Not Found")
+10 ;
EMHCT(DGDFN) ;EXPANDED MH CARE TYPE 'OTH' in Patient file #2
+1 ; Input :
+2 ; DGDFN - Patient IEN
+3 ; Output:
+4 ; Remove EXPANDED MH CARE TYPE entry in field #.5501 node #.55 in Patient File (#2)
+5 if '$GET(DGDFN)
QUIT
+6 NEW DGFDART,DGOTHERR,IENS
+7 ; DG*5.3*1016
SET IENS=DGDFN_","
+8 ; DG*5.3*1016
SET DGFDART($JOB,2,IENS,.5501)=""
+9 ; DG*5.3*1016
SET DGFDART($JOB,2,IENS,.5502)=""
+10 DO FILE^DIE("U","DGFDART($J)","DGOTHERR")
+11 IF $DATA(DGOTHERR)
WRITE !!,"An error occurred during filing."
+12 QUIT
+13 ;
PREVSEL(DGDFN) ;put back the patient's previous primary eligibility code
+1 ; Input :
+2 ; DGDFN - Patient IEN
+3 NEW DA,DGEH,DGFDART,DGIEN33,DIK,DGOTHERR,DGPREEL
+4 SET DGFDART($JOB,2,DGDFN_",",.361)=$SELECT($GET(DGPRVSPE)>0:DGPRVSPE,1:"")
+5 DO FILE^DIE("U","DGFDART($J)","DGOTHERR")
+6 IF $DATA(DGOTHERR)
WRITE !!,"An error occurred during filing."
+7 QUIT
+8 ;