Skip to content

Conversation

@chinmaymudholkar1
Copy link
Collaborator

Added test for syncing vaccinations from Imms to Mavis.

df[col] = df[col].map(replace_substrings)
return df

def replace_placeholders_in_text(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is not used. If we want to keep it, I think it'd make more sense in file_utils.py instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed



@pytest.fixture(scope="session")
def sidekiq_helper():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture isn't used and doesn't need to exist

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to the test file

)
response.raise_for_status()

success = response.status_code in [200, 201]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to check for success after response.raise_for_status(). This method should also not return anything, as the output is never used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably here earlier. Removed now.

# Apply replacements using FileGenerator pattern
payload_content = template_content
for placeholder, value in replacements.items():
payload_content = payload_content.replace(placeholder, value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use the replace_placeholders_in_text method (currently in file_generator.py, but probably should be in file_utils.py)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work on test data files

response.raise_for_status()
return response.json() if response.content else {}

def get_job_status(self, job_name: str) -> dict[str, Any]:
Copy link
Collaborator

@jf-x-dev jf-x-dev Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of get_job_status, list_recurring_jobs or get_sidekiq_stats are used. These may be useful but I don't think it's worth keeping them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

def target_disease_code(self) -> str:
"""Get the SNOMED code for the target disease of this vaccine."""
target_disease_mapping = {
# Flu vaccines target influenza
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of comments. I assume they're coming from an AI? I don't mind them but some are quite unnecessary. I would remove these for example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed comments

"<<VACCINATION_TIME>>": vaccination_time.strftime(
"%Y-%m-%dT%H:%M:%S+00:00"
),
"<<RECORDED_TIME>>": datetime.now(tz=UTC).strftime(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could consider using the get_current_datetime utility method in mavis.test.utils

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

"initial_failed": initial_failed,
},
"message": f"Recurring job '{job_name}' completed",
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the purpose of returning this dict is. If we want to keep it, we could remove some unnecessary fields ( e.g. "status": "completed" is not useful, we know the job completed already as no exception was thrown by the method)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

schedule_session_and_get_consent_url,
set_feature_flags,
setup_session_and_batches_with_fixed_child,
sidekiq_helper,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, think we just need to remove the sidekiq_helper mentions from this file

@chinmaymudholkar1 chinmaymudholkar1 merged commit 8555fba into main Dec 15, 2025
6 checks passed
@chinmaymudholkar1 chinmaymudholkar1 deleted the MAV-2831 branch December 15, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants