# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/MetadataResource
Release: R5
Version: 5.0.0
Build ID: 2aecd53
Last updated: 2023-03-26T15:21:02.749+11:00
"""
import typing

from pydantic import Field

from . import domainresource, fhirtypes


class MetadataResource(domainresource.DomainResource):
    """Disclaimer: Any field name ends with ``__ext`` doesn't part of
    Resource StructureDefinition, instead used to enable Extensibility feature
    for FHIR Primitive Data Types.

    Common Interface declaration for definitional resources.
    Common Interface declaration for conformance and knowledge artifact
    resources.
    """

    __resource_type__ = "MetadataResource"

    approvalDate: fhirtypes.DateType = Field(  # type: ignore
        None,
        alias="approvalDate",
        title="When the {{title}} was approved by publisher",
        description=(
            "The date on which the resource content was approved by the publisher. "
            "Approval happens once when the content is officially approved for "
            "usage."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )
    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType = Field(  # type: ignore
        None, alias="_approvalDate", title="Extension field for ``approvalDate``."
    )

    author: typing.List[fhirtypes.ContactDetailType] = Field(  # type: ignore
        None,
        alias="author",
        title="Who authored the {{title}}",
        description=(
            "An individiual or organization primarily involved in the creation and "
            "maintenance of the {{title}}."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    editor: typing.List[fhirtypes.ContactDetailType] = Field(  # type: ignore
        None,
        alias="editor",
        title="Who edited the {{title}}",
        description=(
            "An individual or organization primarily responsible for internal "
            "coherence of the {{title}}."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    effectivePeriod: fhirtypes.PeriodType = Field(  # type: ignore
        None,
        alias="effectivePeriod",
        title="When the {{title}} is expected to be used",
        description=(
            "The period during which the {{title}} content was or is planned to be "
            "in active use."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    endorser: typing.List[fhirtypes.ContactDetailType] = Field(  # type: ignore
        None,
        alias="endorser",
        title="Who endorsed the {{title}}",
        description=(
            "An individual or organization asserted by the publisher to be "
            "responsible for officially endorsing the {{title}} for use in some "
            "setting."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    lastReviewDate: fhirtypes.DateType = Field(  # type: ignore
        None,
        alias="lastReviewDate",
        title="When the {{title}} was last reviewed by the publisher",
        description=(
            "The date on which the resource content was last reviewed. Review "
            "happens periodically after approval but does not change the original "
            "approval date."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )
    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType = Field(  # type: ignore
        None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``."
    )

    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] = Field(  # type: ignore
        None,
        alias="relatedArtifact",
        title="Additional documentation, citations, etc",
        description=(
            "Related artifacts such as additional documentation, justification, "
            "dependencies, bibliographic references, and predecessor and successor "
            "artifacts."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    reviewer: typing.List[fhirtypes.ContactDetailType] = Field(  # type: ignore
        None,
        alias="reviewer",
        title="Who reviewed the {{title}}",
        description=(
            "An individual or organization asserted by the publisher to be "
            "primarily responsible for review of some aspect of the {{title}}."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    topic: typing.List[fhirtypes.CodeableConceptType] = Field(  # type: ignore
        None,
        alias="topic",
        title="E.g. Education, Treatment, Assessment, etc",
        description=(
            "Descriptive topics related to the content of the {{title}}. Topics "
            "provide a high-level categorization as well as keywords for the "
            "{{title}} that can be useful for filtering and searching."
        ),
        json_schema_extra={
            "element_property": True,
        },
    )

    @classmethod
    def elements_sequence(cls):
        """returning all elements names from
        ``MetadataResource`` according specification,
        with preserving original sequence order.
        """
        return [
            "id",
            "meta",
            "implicitRules",
            "language",
            "text",
            "contained",
            "extension",
            "modifierExtension",
            "approvalDate",
            "lastReviewDate",
            "effectivePeriod",
            "topic",
            "author",
            "editor",
            "reviewer",
            "endorser",
            "relatedArtifact",
        ]
