@root_validator(pre=True, allow_reuse=True)
def validate_required_primitive_elements_594(cls, values: typing.Dict[(str, typing.Any)]) -> typing.Dict[(str, typing.Any)]:
    'https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        '
    required_fields = [('intent', 'intent__ext'), ('status', 'status__ext')]
    _missing = object()

    def _fallback():
        return ''
    errors: typing.List['ErrorWrapper'] = []
    for (name, ext) in required_fields:
        field = cls.__fields__[name]
        ext_field = cls.__fields__[ext]
        value = values.get(field.alias, _missing)
        if (value not in (_missing, None)):
            continue
        ext_value = values.get(ext_field.alias, _missing)
        missing_ext = True
        if (ext_value not in (_missing, None)):
            if isinstance(ext_value, dict):
                missing_ext = (len(ext_value.get('extension', [])) == 0)
            elif (getattr(ext_value.__class__, 'get_resource_type', _fallback)() == 'FHIRPrimitiveExtension'):
                if (ext_value.extension and (len(ext_value.extension) > 0)):
                    missing_ext = False
            else:
                validate_pass = True
                for validator in ext_field.type_.__get_validators__():
                    try:
                        ext_value = validator(v=ext_value)
                    except ValidationError as exc:
                        errors.append(ErrorWrapper(exc, loc=ext_field.alias))
                        validate_pass = False
                if (not validate_pass):
                    continue
                if (ext_value.extension and (len(ext_value.extension) > 0)):
                    missing_ext = False
        if missing_ext:
            if (value is _missing):
                errors.append(ErrorWrapper(MissingError(), loc=field.alias))
            else:
                errors.append(ErrorWrapper(NoneIsNotAllowedError(), loc=field.alias))
    if (len(errors) > 0):
        raise ValidationError(errors, cls)
    return values
https://www.hl7.org/fhir/extensibility.html#Special-Case
In some cases, implementers might find that they do not have appropriate data for
an element with minimum cardinality = 1. In this case, the element must be present,
but unless the resource or a profile on it has made the actual value of the primitive
data type mandatory, it is possible to provide an extension that explains why
the primitive value is not present.
@root_validator(pre=True, allow_reuse=True)
def validate_required_primitive_elements_594(cls, values: typing.Dict[(str, typing.Any)]) -> typing.Dict[(str, typing.Any)]:
    'https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        '
    required_fields = [('intent', 'intent__ext'), ('status', 'status__ext')]
    _missing = object()

    def _fallback():
        return 
    errors: typing.List['ErrorWrapper'] = []
    for (name, ext) in required_fields:
        field = cls.__fields__[name]
        ext_field = cls.__fields__[ext]
        value = values.get(field.alias, _missing)
        if (value not in (_missing, None)):
            continue
        ext_value = values.get(ext_field.alias, _missing)
        missing_ext = True
        if (ext_value not in (_missing, None)):
            if isinstance(ext_value, dict):
                missing_ext = (len(ext_value.get('extension', [])) == 0)
            elif (getattr(ext_value.__class__, 'get_resource_type', _fallback)() == 'FHIRPrimitiveExtension'):
                if (ext_value.extension and (len(ext_value.extension) > 0)):
                    missing_ext = False
            else:
                validate_pass = True
                for validator in ext_field.type_.__get_validators__():
                    try:
                        ext_value = validator(v=ext_value)
                    except ValidationError as exc:
                        errors.append(ErrorWrapper(exc, loc=ext_field.alias))
                        validate_pass = False
                if (not validate_pass):
                    continue
                if (ext_value.extension and (len(ext_value.extension) > 0)):
                    missing_ext = False
        if missing_ext:
            if (value is _missing):
                errors.append(ErrorWrapper(MissingError(), loc=field.alias))
            else:
                errors.append(ErrorWrapper(NoneIsNotAllowedError(), loc=field.alias))
    if (len(errors) > 0):
        raise ValidationError(errors, cls)
    return values