3.7 Wijzigen Task Status Module
Doel
Aanbiedermodule haalt de FHIR Task op en wijzigt de status (bijv. requested → in-progress → completed) bij de DVA FHIR-resource server.
Randvoorwaarden
Module heeft een access_token uit 6. Uitwisselen launch-context.
De Task-id komt uit het token-responseveld
resource(bijv."Task/350755BC-...").Task-status bevat 1 van de statussen beschreven door: http://hl7.org/fhir/task-status
Scopes omvatten o.a.
patient/patient.read,system/Task.*(lezen/schrijven) en juiste audience van de FHIR-server.
Optioneel
Voor tracebility is de logging wel gewenst voor module aanbieders, maar niet verplicht: Correlation-ID in requests (bijv.
X-Correlation-ID) en log deze ketenbreed.
Processtappen
Processtap | Toelichting |
|---|---|
| Lees |
| Het ophalen van de taak gegevens om de module te starten. |
| Om de status van de taak te wijzigen. |
Procesdiagram
Procesdialoog
2. Retrieve FHIR Task
GET {baseUrl}/Task/350755BC-E573-4004-91A3-91321E4BCA2A
Accept: application/fhir+json
Authorization: Bearer {ACCESS_TOKEN}
X-Correlation-ID: {GUID}
3. Update FHIR Task (via PATCH)
PATCH {baseUrl}/Task/350755BC-E573-4004-91A3-91321E4BCA2A
Content-Type: application/json-patch+json
Accept: application/fhir+json
Authorization: Bearer {ACCESS_TOKEN}
X-Correlation-ID: {GUID}
If-Match: W/"{versionId}" (als e-tags worden/kunnen ondersteunt)
[
{ "op": "replace", "path": "/status", "value": "in-progress" }
]
zie ook: FHIR HTTP REST interface: https://hl7.org/fhir/R4/http.html
De task Id komt uit de token response veldnaam resource van 3.6 Ontvangen launch context
3.6: 6. Uitwisselen launch-context
POST https://dvauth/connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&
code=SplxlOBeZQQYbYS6WxSbIA&
redirect_uri=https://module_redirect_uri&
client_id=module_client_id&
client_secret=module_client_secret
HTTP 200 OK
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6...",
"token_type": "Bearer",
"expires_in": 500,
"scope": "launch fhirUser patient/.read patient/Task.",
"patient": "Patient/XXX_Patient",
"fhirUser": "Patient/XXX_Patient",
"resource": "Task/350755BC-E573-4004-91A3-91321E4BCA2A",
"intent": "startmodule",
"return_uri": "https://pgo/launch_callback"
...
}
Fouten & gedrag
401/403: token ongeldig of scope ontbreekt (
patient/Task.*).404 (resource not found): Task niet gevonden (check id uit
resource).409: versie-conflict → ETag/
If-Matchgebruiken en opnieuw ophalen. Indien dit wordt ondersteunt.422: businessregel in FHIR-server (statusovergang ongeldig); vul
statusReasonof gebruikbusinessStatus.
