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

DGPPAPI.m

Go to the documentation of this file.
  1. DGPPAPI ;SLC/SS - Presumptive Psychosis APIs ; 09/22/2020
  1. ;;5.3;Registration;**1029**;Aug 13, 1993;Build 19
  1. ;
  1. ;ICRs:
  1. ;$$INSUR^IBBAPI - DBIA4419
  1. ;
  1. ;/** Returns PP information from the file (#2)
  1. ;Input:
  1. ; DFN - IEN in the file (#2)
  1. ;Output:
  1. ; Piece #1:
  1. ; "" patient does not have information about Presumptive Psychosis category in the file (#2)
  1. ; "Y" patient registered as Presumptive Psychosis patient in the file (#2)
  1. ; "N" patient settings in the file (#2) contradict with the PP status - cannot be PP because he/she is not a veteran
  1. ; Piece #2: internal code for the PP category
  1. ; Piece #3: full name of the PP category
  1. ;Example:
  1. ; Y^REJ^REJECTED DUE TO INCOME
  1. ;*/
  1. PPINFO(DFN) ;
  1. N RETVAL
  1. N DGARR
  1. D GETS^DIQ(2,DFN_",",".5601;1901","IE","DGARR")
  1. I $G(DGARR(2,DFN_",",1901,"I"))="N" Q "N" ;patient in not a veteran so she/he can be PP patient
  1. I $G(DGARR(2,DFN_",",.5601,"I"))="" Q ""
  1. S RETVAL="Y"_U_$G(DGARR(2,DFN_",",.5601,"I"))_U_$G(DGARR(2,DFN_",",.5601,"E"))
  1. Q RETVAL
  1. ;
  1. ;/** Was patient registered by using PP workaround methods
  1. ; a.Eligibility Status Data screen 7, section 1
  1. ; Patient Type = SC VETERAN
  1. ; VETERAN (Y/N)? = Yes
  1. ; SERVICE CONNECTED? = Yes
  1. ; b.Primary Eligibility screen 7, section 3 = SC LESS THAN 50%
  1. ; c.RATED DISABILITIES screen 11, section 4 = SC%:0
  1. ; d.RATED DISABILITY screen 11, section 4 = 9410
  1. ; e.screen 5, field 1 is not null (insurance buffer entry)
  1. ;
  1. ;Input parameter
  1. ; DFN - IEN of the patient file #2
  1. ;Return values:
  1. ; N - No: there are no workaround PP settings
  1. ; Y - Yes, there are workaround PP settings
  1. ;*/
  1. PPWRKARN(DGDFN) ;
  1. N RETVAL,DGSCL50,DGARR
  1. ; a.Eligibility Status Data screen 7, section 1
  1. ; Patient Type = SC VETERAN
  1. ; VETERAN (Y/N)? = Yes
  1. ; SERVICE CONNECTED? = Yes
  1. I $$PTYPE(DGDFN)="N" Q "N"
  1. ;b.Primary Eligibility screen 7, section 3 = SC LESS THAN 50%
  1. I $$SCLES50(DGDFN)="N" Q "N"
  1. D GETS^DIQ(2,DGDFN_",",".302;.3721*","I","DGARR")
  1. ;c.RATED DISABILITIES screen 11, section 4 = SC%:0
  1. I $G(DGARR(2,DGDFN_",",.302,"I"))'=0 Q "N" ;2,.302 SERVICE CONNECTED PERCENTAGE
  1. ;d.RATED DISABILITY screen 11, section 4 = 9410 (2,.3721 RATED DISABILITIES (VA) .372;0 POINTER Multiple #2.04)
  1. I '$$DISABL(.DGARR) Q "N"
  1. ;e.screen 5, field 1 is not null (insurance buffer entry)
  1. I '$$INSBUFF(DGDFN) Q "N"
  1. Q "Y"
  1. ;
  1. ; a.Eligibility Status Data screen 7, section 1
  1. ; Patient Type = SC VETERAN (2,391)
  1. ; VETERAN (Y/N)? = Yes (2,1901)
  1. ; SERVICE CONNECTED? = Yes (2,.301)
  1. ;Input parameter
  1. ; DFN - IEN of the patient file #2
  1. ;Return values:
  1. ; N - No
  1. ; Y - Yes
  1. PTYPE(DFN) ;
  1. N VAEL,VAERR,PTYPE
  1. D ELIG^VADPT
  1. ;Patient Type = SC VETERAN (2,391)
  1. ;VETERAN (Y/N)? = Yes
  1. ;SERVICE CONNECTED? = Yes (2,.301)
  1. S PTYPE="N"
  1. I $P(VAEL(6),U,2)="SC VETERAN",+VAEL(4),+VAEL(3) S PTYPE="Y"
  1. D KVAR^VADPT
  1. Q PTYPE
  1. ;
  1. ;/** Patient's primary insurance = "SC LESS THAN 50%"?
  1. ;2,.361 PRIMARY ELIGIBILITY CODE
  1. ;Input parameter
  1. ; DFN - IEN of the patient file #2
  1. ;Return values:
  1. ; N - No
  1. ; Y - Yes
  1. ;*/
  1. SCLES50(DFN) ;
  1. N VAEL,X
  1. D ELIG^VADPT
  1. I +VAEL(1)>0,$$GET1^DIQ(8,+VAEL(1)_",",8)="SC LESS THAN 50%" Q "Y"
  1. Q "N"
  1. ;
  1. ;/** Does patient have an entry in the insurance buffer?
  1. ;Input parameter
  1. ; DFN - IEN of the patient file #2
  1. ;Return values:
  1. ; N - No
  1. ; Y - Yes
  1. ;*/
  1. INSBUFF(DFN) ;
  1. N DGX,DGRTN
  1. S DGX=$$INSUR^IBBAPI(DFN,"","RAB",.DGRTN,"*")
  1. I $G(DGRTN("BUFFER"))>0 Q 1
  1. Q 0
  1. ;
  1. ;/** Return the disability DX CODE
  1. ;Input parameter
  1. ; IEN31 - IEN of the file #31
  1. ;Return values:
  1. ; DX CODE
  1. ;*/
  1. DXCODE(IEN31) ;
  1. N DGARR
  1. D GETS^DIQ(31,IEN31_",","2","I","DGARR")
  1. Q $G(DGARR(31,IEN31_",",2,"I"))
  1. ;
  1. ;/** check for PP disability settings
  1. ;Input parameter
  1. ; IEN31 - IEN of the file #31
  1. ;Return values:
  1. ; 1 - PP settings
  1. ; 0 - no PP settings
  1. ;*/
  1. ;
  1. DISABL(DGARR) ;
  1. N DGZ,DG31,DGRET
  1. S DGRET=0
  1. S DGZ=$O(DGARR(2.04,""))
  1. I '$G(DGZ) Q 0
  1. S DG31=$G(DGARR(2.04,DGZ,.01,"I")) ;IEN of the file #31
  1. I $$DXCODE(DG31)=9410,$G(DGARR(2.04,DGZ,2,"I"))=0 S:'$O(DGARR(2.04,DGZ)) DGRET=1
  1. Q DGRET
  1. ;