From 52d6e1dca71a6f48997820deb206f3e60bd8a33b Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Thu, 5 Mar 2026 07:38:25 +0000 Subject: [PATCH 1/2] [NRL-1990] Allow unstructured data for text/html contents in pointers --- layer/nrlf/core/validators.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layer/nrlf/core/validators.py b/layer/nrlf/core/validators.py index bac27ca9f..97f801ec6 100644 --- a/layer/nrlf/core/validators.py +++ b/layer/nrlf/core/validators.py @@ -473,7 +473,11 @@ def _validate_content_format(self, model: DocumentReference): if ( content.attachment.contentType == "text/html" and content.format.code - not in ["urn:nhs-ic:record-contact", "urn:nhs-ic:structured"] + not in [ + "urn:nhs-ic:record-contact", + "urn:nhs-ic:structured", + "urn:nhs-ic:unstructured", + ] ): self.result.add_error( issue_code="business-rule", From 9cc447ac18ece09c8e38ebd21c67868dbc2b3ccd Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Thu, 5 Mar 2026 07:57:14 +0000 Subject: [PATCH 2/2] [NRL-1990] Temporarily skip test that checks unstructured is not allowed for text/html --- layer/nrlf/core/tests/test_validators.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layer/nrlf/core/tests/test_validators.py b/layer/nrlf/core/tests/test_validators.py index 39939aa56..dca69fcb8 100644 --- a/layer/nrlf/core/tests/test_validators.py +++ b/layer/nrlf/core/tests/test_validators.py @@ -1198,6 +1198,9 @@ def test_validate_content_format_invalid_code_for_structured_document(): } +@pytest.mark.skip( + reason="Disabling temporarily as the validation rule is now allowed (but only for NRL-1966)" +) def test_validate_content_format_invalid_code_for_contact_details(): validator = DocumentReferenceValidator() document_ref_data = load_document_reference_json("Y05868-736253002-Valid")