# Path: dhis2_core/src/dhis2/code_list/models/icd11.py
# class LinearizationEntity(BaseModel):
#     id: str = Field(alias="@id")
#     context: str = Field(alias="@context")
#     title: Optional[LanguageSpecificText]
#     definition: Optional[LanguageSpecificText]
#     longDefinition: Optional[LanguageSpecificText]
#     fullySpecifiedName: Optional[LanguageSpecificText]
#     source: Optional[str]
#     code: Optional[str]
#     codingNote: Optional[LanguageSpecificText]
#     blockId: Optional[str]
#     codeRange: Optional[str]
# 
#     # chapter : if the entity is a chapter. (i.e. at the top level of the classification
#     # block : higher level entity which don't have codes
#     # category : An ICD entity that bears a code
# 
#     classKind: Optional[Literal["block", "category", "chapter", "window"]]
#     child: Union[List[str], List["LinearizationEntity"]] = []
#     parent: Union[List[str], List["LinearizationEntity"]] = []
#     browserUrl: Optional[str]


import logging
from typing import List
from dhis2.core.http import BaseHttpRequest
from dhis2.core.inventory import HostResolved
from .models.icd11 import LinearizationEntity
            id = parts[8]
        elif 10 == len(parts):
            id = f"{parts[8]}/{parts[9]}"

        if id:
            ch = _icd11_fetch(host, linearizationname, release_id, language, id)

            if "category" == ch.classKind:
                children.append(ch)

            if ch.child:
                children.extend(
                    _icd11_resolve_children(
                        ch.child,
                        host,
                        linearizationname,
                        release_id,
                        language,
                    )
                )

    return children


def _icd11_fetch_all(
    host: HostResolved,
    linearizationname: str,
    release_id: str,
    language: str,
    root_id: str,

# Path: dhis2_core/src/dhis2/code_list/models/icd11.py
# class LinearizationEntity(BaseModel):
#     id: str = Field(alias="@id")
#     context: str = Field(alias="@context")
#     title: Optional[LanguageSpecificText]
#     definition: Optional[LanguageSpecificText]
#     longDefinition: Optional[LanguageSpecificText]
#     fullySpecifiedName: Optional[LanguageSpecificText]
#     source: Optional[str]
#     code: Optional[str]
#     codingNote: Optional[LanguageSpecificText]
#     blockId: Optional[str]
#     codeRange: Optional[str]
# 
#     # chapter : if the entity is a chapter. (i.e. at the top level of the classification
#     # block : higher level entity which don't have codes
#     # category : An ICD entity that bears a code
# 
#     classKind: Optional[Literal["block", "category", "chapter", "window"]]
#     child: Union[List[str], List["LinearizationEntity"]] = []
#     parent: Union[List[str], List["LinearizationEntity"]] = []
#     browserUrl: Optional[str]


# Path: dhis2_core/src/dhis2/code_list/icd11.py
import logging
from typing import List
from dhis2.core.http import BaseHttpRequest
from dhis2.core.inventory import HostResolved
from .models.icd11 import LinearizationEntity

            id = parts[8]
        elif 10 == len(parts):
            id = f"{parts[8]}/{parts[9]}"

        if id:
            ch = _icd11_fetch(host, linearizationname, release_id, language, id)

            if "category" == ch.classKind:
                children.append(ch)

            if ch.child:
                children.extend(
                    _icd11_resolve_children(
                        ch.child,
                        host,
                        linearizationname,
                        release_id,
                        language,
                    )
                )

    return children


def _icd11_fetch_all(
    host: HostResolved,
    linearizationname: str,
    release_id: str,
    language: str,
    root_id: str,

) -> LinearizationEntity: