Skip to content

Commit 5b96482

Browse files
committed
Made changes to markdown
1 parent a8b2d93 commit 5b96482

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed
Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,71 @@
1-
# Utility Guide: FitKitGeneration
1+
# Utility Guide: fit_kit_generation
22

3-
The FitKitGeneration Utility provides methods to generate and manage FIT test kits for screening purposes.
3+
The FitKitGeneration Utility provides methods to generate and manage FIT test kits for testing purposes.
44

55
## Table of Contents
66

7-
- [Utility Guide: FitKitGeneration](#utility-guide-fitkitgeneration)
7+
- [Utility Guide: fit\_kit\_generation](#utility-guide-fit_kit_generation)
88
- [Table of Contents](#table-of-contents)
99
- [Using the FitKitGeneration Utility](#using-the-fitkitgeneration-utility)
1010
- [Required Arguments](#required-arguments)
11-
- [Example Usage](#example-usage)
1211
- [FitKitGeneration Specific Functions](#fitkitgeneration-specific-functions)
12+
- [Example Usage](#example-usage)
13+
- [Call the example usage function](#call-the-example-usage-function)
1314

1415
## Using the FitKitGeneration Utility
1516

16-
To use the fit_kit_generation Utility, import the `fit_kit_generation` module into your test file and call it's methods from within your tests, as required
17+
To use the fit_kit_generation Utility, import the `fit_kit_generation` module, from the `utils` directory, into your test file and call it's methods from within your tests, as required.
1718

1819
## Required Arguments
1920

2021
The methods in this utility require specific arguments. Refer to the docstrings in the `fit_kit_generation.py` file for details on required and optional arguments.
2122

22-
## Example Usage
23-
24-
from utils.fit_kit_generation import FitKitGenerator
25-
26-
def test_generate_fit_kit() -> None:
27-
fit_kit = FitKitGenerator().generate_kit(batch_id=12345, kit_type="Standard")
28-
assert fit_kit is not None
29-
3023
## FitKitGeneration Specific Functions
3124

3225
The FitKitGeneration Utility includes methods for generating, validating, and managing FIT test kits. These methods are designed to streamline the process of creating test kits for various scenarios. Below are some key functions:
3326

34-
1. **`generate_kit(batch_id: int, kit_type: str) -> dict`**
35-
Generates a FIT test kit with the specified batch ID and kit type.
27+
1. **`generate_kit(batch_id: int, kit_type: str) -> dict`**
28+
Generates a FIT test kit with the specified batch ID and kit type.
3629
- **Arguments**:
3730
- `batch_id` (int): The ID of the batch to which the kit belongs.
3831
- `kit_type` (str): The type of kit to generate (e.g., "Standard", "Advanced").
3932
- **Returns**: A dictionary containing the details of the generated kit.
4033

41-
2. **`validate_kit(kit_id: int) -> bool`**
42-
Validates a FIT test kit by its ID.
34+
2. **`validate_kit(kit_id: int) -> bool`**
35+
Validates a FIT test kit by its ID.
4336
- **Arguments**:
4437
- `kit_id` (int): The ID of the kit to validate.
4538
- **Returns**: `True` if the kit is valid, `False` otherwise.
4639

47-
3. **`manage_kits(action: str, kit_ids: list[int]) -> None`**
48-
Performs bulk actions on a list of FIT test kits.
40+
3. **`manage_kits(action: str, kit_ids: list[int]) -> None`**
41+
Performs bulk actions on a list of FIT test kits.
4942
- **Arguments**:
5043
- `action` (str): The action to perform (e.g., "activate", "deactivate").
5144
- `kit_ids` (list[int]): A list of kit IDs to apply the action to.
5245

5346
## Example Usage
5447

55-
from utils.fit_kit_generation import FitKitGenerator
48+
from utils.fit_kit_generation import create_fit_id_df, calculate_check_digit, convert_kit_id_to_fit_device_id
49+
50+
def example_usage() -> None:
51+
# Example inputs
52+
tk_type_id = 1
53+
hub_id = 101
54+
no_of_kits_to_retrieve = 2
55+
56+
# Step 1: Retrieve and process FIT kit data
57+
fit_kit_df = create_fit_id_df(tk_type_id, hub_id, no_of_kits_to_retrieve)
58+
print("Processed FIT Kit DataFrame:")
59+
print(fit_kit_df)
5660

57-
def test_fit_kit_functions() -> None:
58-
# Generate a new FIT kit
59-
fit_kit = FitKitGenerator().generate_kit(batch_id=12345, kit_type="Standard")
60-
assert fit_kit["kit_type"] == "Standard"
61+
# Step 2: Calculate a check digit for a single kit ID
62+
kit_id = "ABC123"
63+
kit_with_check_digit = calculate_check_digit(kit_id)
64+
print(f"Kit ID with Check Digit: {kit_with_check_digit}")
6165

62-
# Validate the generated kit
63-
is_valid = FitKitGenerator().validate_kit(kit_id=fit_kit["kit_id"])
64-
assert is_valid
66+
# Step 3: Convert a kit ID to a FIT Device ID
67+
fit_device_id = convert_kit_id_to_fit_device_id(kit_with_check_digit)
68+
print(f"FIT Device ID: {fit_device_id}")
6569

66-
# Manage multiple kits
67-
FitKitGenerator().manage_kits(action="activate", kit_ids=[fit_kit["kit_id"]])
68-
70+
# Call the example usage function
71+
example_usage()

0 commit comments

Comments
 (0)