Skip to content

Medical

module_medical(config)

Extracts specific medical parameters from a data source using a Redis-based RAG pipeline.

Parameters:

Name Type Description Default
config AppConfig

Configuration object containing user, task, and analysis information.

required

Returns:

Name Type Description
str str

The Redis key associated with the result of the RAG pipeline execution.

Source code in modules/medical.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def module_medical(config: AppConfig) -> str:
    """
    Extracts specific medical parameters from a data source using a Redis-based RAG pipeline.

    Args:
        config (AppConfig): Configuration object containing user, task, and analysis information.

    Returns:
        str: The Redis key associated with the result of the RAG pipeline execution.
    """

    query = """Extract the parĂ¢meters: Creatinine, Hemoglobin, White Blood Cell Count (WBC),Red Blood Cell Count (RBC)
	Platelet Count, Hematocrit, Glucose, Cholesterol (Total), LDL Cholesterol, HDL Cholesterol, Triglycerides, 
    Urea, Blood Urea Nitrogen (BUN), Liver Function Tests (ALT, AST), Bilirubin (Total and Direct), Albumin, 
    Calcium (Serum), Sodium (Serum), Potassium (Serum), Thyroid Stimulating Hormone (TSH)"""

    rag_redis_key = ct_rag.base_rag_redis_pipeline_controller(
        prompt=ct_prompts.PROMPT_MEDICAL,
        query=query,
        config=config,
        redis_client=REDIS_CLIENT,
        k=6,
        redis_url=REDIS_URL,
        chunk_size=4000,
        service=config.service
        )

    return rag_redis_key