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)
|
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.