# CalendarCodeLookup

## Program ID

MetraPipeline.CalendarCodeLookup.1

## Description

When given a date/time value, this plugin looks up the applicable calendar code.

This plugin is useful when weighted rating is not needed and when only one date/time property is needed in determining a calendar code (for example "ConnectTime").

Important: This plugin SHOULD NOT be used when the rate needs to be weighted, or if the intervals span several calendar codes. In these cases the WeightedRate plugin should be used instead.

## Required Input Properties

Tag name | Value type | Description
lookup_time_prop_name | DATETIME | The date value to be used in looking up the calendar code (this can be a transaction timestamp, the date and time of the end of a period, etc.)
offset_prop_name | LONG | No longer used, but required in the configuration.
timezoneid_prop_name | LONG | User’s timezone ID (see Remarks section for values)

## Required Output Properties

Tag name | Value type | Description
calendar_code_prop_name | STRING | The name of the pipeline property which will hold the value for the calendar code.

## Additional Configuration Tags

Tag name | Value type | Description
SetEnumCalendarCode | BOOLEAN | If true, the calendar code property (see the calendar_code_prop_name tag above) is set as ENUM, otherwise it is set to STRING.
calendar_code_enum_type | STRING | If SetEnumCalendarCode is set to true, this value indicates the enum type where the CalandarCode enumerated type definition is located.
calendar_code_enum_space | STRING | If SetEnumCalendarCode is set to true, this value indicates the enum space where the CalandarCode enumerated type is located.
calendar | STRING | Indicates the filename for the default calendar code data (if no calendar_id_prop_name values exist).
calendar_id_prop_name | STRING | This tag indicates the name of the property where calendar id is stored for the specific user. Based on this calendar id, a file name is retrieved.

## Configuration Example

<configdata>
<calendar_code_prop_name>CalendarCode</calendar_code_prop_name>
<SetEnumCalendarCode ptype="BOOL">TRUE</SetEnumCalendarCode>
<calendar_code_enum_space>metratech.com/calendar</calendar_code_enum_space>
<calendar_code_enum_type>CalendarCode</calendar_code_enum_type>
<lookup_time_prop_name>Time</lookup_time_prop_name>
<offset_prop_name>timezoneoffset</offset_prop_name>
<timezoneid_prop_name>timezoneID</timezoneid_prop_name>
<calendar>calendar.xml</calendar>
<calendar_id_prop_name>calendar_id</calendar_id_prop_name>
</configdata>

## Remarks

The Unix zoneinfo database is used to do all time of day calculations. The following timezone ID’s are supported.

ID | Microsoft Time Zone Name | Unix Zoneinfo Name
1 | Afghanistan Standard Time | Asia/Kabul
2 | Alaskan Standard Time | America/Anchorage
3 | Arabian Standard Time | Asia/Muscat
4 | Atlantic Standard Time | America/Halifax
5 | AUS Central Standard Time | Australia/Darwin
6 | Azores Standard Time | Atlantic/Azores
7 | Bangkok Standard Time | Asia/Bangkok
8 | Canada Central Standard Time | America/Regina
9 | Cen. Australia Standard Time | Australia/Adelaide
10 | Central Asia Standard Time | Asia/Almaty
11 | Central Europe Standard Time | Europe/Prague
12 | Central Pacific Standard Time | Asia/Magadan
13 | Central Standard Time | America/Chicago
14 | China Standard Time | Asia/Urumqi
15 | Dateline Standard Time | Pacific/Kwajalein
16 | E. Europe Standard Time | NOT SUPPORTED
17 | E. South America Standard Time | NOT SUPPORTED
18 | Eastern Standard Time | America/New_York
19 | Egypt Standard Time | Africa/Cairo
20 | Fiji Standard Time | Pacific/Fiji
21 | GFT Standard Time | Europe/Athens
22 | GMT | Europe/Dublin
23 | GMT Standard Time | Africa/Monrovia
24 | Hawaiian Standard Time | Pacific/Honolulu
25 | India Standard Time | Asia/Calcutta
26 | Iran Standard Time | Asia/Tehran
27 | Israel Standard Time | Asia/Jerusalem
28 | Mexico Standard Time | America/Mexico_City
29 | Mid-Atlantic Standard Time | NOT SUPPORTED
30 | Mountain Standard Time | America/Phoenix
31 | New Zealand Standard Time | Pacific/Auckland
32 | Newfoundland Standard Time | America/St_Johns
33 | Pacific Standard Time | America/Los_Angeles
34 | Romance Standard Time | Europe/Paris
35 | Russian Standard Time | Europe/Moscow
36 | SA Eastern Standard Time | America/Buenos_Aires
37 | SA Pacific Standard Time | America/Bogota
38 | SA Western Standard Time | America/Caracas
39 | Samoa Standard Time | Pacific/Midway
40 | Saudi Arabia Standard Time | Asia/Baghdad
41 | South Africa Standard Time | Africa/Harare
42 | Sydney Standard Time | Australia/Brisbane
43 | Taipei Standard Time | Asia/Hong_Kong
44 | Tasmania Standard Time | Australia/Hobart
45 | Tokyo Standard Time | Asia/Tokyo
46 | US Eastern Standard Time | America/Indianapolis
47 | US Mountain Standard Time | America/Phoenix
48 | W. Europe Standard Time | Europe/Berlin
49 | West Asia Standard Time | Asia/Karachi
50 | West Pacific Standard Time | Pacific/Guam