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

DGOTHBTN.m

Go to the documentation of this file.
  1. DGOTHBTN ;SLC/SS,RM,JC - OTHD (OTHER THAN HONORABLE DISCHARGE) APIs ; 03/27/2019
  1. ;;5.3;Registration;**952,977,1029,1035,1047**;Aug 13, 1993;Build 13
  1. ;
  1. ;
  1. ;ICR# TYPE DESCRIPTION
  1. ;----- ---- ---------------------
  1. ; 2056 Sup ^DIQ : GETS
  1. ;10103 Sup ^XLFDT: $$FMADD,$$FMDIFF
  1. ; 2992 Sup ^XTV(8989.51) access
  1. ;
  1. ;Functionality:
  1. ;This function is called from the "OROTHCL GET" RPC to compose
  1. ; OTH (Other Than Honorable) status,
  1. ; PP (Presumptive Psychosis) status,
  1. ; PRF (Patient Record Flag) and its history
  1. ; as a text to display in OTH/PP/inactive PRF history button and associated pop-up message in CPRS.
  1. ;Will be called by OROTHCL code, that is used by ORTHCL GET RPC
  1. ;See also the DG ICR# 6873 that provides CPRS access to this API.
  1. ;
  1. ;Input parameters:
  1. ; RET - reference type parameter to return data
  1. ; DGDFN - patient's IEN in the file (#2)
  1. ; DGDATE - the date to calculate status and compose the text to return to CPRS
  1. ; default = DT (today)
  1. ;
  1. ;ATTENTION: Here below is what the ORTHCL GET RPC is supposed to return to GUI code
  1. ; (actual return values of this API below not necessarily should be the same
  1. ; but need to provide all information to support OR M-code that will pass it to the OR RPC)
  1. ;
  1. ;Return array:
  1. ;If RET(0)<0 : error code less than zero^error message - it is an error, and do not display anything
  1. ;
  1. ;If RET(0)=0 : then do not display anything in CPRS
  1. ;
  1. ;If RET(0)>0 : see the description below:
  1. ;
  1. ;RET(0) = number of lines to return
  1. ;RET(1) = text for the 1st line on the button ^Text to display when hover over the 1st line on the button
  1. ;RET(2) = text for the 2nd line on the button^Text to display when hover over the 2nd line on the button
  1. ;RET(3) = text for the 1st line of the button-click popup message ^ Text for the 1st line of the warning popup message (see the example for the OTH-90 below)
  1. ;RET(>3)= text lines for the rest of the text in the popup message when the user clicks on the button or for the warning popup message
  1. ;NOTE: empty or null values in array elements greater than 3 will not be displayed on the CPRS side.
  1. ; Enter at least a blank space in the piece to include a blank line in the displayed text.
  1. ;
  1. ;Example for OTH-EXT:
  1. ;RET(0)=6
  1. ;RET(1)="OTH-EXT^Other than Honorable, click for details"
  1. ;RET(2)=" "
  1. ;RET(3)="Other than Honorable - Extended"
  1. ;RET(4)="Eligible for Mental Health care only"
  1. ;RET(5)="Not time limited - pending VBA adjudication"
  1. ;RET(6)="Adjudication will determine eligibility for continuing care"
  1. ;
  1. ;Example for OTH-90 with zero days remaining:
  1. ;RET(0)=10
  1. ;RET(1)="OTH^Other than Honorable, click for details"
  1. ;RET(2)="0D,P1^Zero days remaining in the most recent period"
  1. ;RET(3)="Other Than Honorable Status"
  1. ;RET(4)=" "
  1. ;RET(5)="Zero days remaining in the most recent period^WARNING: EMERGENT MH OTH"
  1. ;RET(6)="^Zero days remaining in the most recent period."
  1. ;RET(7)="^Authorization from VISN Chief Medical Officer is required for an additional 90-Day period."
  1. ;RET(8)=" "
  1. ;RET(9)="Call Registration team for details."
  1. ;RET(10)="Clinician: Determine and document in 1st line of Progress Note if MH treatment related to service."
  1. ;
  1. ;Example for OTH-90 with less than 7 days remaining:
  1. ;RET(0)=10
  1. ;RET(1)="OTH^Other than Honorable, click for details"
  1. ;RET(2)="5D,P1^5 day(s) remaining in the current period"
  1. ;RET(3)="Other Than Honorable Status"
  1. ;RET(4)=" "
  1. ;RET(5)="5 day(s) remaining in the current period^WARNING: EMERGENT MH OTH"
  1. ;RET(6)="^Less than 7 day(s) remaining in the current period."
  1. ;RET(7)="^Authorization from VISN Chief Medical Officer is required for an additional 90-Day period."
  1. ;RET(8)=" "
  1. ;RET(9)="Call Registration team for details."
  1. ;RET(10)="Clinician: Determine and document in 1st line of Progress Note if MH treatment related to service."
  1. ;
  1. ;Example for OTH-90 with more than 7 days remaining:
  1. ;RET(0)=8
  1. ;RET(1)="OTH^Other than Honorable, click for details"
  1. ;RET(2)="80D,P1^80 day(s) remaining in the current period"
  1. ;RET(3)="Other Than Honorable Status"
  1. ;RET(4)=" "
  1. ;RET(5)="80 day(s) remaining in the current period"
  1. ;RET(6)=" "
  1. ;RET(7)="Call Registration Team for Details."
  1. ;RET(7)=RET(7)_Additional Line 1 if defined in ^XTV(8989.51,IEN,20,1,0)
  1. ;RET(8)=Additional Line 2 if defined in ^XTV(8989.51,IEN,20,2,0) or it will be a blank line.
  1. ;RET(9)="Clinician: Determine and document in 1st line of Progress Note if MH treatment related to service."
  1. ;
  1. ;Example for PP workaround settings only:
  1. ;RET(0)=7
  1. ;RET(1)="PP^Presumptive Psychosis Authority, click for details"
  1. ;RET(2)="^"
  1. ;RET(3)="Eligible for mental health care only under Presumptive Psychosis"
  1. ;RET(4)="Authority."
  1. ;RET(5)="PP Category: No value was selected as PP Indicator is not completed."
  1. ;RET(6)="Patients who experienced MST are eligible for MST related mental"
  1. ;RET(7)="health and medical care."
  1. ;
  1. ;Example for PP workaround settings and PP category:
  1. ;RET(0)=7
  1. ;RET(1)="PP^Presumptive Psychosis Authority, click for details"
  1. ;RET(2)="Fsm^Former Service Member with prior OTH discharge; should now be post-adjudication."
  1. ;RET(3)="Eligible for mental health care only under Presumptive Psychosis"
  1. ;RET(4)="Authority: Former Service Member with prior OTH discharge;"
  1. ;RET(5)="should now be post-adjudication."
  1. ;RET(6)="Patients who experienced MST may be eligible for MST-related care;"
  1. ;RET(7)="check with Eligibility for specifics."
  1. ;
  1. ;Example for PP category without PP workaround settings (the mailman will be also sent to the DGEN ELIGIBILITY ALERT group in DGOTHBT2):
  1. ;RET(0)=6
  1. ;RET(1)="PP^Presumptive Psychosis Authority, click for details"
  1. ;RET(2)="Dec^VETERAN DECLINES ENROLLMENT"
  1. ;RET(3)="Eligible for mental health care only under Presumptive Psychosis"
  1. ;RET(4)="Authority: VETERAN DECLINES ENROLLMENT."
  1. ;RET(5)="Patients who experienced MST are eligible for MST related mental"
  1. ;RET(6)="health and medical care." ^
  1. ;
  1. ;Example for inactive PRFs:
  1. ;RET(0)=23
  1. ;RET(1)="Inactive Flag^Patient has Inactive Flag(s), click to view"
  1. ;RET(2)=" "
  1. ;RET(3)="Flag name: HIGH RISK FOR SUICIDE Status: INACTIVE"
  1. ;RET(4)=" Initial Assigned Date: OCT 12, 2020@16:27:10"
  1. ;RET(5)=" Originating Site: CAMP MASTER"
  1. ;RET(6)=" Owner Site: CAMP MASTER"
  1. ;RET(7)=" CAMP MASTER changes:"
  1. ;RET(8)=" DATE/TIME: NOV 25, 2020@10:45:44 ACTION: INACTIVATE"
  1. ;RET(9)=" BAY PINES VAMC changes:"
  1. ;RET(10)=" DATE/TIME: NOV 25, 2020@10:19:17 ACTION: REACTIVATE"
  1. ;RET(11)=" CAMP MASTER changes:"
  1. ;RET(12)=" DATE/TIME: NOV 24, 2020@09:26:06 ACTION: INACTIVATE"
  1. ;RET(13)=" NEW YORK HHS changes:"
  1. ;RET(14)=" DATE/TIME: NOV 24, 2020@09:25:30 ACTION: CONTINUE"
  1. ;RET(15)=" *****additional info is in vista*****"
  1. ;RET(16)=" "
  1. ;RET(17)="Flag name: MISSING PATIENT Status: INACTIVE"
  1. ;RET(18)=" Initial Assigned Date: OCT 12, 2020@16:27:54"
  1. ;RET(19)=" Originating Site: CAMP MASTER"
  1. ;RET(20)=" Owner Site: CAMP MASTER"
  1. ;RET(21)=" CAMP MASTER changes:"
  1. ;RET(22)=" DATE/TIME: DEC 01, 2020@12:06:47 ACTION: INACTIVATE"
  1. ;RET(23)=" *****additional info is in vista*****"
  1. ;
  1. ;
  1. OTHBTN(DGDFN,DGDATE,RET) ;
  1. ;
  1. N DGEXP,PPWRK,PPCAT,PRFINF
  1. K ^TMP($J,"DGPRINFO")
  1. S PRFINF=$$PRFINFO^DGOTHBT2(DGDFN,"DGPRINFO")
  1. S RET(0)=0
  1. ;check OTH
  1. S DGEXP=$$GETEXPR^DGOTHD(DGDFN)
  1. ;if OTH (and possibly inactive PRF)
  1. I DGEXP'="" D OTH(DGEXP,DGDFN,.RET,PRFINF) K ^TMP($J,"DGPRINFO") Q
  1. ;check for PP workaround settings
  1. S PPWRK=$$PPWRKARN^DGPPAPI(DGDFN)
  1. ;check for PP category
  1. S PPCAT=$$PPINFO^DGPPAPI(DGDFN)
  1. ;if PP (and possibly inactive PRF)
  1. I PPWRK'="N"!(PPCAT'="") D PRESUMP(PPWRK,PPCAT,DGDFN,.RET,PRFINF) K ^TMP($J,"DGPRINFO") Q
  1. ;check if PRF
  1. ;if no inactive PRF then quit
  1. I $P(PRFINF,U,3)'="I" K ^TMP($J,"DGPRINFO") Q
  1. ;if at least one inactive PRF flag
  1. D INPRFONL^DGOTHBT2(DGDFN,"DGPRINFO",.RET)
  1. K ^TMP($J,"DGPRINFO")
  1. ;if nothing then don't display button - RET(0) is already set to 0
  1. Q
  1. ;
  1. ;/** Process OTH patient with or without inactive PRF
  1. ;check for OTH settings and prepare the text for the button and pop-up window
  1. ;Input:
  1. ; DGEXP - OTH data from $$GETEXPR^DGOTHD(DGDFN)
  1. ; DGDFN - IEN in the file (#2)
  1. ; RET - to return an array with data
  1. ;Output:
  1. ; RET(0)=0 - nothing to display
  1. ;or
  1. ; RET(0)>0, RET - with data to display on the button
  1. ;*/
  1. OTH(DGEXP,DGDFN,RET,PRFINF) ;
  1. N PPRET
  1. S RET(0)=0
  1. ;if error then quit
  1. I DGEXP<0 S RET(0)=DGEXP Q
  1. ;if there are no any inactive PRF
  1. ;or there are no any inactive PRF that are qualified
  1. ;then show just OTH information
  1. I $P(PRFINF,U,3)'="I"!($$QUALINACT^DGOTHBT2("DGPRINFO",DGDFN)=0) D Q
  1. .I DGEXP'?1"OTH".E S RET(0)=0 Q
  1. .;determine the OTH type
  1. .I $$ISOTH^DGOTHD(DGEXP)>1 D Q
  1. ..;set RET for OTH-90 and return
  1. ..D OTH90(DGDFN,.RET)
  1. .;if OTH-EXT then set RET for OTH-EXT
  1. .S RET(0)=11
  1. .S RET(1)="OTH-EXT^Other than Honorable, click for details"
  1. .S RET(2)=" "
  1. .S RET(3)="Other than Honorable - Extended"
  1. .S RET(4)=" "
  1. .S RET(5)="Eligible for Mental Health care only unless Veteran has positive MST screen."
  1. .S RET(6)=" "
  1. .S RET(7)="If MST Screen is positive, Veteran is eligible for MST related mental health and medical care."
  1. .S RET(8)="Please review MST checkbox or complete MST screening."
  1. .S RET(9)=" "
  1. .S RET(10)="Not time limited - pending VBA adjudication."
  1. .S RET(11)="Adjudication will determine eligibility for continuing care."
  1. .Q
  1. ;if at least one inactive PRF
  1. D OTHINPRF^DGOTHBT2(DGDFN,DGEXP,"DGPRINFO",.RET)
  1. Q
  1. ;
  1. ;/**
  1. ;process PP patient with or without inactive PRF
  1. ;check for PP settings and prepare the text for the button and pop-up window
  1. ;Input:
  1. ; WRKARND - PP work around data from $$PPWRKARN^DGOTHBT2(DGDFN)
  1. ; PPIND - PP category data from $$PPINFO^DGOTHBT2(DGDFN)
  1. ; DGDFN - IEN in the file (#2)
  1. ; RET - to return an array with data
  1. ;Output:
  1. ; RET(0)=0 - nothing to display
  1. ;or
  1. ; RET(0)>0, RET - with data to display on the button
  1. ;*/
  1. PRESUMP(WRKARND,PPIND,DGDFN,RET,PRFINF) ;
  1. N PPRET
  1. S RET(0)=0
  1. S PPRET=$P(PPIND,U,1)
  1. ;if there are no any inactive PRF
  1. ;then show just PP information
  1. D I $P(PRFINF,U,3)="I",$$QUALINACT^DGOTHBT2("DGPRINFO",DGDFN)=1 D PRWITHPP^DGOTHBT2(DGDFN,"DGPRINFO",.RET)
  1. .I PPRET="N" Q ;if indicator = NO then we NEVER show PP indicator
  1. .I PPIND="",WRKARND="N" Q ;if no indicator data AND no workaround settings then don't show PP indicator
  1. .I PPIND="",WRKARND="Y" D WORKARND(.RET) Q ;if no indicator data BUT workaround settings exist- then set RET to warn the user
  1. .I PPRET="Y",WRKARND="Y" D SHOWPP(PPIND,.RET) Q ;set RET for regular message when PP indicator data exist
  1. .I PPRET="Y",WRKARND="N" D SHOWPP(PPIND,.RET) D SENDMAIL^DGOTHBT2(DGDFN) Q ;set RET for regular message when PP indicator data exist
  1. ;if at least one inactive PRF
  1. Q
  1. ;
  1. ;
  1. OTH90(DGDFN,RET) ;calculate the CPRS EMERGENT OTH button
  1. K RET
  1. N DGN,DGIEN33,DGRET,DGCLCK,DGLS365D,DGLS365I,DG90A,DGCNTR,DG90,DGCRNT,LSTDAY
  1. N Z,DTSTR,DGSDT365,DGEDT365,DGSDT90,DGEDT90,DGNXT365,DGARR,DGERR,I,II,ZJMC
  1. I $$ISOTHD^DGOTHD(DGDFN)=0 S RET(0)="-1^Patient's primary eligibility code is no longer EXPANDED MH CARE NON-ENROLLEE" Q
  1. S DGIEN33=+$O(^DGOTH(33,"B",DGDFN,0))
  1. I DGIEN33=0 S RET(0)="-1^Unable to find an entry in OTH ELIGIBILITY PATIENT file #33 for this patient" Q
  1. D GETS^DIQ(33,DGIEN33_",",".01;.02;1*;2*","I","DGARR","DGERR")
  1. I $D(DGERR) S RET(0)="-1^FileMan Error #"_DGERR("DIERR",1)_": "_DGERR("DIERR",1,"TEXT",1) Q
  1. I $G(DGARR(33,DGIEN33_",",.02,"I"))<1 S RET(0)="-1^Patient is no longer Other Than Honorable eligible" Q
  1. D CLOCK^DGOTHRP2(DGIEN33)
  1. I DGLS365D'>0 S RET(0)="-1^No 365 days clocks started" Q
  1. ;check if one of the 365 or 90-day period is missing
  1. I $$MSNGPRD(DGLS365D,.DGCLCK) Q
  1. D RESULT^DGOTHRP3(.DGARR,.DGCLCK,DGIEN33)
  1. I '$D(DGRET) S RET(0)="-1^Check patient's 90-Day period, one of them is missing" Q
  1. S DGCNTR=1,(LSTDAY,DGCRNT)=0
  1. S RET(DGCNTR)="OTH^Other than Honorable, click for details"
  1. S DGCNTR=DGCNTR+1
  1. F I=1:1:DGLS365D D
  1. . ;get date for the last 365 and 90-day period
  1. . I 'DGCRNT D LSTPRD
  1. . Q:DGCRNT>0
  1. . I DGRET(I)<1,$D(DGRET(I+1)) Q
  1. . S II="" F S II=$O(DGRET(I,II)) Q:II="" D
  1. . . N DG90
  1. . . S DG90=DGRET(I,II)
  1. . . I $P(DG90,U,3)<1,$D(DGRET(I,II+1)) Q
  1. . . I $P(DG90,U,2)=DT S LSTDAY=1
  1. . . I DGCNTR=2 S DGCRNT=1 D BTN,HDR,MST
  1. . . I $P(DG90,U,3)>=7,$P(DG90,U,3)<=90 D
  1. . . . I $P(DG90,U)>DT D AUTH1 Q
  1. . . . S DGCNTR=DGCNTR+1
  1. . . . S RET(DGCNTR)=$$POPUP
  1. . . . I '$D(DGRET(I,II+1)) D
  1. . . . . I 'DGNXT365 D AUTH1 Q
  1. . . . . D NXT365
  1. . . I $P(DG90,U,3)<7 D
  1. . . . ;display warning message
  1. . . . S DGCNTR=DGCNTR+1
  1. . . . S RET(DGCNTR)=$$POPUP
  1. . . . D WARN
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=" "
  1. S DGCNTR=DGCNTR+1
  1. N LOCMSG1,LOCMSG2,DIE,DA,DR,ARRAY,DIC,X,LOCIEN,LOCDFLT
  1. S LOCDFLT="Call Registration Team for Details. "
  1. ; ICR 2992 access to ^XTV(8989.51
  1. S DIC="^XTV(8989.51,",DIC(0)="QEZ",X="OR OTH BTN LOCAL MSG"
  1. D ^DIC
  1. S LOCIEN=$P($G(Y),"^")
  1. D GETS^DIQ(8989.51,LOCIEN_",","**","","ARRAY")
  1. S LOCMSG1=$G(ARRAY(8989.51,LOCIEN_",","20",1))
  1. S LOCMSG2=$G(ARRAY(8989.51,LOCIEN_",","20",2))
  1. S RET(DGCNTR)=$G(LOCDFLT)_$G(LOCMSG1),DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=$G(LOCMSG2),DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=" ",DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)="Clinician: Determine and document in 1st line of Progress Note if MH treatment related to service."
  1. S RET(0)=DGCNTR
  1. Q
  1. ;
  1. MSNGPRD(DGLS365D,DGCLCK) ;check if there are 90-Day period missing
  1. N I,II,MSNGPRD
  1. S MSNGPRD=0
  1. F I=1:1:DGLS365D D Q:MSNGPRD
  1. . I '$D(DGCLCK(I)) D Q
  1. . . S RET(0)="-1^The 365-Day period # "_I_" is missing."
  1. . . S MSNGPRD=1
  1. . F II=1:1:DGCLCK(I) D Q:MSNGPRD
  1. . . I DGCLCK(I,II)'=II D
  1. . . . S RET(0)="-1^The "_II_$S(II=1:"st",II=2:"nd",II=3:"rd",45[II:"th")_" 90-Day period for the 365 days period # "_I_" is missing."
  1. . . . S MSNGPRD=1
  1. Q MSNGPRD
  1. ;
  1. MST ;Text for MST information.
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)="Eligible for MH care only. Remember to perform MST screen."
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=" "
  1. Q
  1. ;
  1. BTN ;Text to be displayed in the button and when user hover the button
  1. ;
  1. S RET(DGCNTR)=$S($G(LSTDAY):"LD",1:$P(DG90,U,3)_"D")_",P"_II_"^"_$$POPUP()
  1. Q
  1. ;
  1. HDR ;display popup message header
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)="Other Than Honorable Status"
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=" "
  1. Q
  1. ;
  1. Q $S($G(LSTDAY):$$LSTDAY(),$P(DG90,U,3)=0:"Zero days remaining ",1:$P(DG90,U,3)_" day(s) remaining ")_"in the "_$$MSG()_" period"
  1. ;
  1. AUTH1 ;Display authorization verbiage in the popup message
  1. I $P(DG90,U,4)="" D Q
  1. . I $P(DG90,U)>DT S DGCNTR=DGCNTR+1 D AUTH3 Q
  1. . S DGCNTR=DGCNTR+1
  1. . S RET(DGCNTR)="Authorization required for further care."
  1. I DGSDT90<=DT D Q
  1. . S DGCNTR=DGCNTR+1
  1. . S RET(DGCNTR)=$$AUTH2()
  1. S DGCNTR=DGCNTR+1
  1. D AUTH3
  1. Q
  1. ;
  1. LSTDAY() ;
  1. Q "Last day patient is eligible for treatment "
  1. ;
  1. AUTH2() ;
  1. Q "Authorization from VISN Chief Medical Officer is required for an additional 90-Day period."
  1. ;
  1. AUTH3 ;
  1. S RET(DGCNTR)=$P(DG90,U,3)_" day(s) are authorized starting on "_$$FMTE^XLFDT($P(DG90,U))
  1. Q
  1. MSG() ;
  1. Q $S($G(LSTDAY):"current",(('DGNXT365)&(DGRET(I)>0)):"current",1:"most recent")
  1. ;
  1. WARN ;display warning message when user selects a patient less than 7 day(s) remaining.
  1. S RET(DGCNTR)=RET(DGCNTR)_"^WARNING: EMERGENT MH OTH"
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=$S($G(LSTDAY):"^"_$$LSTDAY(),$P(DG90,U,3)=0:"^Zero days remaining ",1:"^Less than 7 day(s) remaining ")_"in the "_$$MSG()_" period."
  1. I 'DGNXT365 D Q
  1. . I DGSDT90<=DT D
  1. . . S DGCNTR=DGCNTR+1
  1. . . S RET(DGCNTR)="^"_$$AUTH2()
  1. . . I $P(DG90,U,3)<7 S RET(DGCNTR+1)=$P(RET(DGCNTR),U,2),DGCNTR=DGCNTR+1
  1. E D
  1. . I '$D(DGRET(I,II+1)) D
  1. . . S DGCNTR=DGCNTR+1
  1. . . S RET(DGCNTR)="^"_$$NXT2()
  1. . . D NXT365
  1. Q
  1. ;
  1. LSTPRD ;get dates for the last 365 and 90- day period
  1. S DTSTR=DGRET(I,DGCLCK(I))
  1. S DGSDT365=$P(DGRET(I,1),U),DGEDT365=$$FMADD^XLFDT(DGSDT365,365)
  1. S DGSDT90=$P(DTSTR,U),DGEDT90=$P(DTSTR,U,2)
  1. S DGNXT365=$S(DGEDT365<=DT:1,$$FMDIFF^XLFDT(DGEDT90,DGSDT365)>=365:1,(DGSDT90>=DT||DGSDT90<=DT)&(DGEDT90>=DT):0,1:0)
  1. Q
  1. ;
  1. NXT365 ;display verbiage for the next 365-day period
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)=$$NXT2()
  1. S DGCNTR=DGCNTR+1
  1. S RET(DGCNTR)="Please contact Registration to start the clock."
  1. Q
  1. ;
  1. NXT2() ;
  1. Q "Patient is eligible for an additional 90-Day period for the next 365-Day."
  1. ;
  1. ;
  1. ;
  1. ;/** Set RET for the case when PP category was selected for the patient
  1. ;Input:
  1. ; PPIND - returned by $$PPINFO^DGOTHBT2(DGDFN)
  1. ;Output:
  1. ; RET - local array to return information to send to CPRS
  1. ;
  1. ;*/
  1. SHOWPP(PPIND,RET) ;
  1. N DGRET,DGCAT
  1. S DGRET=$P(PPIND,U,2,3)
  1. S RET(1)="PP^Presumptive Psychosis Authority, click for details"
  1. S DGCAT=$P(DGRET,U)
  1. I DGCAT="OTH" D Q
  1. . S RET(2)="Fsm^Former Service Member with prior OTH discharge; should now be post-adjudication."
  1. . S RET(3)="Eligible for mental health care only under Presumptive Psychosis Authority: Former Service Member with"
  1. . S RET(4)="prior OTH discharge; should now be post-adjudication."
  1. . S RET(5)="Patients who experienced MST may be eligible for MST-related care; check with Eligibility for specifics."
  1. . S RET(6)=""
  1. . S RET(0)=6
  1. S RET(2)=$E(DGCAT,1,1)_$$LOW^XLFSTR($E(DGCAT,2,3))_U_$P(DGRET,U,2)
  1. S RET(3)="Eligible for mental health care only under Presumptive Psychosis Authority: "_$P(DGRET,U,2)_"."
  1. S RET(4)="Patients who experienced MST are eligible for MST related mental health and medical care."
  1. S RET(0)=4
  1. Q
  1. ;
  1. ;/** Set RET array for the messages to display in CPRS when we have PP workaround settings
  1. ;Input:
  1. ; nothing
  1. ;Output:
  1. ; RET - local array to return information to send to CPRS
  1. ;*/
  1. WORKARND(RET) ;
  1. S RET(1)="PP^Presumptive Psychosis Authority, click for details"
  1. S RET(2)="^"
  1. S RET(3)="Eligible for mental health care only under Presumptive Psychosis Authority."
  1. S RET(4)="PP Category: No value was selected as PP Indicator is not completed."
  1. S RET(5)="Patients who experienced MST are eligible for MST related mental health and medical care."
  1. S RET(0)=5
  1. Q
  1. ;