SPEC CHANGE - WPP-11130 - Proposed changes to API specs for Invite to Book - #166
SPEC CHANGE - WPP-11130 - Proposed changes to API specs for Invite to Book#166simeonparris-nhs wants to merge 31 commits into
Conversation
so that it is suitable for a variety of tasks rather than just questionnaire responses
so that a variety of task details, such as booking invites and questionnaire responses can be communicated
for allAppointmentBookingInvitationStates
…hile backwards compatible
|
Just want to check this has been aligned with kevin/sachit? |
The design has been run through with Sachit yes, we collaborated on that, but not this specific spec change. Reaching out to David Rabbich in Sachit and Kevin's absence. |
Definitely think this will be a positive change as the line between tasks and questionnaires is currently quite blurry. |
…nts and only trigger after an API spec change
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-333acb5.zip |
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-536a269.zip |
as reasonReference.reference carries the same URL value
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-e682726.zip |
as latest invite to book designs do not make use of it
of the new Task resource in the consumer spec as I forgot to remove then when I removed that extension
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-6cb7f63.zip |
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-1543182.zip |
and define code system as well as update the examples
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-03aea92.zip |
| identifier: | ||
| system: "https://fhir.nhs.uk/Id/nhs-number" | ||
| value: "9000000014" | ||
| authoredOn: "2026-07-13T12:30:00+00:00" |
There was a problem hiding this comment.
should this be authored to match the Schema
There was a problem hiding this comment.
Yes, that would match the spec. I think that mistake was made because authored is not a valid FHIR R4 field for the Task resource; it should be authoredOn in the schema.
| detail: | ||
| description: Details of the task. | ||
| type: object | ||
| required: |
There was a problem hiding this comment.
detail.required does not require intent, for, owner, or reasonCode which are core for task classification and routing. Given the move to a generic task contract, should intent, for, owner, and reasonCode be required here to keep producer/consumer behaviour deterministic?
| description: URI to identifier Questionnaire types | ||
| description: URI to identify Task types | ||
| enum: | ||
| - https://fhir.nhs.uk/StructureDefinition/Extension-Questionnaire-Type |
There was a problem hiding this comment.
This enum only permits questionnaire-type URI. If booking invites are first-class Task types should this allow the booking/task-type system too?
❌ Branch Name Validation FailedBranch format is invalid. Expected format: Ensure JIRA ticket key is included. Allowed prefixes: feat, feature, chore, spike, hotfix, bugfix, release, revert |
and correct example taskQuestionnaire
by removing detail wrapper
API Spec HTML DocsBuilt from commit Download HTML API Specs: api-specs-html-docs-19784cf.zip |
Invite to Book - Task Resource Alignment Summary
Overview
To support the Invite to Book changes, the design has been made to uplift the existing Task resource to support both Invitations to Book and Questionnaires, along with being extensible for further use cases.
The Consumer spec Task resource has been updated to align with the Producer spec's generic FHIR-based Task implementation. This enables the Task resource to support multiple use cases (questionnaires, appointment booking invites, and future task types) while maintaining backwards compatibility with the existing Questionnaire resource.
Why This Change?
Previous Implementation
kindenum was rigid and required updates for each new task typeNew Implementation
status,intent,reasonCode,reasonReferencereasonCodeand extensions for new task typesKey Changes
Removed Fields
kind→ Replaced byreasonCode(FHIR standard, provides more semantic meaning)scheduledPeriod→ Replaced byrestriction.period(FHIR standard)performer→ Replaced byowner(FHIR standard terminology)Added Fields
ididentifierintentauthoredlastModifiedrestriction.periodfocusforownerbasedOnreasonCodereasonReferenceModified Fields
status: Changed from["not-started", "in-progress", "completed", "cancelled"]to FHIR-compliant["requested", "rejected", "cancelled", "in-progress", "completed"]description: Enhanced with clearer guidance for both questionnaires and invitesextension: Streamlined to include Client ID and Treatment Function (for PIFU only)Task Type Classification
Using
reasonCodeto Distinguish Task TypesThe new
reasonCodestructure replaces the oldkindenum and provides semantic clarity:For Questionnaires:
For Appointment Booking Invites:
Backwards Compatibility
Questionnaire Resource Preserved
Questionnaireresource remains unchangedMigration Path
Data Models
Appointment Booking Invite (Task)
Questionnaire (Task)
Implementation Notes
For Consumer API Users
For Portal Providers (Producer API)
For the Aggregator Service
Status Values Mapping
not-startedrequestedin-progressin-progresscompletedcompletedcancelledcancelledrejectedExtension Framework
The streamlined extensions provide:
Client ID (optional)
https://fhir.nhs.uk/StructureDefinition/Extension-Client-idTreatment Function (conditional)
https://fhir.nhs.uk/StructureDefinition/Extension-Task-TreatmentFunctionQuestions & Clarifications
Q: When will the Questionnaire resource be deprecated?
A: No immediate deprecation. The Questionnaire resource will remain supported during a transition period (to be determined). We'll provide advance notice before any deprecation.
Q: Do I need to update my system immediately?
A: No. Existing implementations using Questionnaire continue to work. Adopt Task resource for new implementations or when ready to migrate.
Q: How do I distinguish between task types?
A: Use the
reasonCode.coding.systemfield:Extension-Questionnaire-TypeExtension-Task-TypeQ: What about linked appointments?
A: Use the
focusfield to reference an appointment:focus.referencepoints to the booked appointmentfocusmay be empty or optionalQ: Can I store custom data in Task?
A: Yes, use extensions (array) to add custom fields following FHIR extension patterns.