FHIR Chat · Timing Validation error on periodUnit · implementers

Stream: implementers

Topic: Timing Validation error on periodUnit


view this post on Zulip Alessio Graziani (Mar 18 2020 at 11:18):

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 is quite clear to understand, but I do not understand how to provide also the system ("http://unitsofmeasure.org") to periodUnit, because the Timing java class only allows using only Timing.UnitsOfTime in method setPeriodUnit().

The version I'm using is R4 version 4.1.0

Thanks
Alessio Graziani

view this post on Zulip Michele Mottini (Mar 18 2020 at 13:31):

I'd say the validation has it wrong - periodUnit is a code, so does not have (nor need) a system, and d is a valid code

view this post on Zulip Lloyd McKenzie (Mar 18 2020 at 14:03):

@Grahame Grieve

view this post on Zulip Grahame Grieve (Mar 19 2020 at 01:12):

looks like a HAPI issue around hosting the validator to me .

view this post on Zulip Alessio Graziani (Mar 19 2020 at 15:33):

What else should I do to get help for this potential issue? I also added an item on the Google HAPI groups...

view this post on Zulip Grahame Grieve (Mar 29 2020 at 10:59):

HAPI is doing a lot of work to address issues like this in release5 of HAPI - so try in the R5 candidate


Last updated: Apr 12 2022 at 19:14 UTC