Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,22 @@ Clone the repository if you haven't done so already, then follow these steps to

To run the application locally, follow these steps:

> Note: Ensure you have activated your pipenv shell by running `pipenv shell`.

1. Ensure all dependencies are installed using Pipenv.
```bash
pipenv install
```
2. Start your Docker containers if the application requires any external services like databases.
3. Use the following command to run the application under the ``src``:
3. Use the following command to run the application under the ``src`` directory:
```shell
flask run
```
Adjust the command based on your application's entry point if different.
4. Alternatively, run the following command to start the application, at the root path of the project if there is any port conflict on your machine:
```shell
flask run --host=127.0.0.1 --port=5001
```

> **NOTE:** If your frontend is also running, ensure it is configured to communicate with this backend API. You may need to set the API URL in your frontend configuration.
> Also, you might need to use CORS (Cross-Origin Resource Sharing) if your frontend and backend are served from different origins. You can use the `flask-cors` package to handle this:
Expand Down
6 changes: 5 additions & 1 deletion src/cases/service/case_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def get_page_configuration(self):

def get_case_review(self, case_config_id): # pragma: no cover
"""
A function that implements the business logic for the /case-reviews/{id} API endpoint.
Steps:
1) Load saved DisplayConfig for this case_config_id + user_email.
2) Build full unpruned case_details tree.
3) Prune under “BACKGROUND” according to CSV path_config.
Expand All @@ -279,6 +281,9 @@ def get_case_review(self, case_config_id): # pragma: no cover
b) Then, any "Adjusted CRC Risk" row (renaming it)
c) If neither found, emit "N/A"
6) If CSV had no RISK ASSESSMENT entries at all, do not emit any CRC score node.
7) Return Case object with pruned case_details and important_infos.

This function relies on the Tree data structure, which is built by utils/csv_parser.py.
"""
# --- 1) Load configuration & verify access ---
configuration = self.configuration_repository.get_configuration_by_id(case_config_id)
Expand Down Expand Up @@ -406,7 +411,6 @@ def get_case_review(self, case_config_id): # pragma: no cover

# 6) If neither csv_crc_score_leaf nor old_crc_toggle, we do not append any CRC score node.

# --- 7) Return the assembled Case object ---
return Case(
self.person.person_source_value,
str(configuration.case_id),
Expand Down