Operations

1. $linkToHealthIssue

Introduction

The operation $linkToHealthIssue is an operation performed on the profile QuestionnaireResponseSe, which is based on the QuestionnaireResponse resource. This operation is used to link a ConditionHealthIssueSe to the QuestionnaireResponseSe.

The formal computable definition of the operation is specified by the OperationDefinitionLinkToHealthIssue profile, derived from the OperationDefinition resource in FHIR R4.

To pass information into the operation, the ParametersHealthIssueReferenceSe profile is used, which is based on the Parameters resource in FHIR R4.

Intended Use

The API is designed to link a ConditionHealthIssueSe to a QuestionnaireResponseSe belonging to the same patient. Only one ConditionHealthIssueSe can be linked to a QuestionnaireResponseSe at a time. Additionally, only ConditionHealthIssueSe resources with an active or closed status can be linked.

The literal ID (internal COSMIC ID) of the QuestionnaireResponseSe to be linked must be provided in the API path. This ensures that the QuestionnaireResponseSe referenced exists in COSMIC.

The literal ID (internal COSMIC ID) of the ConditionHealthIssueSe to be linked should be included in the API request body using the ParametersHealthIssueReferenceSe profile.

This API is recommended for use by healthcare professionals.

Specific Rules and Limitations

Type Description
Rule Only the ConditionHealthIssueSe in status active or completed may be linked to the QuestionnaireResponseSe.
Limitation Invalidating a link created in an erroneous situation is not supported.
Limitation Only one ConditionHealthIssueSe can be linked at a time; linking multiple is not permitted.

Profile Overview

OperationDefinitionLinkToHealthIssue

