DGRP62 ;ALB/PJH,LBD,ARF - Patient MSDS History - List Manager Screen;12 JUN 1997 10:00 am ; 6/23/09 3:48pm
;;5.3;Registration;**797,1014**;08/13/93;Build 42
;
EN(DFN) ;Main entry point to invoke the DGEN PATIENT MSDS VIEW list
; Input -- DFN Patient IEN
;
D WAIT^DICD
D EN^VALM("DGEN MSDS PATIENT VIEW")
Q
;
HDR ;Header code
N DGPREFNM,X,VA,VAERR
S VALMHDR(1)=$J("",18)_"VISTA MILITARY SERVICE DATA, SCREEN <6.2>"
D LISTHDR^DGRPU(2) ;DG*5.3*1014 - ARF - sets patient data in the 2nd and 3rd entries in VALMHDR array
;D PID^VADPT ;DG*5.3*1014 begin - comment previous code
;S VALMHDR(2)=$E("Patient: "_$P($G(^DPT(DFN,0)),U),1,30)
;S VALMHDR(2)=VALMHDR(2)_" ("_VA("BID")_")"
;S X="PATIENT TYPE UNKNOWN"
;I $D(^DPT(DFN,"TYPE")),$D(^DG(391,+^("TYPE"),0)) S X=$P(^(0),U,1)
;S VALMHDR(2)=$$SETSTR^VALM1(X,VALMHDR(2),60,80)
;S VALMHDR(3)=$J("",4)_"Service Branch/Component Service #"
;S VALMHDR(3)=VALMHDR(3)_" Entered Separated Discharge" ;DG*5.3*1014 end - comment previous code
S VALMHDR(4)=$J("",4)_"Service Branch/Component Service #"
S VALMHDR(4)=VALMHDR(4)_" Entered Separated Discharge"
Q
;
INIT ;Build patient MSDS screen
D CLEAN^VALM10
K ^TMP("DGRP62",$J)
;
N GLBL
S GLBL=$NA(^TMP("DGRP62",$J))
D GETMSE(DFN,GLBL,0)
Q
;
GETMSE(DFN,GLBL,NUM) ;Get old format MSE data from node .32
N DGDATA
S VALMCNT=0
S:'$D(DGRP(.32)) DGRP(.32)=$G(^DPT(DFN,.32))
S:'$D(DGRP(.3291)) DGRP(.3291)=$G(^DPT(DFN,.3291))
;Last service episode (SL)
S DGDATA=$$SETDAT(.DGRP,4)
D EPISODE^DGRP61(DGDATA,GLBL,NUM)
;Next to last service episode (SNL)
Q:$P(DGRP(.32),U,19)'="Y"
S DGDATA=$$SETDAT(.DGRP,9)
D EPISODE^DGRP61(DGDATA,GLBL,NUM)
;Prior episode (SNNL)
Q:$P(DGRP(.32),U,20)'="Y"
S DGDATA=$$SETDAT(.DGRP,14)
D EPISODE^DGRP61(DGDATA,GLBL,NUM)
Q
;
SETDAT(DGRP,FLD) ;Set MSE data into DGDATA
N DGX,DGY
Q:'$G(FLD) ""
S DGX=$G(DGRP(.32)) I DGX="" Q ""
S DGY=$G(DGRP(.3291))
Q $P(DGX,U,FLD+2)_U_$P(DGX,U,FLD+3)_U_$P(DGX,U,FLD+1)_U_$P(DGY,U,FLD+1/5)_U_$P(DGX,U,FLD+4)_U_$P(DGX,U,FLD)
;
;
HELP ;Help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ;Exit code
D CLEAN^VALM10
D CLEAR^VALM1
K ^TMP("DGRP62",$J)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGRP62 2282 printed Nov 22, 2024@18:05:41 Page 2
DGRP62 ;ALB/PJH,LBD,ARF - Patient MSDS History - List Manager Screen;12 JUN 1997 10:00 am ; 6/23/09 3:48pm
+1 ;;5.3;Registration;**797,1014**;08/13/93;Build 42
+2 ;
EN(DFN) ;Main entry point to invoke the DGEN PATIENT MSDS VIEW list
+1 ; Input -- DFN Patient IEN
+2 ;
+3 DO WAIT^DICD
+4 DO EN^VALM("DGEN MSDS PATIENT VIEW")
+5 QUIT
+6 ;
HDR ;Header code
+1 NEW DGPREFNM,X,VA,VAERR
+2 SET VALMHDR(1)=$JUSTIFY("",18)_"VISTA MILITARY SERVICE DATA, SCREEN <6.2>"
+3 ;DG*5.3*1014 - ARF - sets patient data in the 2nd and 3rd entries in VALMHDR array
DO LISTHDR^DGRPU(2)
+4 ;D PID^VADPT ;DG*5.3*1014 begin - comment previous code
+5 ;S VALMHDR(2)=$E("Patient: "_$P($G(^DPT(DFN,0)),U),1,30)
+6 ;S VALMHDR(2)=VALMHDR(2)_" ("_VA("BID")_")"
+7 ;S X="PATIENT TYPE UNKNOWN"
+8 ;I $D(^DPT(DFN,"TYPE")),$D(^DG(391,+^("TYPE"),0)) S X=$P(^(0),U,1)
+9 ;S VALMHDR(2)=$$SETSTR^VALM1(X,VALMHDR(2),60,80)
+10 ;S VALMHDR(3)=$J("",4)_"Service Branch/Component Service #"
+11 ;S VALMHDR(3)=VALMHDR(3)_" Entered Separated Discharge" ;DG*5.3*1014 end - comment previous code
+12 SET VALMHDR(4)=$JUSTIFY("",4)_"Service Branch/Component Service #"
+13 SET VALMHDR(4)=VALMHDR(4)_" Entered Separated Discharge"
+14 QUIT
+15 ;
INIT ;Build patient MSDS screen
+1 DO CLEAN^VALM10
+2 KILL ^TMP("DGRP62",$JOB)
+3 ;
+4 NEW GLBL
+5 SET GLBL=$NAME(^TMP("DGRP62",$JOB))
+6 DO GETMSE(DFN,GLBL,0)
+7 QUIT
+8 ;
GETMSE(DFN,GLBL,NUM) ;Get old format MSE data from node .32
+1 NEW DGDATA
+2 SET VALMCNT=0
+3 if '$DATA(DGRP(.32))
SET DGRP(.32)=$GET(^DPT(DFN,.32))
+4 if '$DATA(DGRP(.3291))
SET DGRP(.3291)=$GET(^DPT(DFN,.3291))
+5 ;Last service episode (SL)
+6 SET DGDATA=$$SETDAT(.DGRP,4)
+7 DO EPISODE^DGRP61(DGDATA,GLBL,NUM)
+8 ;Next to last service episode (SNL)
+9 if $PIECE(DGRP(.32),U,19)'="Y"
QUIT
+10 SET DGDATA=$$SETDAT(.DGRP,9)
+11 DO EPISODE^DGRP61(DGDATA,GLBL,NUM)
+12 ;Prior episode (SNNL)
+13 if $PIECE(DGRP(.32),U,20)'="Y"
QUIT
+14 SET DGDATA=$$SETDAT(.DGRP,14)
+15 DO EPISODE^DGRP61(DGDATA,GLBL,NUM)
+16 QUIT
+17 ;
SETDAT(DGRP,FLD) ;Set MSE data into DGDATA
+1 NEW DGX,DGY
+2 if '$GET(FLD)
QUIT ""
+3 SET DGX=$GET(DGRP(.32))
IF DGX=""
QUIT ""
+4 SET DGY=$GET(DGRP(.3291))
+5 QUIT $PIECE(DGX,U,FLD+2)_U_$PIECE(DGX,U,FLD+3)_U_$PIECE(DGX,U,FLD+1)_U_$PIECE(DGY,U,FLD+1/5)_U_$PIECE(DGX,U,FLD+4)_U_$PIECE(DGX,U,FLD)
+6 ;
+7 ;
HELP ;Help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ;Exit code
+1 DO CLEAN^VALM10
+2 DO CLEAR^VALM1
+3 KILL ^TMP("DGRP62",$JOB)
+4 QUIT