Description
Convert fixed units to seconds, or months/years to calendarMonths with seconds zero and fixedDuration false.
Clinical data distinguishes precise instants, partial dates, fixed durations, and calendar quantities. Missing precision or a calendar month cannot be silently replaced by an arbitrary timestamp or fixed duration.
Convert fixed units to seconds, or months/years to calendarMonths with seconds zero and fixedDuration false.
When to use this tool
Use FHIR Timing Repeat Period Unit Pair when you need one explicit clinical date, time, or duration representation component.
How to use the tool and how it works
- Enter period, unit. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read fixedDuration, seconds, calendarMonths. Inspect fixedDuration before interpreting the associated values.
Require positive period and unit s, min, h, d, wk, mo, or a. Convert fixed units to seconds, or months/years to calendarMonths with seconds zero and fixedDuration false.1
FHIR timing separates the period amount from its unit. This tool retains month and year periods as calendar months instead of assigning them a fixed second count.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| period | Period | Required. Finite number; strictly above 0. |
| unit | Supplied unit label; actual unit compatibility is not automatically established. | Required. Text; one of "s", "min", "h", "d", "wk", "mo", "a"; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| fixedDuration | Whether the period has a fixed second conversion in this tool. | Required. Boolean. |
| seconds | Fixed duration in seconds, or zero placeholder for calendar units. | Required. Finite number. |
| calendarMonths | Calendar-month count for mo or a, or zero for fixed units. | Required. Finite number. |
{
"input": {
"period": 2,
"unit": "wk"
},
"output": {
"fixedDuration": true,
"seconds": 1209600,
"calendarMonths": 0
}
} Limitations and assumptions
- Month and year values are calendar quantities rather than fixed-second durations; zero seconds is a placeholder for those units and no schedule, medication timing, or calendar anchor is evaluated.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Retain precision and offset metadata and validate the complete record against its standard and intended clinical context.
References
-
Calculation and input contract: health-informatics/fhir-timing-repeat-period-unit-pair — tool.io
-
FHIR R4: Data Types — Health Level Seven International
Similar or alternative tools
- FHIR Date Partial Precision Envelope
Parse YYYY, YYYY-MM, or real YYYY-MM-DD in years 0001-9999.
- DICOM Time Fraction Padding Token
Pad the fraction to six digits and return the original fractional digit count.