Module phc.easy.summary.clinical_counts
Expand source code
import inspect
from typing import List, Optional, Union
from phc.easy.abstract.paging_api_item import PagingApiItem
from phc.easy.auth import Auth
from phc.easy.summary.counts import SummaryCounts
from phc.easy.summary.options.clinical_counts import (
SummaryClinicalCountsOptions,
SummarySearchMatchOption,
)
class SummaryClinicalCounts(PagingApiItem):
@staticmethod
def resource_path():
return "analytics/summary/{project_id}/clinical/codified/counts"
@staticmethod
def execute_args() -> dict:
return SummaryCounts.execute_args()
@staticmethod
def params_class():
return SummaryClinicalCountsOptions
@classmethod
def get_data_frame(
cls,
all_results: bool = True,
auth_args: Auth = Auth.shared(),
max_pages: Optional[int] = None,
page_size: Optional[int] = None,
log: bool = False,
match: Optional[SummarySearchMatchOption] = None,
code: Optional[Union[str, List[str]]] = None,
display: Optional[Union[str, List[str]]] = None,
system: Optional[Union[str, List[str]]] = None,
**kw_args,
):
"""Execute a request for summary counts across clinical data
>>> from phc.easy.summary.clinical_counts import SummaryClinicalCountsOptions
>>> SummaryClinicalCountsOptions.get_data_frame(match="fuzzy", display="sleep")
## Parameters
Execution: `phc.easy.query.Query.execute_paging_api`
"""
df = super().get_data_frame(
**kw_args, **cls._get_current_args(inspect.currentframe(), locals())
)
return df
Classes
class SummaryClinicalCounts
-
Expand source code
class SummaryClinicalCounts(PagingApiItem): @staticmethod def resource_path(): return "analytics/summary/{project_id}/clinical/codified/counts" @staticmethod def execute_args() -> dict: return SummaryCounts.execute_args() @staticmethod def params_class(): return SummaryClinicalCountsOptions @classmethod def get_data_frame( cls, all_results: bool = True, auth_args: Auth = Auth.shared(), max_pages: Optional[int] = None, page_size: Optional[int] = None, log: bool = False, match: Optional[SummarySearchMatchOption] = None, code: Optional[Union[str, List[str]]] = None, display: Optional[Union[str, List[str]]] = None, system: Optional[Union[str, List[str]]] = None, **kw_args, ): """Execute a request for summary counts across clinical data >>> from phc.easy.summary.clinical_counts import SummaryClinicalCountsOptions >>> SummaryClinicalCountsOptions.get_data_frame(match="fuzzy", display="sleep") ## Parameters Execution: `phc.easy.query.Query.execute_paging_api` """ df = super().get_data_frame( **kw_args, **cls._get_current_args(inspect.currentframe(), locals()) ) return df
Ancestors
Static methods
def execute_args() ‑> dict
-
Expand source code
@staticmethod def execute_args() -> dict: return SummaryCounts.execute_args()
def get_data_frame(all_results: bool = True, auth_args: Auth = <phc.easy.auth.Auth object>, max_pages: Optional[int] = None, page_size: Optional[int] = None, log: bool = False, match: Optional[SummarySearchMatchOption] = None, code: Union[str, List[str], ForwardRef(None)] = None, display: Union[str, List[str], ForwardRef(None)] = None, system: Union[str, List[str], ForwardRef(None)] = None, **kw_args)
-
Execute a request for summary counts across clinical data
>>> from phc.easy.summary.clinical_counts import SummaryClinicalCountsOptions >>> SummaryClinicalCountsOptions.get_data_frame(match="fuzzy", display="sleep")
Parameters
Execution:
Query.execute_paging_api()
Expand source code
@classmethod def get_data_frame( cls, all_results: bool = True, auth_args: Auth = Auth.shared(), max_pages: Optional[int] = None, page_size: Optional[int] = None, log: bool = False, match: Optional[SummarySearchMatchOption] = None, code: Optional[Union[str, List[str]]] = None, display: Optional[Union[str, List[str]]] = None, system: Optional[Union[str, List[str]]] = None, **kw_args, ): """Execute a request for summary counts across clinical data >>> from phc.easy.summary.clinical_counts import SummaryClinicalCountsOptions >>> SummaryClinicalCountsOptions.get_data_frame(match="fuzzy", display="sleep") ## Parameters Execution: `phc.easy.query.Query.execute_paging_api` """ df = super().get_data_frame( **kw_args, **cls._get_current_args(inspect.currentframe(), locals()) ) return df
def params_class()
-
Inherited from:
PagingApiItem
.params_class
Returns a pydantic type that validates and transforms the params with dict()
Expand source code
@staticmethod def params_class(): return SummaryClinicalCountsOptions
def process_params(params: dict) ‑> dict
-
Inherited from:
PagingApiItem
.process_params
Validates and transforms the API query parameters
def resource_path()
-
Inherited from:
PagingApiItem
.resource_path
Returns the API url name for retrieval
Expand source code
@staticmethod def resource_path(): return "analytics/summary/{project_id}/clinical/codified/counts"
def transform_results(data_frame: pandas.core.frame.DataFrame, **expand_args)
-
Inherited from:
PagingApiItem
.transform_results
Transform data frame batch