idΣ0..1string
metaΣ0..1Meta
implicitRulesΣ ?!0..1uri
language0..1codeBinding
text0..1Narrative
contained0..*Resource
extensionI0..*Extension
modifierExtension?! I0..*Extension
urlΣ0..0uri
versionΣ0..0string
nameΣ I1..1stringFixed Value
titleΣ0..0string
statusΣ ?!1..1codeBindingFixed Value
kindΣ1..1codeBindingFixed Value
experimentalΣ0..0boolean
dateΣ0..0dateTime
publisherΣ0..0string
contactΣ0..0ContactDetail
description0..0markdown
useContextΣ0..0UsageContext
jurisdictionΣ0..0CodeableConceptBinding
purpose0..0markdown
affectsStateΣ0..0boolean
codeΣ1..1codeFixed Value
comment0..0markdown
baseΣ0..0canonical(OperationDefinition)
resourceΣ0..0codeBinding
systemΣ1..1booleanFixed Value
typeΣ1..1booleanFixed Value
instanceΣ1..1booleanFixed Value
inputProfile1..1canonical(https://fhir.cambio.se/StructureDefinition/ParametersHealthIssueReferenceSe)
outputProfile0..0canonical(StructureDefinition)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
name1..1codeFixed Value
use1..1codeBindingFixed Value
min1..1integerFixed Value
max1..1stringFixed Value
documentation0..0string
typeI0..0codeBinding
targetProfile0..0canonical(StructureDefinition)
searchTypeI0..0codeBinding
partI0..0see (parameter)

ParametersHealthIssueReferenceSe

idΣ0..1string
id0..1string
extensionI0..*Extension
versionIdΣ0..1id
lastUpdatedΣ0..1instant
sourceΣ0..1uri
profileΣ1..1canonical(StructureDefinition)Fixed Value
securityΣ0..*CodingBinding
tagΣ0..*Coding
implicitRulesΣ ?!0..1uri
language0..1codeBinding
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
nameΣ1..1stringFixed Value
id0..1string
extensionI0..*Extension
referenceΣ I1..1string
typeΣ0..0uriBindingFixed Value
identifierΣ0..0Identifier
displayΣ0..0string
valueReferenceReference()
resourceΣ I0..0Resource
partΣ0..0see (parameter)

Versions

COS version Profile version Required COSMIC version Date Description
4.5.0 1.0.0 4.0.0 Sep 2024 Initial version, support for POST $linkToHealthIssue.

Supported Operations

HTTP Methods

Method Description Scope
POST Link a QuestionnaireResponseSe to a ConditionHealthIssueSe belonging to the same patient. system/QuestionnaireResponse.write OR user/QuestionnaireResponse.write OR patient/QuestionnaireResponse.write

Query Operations

Input Parameters

  • Path parameters: The literal ID of the QuestionnaireResponse
  • Body parameters: The literal ID of the ConditionHealthIssueSe to be linked via the ParametersHealthIssueReferenceSe profile

Supported Queries

  1. POST [baseURL]/QuestionnaireResponse/{id}/$linkToHealthIssue

Response Codes

Scenario Response code Description
API request is a success. 200 OK -
Path parameter "id": Empty 400 Bad Request Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[QuestionnaireResponse/$linkToHealthIssue] with parameters [[]]
Path parameter "id": Journal note doesn't exist in Cosmic 404 Not Found Invalid parameters: QuestionnaireResponseSe not found.
Path parameter "id": Invalid input type 500 Internal Server Error -
Body parameter "resourceType": Empty, NULL, or not supplied 400 Bad Request HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1838: Invalid JSON content detected, missing required element: 'resourceType'
Body parameter "resourceType": A different value than 'Parameters' 400 Bad Request HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1684: Unknown resource name "<supplied value>" (this name is not known in FHIR version "R4")
Body parameter "meta": Empty, NULL, or Not supplied 400 Bad Request Parameters must contain a valid meta profile
Body parameter "meta.profile": Empty 400 Bad Request HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1821: [element="profile"] Invalid attribute value "": Attribute value must not be empty ("")
Body parameter "meta.profile": NULL 400 Bad Request Parameters must contain a valid meta profile
Body parameter "meta.profile": Not supplied 400 Bad Request Parameters must contain a valid meta profile
Body parameter "meta.profile": Wrong profile url value 422 Unprocessable Entity Profile reference 'https://fhir.cambio.se/StructureDefinition/ParametersHealthIssueReferenceSee/v1' has not been checked because it is unknown
Body parameter "parameter": Empty, NULL, or Not supplied 422 Unprocessable Entity Parameters.parameter: minimum required = 1, but only found 0 (from https://fhir.cambio.se/StructureDefinition/ParametersHealthIssueReferenceSe/v1)
Body parameter "parameter.name": Empty 400 Bad Request HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1821: [element="name"] Invalid attribute value "": Attribute value must not be empty ("")
Body parameter "parameter.name": NULL, or Not supplied 422 Unprocessable Entity Parameters.parameter.name: minimum required = 1, but only found 0 (from https://fhir.cambio.se/StructureDefinition/ParametersHealthIssueReferenceSe/v1)
Body parameter "parameter.name": A different value other than "HealthIssueReference" 422 Unprocessable Entity Value is '<supplied value>' but must be 'HealthIssueReference'
Body parameter "parameter.valueReference": Empty, or Not supplied 422 Unprocessable Entity inv-1: 'A parameter must have one and only one of (value, resource, part)' Rule 'A parameter must have one and only one of (value, resource, part)' Failed
Body parameter "parameter.valueReference.reference": Empty 400 Bad Request HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1821: [element="reference"] Invalid attribute value "": Attribute value must not be empty ("")
Body parameter "parameter.valueReference.reference": NULL, or Not supplied 422 Unprocessable Entity inv-1: 'A parameter must have one and only one of (value, resource, part)' Rule 'A parameter must have one and only one of (value, resource, part)' Failed
Body parameter "parameter.valueReference.reference": Not in the format 'Codition/hi-< id >' 400 Bad Request Invalid request: The supplied condition ID is not supported
Body parameter "parameter.valueReference.reference": Invalid input type 400 Bad Request HealthIssueReference must contain a valid reference
Body parameter "parameter.valueReference.reference": Health issue doesn't exist in Cosmic 400 Bad Request Invalid parameters: ConditionHealthIssueSe not found
Body parameter "parameter.valueReference.reference": Health issue status is not Ongoing or Closed. 400 Bad Request Invalid parameters: The supplied ConditionHealthIssueSe is not in Ongoing or Closed status
If the supplied journal note and the health issue do not belong to the same patient. 400 Bad Request Invalid parameters: Supplied QuestionnaireResponseSe and ConditionHealthIssueSe do not belong to the same patient
If a link already exist for the supplied health issue and journal note. 409 Conflict The supplied QuestionnaireResponse & ConditionHealthIssue are already linked
If an unsupported scope is supplied. 403 Forbidden -

For common codes, refer to Error handling section.