DGMTHL1 ;ALB/CJM/TDM - Hardship Determinations - Build List Area;13 JUN 1997 08:00 am ; 8/29/02 4:50pm
;;5.3;PIMS;**182,456,1015,1016**;JUN 30, 2012;Build 20
;
EN(DGARY,HARDSHIP,DGCNT) ;Entry point to build list area
; Input;
; DGARY Global array subscript
; HARDSHIP - hardship array (pass by reference)
; Output -- DGCNT Number of lines in the list
;
N DGLINE
S DGLINE=1,DGCNT=0
D SET(DGARY,.HARDSHIP,.DGLINE,.DGCNT)
Q
;
SET(DGARY,HARDSHIP,DGLINE,DGCNT) ;
;Description: Writes hardship
; Input -- DGARY Global array subscript
; HARDSHIP Hardship array
; DGLINE Line number
; Output -- DGCNT Number of lines in the list
N DGSTART,LINE
;
S DGSTART=DGLINE ; starting line number
D SET^DGENL1(DGARY,DGLINE,"Hardship",21,IORVON,IORVOFF,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Current Means Test Status: ",31)_$$EXT^DGMTH("CURRENT STATUS",HARDSHIP("CURRENT STATUS")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Income Year: ",31)_$S(HARDSHIP("YEAR"):$$EXT^DGMTH("YEAR",HARDSHIP("YEAR")),1:""),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Means Test Date: ",31)_$$EXT^DGMTH("TEST DATE",HARDSHIP("TEST DATE")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
I (HARDSHIP("AGREE")'="") D SET^DGENL1(DGARY,DGLINE,$J("Agreed To Pay Deductible: ",31)_$$EXT^DGMTH("AGREE",HARDSHIP("AGREE")),1,,,,,,.DGCNT) S DGLINE=DGLINE+1
;
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Hardship?: ",31)_$$EXT^DGMTH("HARDSHIP?",HARDSHIP("HARDSHIP?")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Hardship Effective Date: ",31)_$$EXT^DGMTH("EFFECTIVE",HARDSHIP("EFFECTIVE")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Review Date: ",31)_$$EXT^DGMTH("REVIEW",HARDSHIP("REVIEW")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Site Granting Hardship: ",31)_$$EXT^DGMTH("SITE",HARDSHIP("SITE")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Approved By: ",31)_$$EXT^DGMTH("BY",HARDSHIP("BY")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Hardship Reason: ",31)_$$EXT^DGMTH("REASON",HARDSHIP("REASON")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+2
;
D SET^DGENL1(DGARY,DGLINE,$J("Date Category Last Changed: ",31)_$$EXT^DGMTH("DT/TM CTGRY CHNGD",HARDSHIP("DT/TM CTGRY CHNGD")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
D SET^DGENL1(DGARY,DGLINE,$J("Category Last Changed By: ",31)_$$EXT^DGMTH("CTGRY CHNGD BY",HARDSHIP("CTGRY CHNGD BY")),1,,,,,,.DGCNT)
S DGLINE=DGLINE+1
I $D(^DGMT(408.31,HARDSHIP("MTIEN"),"C")) D
.N LINE
.D SET^DGENL1(DGARY,DGLINE,"COMMENTS:",1,$G(IOINHI),$G(IOINORM),,,,.DGCNT)
.S DGLINE=DGLINE+1
.S LINE=0
.F S LINE=$O(^DGMT(408.31,HARDSHIP("MTIEN"),"C",LINE)) Q:'LINE D
..D SET^DGENL1(DGARY,DGLINE,$G(^DGMT(408.31,HARDSHIP("MTIEN"),"C",LINE,0)),1,,,,,,.DGCNT)
..S DGLINE=DGLINE+1
Q
;
CHKADD(HARDSHIP) ;
;Determines whether granting a hardship is appropriate
;Input:
; HARDSHIP - hardship array (pass by reference)
;Output:
; Function Value - 1 if the hardship can be granted, 0 otherwise
;
N CODE
S CODE=""
S CODE=$$GETCODE^DGMTH(HARDSHIP("CURRENT STATUS"))
I CODE'="C",CODE'="P",CODE'="G" Q 0
Q 1
;
ADD(HARDSHIP) ;
;Add hardship protocol.
;
;Input:
; HARDSHIP - hardship array, pass by reference
;Output:
; HARDSHIP - hardship array (pass by reference)
;
N CODE,ERROR
I $G(DUZ)'>1 W !,"YOUR DUZ IS NOT DEFINED!" D PAUSE^VALM1 S VALMBCK="R" Q
S CODE=""
S CODE=$$GETCODE^DGMTH(HARDSHIP("CURRENT STATUS"))
I CODE'="C",CODE'="P",CODE'="G" W !,"PATIENT NOT CURRENTLY RESPONSIBLE FOR COPAYMENT CHARGES!" D PAUSE^VALM1 Q
S HARDSHIP("EFFECTIVE")=DT
S HARDSHIP("SITE")=$$GETSITE^DGMTU4(.DUZ)
I HARDSHIP("TEST STATUS")="" S HARDSHIP("TEST STATUS")=HARDSHIP("CURRENT STATUS")
;S HARDSHIP("CURRENT STATUS")=$$GETSTAT^DGMTH("A",1)
S HARDSHIP("BY")=DUZ
S HARDSHIP("CTGRY CHNGD BY")=DUZ
S HARDSHIP("DT/TM CTGRY CHNGD")=$$NOW^XLFDT
S HARDSHIP("HARDSHIP?")=1
D
.I '$$GETSTAT(.HARDSHIP) Q
.I '$$GETEFF(.HARDSHIP) Q
.I '$$GETREV(.HARDSHIP) Q
.I '$$GETREAS(.HARDSHIP) Q
.D PRIOR(.HARDSHIP)
.I $$STORE^DGMTH(.HARDSHIP,.ERROR) D
..N EVENTS
..S EVENTS("IVM")=1
..I $$LOG^IVMPLOG(HARDSHIP("DFN"),HARDSHIP("YEAR"),.EVENTS)
.E W !,$G(ERROR) D PAUSE^VALM1
.D AFTER(.HARDSHIP)
D INIT^DGMTHL
S VALMBCK="R"
Q
;
EDIT(HARDSHIP) ;
;Add hardship protocol.
;
;Input:
; HARDSHIP - hardship array, pass by reference
;Output:
; HARDSHIP - hardship array (pass by reference)
;
N ERROR
D
.I '$$GETSTAT(.HARDSHIP,1) Q
.I '$$GETEFF(.HARDSHIP) Q
.I '$$GETREV(.HARDSHIP) Q
.I '$$GETREAS(.HARDSHIP) Q
.D PRIOR(.HARDSHIP)
.I $$STORE^DGMTH(.HARDSHIP,.ERROR) D
..N EVENTS
..S EVENTS("IVM")=1
..I $$LOG^IVMPLOG(HARDSHIP("DFN"),HARDSHIP("YEAR"),.EVENTS)
.E W !,$G(ERROR) D PAUSE^VALM1
.D AFTER(.HARDSHIP)
D INIT^DGMTHL
S VALMBCK="R"
Q
;
CHKDEL(HARDSHIP) ;
;Checks whether the hardship can be deleted.
;Input:
; HARDSHIP - hardship array (pass by reference)
I (HARDSHIP("HARDSHIP?")="1"),(HARDSHIP("BY")!((+HARDSHIP("SITE")=+$$GETSITE^DGMTU4($G(DUZ))))) Q 1
Q 0
DELETE(HARDSHIP) ;
;Deletes the hardship.
;
;Input:
; HARDSHIP - hardship array (pass by reference)
;
N ERROR
I $$RUSURE,'$$DELETE^DGMTH(.HARDSHIP,1,.ERROR) W !,"AN ERROR OCCURRED - "_$G(ERROR) D PAUSE^VALM1
D INIT^DGMTHL
S VALMBCK="R"
Q
;
GETSTAT(HARDSHIP,EDITFLG) ;
;Asks the user to enter the means test status.
;
;Input:
; HARDSHIP - hardship array (pass by reference)
; EDITFLG - Edit Flag: 1=Edit
;Output:
; HARDSHIP("CURRENT STATUS")
;
N DIR,FLTRSTAT
S FLTRSTAT=$$GETCODE^DGMTH($S($G(EDITFLG):HARDSHIP("TEST STATUS"),1:HARDSHIP("CURRENT STATUS")))
S DIR(0)="Pr^408.32:EMZ"
S DIR("S")="I $P(^(0),U,19)=1"
I "CP"[FLTRSTAT S DIR("S")=DIR("S")_",""AG""[$P(^(0),U,2)"
I FLTRSTAT="G" S DIR("S")=DIR("S")_",""A""[$P(^(0),U,2)"
S DIR("A")="Means Test Status"
S DIR("B")=$$EXT^DGMTH("CURRENT STATUS",HARDSHIP("CURRENT STATUS"))
D FULL^VALM1
D ^DIR
I $D(DIRUT) Q 0
I Y<1 Q 0
S HARDSHIP("CURRENT STATUS")=+Y
; Don't reset agreed to pay if mt copay req/GMT copay req/pend adj
S:"^C^G^P^"'[(U_$P($G(^DG(408.32,+Y,0)),U,2)_U) HARDSHIP("AGREE")=""
S VALMBCK="R"
Q 1
;
GETEFF(HARDSHIP) ;
;Asks the user to enter the effective date. Returns 1 on success, 0 on failure
;
;Input:
; HARDSHIP - hardship array (pass by reference)
;Output:
; HARDSHIP("EFFECTIVE")
;
N DIR
S DIR(0)="D^"_HARDSHIP("TEST DATE")_":"_DT_":EX"
S DIR("A")="Hardship Effective Date"
S DIR("B")=$$FMTE^XLFDT($S(HARDSHIP("EFFECTIVE"):HARDSHIP("EFFECTIVE"),1:HARDSHIP("TEST DATE")),"1D")
D ^DIR
I $D(DIRUT) Q 0
I Y<1 Q 0
S HARDSHIP("EFFECTIVE")=Y
Q 1
GETREV(HARDSHIP) ;
;Asks the user to enter the review date. Returns 1 on success, 0 on failure
;
;Input:
; HARDSHIP - hardship array (pass by reference)
;Output:
; HARDSHIP("REVIEW")
;
N RET,STOP,X,Y
S (STOP,RET)=0
S DIR(0)="DO^::EX"
S DIR("A")="Hardship Review Date"
I HARDSHIP("REVIEW") S DIR("B")=$$FMTE^XLFDT(HARDSHIP("REVIEW"),"1D")
S DIR("?")="Enter a future date if you wish to conduct a review."
F D Q:STOP
.N DIR
.S DIR(0)="DO^::EX"
.S DIR("A")="Hardship Review Date"
.I HARDSHIP("REVIEW") S DIR("B")=$$FMTE^XLFDT(HARDSHIP("REVIEW"),"1D")
.S DIR("?")="Enter a future date if you wish to conduct a review."
.D ^DIR
.I $D(DTOUT)!$D(DUOUT)!$D(DIROUT) S STOP=1,RET=0 Q
.I X="@" S Y="",STOP=1,RET=1 Q
.I Y=-1 S STOP=1,RET=0 Q
.I Y<DT W !,DIR("?") Q
.S (STOP,RET)=1
S:RET HARDSHIP("REVIEW")=Y
Q RET
;
GETREAS(HARDSHIP) ;
;Asks the user to enter the hardship reason.
;
;Input:
; HARDSHIP - hardship array (pass by reference)
;Output
; HARDSHIP("REASON")
;
N DIR
S DIR(0)="FO^3:80"
S DIR("A")="Hardship Reason"
S DIR("B")=$G(HARDSHIP("REASON")) K:DIR("B")="" DIR("B")
D ^DIR
I $D(DTOUT)!$D(DUOUT) Q 0
S HARDSHIP("REASON")=Y
Q 1
;
PRIOR(HARDSHIP) ;set up for means test event driver
S DFN=HARDSHIP("DFN")
S DGMTI=HARDSHIP("MTIEN")
S DGMTS=HARDSHIP("CURRENT STATUS")
S DGMTACT="CAT"
S DGMTYPT=1
D PRIOR^DGMTEVT
Q
AFTER(HARDSHIP) ;calls means test event driver
D AFTER^DGMTEVT
S DGMTINF=0
D EN^DGMTEVT
K DGMTA,DGMTACT,DGMTDT,DGMTI,DGMTINF,DGMTP,DGMTS,DGMTYPT,I,J,Y
Q
;Edit Comments protocol.
;
;Input:
; HARDSHIP - hardship array, pass by reference
;Output:
; none
;
N DA,DIE,DR
I $G(DUZ)'>1 W !,"YOUR DUZ IS NOT DEFINED!" D PAUSE^VALM1 S VALMBCK="R" Q
D FULL^VALM1
I $G(HARDSHIP("MTIEN")) S DR="50",DA=HARDSHIP("MTIEN"),DIE=408.31 D ^DIE
D INIT^DGMTHL
I VALMCNT<15 S VALMBG=1
S VALMBCK="R"
Q
;
RUSURE() ;
;Description: Asks user 'Are you sure?'
;Input: none
;Output: Function Value returns 0 or 1
;
N DIR
S DIR(0)="Y"
S DIR("A")="Are you sure that the hardship should be deleted"
S DIR("B")="NO"
D ^DIR
Q:$D(DIRUT) 0
Q Y
DGMTHL1 ;ALB/CJM/TDM - Hardship Determinations - Build List Area;13 JUN 1997 08:00 am ; 8/29/02 4:50pm
+1 ;;5.3;PIMS;**182,456,1015,1016**;JUN 30, 2012;Build 20
+2 ;
EN(DGARY,HARDSHIP,DGCNT) ;Entry point to build list area
+1 ; Input;
+2 ; DGARY Global array subscript
+3 ; HARDSHIP - hardship array (pass by reference)
+4 ; Output -- DGCNT Number of lines in the list
+5 ;
+6 NEW DGLINE
+7 SET DGLINE=1
SET DGCNT=0
+8 DO SET(DGARY,.HARDSHIP,.DGLINE,.DGCNT)
+9 QUIT
+10 ;
SET(DGARY,HARDSHIP,DGLINE,DGCNT) ;
+1 ;Description: Writes hardship
+2 ; Input -- DGARY Global array subscript
+3 ; HARDSHIP Hardship array
+4 ; DGLINE Line number
+5 ; Output -- DGCNT Number of lines in the list
+6 NEW DGSTART,LINE
+7 ;
+8 ; starting line number
SET DGSTART=DGLINE
+9 DO SET^DGENL1(DGARY,DGLINE,"Hardship",21,IORVON,IORVOFF,,,,.DGCNT)
+10 SET DGLINE=DGLINE+1
+11 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Current Means Test Status: ",31)_$$EXT^DGMTH("CURRENT STATUS",HARDSHIP("CURRENT STATUS")),1,,,,,,.DGCNT)
+12 SET DGLINE=DGLINE+1
+13 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Income Year: ",31)_$SELECT(HARDSHIP("YEAR"):$$EXT^DGMTH("YEAR",HARDSHIP("YEAR")),1:""),1,,,,,,.DGCNT)
+14 SET DGLINE=DGLINE+1
+15 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Means Test Date: ",31)_$$EXT^DGMTH("TEST DATE",HARDSHIP("TEST DATE")),1,,,,,,.DGCNT)
+16 SET DGLINE=DGLINE+1
+17 IF (HARDSHIP("AGREE")'="")
DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Agreed To Pay Deductible: ",31)_$$EXT^DGMTH("AGREE",HARDSHIP("AGREE")),1,,,,,,.DGCNT)
SET DGLINE=DGLINE+1
+18 ;
+19 SET DGLINE=DGLINE+1
+20 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Hardship?: ",31)_$$EXT^DGMTH("HARDSHIP?",HARDSHIP("HARDSHIP?")),1,,,,,,.DGCNT)
+21 SET DGLINE=DGLINE+1
+22 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Hardship Effective Date: ",31)_$$EXT^DGMTH("EFFECTIVE",HARDSHIP("EFFECTIVE")),1,,,,,,.DGCNT)
+23 SET DGLINE=DGLINE+1
+24 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Review Date: ",31)_$$EXT^DGMTH("REVIEW",HARDSHIP("REVIEW")),1,,,,,,.DGCNT)
+25 SET DGLINE=DGLINE+1
+26 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Site Granting Hardship: ",31)_$$EXT^DGMTH("SITE",HARDSHIP("SITE")),1,,,,,,.DGCNT)
+27 SET DGLINE=DGLINE+1
+28 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Approved By: ",31)_$$EXT^DGMTH("BY",HARDSHIP("BY")),1,,,,,,.DGCNT)
+29 SET DGLINE=DGLINE+1
+30 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Hardship Reason: ",31)_$$EXT^DGMTH("REASON",HARDSHIP("REASON")),1,,,,,,.DGCNT)
+31 SET DGLINE=DGLINE+2
+32 ;
+33 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Date Category Last Changed: ",31)_$$EXT^DGMTH("DT/TM CTGRY CHNGD",HARDSHIP("DT/TM CTGRY CHNGD")),1,,,,,,.DGCNT)
+34 SET DGLINE=DGLINE+1
+35 DO SET^DGENL1(DGARY,DGLINE,$JUSTIFY("Category Last Changed By: ",31)_$$EXT^DGMTH("CTGRY CHNGD BY",HARDSHIP("CTGRY CHNGD BY")),1,,,,,,.DGCNT)
+36 SET DGLINE=DGLINE+1
+37 IF $DATA(^DGMT(408.31,HARDSHIP("MTIEN"),"C"))
Begin DoDot:1
+38 NEW LINE
+39 DO SET^DGENL1(DGARY,DGLINE,"COMMENTS:",1,$GET(IOINHI),$GET(IOINORM),,,,.DGCNT)
+40 SET DGLINE=DGLINE+1
+41 SET LINE=0
+42 FOR
SET LINE=$ORDER(^DGMT(408.31,HARDSHIP("MTIEN"),"C",LINE))
IF 'LINE
QUIT
Begin DoDot:2
+43 DO SET^DGENL1(DGARY,DGLINE,$GET(^DGMT(408.31,HARDSHIP("MTIEN"),"C",LINE,0)),1,,,,,,.DGCNT)
+44 SET DGLINE=DGLINE+1
End DoDot:2
End DoDot:1
+45 QUIT
+46 ;
CHKADD(HARDSHIP) ;
+1 ;Determines whether granting a hardship is appropriate
+2 ;Input:
+3 ; HARDSHIP - hardship array (pass by reference)
+4 ;Output:
+5 ; Function Value - 1 if the hardship can be granted, 0 otherwise
+6 ;
+7 NEW CODE
+8 SET CODE=""
+9 SET CODE=$$GETCODE^DGMTH(HARDSHIP("CURRENT STATUS"))
+10 IF CODE'="C"
IF CODE'="P"
IF CODE'="G"
QUIT 0
+11 QUIT 1
+12 ;
ADD(HARDSHIP) ;
+1 ;Add hardship protocol.
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array, pass by reference
+5 ;Output:
+6 ; HARDSHIP - hardship array (pass by reference)
+7 ;
+8 NEW CODE,ERROR
+9 IF $GET(DUZ)'>1
WRITE !,"YOUR DUZ IS NOT DEFINED!"
DO PAUSE^VALM1
SET VALMBCK="R"
QUIT
+10 SET CODE=""
+11 SET CODE=$$GETCODE^DGMTH(HARDSHIP("CURRENT STATUS"))
+12 IF CODE'="C"
IF CODE'="P"
IF CODE'="G"
WRITE !,"PATIENT NOT CURRENTLY RESPONSIBLE FOR COPAYMENT CHARGES!"
DO PAUSE^VALM1
QUIT
+13 SET HARDSHIP("EFFECTIVE")=DT
+14 SET HARDSHIP("SITE")=$$GETSITE^DGMTU4(.DUZ)
+15 IF HARDSHIP("TEST STATUS")=""
SET HARDSHIP("TEST STATUS")=HARDSHIP("CURRENT STATUS")
+16 ;S HARDSHIP("CURRENT STATUS")=$$GETSTAT^DGMTH("A",1)
+17 SET HARDSHIP("BY")=DUZ
+18 SET HARDSHIP("CTGRY CHNGD BY")=DUZ
+19 SET HARDSHIP("DT/TM CTGRY CHNGD")=$$NOW^XLFDT
+20 SET HARDSHIP("HARDSHIP?")=1
+21 Begin DoDot:1
+22 IF '$$GETSTAT(.HARDSHIP)
QUIT
+23 IF '$$GETEFF(.HARDSHIP)
QUIT
+24 IF '$$GETREV(.HARDSHIP)
QUIT
+25 IF '$$GETREAS(.HARDSHIP)
QUIT
+26 DO PRIOR(.HARDSHIP)
+27 IF $$STORE^DGMTH(.HARDSHIP,.ERROR)
Begin DoDot:2
+28 NEW EVENTS
+29 SET EVENTS("IVM")=1
+30 IF $$LOG^IVMPLOG(HARDSHIP("DFN"),HARDSHIP("YEAR"),.EVENTS)
End DoDot:2
+31 IF '$TEST
WRITE !,$GET(ERROR)
DO PAUSE^VALM1
+32 DO AFTER(.HARDSHIP)
End DoDot:1
+33 DO INIT^DGMTHL
+34 SET VALMBCK="R"
+35 QUIT
+36 ;
EDIT(HARDSHIP) ;
+1 ;Add hardship protocol.
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array, pass by reference
+5 ;Output:
+6 ; HARDSHIP - hardship array (pass by reference)
+7 ;
+8 NEW ERROR
+9 Begin DoDot:1
+10 IF '$$GETSTAT(.HARDSHIP,1)
QUIT
+11 IF '$$GETEFF(.HARDSHIP)
QUIT
+12 IF '$$GETREV(.HARDSHIP)
QUIT
+13 IF '$$GETREAS(.HARDSHIP)
QUIT
+14 DO PRIOR(.HARDSHIP)
+15 IF $$STORE^DGMTH(.HARDSHIP,.ERROR)
Begin DoDot:2
+16 NEW EVENTS
+17 SET EVENTS("IVM")=1
+18 IF $$LOG^IVMPLOG(HARDSHIP("DFN"),HARDSHIP("YEAR"),.EVENTS)
End DoDot:2
+19 IF '$TEST
WRITE !,$GET(ERROR)
DO PAUSE^VALM1
+20 DO AFTER(.HARDSHIP)
End DoDot:1
+21 DO INIT^DGMTHL
+22 SET VALMBCK="R"
+23 QUIT
+24 ;
CHKDEL(HARDSHIP) ;
+1 ;Checks whether the hardship can be deleted.
+2 ;Input:
+3 ; HARDSHIP - hardship array (pass by reference)
+4 IF (HARDSHIP("HARDSHIP?")="1")
IF (HARDSHIP("BY")!((+HARDSHIP("SITE")=+$$GETSITE^DGMTU4($GET(DUZ)))))
QUIT 1
+5 QUIT 0
DELETE(HARDSHIP) ;
+1 ;Deletes the hardship.
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array (pass by reference)
+5 ;
+6 NEW ERROR
+7 IF $$RUSURE
IF '$$DELETE^DGMTH(.HARDSHIP,1,.ERROR)
WRITE !,"AN ERROR OCCURRED - "_$GET(ERROR)
DO PAUSE^VALM1
+8 DO INIT^DGMTHL
+9 SET VALMBCK="R"
+10 QUIT
+11 ;
GETSTAT(HARDSHIP,EDITFLG) ;
+1 ;Asks the user to enter the means test status.
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array (pass by reference)
+5 ; EDITFLG - Edit Flag: 1=Edit
+6 ;Output:
+7 ; HARDSHIP("CURRENT STATUS")
+8 ;
+9 NEW DIR,FLTRSTAT
+10 SET FLTRSTAT=$$GETCODE^DGMTH($SELECT($GET(EDITFLG):HARDSHIP("TEST STATUS"),1:HARDSHIP("CURRENT STATUS")))
+11 SET DIR(0)="Pr^408.32:EMZ"
+12 SET DIR("S")="I $P(^(0),U,19)=1"
+13 IF "CP"[FLTRSTAT
SET DIR("S")=DIR("S")_",""AG""[$P(^(0),U,2)"
+14 IF FLTRSTAT="G"
SET DIR("S")=DIR("S")_",""A""[$P(^(0),U,2)"
+15 SET DIR("A")="Means Test Status"
+16 SET DIR("B")=$$EXT^DGMTH("CURRENT STATUS",HARDSHIP("CURRENT STATUS"))
+17 DO FULL^VALM1
+18 DO ^DIR
+19 IF $DATA(DIRUT)
QUIT 0
+20 IF Y<1
QUIT 0
+21 SET HARDSHIP("CURRENT STATUS")=+Y
+22 ; Don't reset agreed to pay if mt copay req/GMT copay req/pend adj
+23 IF "^C^G^P^"'[(U_$PIECE($GET(^DG(408.32,+Y,0)),U,2)_U)
SET HARDSHIP("AGREE")=""
+24 SET VALMBCK="R"
+25 QUIT 1
+26 ;
GETEFF(HARDSHIP) ;
+1 ;Asks the user to enter the effective date. Returns 1 on success, 0 on failure
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array (pass by reference)
+5 ;Output:
+6 ; HARDSHIP("EFFECTIVE")
+7 ;
+8 NEW DIR
+9 SET DIR(0)="D^"_HARDSHIP("TEST DATE")_":"_DT_":EX"
+10 SET DIR("A")="Hardship Effective Date"
+11 SET DIR("B")=$$FMTE^XLFDT($SELECT(HARDSHIP("EFFECTIVE"):HARDSHIP("EFFECTIVE"),1:HARDSHIP("TEST DATE")),"1D")
+12 DO ^DIR
+13 IF $DATA(DIRUT)
QUIT 0
+14 IF Y<1
QUIT 0
+15 SET HARDSHIP("EFFECTIVE")=Y
+16 QUIT 1
GETREV(HARDSHIP) ;
+1 ;Asks the user to enter the review date. Returns 1 on success, 0 on failure
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array (pass by reference)
+5 ;Output:
+6 ; HARDSHIP("REVIEW")
+7 ;
+8 NEW RET,STOP,X,Y
+9 SET (STOP,RET)=0
+10 SET DIR(0)="DO^::EX"
+11 SET DIR("A")="Hardship Review Date"
+12 IF HARDSHIP("REVIEW")
SET DIR("B")=$$FMTE^XLFDT(HARDSHIP("REVIEW"),"1D")
+13 SET DIR("?")="Enter a future date if you wish to conduct a review."
+14 FOR
Begin DoDot:1
+15 NEW DIR
+16 SET DIR(0)="DO^::EX"
+17 SET DIR("A")="Hardship Review Date"
+18 IF HARDSHIP("REVIEW")
SET DIR("B")=$$FMTE^XLFDT(HARDSHIP("REVIEW"),"1D")
+19 SET DIR("?")="Enter a future date if you wish to conduct a review."
+20 DO ^DIR
+21 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
SET STOP=1
SET RET=0
QUIT
+22 IF X="@"
SET Y=""
SET STOP=1
SET RET=1
QUIT
+23 IF Y=-1
SET STOP=1
SET RET=0
QUIT
+24 IF Y<DT
WRITE !,DIR("?")
QUIT
+25 SET (STOP,RET)=1
End DoDot:1
IF STOP
QUIT
+26 IF RET
SET HARDSHIP("REVIEW")=Y
+27 QUIT RET
+28 ;
GETREAS(HARDSHIP) ;
+1 ;Asks the user to enter the hardship reason.
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array (pass by reference)
+5 ;Output
+6 ; HARDSHIP("REASON")
+7 ;
+8 NEW DIR
+9 SET DIR(0)="FO^3:80"
+10 SET DIR("A")="Hardship Reason"
+11 SET DIR("B")=$GET(HARDSHIP("REASON"))
IF DIR("B")=""
KILL DIR("B")
+12 DO ^DIR
+13 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT 0
+14 SET HARDSHIP("REASON")=Y
+15 QUIT 1
+16 ;
PRIOR(HARDSHIP) ;set up for means test event driver
+1 SET DFN=HARDSHIP("DFN")
+2 SET DGMTI=HARDSHIP("MTIEN")
+3 SET DGMTS=HARDSHIP("CURRENT STATUS")
+4 SET DGMTACT="CAT"
+5 SET DGMTYPT=1
+6 DO PRIOR^DGMTEVT
+7 QUIT
AFTER(HARDSHIP) ;calls means test event driver
+1 DO AFTER^DGMTEVT
+2 SET DGMTINF=0
+3 DO EN^DGMTEVT
+4 KILL DGMTA,DGMTACT,DGMTDT,DGMTI,DGMTINF,DGMTP,DGMTS,DGMTYPT,I,J,Y
+5 QUIT
+1 ;Edit Comments protocol.
+2 ;
+3 ;Input:
+4 ; HARDSHIP - hardship array, pass by reference
+5 ;Output:
+6 ; none
+7 ;
+8 NEW DA,DIE,DR
+9 IF $GET(DUZ)'>1
WRITE !,"YOUR DUZ IS NOT DEFINED!"
DO PAUSE^VALM1
SET VALMBCK="R"
QUIT
+10 DO FULL^VALM1
+11 IF $GET(HARDSHIP("MTIEN"))
SET DR="50"
SET DA=HARDSHIP("MTIEN")
SET DIE=408.31
DO ^DIE
+12 DO INIT^DGMTHL
+13 IF VALMCNT<15
SET VALMBG=1
+14 SET VALMBCK="R"
+15 QUIT
+16 ;
RUSURE() ;
+1 ;Description: Asks user 'Are you sure?'
+2 ;Input: none
+3 ;Output: Function Value returns 0 or 1
+4 ;
+5 NEW DIR
+6 SET DIR(0)="Y"
+7 SET DIR("A")="Are you sure that the hardship should be deleted"
+8 SET DIR("B")="NO"
+9 DO ^DIR
+10 IF $DATA(DIRUT)
QUIT 0
+11 QUIT Y