ISCasesFilter.DatePeriod

Description

This filter property is used to load the collection of cases opened during the selected date period.

Syntax

object.DatePeriod

Part Attribute Type Description
object Required
The object always implements the ISCasesFilter interface

Return Value

TSDatePeriod

Example

Display the number of the cases loaded on the basis of the selected filter, their titles, statuses, the dates and time when they were opened.

sub main
  Dim aPatient 
  Dim aFilter
  Dim aCases, aCase
  Dim i
  Dim aMessage
  
  Set aPatient = Profile.SelectPatient
  set aFilter = Profile.CreateCasesFilter
  aFilter.Patient = aPatient
  aFilter.DatePeriod = 5  'dpInLast12Months
  set aCases = Profile.LoadCases(aFilter)

  aMessage = "The number of the cases for " & aPatient.SurnameFirstName &_ 
    " = " & aCases.Count 
  
  for i = 0 to aCases.Count -1
    set aCase = aCases.Item(i)
    aMessage = aMessage & vbNewLine & (i + 1) & ") " & aCase.CaseTitle &_ 
      " was opened on " & aCase.OpenedOn & " (Status: " &_ 
      GetStatusDescr(aCase.Status) & ")"    
  next      

  Profile.MsgBox(aMessage) 
end sub

function GetStatusDescr(aStatus)
  Dim aResult

  Select Case aStatus
    Case 0
      aResult = "Unknown"
    Case 1
      aResult = "Open"
    Case 2
      aResult = "In Progress"
    Case 3
      aResult = "On Hold"
    Case 4
      aResult = "Closed"           
  End Select
  
  GetStatusDescr = aResult
end function   
Note:

In Profile Client v8 on User Interface Date Opened can be found in Organisation > Work Centre > Work > Cases > Edit Case > Administrative > General > Date Opened field.

Version information

Added in v7.8.0