Skip to content

Commit 9408c91

Browse files
committed
NRL-477 fix tests
1 parent 99cb5b0 commit 9408c91

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

layer/nrlf/core/tests/test_validators.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,8 @@ def test_validate_content_format_invalid_code_for_unstructured_document():
13091309

13101310
document_ref_data["content"][0]["format"] = {
13111311
"system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode",
1312-
"code": "urn:nhs-ic:contact",
1313-
"display": "Contact details",
1312+
"code": "urn:nhs-ic:record-contact",
1313+
"display": "Contact details (HTTP Unsecured)",
13141314
}
13151315

13161316
result = validator.validate(document_ref_data)
@@ -1330,7 +1330,7 @@ def test_validate_content_format_invalid_code_for_unstructured_document():
13301330
}
13311331
]
13321332
},
1333-
"diagnostics": "Invalid content format code: urn:nhs-ic:contact format code must be 'urn:nhs-ic:unstructured' for Unstructured Document attachments.",
1333+
"diagnostics": "Invalid content format code: urn:nhs-ic:record-contact format code must be 'urn:nhs-ic:unstructured' for Unstructured Document attachments.",
13341334
"expression": ["content[0].format.code"],
13351335
}
13361336

@@ -1643,6 +1643,8 @@ def test_validate_content_invalid_content_type():
16431643
def test_validate_nrl_format_code_valid_match(format_code, format_display):
16441644
validator = DocumentReferenceValidator()
16451645
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")
1646+
if format_code == "urn:nhs-ic:record-contact":
1647+
document_ref_data["content"][0]["attachment"]["contentType"] = "text/html"
16461648

16471649
document_ref_data["content"][0]["format"] = {
16481650
"system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode",
@@ -1675,6 +1677,8 @@ def test_validate_nrl_format_code_display_mismatch(
16751677
):
16761678
validator = DocumentReferenceValidator()
16771679
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")
1680+
if format_code == "urn:nhs-ic:record-contact":
1681+
document_ref_data["content"][0]["attachment"]["contentType"] = "text/html"
16781682

16791683
document_ref_data["content"][0]["format"] = {
16801684
"system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode",

0 commit comments

Comments
 (0)