Skip to content
Open
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
13 changes: 3 additions & 10 deletions tests/e2e_automation/features/APITests/create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Feature: Create the immunization event for a patient
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The imms event table will be populated with the correct data for 'created' event
And The terms are mapped to the respective text fields in imms delta table
And MNS event will be triggered with correct data for created event

Expand All @@ -80,6 +81,7 @@ Feature: Create the immunization event for a patient
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The imms event table will be populated with the correct data for 'created' event
And The terms are mapped to first instance of coding.display fields in imms delta table
And MNS event will be triggered with correct data for created event

Expand All @@ -89,19 +91,10 @@ Feature: Create the immunization event for a patient
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The imms event table will be populated with the correct data for 'created' event
And The terms are mapped to correct instance of coding.display fields in imms delta table
And MNS event will not be triggered for the event

@Delete_cleanUp @vaccine_type_RSV @patient_id_Random @supplier_name_Postman_Auth
Scenario: Verify that site and route codings are preserved in imms event table when the first coding system is invalid
Given Valid json payload is created where site and route have multiple SNOMED codings after an invalid system
When Trigger the post create request
Then The request will be successful with the status code '201'
And The location key and Etag in header will contain the Immunization Id and version
And The delta table will use the first valid SNOMED site and route coding
And The imms event table will preserve every site and route coding from the request
And MNS event will be triggered with correct data for created event

@smoke
@Delete_cleanUp @vaccine_type_PERTUSSIS @patient_id_Random @supplier_name_EMIS
Scenario: Verify that VACCINATION_PROCEDURE_TERM, VACCINE_PRODUCT_TERM, SITE_OF_VACCINATION_TERM, ROUTE_OF_VACCINATION_TERM fields are mapped to coding.display in imms delta table in case of only one instance of coding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
parse_imms_int_imms_event_response,
validate_imms_delta_record_with_created_event,
)
from src.objectModels.api_data_objects import CodeableConcept, Coding
from src.objectModels.api_data_objects import Coding
from src.objectModels.api_immunization_builder import (
build_site_route,
build_vaccine_procedure_code,
Expand Down Expand Up @@ -140,63 +140,6 @@ def build_coding(system, code, display, value_string, value_id):
)


@given("Valid json payload is created where site and route have multiple SNOMED codings after an invalid system")
def create_valid_json_payload_with_multiple_site_route_snomed_codings(context):
valid_json_payload_is_created(context)
context.immunization_object.site = CodeableConcept(
coding=[
build_coding(
"http://snomed.info/test",
"368208006",
"Right upper arm structure (body structure)",
"Test Value string site 111",
"5306706018",
),
build_coding(
"http://snomed.info/sct",
"368209003",
"Left upper arm structure (body structure)",
"Test Value string site 222",
"5306706020",
),
build_coding(
"http://snomed.info/sct",
"368208008",
"Mid upper arm structure (body structure)",
"Test Value string site 333",
"5306706030",
),
],
text="Test String for site",
)
context.immunization_object.route = CodeableConcept(
coding=[
build_coding(
"http://snomed.info/test",
"78421000",
"Intramuscular route (qualifier value)",
"Test Value string route 111",
"5306706040",
),
build_coding(
"http://snomed.info/sct",
"78421000",
"Intramuscular route (qualifier value)",
"Test Value string route 222",
"5306706050",
),
build_coding(
"http://snomed.info/sct",
"34206005",
"Subcutaneous route (qualifier value)",
"Test Value string route 333",
"5306706060",
),
],
text="Test String for route",
)


@given(
"Valid json payload is created where vaccination terms has one instance of coding with no text or value string field"
)
Expand Down Expand Up @@ -355,24 +298,6 @@ def validate_delta_table_uses_first_valid_snomed_site_route_coding(context):
)


@then("The imms event table will preserve every site and route coding from the request")
def validate_imms_event_table_preserves_all_site_route_codings(context):
table_query_response = fetch_immunization_events_detail(context.aws_profile_name, context.ImmsID, context.S3_env)
assert "Item" in table_query_response, f"Item not found in response for ImmsID: {context.ImmsID}"

resource_json_str = table_query_response["Item"].get("Resource")
assert resource_json_str, "Resource field missing in item."
resource = json.loads(resource_json_str)

for field_name in ("site", "route"):
expected = context.request[field_name]
actual = resource[field_name]
assert len(actual["coding"]) == 3, (
f"Expected {field_name}.coding to contain 3 entries, but got {len(actual['coding'])}"
)
assert actual == expected, f"Expected {field_name} to match request, but got {actual}"


@then("The terms are mapped to correct coding.display fields in imms delta table")
def validate_procedure_term_second_display_in_delta_table(context):
actual_terms = get_all_term_text(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def valid_batch_file_is_created_with_different_values_gender(datatable, context)
context.vaccine_df.loc[7, "PERSON_GENDER_CODE"] = "other"
context.vaccine_df.loc[8, "PERSON_SURNAME"] = get_text("name_length_35")
context.vaccine_df.loc[9, "PERSON_FORENAME"] = get_text("name_length_35")
context.vaccine_df.loc[10, "PERSON_FORENAME"] = f"Elan {get_text('name_length_15')}"
context.vaccine_df.loc[10, "PERSON_FORENAME"] = f"Elan Test to get max {get_text('name_length_159')}"
create_batch_file(context)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Feature: Create the immunization event for a patient through batch file
And MNS event will be triggered with correct data for all 'CREATE' events where NHS is not null

@vaccine_type_ROTAVIRUS @supplier_name_TPP
Scenario: verify that vaccination record will be get successful with different valid value in gender field
Scenario: verify that vaccination record will be get successful with different valid value in gender field and name length is within limit in batch file
Given batch file is created for below data where person detail has valid values
| patient_id | unique_id |
| Random | gender_value_0 |
Expand Down
Loading