Skip to content

Commit 96a927a

Browse files
committed
NRL-1165 reflect model changes in feature test scenarios
1 parent bcd3eb6 commit 96a927a

File tree

2 files changed

+67
-67
lines changed

2 files changed

+67
-67
lines changed

tests/features/producer/createDocumentReference-failure.feature

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -545,15 +545,16 @@ Feature: Producer - createDocumentReference - Failure Scenarios
545545
| system | value |
546546
| http://snomed.info/sct | 736253002 |
547547
When producer 'ANGY1' creates a DocumentReference with values:
548-
| property | value |
549-
| subject | 9278693472 |
550-
| status | current |
551-
| type_system | http://invalidsystem.info/sct |
552-
| type | 736253002 |
553-
| category | 734163000 |
554-
| custodian | ANGY1 |
555-
| author | HAR1 |
556-
| url | https://example.org/my-doc.pdf |
548+
| property | value |
549+
| subject | 9278693472 |
550+
| status | current |
551+
| type_system | http://invalidsystem.info/sct |
552+
| type_display | Mental health crisis plan |
553+
| type | 736253002 |
554+
| category | 734163000 |
555+
| custodian | ANGY1 |
556+
| author | HAR1 |
557+
| url | https://example.org/my-doc.pdf |
557558
Then the response status code is 400
558559
And the response is an OperationOutcome with 1 issue
559560
And the OperationOutcome contains the issue:
@@ -581,14 +582,15 @@ Feature: Producer - createDocumentReference - Failure Scenarios
581582
| system | value |
582583
| http://snomed.info/sct | 736253002 |
583584
When producer 'ANGY1' creates a DocumentReference with values:
584-
| property | value |
585-
| subject | 9999999999 |
586-
| status | current |
587-
| type | invalid |
588-
| category | 734163000 |
589-
| custodian | ANGY1 |
590-
| author | HAR1 |
591-
| url | https://example.org/my-doc.pdf |
585+
| property | value |
586+
| subject | 9999999999 |
587+
| status | current |
588+
| type | invalid |
589+
| type_display | Mental health crisis plan |
590+
| category | 734163000 |
591+
| custodian | ANGY1 |
592+
| author | HAR1 |
593+
| url | https://example.org/my-doc.pdf |
592594
Then the response status code is 400
593595
And the response is an OperationOutcome with 1 issue
594596
And the OperationOutcome contains the issue:
@@ -714,6 +716,8 @@ Feature: Producer - createDocumentReference - Failure Scenarios
714716
}
715717
}
716718
"""
719+
Then the response status code is 400
720+
And the response is an OperationOutcome with 1 issue
717721

718722
Scenario: Missing content
719723
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
@@ -901,43 +905,36 @@ Feature: Producer - createDocumentReference - Failure Scenarios
901905
}
902906
"""
903907

