DGMSTD ; ALB/SCK - MST Status Display LM Interface ; 17-DEC-1998
;;5.3;Registration;**195,379,1015**;Aug 13, 1993;Build 21
Q
;
EN ; -- main entry point for DGMST STATUS DISPLAY
D EN^VALM("DGMST STATUS DISPLAY")
Q
;
HDR ; -- header code
N DFN,VA,VADM
S DFN=$G(MSTDFN)
D DEM^VADPT
S VALMHDR(1)="MST Status Information for Patient: "_$$LOWER^VALM1(VADM(1))_" ("_$P(VADM(2),U,2)_")"
S VALMHDR(2)=" "
D KVAR^VADPT
Q
;
INIT ; -- init variables and list array
K ^TMP("DGMST DISP",$J)
N MSTIEN,MSTDT,DGX,VALMCNT,MST1,MSG,DGMST
S VALMCNT=0
;
; Display message if no MST status history exists for patient
I '$D(^DGMS(29.11,"C",MSTDFN)) D Q
. D SET("")
. S MSG="No MST status history is available for this patient"
. S DGX="",DGX=$$SETSTR^VALM1(MSG,DGX,5,70)
. D SET(DGX),SET("")
;
; Retrieve MST status history for patient
S MSTDT="",DGX=""
F S MSTDT=$O(^DGMS(29.11,"APDT",MSTDFN,MSTDT),-1) Q:'MSTDT D
. S MSTIEN="" F S MSTIEN=$O(^DGMS(29.11,"APDT",MSTDFN,MSTDT,MSTIEN),-1) Q:'MSTIEN D
.. S DGMST=$G(^DGMS(29.11,MSTIEN,0))
.. S DGX=$$SETFLD^VALM1($$FMTE^XLFDT($P(DGMST,U)),"","DATE")
.. S DGX=$$SETFLD^VALM1($P(DGMST,U,3),DGX,"STATUS")
.. S MST1=$$NAME^DGMSTAPI(+$P(DGMST,U,4))
.. S DGX=$$SETFLD^VALM1($S(MST1]"":MST1,1:""),DGX,"PROVIDER")
.. S MST1=$$NAME^DGMSTAPI(+$P(DGMST,U,5))
.. S DGX=$$SETFLD^VALM1($S(MST1]"":MST1,1:""),DGX,"USER")
.. S MST1=$$GET1^DIQ(4,(+$P(DGMST,U,6))_",",99)
.. S DGX=$$SETFLD^VALM1($S(MST1]"":MST1,1:""),DGX,"SITE")
.. D SET(DGX)
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
;S VALMBCK="R"
K ^TMP("DGMST DISP",$J)
Q
;
EXPND ; -- expand code
Q
;
SET(X) ;
S VALMCNT=VALMCNT+1,^TMP("DGMST DISP",$J,VALMCNT,0)=X
Q
DGMSTD ; ALB/SCK - MST Status Display LM Interface ; 17-DEC-1998
+1 ;;5.3;Registration;**195,379,1015**;Aug 13, 1993;Build 21
+2 QUIT
+3 ;
EN ; -- main entry point for DGMST STATUS DISPLAY
+1 DO EN^VALM("DGMST STATUS DISPLAY")
+2 QUIT
+3 ;
HDR ; -- header code
+1 NEW DFN,VA,VADM
+2 SET DFN=$GET(MSTDFN)
+3 DO DEM^VADPT
+4 SET VALMHDR(1)="MST Status Information for Patient: "_$$LOWER^VALM1(VADM(1))_" ("_$PIECE(VADM(2),U,2)_")"
+5 SET VALMHDR(2)=" "
+6 DO KVAR^VADPT
+7 QUIT
+8 ;
INIT ; -- init variables and list array
+1 KILL ^TMP("DGMST DISP",$JOB)
+2 NEW MSTIEN,MSTDT,DGX,VALMCNT,MST1,MSG,DGMST
+3 SET VALMCNT=0
+4 ;
+5 ; Display message if no MST status history exists for patient
+6 IF '$DATA(^DGMS(29.11,"C",MSTDFN))
Begin DoDot:1
+7 DO SET("")
+8 SET MSG="No MST status history is available for this patient"
+9 SET DGX=""
SET DGX=$$SETSTR^VALM1(MSG,DGX,5,70)
+10 DO SET(DGX)
DO SET("")
End DoDot:1
QUIT
+11 ;
+12 ; Retrieve MST status history for patient
+13 SET MSTDT=""
SET DGX=""
+14 FOR
SET MSTDT=$ORDER(^DGMS(29.11,"APDT",MSTDFN,MSTDT),-1)
IF 'MSTDT
QUIT
Begin DoDot:1
+15 SET MSTIEN=""
FOR
SET MSTIEN=$ORDER(^DGMS(29.11,"APDT",MSTDFN,MSTDT,MSTIEN),-1)
IF 'MSTIEN
QUIT
Begin DoDot:2
+16 SET DGMST=$GET(^DGMS(29.11,MSTIEN,0))
+17 SET DGX=$$SETFLD^VALM1($$FMTE^XLFDT($PIECE(DGMST,U)),"","DATE")
+18 SET DGX=$$SETFLD^VALM1($PIECE(DGMST,U,3),DGX,"STATUS")
+19 SET MST1=$$NAME^DGMSTAPI(+$PIECE(DGMST,U,4))
+20 SET DGX=$$SETFLD^VALM1($SELECT(MST1]"":MST1,1:""),DGX,"PROVIDER")
+21 SET MST1=$$NAME^DGMSTAPI(+$PIECE(DGMST,U,5))
+22 SET DGX=$$SETFLD^VALM1($SELECT(MST1]"":MST1,1:""),DGX,"USER")
+23 SET MST1=$$GET1^DIQ(4,(+$PIECE(DGMST,U,6))_",",99)
+24 SET DGX=$$SETFLD^VALM1($SELECT(MST1]"":MST1,1:""),DGX,"SITE")
+25 DO SET(DGX)
End DoDot:2
End DoDot:1
+26 QUIT
+27 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 ;S VALMBCK="R"
+2 KILL ^TMP("DGMST DISP",$JOB)
+3 QUIT
+4 ;
EXPND ; -- expand code
+1 QUIT
+2 ;
SET(X) ;
+1 SET VALMCNT=VALMCNT+1
SET ^TMP("DGMST DISP",$JOB,VALMCNT,0)=X
+2 QUIT