Skip to content

Main content

FHIR Timing Repeat Period Unit Pair Tool

Convert fixed FHIR timing periods to seconds and calendar periods to months, leaving the unused representation zero rather than inventing fixed month/year lengths.

Loading tool…

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

  1. Enter period, unit. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
periodPeriodRequired. Finite number; strictly above 0.
unitSupplied 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 fieldInterpretationReturned shape
fixedDurationWhether the period has a fixed second conversion in this tool.Required. Boolean.
secondsFixed duration in seconds, or zero placeholder for calendar units.Required. Finite number.
calendarMonthsCalendar-month count for mo or a, or zero for fixed units.Required. Finite number.
json
{
  "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

  1. Calculation and input contract: health-informatics/fhir-timing-repeat-period-unit-pair — tool.io

  2. FHIR R4: Data Types — Health Level Seven International

Similar or alternative tools