DGRRPSEE ; ALB/SGG - rtnDGRR PatientServices Enrollment and Eligibility ;09/30/03 ; Compiled November 24, 2003 11:54:30
;;5.3;Registration;**557**;Aug 13, 1993
;
;
DOC ;"
DO ELIGIBLE
DO DISABLED
SET CNT=$G(CNT)+1,PSARRAY(CNT)=""_"^^^1"
QUIT
;
;
ENRLDATE() ;
NEW DATA
SET DATA=$P($G(^DPT(PTID,"ENR")),"^",1)
IF DATA'="" SET DATA=$P($G(^DGEN(27.11,DATA,0)),"^",10)
QUIT DATA
;
ENRLSTAT() ;
NEW DATA
SET DATA=$P($G(^DPT(PTID,"ENR")),"^",1)
IF DATA'="" SET DATA=$P($G(^DGEN(27.11,DATA,0)),"^",4)
IF DATA'="" SET DATA=$P($G(^DGEN(27.15,DATA,0)),"^",1)
QUIT DATA
;
ENRLPRIO() ;
NEW DATA
SET DATA=$P($G(^DPT(PTID,"ENR")),"^",1)
IF DATA'="" SET DATA=$P($G(^DGEN(27.11,DATA,0)),"^",7)
SET DATA=$S(DATA=1:"GROUP 1",DATA=2:"GROUP 2",DATA=3:"GROUP 3",DATA=4:"GROUP 4",DATA=5:"GROUP 5",DATA=6:"GROUP 6",DATA=7:"GROUP 7",DATA=8:"GROUP 8",1:"")
QUIT DATA
;
ENRLSUBG() ;
NEW DATA
SET DATA=$P($G(^DPT(PTID,"ENR")),"^",1)
IF DATA'="" SET DATA=$P($G(^DGEN(27.11,DATA,0)),"^",12)
SET DATA=$S(DATA=1:"a",DATA=3:"c",DATA=5:"e",DATA=7:"g",1:"")
QUIT DATA
;
CMEANTST() ;
NEW DATA
SET DATA=$P(GLOB(0),"^",14)
IF DATA'="" SET DATA=$P($G(^DG(408.32,DATA,0)),"^",1)
QUIT DATA
;
INELDATE() ;
QUIT $P(GLOB(.15),"^",2)
;
SERVCONC() ;
NEW DATA
SET DATA=$P(GLOB(.3),"^",1)
SET DATA=$S(DATA="Y":"YES",DATA="N":"NO",1:"")
QUIT DATA
;
SERVCPER() ;
QUIT $P(GLOB(.3),"^",2)
;
UNEMPLOY() ;
N DATA
SET DATA=$P(GLOB(.3),"^",5)
SET DATA=$S(DATA="Y":"YES",DATA="N":"NO",1:"")
QUIT DATA
;
INELIGRS() ;
QUIT $P(GLOB(.3),"^",7)
;
CLAIMNUM() ;
QUIT $P(GLOB(.31),"^",3)
;
PEROFSRV() ;
NEW DATA
SET DATA=$P(GLOB(.32),"^",3)
IF DATA'="" SET DATA=$P($G(^DIC(21,DATA,0)),"^",1)
QUIT DATA
;
ELIGPRIM() ;
NEW DATA
SET DATA=$P(GLOB(.36),"^",1)
IF DATA'="" SET DATA=$P($G(^DIC(8,DATA,0)),"^",9)
IF DATA'="" SET DATA=$P($G(^DIC(8.1,DATA,0)),"^",1)
QUIT DATA
;
ELIGSTAT() ;
NEW DATA
SET DATA=$P(GLOB(.361),"^",1)
SET DATA=$S(DATA="P":"PENDING VERIFICATION",DATA="R":"PENDING RE-VERIFICATION",DATA="V":"PENDING VERIFICATION",1:"")
QUIT DATA
;
PATNTYPE() ;
NEW DATA
SET DATA=$P($G(^DPT(PTID,"TYPE")),"^",1)
I DATA'="" SET DATA=$P($G(^DG(391,DATA,0)),"^",1)
QUIT DATA
;
VETERAN() ;
NEW DATA
SET DATA=$P($G(^DPT(PTID,"VET")),"^",1)
SET DATA=$S(DATA="Y":"YES",DATA="N":"NO",1:"")
QUIT DATA
;
CLASS(PTID) ;Get A/O, Ion. Rad., Env. Cont., Combat Svc, MST, HNC
I $G(PTID)="" Q
N DGARRY,DGERR,DGIENS,DGNTAPI
S DGIENS=$$IENS^DILF(PTID)
D GETS^DIQ(2,DGIENS,".32102;.32103;.322013;.5291","E","DGARRY","DGERR")
I '$D(DGERR) D
.S DGAO=$G(DGARRY(2,DGIENS,.32102,"E"))
.S DGIR=$G(DGARRY(2,DGIENS,.32103,"E"))
.S DGENV=$G(DGARRY(2,DGIENS,.322013,"E"))
.S DGCS=$G(DGARRY(2,DGIENS,.5291,"E"))
; Get MST information
S DGMST=$$GETSTAT^DGMSTAPI(PTID)
;MST Status (#3) field from MST History (#29.11) file
S DGMST=$P($G(DGMST),U,6)
; Get Head/Neck Cancer information
S DGNTAPI=$$GETCUR^DGNTAPI(PTID,"DGNTAPI")
; NTR Indicator (#.02) field from Nose and Throad Radium History (#28.11) file
S DGHNC=$P($G(DGNTAPI("IND")),U,2)
Q
;
SPINALCI() ;
NEW DATA
SET DATA=$P(GLOB(57),"^",4)
IF DATA=1 S DATA="PARAPLEGIA-TRAUMATIC"
IF DATA=2 S DATA="QUADRIPLEGIA-TRAUMATIC"
IF DATA=3 S DATA="PARAPLEGIA-NONTRAUMATIC"
IF DATA=4 S DATA="QUADRIPLEGIA-NONTRAUMATIC"
IF DATA="X" S DATA="NOT APPLICABLE"
QUIT DATA
;
DISABLED ;
NEW DABLECNT,ROWCNT,DABLERTD,DABLEPER,DABLECON
SET DABLECNT=0,ROWCNT=0
FOR SET DABLECNT=$O(^DPT(PTID,.372,DABLECNT)) QUIT:(DABLECNT<1) DO
.SET GLOB(.372)=$G(^DPT(PTID,.372,DABLECNT,0))
.SET DABLERTD=$P(GLOB(.372),"^",1)
.SET DABLERTD=$P($G(^DIC(31,+DABLERTD,0)),"^",1)
.Q:DABLERTD=""
.SET DABLEPER=$P(GLOB(.372),"^",2)
.SET DABLECON=$S($P(GLOB(.372),"^",3)=0:"NO",$P(GLOB(.372),"^",3)=1:"YES",1:"")
.IF +$L(DABLERTD_DABLEPER_DABLECON) DO
..SET ROWCNT=ROWCNT+1
..SET CNT=$G(CNT)+1,PSARRAY(CNT)=""
IF ROWCNT=0 DO
.SET CNT=$G(CNT)+1,PSARRAY(CNT)=""
QUIT
;
ELIGIBLE ;
NEW ELIGCNT,ROWCNT,ELIGIBLE,ELIGLONG,ELIGSHRT
SET ELIGCNT=0,ROWCNT=0
FOR SET ELIGCNT=$O(^DPT(PTID,"E",ELIGCNT)) QUIT:(ELIGCNT<1) DO
.SET GLOB("E")=$G(^DPT(PTID,"E",ELIGCNT,0))
.SET ELIGIBLE=$P(GLOB("E"),"^",1)
.IF ELIGIBLE'="" SET ELIGIBLE=$P($G(^DIC(8,ELIGIBLE,0)),"^",9)
.IF ELIGIBLE'="" SET ELIGIBLE=$P($G(^DIC(8.1,ELIGIBLE,0)),"^",1)
.SET ELIGLONG=$P(GLOB("E"),"^",3)
.SET ELIGSHRT=$P(GLOB("E"),"^",4)
.IF +$L(ELIGIBLE_ELIGLONG_ELIGSHRT) DO
..SET ROWCNT=ROWCNT+1
..SET CNT=$G(CNT)+1,PSARRAY(CNT)=""
IF ROWCNT=0 DO
.SET CNT=$G(CNT)+1,PSARRAY(CNT)=""
QUIT