@root_validator(pre=True, allow_reuse=True)
def validate_one_of_many_1131(cls, values: typing.Dict[(str, typing.Any)]) -> typing.Dict[(str, typing.Any)]:
    'https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The "nnn" part of the name is constant, and the "[x]" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        '
    one_of_many_fields = {'value': ['valueAddress', 'valueAge', 'valueAnnotation', 'valueAttachment', 'valueBase64Binary', 'valueBoolean', 'valueCanonical', 'valueCode', 'valueCodeableConcept', 'valueCoding', 'valueContactDetail', 'valueContactPoint', 'valueContributor', 'valueCount', 'valueDataRequirement', 'valueDate', 'valueDateTime', 'valueDecimal', 'valueDistance', 'valueDosage', 'valueDuration', 'valueExpression', 'valueHumanName', 'valueId', 'valueIdentifier', 'valueInstant', 'valueInteger', 'valueMarkdown', 'valueMeta', 'valueMoney', 'valueOid', 'valueParameterDefinition', 'valuePeriod', 'valuePositiveInt', 'valueQuantity', 'valueRange', 'valueRatio', 'valueReference', 'valueRelatedArtifact', 'valueSampledData', 'valueSignature', 'valueString', 'valueTime', 'valueTiming', 'valueTriggerDefinition', 'valueUnsignedInt', 'valueUri', 'valueUrl', 'valueUsageContext', 'valueUuid']}
    for (prefix, fields) in one_of_many_fields.items():
        assert (cls.__fields__[fields[0]].field_info.extra['one_of_many'] == prefix)
        required = (cls.__fields__[fields[0]].field_info.extra['one_of_many_required'] is True)
        found = False
        for field in fields:
            if ((field in values) and (values[field] is not None)):
                if (found is True):
                    raise ValueError(f'Any of one field value is expected from this list {fields}, but got multiple!')
                else:
                    found = True
        if ((required is True) and (found is False)):
            raise ValueError(f'Expect any of field value from this list {fields}.')
    return values
https://www.hl7.org/fhir/formats.html#choice
A few elements have a choice of more than one data type for their content.
All such elements have a name that takes the form nnn[x].
The "nnn" part of the name is constant, and the "[x]" is replaced with
the title-cased name of the type that is actually used.
The table view shows each of these names explicitly.

Elements that have a choice of data type cannot repeat - they must have a
maximum cardinality of 1. When constructing an instance of an element with a
choice of types, the authoring system must create a single element with a
data type chosen from among the list of permitted data types.
@root_validator(pre=True, allow_reuse=True)
def validate_one_of_many_1131(cls, values: typing.Dict[(str, typing.Any)]) -> typing.Dict[(str, typing.Any)]:
    'https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The "nnn" part of the name is constant, and the "[x]" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        '
    one_of_many_fields = {'value': ['valueAddress', 'valueAge', 'valueAnnotation', 'valueAttachment', 'valueBase64Binary', 'valueBoolean', 'valueCanonical', 'valueCode', 'valueCodeableConcept', 'valueCoding', 'valueContactDetail', 'valueContactPoint', 'valueContributor', 'valueCount', 'valueDataRequirement', 'valueDate', 'valueDateTime', 'valueDecimal', 'valueDistance', 'valueDosage', 'valueDuration', 'valueExpression', 'valueHumanName', 'valueId', 'valueIdentifier', 'valueInstant', 'valueInteger', 'valueMarkdown', 'valueMeta', 'valueMoney', 'valueOid', 'valueParameterDefinition', 'valuePeriod', 'valuePositiveInt', 'valueQuantity', 'valueRange', 'valueRatio', 'valueReference', 'valueRelatedArtifact', 'valueSampledData', 'valueSignature', 'valueString', 'valueTime', 'valueTiming', 'valueTriggerDefinition', 'valueUnsignedInt', 'valueUri', 'valueUrl', 'valueUsageContext', 'valueUuid']}
    for (prefix, fields) in one_of_many_fields.items():
        assert (cls.__fields__[fields[0]].field_info.extra['one_of_many'] == prefix)
        required = (cls.__fields__[fields[0]].field_info.extra['one_of_many_required'] is True)
        found = False
        for field in fields:
            if ((field in values) and (values[field] is not None)):
                if (found is True):
                    raise ValueError(f'Any of one field value is expected from this list {fields}, but got multiple!')
                else:
                    found = True
        if ((required is True) and (found is False)):
            raise ValueError(f'Expect any of field value from this list {fields}.')
    return values