FHIR Chat · Validation error in Timing.periodUnit · hapi

Stream: hapi

Topic: Validation error in Timing.periodUnit


view this post on Zulip Alessio Graziani (Jul 07 2020 at 16:02):

Hi all,
I'm getting the following error while validating (with the HAPI FHIR validation framework) a MedicationStatement: The value provided ('d') is not in the value set http://hl7.org/fhir/ValueSet/units-of-time|4.0.0 (http://hl7.org/fhir/ValueSet/units-of-time, and a code is required from this value set) (error message = Unknown code[d] in system[(none)])

This is the code that I use for creating the instance of Timing:

Timing timing = new Timing();
        timing.setRepeat((new Timing.TimingRepeatComponent())
                .setFrequency(2)
                .setPeriod(1)
                .setPeriodUnit(Timing.UnitsOfTime.D)
                .addTimeOfDay("08:00:00")
                .addTimeOfDay("20:00:00"));

and this is the corresponding generated JSON:

            "timing": {
              "repeat": {
                "frequency": 2,
                "period": 1,
                "periodUnit": "d",
                "timeOfDay": [
                  "08:00:00",
                  "20:00:00"
                ]
              }
            }

The error message is quite clear to understand, but I do not know how to fix it.

The version I'm using is R4 version 4.1.0

Thanks
Alessio Graziani


Last updated: Apr 12 2022 at 19:14 UTC