904-
Scenario: contentType empty string
908+
Scenario: codings with empty string or leading whitespace
905909
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
906910
And the organisation 'TSTCUS' is authorised to access pointer types:
907911
| system | value |
908912
| http://snomed.info/sct | 736253002 |
909-
When producer 'TSTCUS' requests creation of a DocumentReference with default test values except 'content' is:
913+
When producer 'TSTCUS' requests creation of a DocumentReference with default test values except 'context' is:
910914
"""
911-
"content": [
912-
{
913-
"attachment": {
914-
"contentType": "",
915-
"url": "https://spine-proxy.national.ncrs.nhs.uk/https%3A%2F%2Fp1.nhs.uk%2FMentalhealthCrisisPlanReport.pdf"
916-
},
917-
"format": {
918-
"system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode",
919-
"code": "urn:nhs-ic:unstructured",
920-
"display": "Unstructured Document"
921-
},
922-
"extension": [
923-
{
924-
"url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability",
925-
"valueCodeableConcept": {
926-
"coding": [
927-
{
928-
"system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability",
929-
"code": "static",
930-
"display": "Static"
931-
}
932-
]
933-
}
934-
}
935-
]
936-
}
915+
"context": {
916+
"practiceSetting": {
917+
"coding": [
918+
{
919+
"system": "http://snomed.info/sct",
920+
"code": "788002001",
921+
"display": ""
922+
}
923+
]
924+
},
925+
"facilityType": {
926+
"coding": [
927+
{
928+
"system": " system",
929+
"code": "1234",
930+
"display": "Tertiary care facility"
931+
}
937932
]
933+
}
934+
}
938935
"""
939936
Then the response status code is 400
940-
And the response is an OperationOutcome with 1 issue
937+
And the response is an OperationOutcome with 2 issues
941938
And the OperationOutcome contains the issue:
942939
"""
943940
{
@@ -952,9 +949,9 @@ Feature: Producer - createDocumentReference - Failure Scenarios
952949
}
953950
]
954951
},
955-
"diagnostics": "Request body could not be parsed (content[0].attachment.contentType: String should match pattern '[^\\s]+(\\s[^\\s]+)*')",
952+
"diagnostics": "Request body could not be parsed (context.practiceSetting.coding[0].display: String should match pattern '[^\\s]+(\\s[^\\s]+)*')",
956953
"expression": [
957-
"content[0].attachment.contentType"
954+
"context.practiceSetting.coding[0].display"
958955
]
959956
}
960957
"""

tests/features/producer/upsertDocumentReference-failure.feature

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ Feature: Producer - upsertDocumentReference - Failure Scenarios
8383
| system | value |
8484
| http://snomed.info/sct | 736253002 |
8585
When producer 'ANGY1' upserts a DocumentReference with values:
86-
| property | value |
87-
| id | X26-testid-upsert-0001-0001 |
88-
| subject | 9278693472 |
89-
| status | current |
90-
| type_system | http://invalidsystem.info/sct |
91-
| type | 736253002 |
92-
| category | 734163000 |
93-
| custodian | ANGY1 |
94-
| author | HAR1 |
95-
| url | https://example.org/my-doc.pdf |
86+
| property | value |
87+
| id | X26-testid-upsert-0001-0001 |
88+
| subject | 9278693472 |
89+
| status | current |
90+
| type_system | http://invalidsystem.info/sct |
91+
| type_display | Mental health crisis plan |
92+
| type | 736253002 |
93+
| category | 734163000 |
94+
| custodian | ANGY1 |
95+
| author | HAR1 |
96+
| url | https://example.org/my-doc.pdf |
9697
Then the response status code is 400
9798
And the response is an OperationOutcome with 1 issue
9899
And the OperationOutcome contains the issue:
@@ -120,15 +121,17 @@ Feature: Producer - upsertDocumentReference - Failure Scenarios
120121
| system | value |
121122
| http://snomed.info/sct | 736253002 |
122123
When producer 'ANGY1' upserts a DocumentReference with values:
123-
| property | value |
124-
| id | X26-testid-upsert-0001-0001 |
125-
| subject | 9999999999 |
126-
| status | current |
127-
| type | invalid |
128-
| category | 734163000 |
129-
| custodian | ANGY1 |
130-
| author | HAR1 |
131-
| url | https://example.org/my-doc.pdf |
124+
| property | value |
125+
| id | X26-testid-upsert-0001-0001 |
126+
| subject | 9999999999 |
127+
| status | current |
128+
| type | invalid |
129+
| type_system | http://snomed.info/sct |
130+
| type_display | Mental health crisis plan |
131+
| category | 734163000 |
132+
| custodian | ANGY1 |
133+
| author | HAR1 |
134+
| url | https://example.org/my-doc.pdf |
132135
Then the response status code is 400
133136
And the response is an OperationOutcome with 1 issue
134137
And the OperationOutcome contains the issue:

0 commit comments

Comments
 (0)