Skip to content

Add cancellation process#38

Merged
trawlinson-kainos merged 19 commits into
NHSDigital:mainfrom
trawlinson-kainos:feat/add-cancellation-process
Jun 26, 2026
Merged

Add cancellation process#38
trawlinson-kainos merged 19 commits into
NHSDigital:mainfrom
trawlinson-kainos:feat/add-cancellation-process

Conversation

@trawlinson-kainos

Copy link
Copy Markdown
Contributor

Description

Update the API specs to add in the route for sending cancellations to the suppliers.
Also updated the FHIR Task status a little to demonstrate how the 'order-rejected' update would work.

Context

There is clarification needed between order cancellation (user-driven) and rejection (supplier-driven).
An API spec update was needed for order cancellation, and a similar update also helps to clarify how order rejection is expected to work.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🔬 FHIR Validation Results

⚠️ Validation passed with warnings — 0 error(s) · 4 warning(s) · 16 info

observation_reactive_with_contact.example.json
Severity Location Message
ℹ️ information All OK
observation_non_reactive.example.json
Severity Location Message
ℹ️ information All OK
observation_non_definitive_result.example.json
Severity Location Message
ℹ️ information All OK
get_test_results_non_reactive.example.json
Severity Location Message
ℹ️ information Bundle No types could be determined from the search string, so the types can't be checked
task_update_received-at-lab.example.json
Severity Location Message
⚠️ warning Task.statusReason.text value should not start or finish with whitespace ' Test kit has been received at the lab and is being processed'
⚠️ warning Task Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)
ℹ️ information Task.statusReason Binding for path Task.statusReason in profile StructureDefinition[http://hl7.org/fhir/StructureDefinition/Task
ℹ️ information Task.businessStatus Binding for path Task.businessStatus in profile StructureDefinition[http://hl7.org/fhir/StructureDefinition/Task
observation_reactive_without_contact.example.json
Severity Location Message
ℹ️ information All OK
ordereligibility_ineligible_operationoutcome.example.json
Severity Location Message
ℹ️ information All OK
task_update_test-processed.example.json
Severity Location Message
⚠️ warning Task.statusReason.text value should not start or finish with whitespace ' Test kit has been processed'
⚠️ warning Task Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)
ℹ️ information Task.statusReason Binding for path Task.statusReason in profile StructureDefinition[http://hl7.org/fhir/StructureDefinition/Task
ℹ️ information Task.businessStatus Binding for path Task.businessStatus in profile StructureDefinition[http://hl7.org/fhir/StructureDefinition/Task
ordereligibility_servicerequest.example.json
Severity Location Message
ℹ️ information All OK
task_update_dispatched.example.json
Severity Location Message
ℹ️ information Task.statusReason Binding for path Task.statusReason in profile StructureDefinition[http://hl7.org/fhir/StructureDefinition/Task
ℹ️ information Task.businessStatus Binding for path Task.businessStatus in profile StructureDefinition[http://hl7.org/fhir/StructureDefinition/Task
order_cancelled.example.json
Severity Location Message
ℹ️ information All OK
order_servicerequest.example.json
Severity Location Message
ℹ️ information All OK
operationoutcome_business_rule.example.json
Severity Location Message
ℹ️ information All OK

Full HTML report available in the workflow run artifacts.

Comment thread schemas/home-test-supplier-api.yaml Outdated
Comment thread schemas/home-test-supplier-api.yaml Outdated
Needed to make 'contained' no longer required, as we don't have enough information to fully populate the patient at that point, and can only use a reference
Some other minor changes to align the examples within the spec to the JSON examples.
@trawlinson-kainos trawlinson-kainos force-pushed the feat/add-cancellation-process branch from f06e067 to 9bbe90f Compare June 19, 2026 09:35
Generally removing references to order rejection, and clarifying that the failure of the order eligibility check is the only supported way for the suppliers to reject orders based on eligibility.
…t a raw string.

This caused a FHIR validator error
@trawlinson-kainos trawlinson-kainos marked this pull request as ready for review June 23, 2026 08:36
@trawlinson-kainos trawlinson-kainos requested review from a team as code owners June 23, 2026 08:36
@trawlinson-kainos

Copy link
Copy Markdown
Contributor Author

@ElldanLimited - I think I've managed to get the allowed businessStatus values as an enum, but it would be useful to check that's worked for you (not 100% confident in the inheritance parts of OpenAPI!).

I've also removed references to 'order rejection', and clarified in the documentation (status-transitions.md) that the Pre-Eligibility Check is where any patient eligibility decisions by the supplier will be made.

Comment thread schemas/home-test-supplier-api.yaml
@lewisbirks lewisbirks changed the title Feat/add cancellation process Add cancellation process Jun 24, 2026
Comment thread docs/status-transitions.md
Comment thread docs/status-transitions.md Outdated
Comment thread schemas/supplier-api-spec.yaml
Comment thread examples/fhir/order_cancelled.example.json
Comment thread schemas/changelog.md Outdated
Comment thread schemas/changelog.md
Comment thread schemas/supplier-api-spec.yaml
Comment thread schemas/supplier-api-spec.yaml
Comment thread examples/fhir/task_update_dispatched.example.json
trawlinson-kainos and others added 5 commits June 24, 2026 11:21
Also added specific failure codes for some obvious possible errors (order not found, order already processed)
clarify wording of first order needing to go to supplier before being moved to dispatch

Co-authored-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
Comment thread schemas/supplier-api-spec.yaml Outdated
Comment thread examples/fhir/order_cancelled.example.json
Comment thread schemas/supplier-api-spec.yaml Outdated
Comment thread schemas/changelog.md Outdated
@trawlinson-kainos trawlinson-kainos merged commit 7a2011d into NHSDigital:main Jun 26, 2026
4 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants