|
1 | 1 | { |
2 | 2 | "info": { |
3 | | - "_postman_id": "e3d42c87-bf68-4cae-b08d-e1fd0dba1f80", |
4 | | - "name": "Validate Relationship Service Sandbox 29/05/25", |
| 3 | + "_postman_id": "de538326-5564-4efd-9ed2-d1c64142fcfe", |
| 4 | + "name": "Validate Relationship Service Sandbox 04/06/25", |
5 | 5 | "description": "Example usage of the Validate Relationship Service (VRS) sandbox.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)", |
6 | 6 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", |
7 | | - "_exporter_id": "34042403" |
| 7 | + "_exporter_id": "44536620" |
8 | 8 | }, |
9 | 9 | "item": [ |
10 | 10 | { |
|
6053 | 6053 | "});", |
6054 | 6054 | "", |
6055 | 6055 | "pm.test(\"Location header is returned\", () => {", |
6056 | | - " pm.response.to.have.header(\"Location\", \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/9000000009\")", |
| 6056 | + " pm.response.to.have.header(\"Location\", \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/90b9863e-e33c-4895-a333-fd0ea0e23205\")", |
6057 | 6057 | "})" |
6058 | 6058 | ], |
6059 | 6059 | "type": "text/javascript", |
|
6112 | 6112 | "});", |
6113 | 6113 | "", |
6114 | 6114 | "pm.test(\"Location header is returned\", () => {", |
6115 | | - " pm.response.to.have.header(\"Location\", \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/9000000017\")", |
| 6115 | + " pm.response.to.have.header(\"Location\", \"https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/90b9863e-e33c-4895-a333-fd0ea0e23205\")", |
6116 | 6116 | "})" |
6117 | 6117 | ], |
6118 | 6118 | "type": "text/javascript", |
|
6328 | 6328 | } |
6329 | 6329 | }, |
6330 | 6330 | "url": { |
6331 | | - "raw": "{{api_base_url}}/Consent/c6f48e4d", |
| 6331 | + "raw": "{{api_base_url}}/Consent/c512b0db-6702-43ee-8c21-bbded2552da9", |
6332 | 6332 | "host": [ |
6333 | 6333 | "{{api_base_url}}" |
6334 | 6334 | ], |
6335 | 6335 | "path": [ |
6336 | 6336 | "Consent", |
6337 | | - "c6f48e4d" |
| 6337 | + "c512b0db-6702-43ee-8c21-bbded2552da9" |
6338 | 6338 | ] |
6339 | 6339 | }, |
6340 | 6340 | "description": "Valid patch changing status to 'active'" |
|
6385 | 6385 | } |
6386 | 6386 | }, |
6387 | 6387 | "url": { |
6388 | | - "raw": "{{api_base_url}}/Consent/0c56a594", |
| 6388 | + "raw": "{{api_base_url}}/Consent/6b71ac92-baa3-4b76-b0f5-a601257e2722", |
6389 | 6389 | "host": [ |
6390 | 6390 | "{{api_base_url}}" |
6391 | 6391 | ], |
6392 | 6392 | "path": [ |
6393 | 6393 | "Consent", |
6394 | | - "0c56a594" |
| 6394 | + "6b71ac92-baa3-4b76-b0f5-a601257e2722" |
6395 | 6395 | ] |
6396 | 6396 | }, |
6397 | 6397 | "description": "Valid patch modifying the role end date" |
|
6442 | 6442 | } |
6443 | 6443 | }, |
6444 | 6444 | "url": { |
6445 | | - "raw": "{{api_base_url}}/Consent/b02ea26c", |
| 6445 | + "raw": "{{api_base_url}}/Consent/43003db8-ffcd-4bd6-ab2f-b49b9656f9e5", |
6446 | 6446 | "host": [ |
6447 | 6447 | "{{api_base_url}}" |
6448 | 6448 | ], |
6449 | 6449 | "path": [ |
6450 | 6450 | "Consent", |
6451 | | - "b02ea26c" |
| 6451 | + "43003db8-ffcd-4bd6-ab2f-b49b9656f9e5" |
6452 | 6452 | ] |
6453 | 6453 | }, |
6454 | 6454 | "description": "Valid patch modifying the role end date" |
|
6466 | 6466 | " \"issue\": [", |
6467 | 6467 | " {", |
6468 | 6468 | " \"code\": \"invalid\",", |
6469 | | - " \"diagnostics\": \"Patch attempting invalid status change.\",", |
| 6469 | + " \"diagnostics\": \"Invalid status code.\",", |
6470 | 6470 | " \"details\": {", |
6471 | 6471 | " \"coding\": [", |
6472 | 6472 | " {", |
6473 | | - " \"code\": \"INVALID_STATE_TRANSITION\",", |
6474 | | - " \"display\": \"Status change is invalid.\",", |
| 6473 | + " \"code\": \"INVALID_STATUS_CODE\",", |
| 6474 | + " \"display\": \"Status code is invalid.\",", |
6475 | 6475 | " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", |
6476 | 6476 | " \"version\": \"1\"", |
6477 | 6477 | " }", |
|
6483 | 6483 | " \"resourceType\": \"OperationOutcome\"", |
6484 | 6484 | "}", |
6485 | 6485 | "", |
6486 | | - "pm.test(\"Status code is 201\", function () {", |
| 6486 | + "pm.test(\"Status code is 422\", function () {", |
6487 | 6487 | " pm.response.to.have.status(422);", |
6488 | 6488 | "});", |
6489 | 6489 | "", |
|
6510 | 6510 | } |
6511 | 6511 | }, |
6512 | 6512 | "url": { |
6513 | | - "raw": "{{api_base_url}}/Consent/6fb4361b", |
| 6513 | + "raw": "{{api_base_url}}/Consent/78c35330-fa2f-4934-a5dd-fff847f38de5", |
6514 | 6514 | "host": [ |
6515 | 6515 | "{{api_base_url}}" |
6516 | 6516 | ], |
6517 | 6517 | "path": [ |
6518 | 6518 | "Consent", |
6519 | | - "6fb4361b" |
| 6519 | + "78c35330-fa2f-4934-a5dd-fff847f38de5" |
6520 | 6520 | ] |
6521 | 6521 | }, |
6522 | 6522 | "description": "Patch with invalid status value" |
|
6578 | 6578 | } |
6579 | 6579 | }, |
6580 | 6580 | "url": { |
6581 | | - "raw": "{{api_base_url}}/Consent/94df7c8f", |
| 6581 | + "raw": "{{api_base_url}}/Consent/01abb0c5-b1ac-499d-9655-9cd0b8d3588f", |
6582 | 6582 | "host": [ |
6583 | 6583 | "{{api_base_url}}" |
6584 | 6584 | ], |
6585 | 6585 | "path": [ |
6586 | 6586 | "Consent", |
6587 | | - "94df7c8f" |
| 6587 | + "01abb0c5-b1ac-499d-9655-9cd0b8d3588f" |
6588 | 6588 | ] |
6589 | 6589 | }, |
6590 | 6590 | "description": "Patch targeting non-existent element" |
|
6714 | 6714 | } |
6715 | 6715 | }, |
6716 | 6716 | "url": { |
6717 | | - "raw": "{{api_base_url}}/Consent/3a2679eb", |
| 6717 | + "raw": "{{api_base_url}}/Consent/849ea584-2318-471b-a24c-cee1b5ad0137", |
6718 | 6718 | "host": [ |
6719 | 6719 | "{{api_base_url}}" |
6720 | 6720 | ], |
6721 | 6721 | "path": [ |
6722 | 6722 | "Consent", |
6723 | | - "3a2679eb" |
| 6723 | + "849ea584-2318-471b-a24c-cee1b5ad0137" |
6724 | 6724 | ] |
6725 | 6725 | }, |
6726 | 6726 | "description": "Malformed JSON patch document" |
|
6738 | 6738 | " \"issue\": [", |
6739 | 6739 | " {", |
6740 | 6740 | " \"code\": \"invalid\",", |
6741 | | - " \"diagnostics\": \"Malformed JSON patch document.\",", |
| 6741 | + " \"diagnostics\": \"Patch attempting invalid status change.\",", |
6742 | 6742 | " \"details\": {", |
6743 | 6743 | " \"coding\": [", |
6744 | 6744 | " {", |
6745 | | - " \"code\": \"INVALID_PATCH_FORMAT\",", |
6746 | | - " \"display\": \"Request format is invalid.\",", |
| 6745 | + " \"code\": \"INVALID_STATE_TRANSITION\",", |
| 6746 | + " \"display\": \"Status change is invalid.\",", |
6747 | 6747 | " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", |
6748 | 6748 | " \"version\": \"1\"", |
6749 | 6749 | " }", |
|
6755 | 6755 | " \"resourceType\": \"OperationOutcome\"", |
6756 | 6756 | "}", |
6757 | 6757 | "", |
6758 | | - "pm.test(\"Status code is 400\", function () {", |
6759 | | - " pm.response.to.have.status(400);", |
| 6758 | + "pm.test(\"Status code is 422\", function () {", |
| 6759 | + " pm.response.to.have.status(422);", |
6760 | 6760 | "});", |
6761 | 6761 | "", |
6762 | 6762 | "pm.test(\"Should have correct response body\", () => {", |
|
6774 | 6774 | "header": [], |
6775 | 6775 | "body": { |
6776 | 6776 | "mode": "raw", |
6777 | | - "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"active\"\n }\n]", |
| 6777 | + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"someinvalidcode\"\n }\n]", |
6778 | 6778 | "options": { |
6779 | 6779 | "raw": { |
6780 | 6780 | "language": "json" |
6781 | 6781 | } |
6782 | 6782 | } |
6783 | 6783 | }, |
6784 | 6784 | "url": { |
6785 | | - "raw": "{{api_base_url}}/Consent/3a2679eb", |
| 6785 | + "raw": "{{api_base_url}}/Consent/7b7f47b8-96e5-43eb-b733-283bf1449f2c", |
6786 | 6786 | "host": [ |
6787 | 6787 | "{{api_base_url}}" |
6788 | 6788 | ], |
6789 | 6789 | "path": [ |
6790 | 6790 | "Consent", |
6791 | | - "3a2679eb" |
| 6791 | + "7b7f47b8-96e5-43eb-b733-283bf1449f2c" |
6792 | 6792 | ] |
| 6793 | + } |
| 6794 | + }, |
| 6795 | + "response": [] |
| 6796 | + }, |
| 6797 | + { |
| 6798 | + "name": "Invalid Status Reason", |
| 6799 | + "event": [ |
| 6800 | + { |
| 6801 | + "listen": "test", |
| 6802 | + "script": { |
| 6803 | + "exec": [ |
| 6804 | + "const expectedResponseBody = {", |
| 6805 | + " \"issue\": [", |
| 6806 | + " {", |
| 6807 | + " \"code\": \"invalid\",", |
| 6808 | + " \"diagnostics\": \"Invalid status reason.\",", |
| 6809 | + " \"details\": {", |
| 6810 | + " \"coding\": [", |
| 6811 | + " {", |
| 6812 | + " \"code\": \"INVALID_STATUS_REASON\",", |
| 6813 | + " \"display\": \"Status reason is invalid.\",", |
| 6814 | + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode\",", |
| 6815 | + " \"version\": \"1\"", |
| 6816 | + " }", |
| 6817 | + " ]", |
| 6818 | + " },", |
| 6819 | + " \"severity\": \"error\"", |
| 6820 | + " }", |
| 6821 | + " ],", |
| 6822 | + " \"resourceType\": \"OperationOutcome\"", |
| 6823 | + "}", |
| 6824 | + "", |
| 6825 | + "pm.test(\"Status code is 422\", function () {", |
| 6826 | + " pm.response.to.have.status(422);", |
| 6827 | + "});", |
| 6828 | + "", |
| 6829 | + "pm.test(\"Should have correct response body\", () => {", |
| 6830 | + " var responseJson = pm.response.json();", |
| 6831 | + " pm.expect(responseJson).to.eql(expectedResponseBody);", |
| 6832 | + "});" |
| 6833 | + ], |
| 6834 | + "type": "text/javascript", |
| 6835 | + "packages": {} |
| 6836 | + } |
| 6837 | + } |
| 6838 | + ], |
| 6839 | + "request": { |
| 6840 | + "method": "PATCH", |
| 6841 | + "header": [], |
| 6842 | + "body": { |
| 6843 | + "mode": "raw", |
| 6844 | + "raw": "[\n {\n \"op\": \"replace\",\n \"path\": \"/status\",\n \"value\": \"someinvalidcode\"\n }\n]", |
| 6845 | + "options": { |
| 6846 | + "raw": { |
| 6847 | + "language": "json" |
| 6848 | + } |
| 6849 | + } |
6793 | 6850 | }, |
6794 | | - "description": "Malformed JSON patch document" |
| 6851 | + "url": { |
| 6852 | + "raw": "{{api_base_url}}/Consent/51fb4df5-815a-45cd-8427-04d6558336b7", |
| 6853 | + "host": [ |
| 6854 | + "{{api_base_url}}" |
| 6855 | + ], |
| 6856 | + "path": [ |
| 6857 | + "Consent", |
| 6858 | + "51fb4df5-815a-45cd-8427-04d6558336b7" |
| 6859 | + ] |
| 6860 | + } |
6795 | 6861 | }, |
6796 | 6862 | "response": [] |
6797 | 6863 | } |
|
0 commit comments