Skip to content

Commit 4cc04fb

Browse files
committed
NRL-1165 add feature test for regex validation on non-mandatory segments
1 parent 8fa5025 commit 4cc04fb

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

tests/features/producer/createDocumentReference-failure.feature

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ Feature: Producer - createDocumentReference - Failure Scenarios
926926
"coding": [
927927
{
928928
"system": " system",
929-
"code": "1234",
929+
"code": "1234"
930930
}
931931
]
932932
}
@@ -948,9 +948,29 @@ Feature: Producer - createDocumentReference - Failure Scenarios
948948
}
949949
]
950950
},
951-
"diagnostics": "Request body could not be parsed (context.practiceSetting.coding[0].system: String should match pattern '[^\\s]+(\\s[^\\s]+)*')",
951+
"diagnostics": "Request body could not be parsed (context.facilityType.coding[0].system: String should match pattern '[^\\s]+(\\s[^\\s]+)*')",
952952
"expression": [
953-
"context.practiceSetting.coding[0].system"
953+
"context.facilityType.coding[0].system"
954+
]
955+
}
956+
"""
957+
And the OperationOutcome contains the issue:
958+
"""
959+
{
960+
"severity": "error",
961+
"code": "invalid",
962+
"details": {
963+
"coding": [
964+
{
965+
"system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1",
966+
"code": "MESSAGE_NOT_WELL_FORMED",
967+
"display": "Message not well formed"
968+
}
969+
]
970+
},
971+
"diagnostics": "Request body could not be parsed (context.practiceSetting.coding[0].display: String should match pattern '[^\\s]+(\\s[^\\s]+)*')",
972+
"expression": [
973+
"context.practiceSetting.coding[0].display"
954974
]
955975
}
956976
"""

0 commit comments

Comments
 (0)