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

DGMSTL2.m

Go to the documentation of this file.
  1. DGMSTL2 ;ALB/SCK - MST LISTMANAGER UTILITIES CONT. ; 12/17/98
  1. ;;5.3;Registration;**195**;Aug 13, 1993
  1. Q
  1. ;
  1. ASKDATE(MSTDT,MSTOLDDT) ; Return status change date
  1. ; Future dates will not be allowed
  1. ;
  1. ; Input
  1. ; MSTDT - Date to be used as default [optional] Default is NOW
  1. ; MSTOLDDT - Date to be used as the minimum allowed entry date
  1. ; [optional] Default is null
  1. ; Both dates must be in FM date format is passed in.
  1. ;
  1. ; Output
  1. ; DGRSLT has the following values:
  1. ; 0 - if user up-arrows, times out, or enters null
  1. ; Y - date in FM date format
  1. ;
  1. N DGRSLT,Y
  1. ;
  1. K DIRUT
  1. S MSTDT=$G(MSTDT)
  1. S MSTOLDDT=$G(MSTOLDDT)
  1. S DIR(0)="DAO^"_$S(MSTOLDDT>0:MSTOLDDT,1:"")_":NOW:ERXP"
  1. S DIR("B")=$S(MSTDT>0:$$FMTE^XLFDT(MSTDT),1:"NOW")
  1. S DIR("A")="Enter date of status change: "
  1. D ^DIR K DIR
  1. I $D(DIRUT) S DGRSLT=0
  1. E S DGRSLT=Y
  1. ;
  1. Q $G(DGRSLT)
  1. ;
  1. ASKPROV(MSTPV) ; Ask for Provider
  1. ; Input
  1. ; MSTPV - IEN of default provider [optional]
  1. ;
  1. ; Returns
  1. ; DGRSLT
  1. ; 0 - if user up-arrows, times out, or enters null
  1. ; +Y - IEN of selected provider
  1. ;
  1. N DGRSLT
  1. ;
  1. K DIRUT
  1. S MSTPV=$G(MSTPV)
  1. S DIR(0)="29.11,4AO"
  1. S DIR("B")=$S(MSTPV>0:$$NAME^DGMSTAPI(MSTPV),1:"")
  1. S DIR("A")="Provider determining status: "
  1. D ^DIR K DIR
  1. I $D(DIRUT) S DGRSLT=0
  1. E S DGRSLT=+Y
  1. ;
  1. Q $G(DGRSLT)
  1. ;
  1. ADDSTR(DFN,MSTST,MSTDT,MSTPR,MSTIEN) ; Build the formatted display string for the List Manager display
  1. ; Input
  1. ; DFN - IEN of patient in the PATIENT File (#2)
  1. ; MSTST - Status code for the MST status
  1. ; MSTDT - Date of the status change in FM internal format
  1. ; MSTPR - IEN of provider in the NEW USER File (#200)
  1. ; MSTIEN- IEN of new entry in the MST HISTORY File (#29.11)
  1. ;
  1. ;; Check for empty list. If list is empty, clear message and reset LM variables.
  1. N DGX
  1. I $D(^TMP("DGMST",$J,"INIT"))>0 D
  1. . K ^TMP("DGMST",$J)
  1. . D CLEAN^VALM10
  1. . S (VALMCNT,MSTCNT)=0
  1. ;
  1. N VADM,VA
  1. D DEM^VADPT,PID^VADPT
  1. S MSTCNT=$G(MSTCNT)+1
  1. S DGX=$$SETFLD^VALM1(MSTCNT,"","MST#")
  1. S DGX=$$SETFLD^VALM1(VA("BID"),DGX,"SSN")
  1. S DGX=$$SETFLD^VALM1(VADM(1),DGX,"PATIENT")
  1. S DGX=$$SETFLD^VALM1(MSTST,DGX,"STATUS")
  1. S DGX=$$SETFLD^VALM1($$FMTE^XLFDT(MSTDT),DGX,"DATE")
  1. S DGX=$$SETFLD^VALM1($S(MSTPR>0:$$NAME^DGMSTAPI(MSTPR),1:""),DGX,"PROVIDER")
  1. D SET(DGX,MSTCNT,DFN,MSTIEN)
  1. S ^TMP("DGMST",$J,0)=MSTCNT
  1. D KVA^VADPT
  1. Q
  1. ;
  1. SET(X,IDX,DFN,MSTIEN) ; Set the formatted display string into the List Manager global
  1. ; Build the DFN and IDX indexes
  1. ; Input
  1. ; X - formated display string
  1. ; IDX - Index number
  1. ; DFN - IEN of patient in the PATIENT File (#2)
  1. ;
  1. S VALMCNT=$G(VALMCNT)+1,^TMP("DGMST",$J,VALMCNT,0)=X
  1. S ^TMP("DGMST",$J,"IDX",VALMCNT,IDX)=""
  1. S ^TMP("DGMST",$J,"DFN",VALMCNT,DFN)=""
  1. S ^TMP("DGMST",$J,"IEN",VALMCNT,MSTIEN)=""
  1. Q
  1. ;
  1. EXTMST(MSTST) ; convert MST status code to external dislay format
  1. Q $S(MSTST["Y":"Yes, Screened reports MST",MSTST["N":"No, Screened does not report MST",MSTST["D":"Screened Declines to answer",1:"Unknown, not screened")
  1. ;
  1. NUL ; Check for empty list. If empty display message and force page number
  1. I '$O(^TMP("DGMST",$J,0)) D SET^DGMSTL(" No Entries")
  1. Q
  1. ;
  1. CHKNUL() ; Checks of an "empty" list to lock out protocols.
  1. N DGRSLT
  1. S DGRSLT=0
  1. I VALMCNT>0,^TMP("DGMST",$J,1,0)["No Entries" D
  1. . S DIR(0)="FAO"
  1. . S DIR("A",1)="Action not allowed at this point."
  1. . S (DIR("A"),DIR("?"),DIR("??"))="Press any key to continue..."
  1. . D ^DIR K DIR
  1. . S DGRSLT=1
  1. Q $G(DGRSLT)