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 16 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-a0d3416.zip |
|
Feedback from David Rabbich (Responses in Italics)
|
| Note that the above URL path is an example - you can use a different URL path if you prefer. | ||
|
|
||
| ## Questionnaires inclusion and exclusion rules | ||
| ## Task inclusion and exclusion rules |
There was a problem hiding this comment.
Expand on inclusion / exclusion rules. Still applicable for generic tasks?
There was a problem hiding this comment.
- Potentially add, review clinical Monday drop in
| description: | | ||
| ## Overview | ||
| This endpoint returns a list of tasks for completion of questionnaires from a secondary care booking system for a given patient. | ||
| This endpoint returns a list of tasks, such as those for appointment booking invitations or for the completion of questionnaires, from a secondary care booking system for a given patient. |
There was a problem hiding this comment.
Be explicit, just ItB and questionnaires. Will extend later
| responses: | ||
| 2XX: | ||
| $ref: "#/components/responses/questionnaireHappyPath" | ||
| $ref: "#/components/responses/tasksHappyPath" |
There was a problem hiding this comment.
Indentation. Task singular?
| example: "https://my.portal.com/Document/b710e648-c12e-4f66-80e2-9957a254900f" | ||
| Task: | ||
| description: "FHIR TASK resource for the questionnaire" | ||
| description: "FHIR Task resource for the task" |
There was a problem hiding this comment.
Expand on Task uses, explicit
| - authored | ||
| - reasonReference | ||
| - owner | ||
| # removed 'owner' as it might need to be optional, as booking invites might offer a range of hospitals to choose from |
There was a problem hiding this comment.
Revert, will be needed for both.
| example: "3a146c43-2b21-44e9-95bc-6f4849e504c8" | ||
| basedOn: | ||
| description: Reference to the related CarePlan (Pathway). This reference should contain the pathway ID. This field is required for PIFU questionnaires to identify duplicate entries and is optional for other questionnaire types. | ||
| description: Reference to the related CarePlan (Pathway). This reference should contain the pathway ID. This field is required to identify duplicate entries and is optional for other task types. |
There was a problem hiding this comment.
Required for PIFU questionnaires
| example: "RBH5644312231" | ||
| status: | ||
| description: "Status of the Task for the completion of the Questionnaire. See: https://build.fhir.org/valueset-task-status.html" | ||
| description: "Status of the task. See: https://build.fhir.org/valueset-task-status.html" |
There was a problem hiding this comment.
Expand on link details, description on what each status means etc...
Invite to Book - Task Resource Alignment Summary
Overview
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"]statusReason: Now structured as codeable concept (ready for future expansion)description: Enhanced with clearer guidance for both questionnaires and invitesextension: Streamlined to include Portal Link, 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:
Portal Link (required)
https://fhir.nhs.uk/StructureDefinition/Extension-Portal-LinkClient 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.