C# Class gov.va.medora.mdo.dao.vista.VistaDateTimeIterator

Iterator that also produces the correct mask (DdrLister.Part) for DDR LISTER queries
The key part is only providing the string of just the right length to match. Note that if your iterator is of a lesser precision than the precision of the dates then you will get some bleed at the edges of the iteration. For example, say you want to iterate by day between 12am on the start day and 3pm of the end day. The iterator will go through the whole day and the DdrLister.Part will only match on the whole day. Therefore you will get the whole end day -- the calling function will have to be responsible for cleaning up the loose ends. An iterator of lesser precision will give greater performance (fewer iterations, appends, and queries to VistA) but it will have poorer accuracy. The application should be designed with this in mind.
Mostrar archivo Open project: OSEHRA/mdo Class Usage Examples

Public Properties

Property Type Description
DAY_ITERATION System.TimeSpan
HOUR_ITERATION System.TimeSpan
MINIMUM_ITERATION System.TimeSpan
MINUTE_ITERATION System.TimeSpan
SECOND_ITERATION System.TimeSpan

Private Properties

Property Type Description
AdvanceIterStartDate void
IsDone bool
IterationDays int
IterationHours int
IterationMinutes int
IterationSeconds int
IterationTimeSpanFromString System.TimeSpan
SetIterEndDate void
SetIteratorLengthFromDateStrings void
SetPrecision void

Public Methods

Method Description
GetDdrListerPart ( ) : string
IsMinimumIteration ( ) : bool

Checks to see if the iteration start and end dates are equal or smaller to the shortest possible time span that this instance of the DateIterator will process.

VistaDateTimeIterator ( System.DateTime startDate, System.DateTime endDate, System.TimeSpan iterationLength ) : System
VistaDateTimeIterator ( string startString, string endString ) : System
VistaDateTimeIterator ( string startString, string endString, System.TimeSpan iterationLength ) : System
VistaDateTimeIterator ( string startString, string endString, int timespanDays ) : System
VistaDateTimeIterator ( string startString, string endString, string iterationLength ) : System

This is better called by converting the iteration length into a TimeSpan first using the static IterationTimeSpanFromString() first.

Private Methods

Method Description
AdvanceIterStartDate ( ) : void
IsDone ( ) : bool
IterationDays ( string iterationLength ) : int

find the separator and get the value to the left of it.

IterationHours ( string iterationLength ) : int
IterationMinutes ( string iterationLength ) : int
IterationSeconds ( string iterationLength ) : int
IterationTimeSpanFromString ( string iterationLength ) : System.TimeSpan

Makes the iteration timespan from a string.

SetIterEndDate ( ) : void

either the endDate, or the iteration start date + iteration length

SetIteratorLengthFromDateStrings ( string startDate, string endDate ) : void

Looks at both the start and end dates to get the precision.

need to look at string length - 0 won't do the trick. Just need to hope that the date strings aren't normalized at some point.

SetPrecision ( ) : void

Set the precision of the DdrPart based on the precision of the iteration length.

Method Details

GetDdrListerPart() public method

public GetDdrListerPart ( ) : string
return string

IsMinimumIteration() public method

Checks to see if the iteration start and end dates are equal or smaller to the shortest possible time span that this instance of the DateIterator will process.
public IsMinimumIteration ( ) : bool
return bool

VistaDateTimeIterator() public method

public VistaDateTimeIterator ( System.DateTime startDate, System.DateTime endDate, System.TimeSpan iterationLength ) : System
startDate System.DateTime
endDate System.DateTime
iterationLength System.TimeSpan
return System

VistaDateTimeIterator() public method

public VistaDateTimeIterator ( string startString, string endString ) : System
startString string
endString string
return System

VistaDateTimeIterator() public method

public VistaDateTimeIterator ( string startString, string endString, System.TimeSpan iterationLength ) : System
startString string
endString string
iterationLength System.TimeSpan
return System

VistaDateTimeIterator() public method

public VistaDateTimeIterator ( string startString, string endString, int timespanDays ) : System
startString string
endString string
timespanDays int
return System

VistaDateTimeIterator() public method

This is better called by converting the iteration length into a TimeSpan first using the static IterationTimeSpanFromString() first.
public VistaDateTimeIterator ( string startString, string endString, string iterationLength ) : System
startString string
endString string
iterationLength string
return System

Property Details

DAY_ITERATION public_oe static_oe property

public static TimeSpan,System DAY_ITERATION
return System.TimeSpan

HOUR_ITERATION public_oe static_oe property

public static TimeSpan,System HOUR_ITERATION
return System.TimeSpan

MINIMUM_ITERATION public_oe property

public TimeSpan,System MINIMUM_ITERATION
return System.TimeSpan

MINUTE_ITERATION public_oe static_oe property

public static TimeSpan,System MINUTE_ITERATION
return System.TimeSpan

SECOND_ITERATION public_oe static_oe property

public static TimeSpan,System SECOND_ITERATION
return System.TimeSpan