Swedish Healthcare Service - Health Condition Description
0.1.0 - CI Build Sweden

Swedish Healthcare Service - Health Condition Description - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

GetDiagnosis

GetDiagnosis Service

Overview

Service Name: GetDiagnosis
Version: 2.0
Domain: clinicalprocess:healthcond:description
Purpose: Retrieves registered diagnoses for a patient

Description

The GetDiagnosis service provides access to all diagnoses that have been registered for a patient in Swedish healthcare systems. This includes primary diagnoses, secondary diagnoses, and related diagnostic information.

Service Interface

Request Parameters

The service accepts the following parameters to filter and retrieve diagnoses:

Parameter Cardinality Type Description
patientId 1..1 PatientId Required. Patient identifier (personnummer or samordningsnummer, 12 characters without separator)
careUnitHSAId 0..* string Filter results to specific care units using HSA-ID
timePeriod 0..1 TimePeriod Limit search to diagnoses within a specific time period
sourceSystemHSAId 0..1 string Filter to specific source system
careContactId 0..* string Filter to specific care contacts

Response Structure

The service returns zero or more diagnoses matching the request criteria. Each diagnosis contains:

  • Diagnosis Header: Metadata about the diagnosis (document ID, source system, patient ID, accountable professional)
  • Diagnosis Body: The actual diagnosis information including code, text, and clinical details
  • Legal Authenticator (optional): Information about who signed/authenticated the diagnosis

See the Logical Models for complete structure definitions.

Business Rules

  1. Patient Identification: Patient must be identified using valid Swedish personnummer or samordningsnummer
  2. Time Period: If specified, only diagnoses with validity periods overlapping the search period are returned
  3. Care Unit Filter: If specified, only diagnoses registered by the specified care units are returned
  4. Legitimate Relationship: Healthcare professional must have a legitimate relationship to access patient data
  5. Audit Logging: All access is logged for security audit purposes

Use Cases

Primary Use Case: Retrieve All Diagnoses for Patient

Healthcare professional needs to see all registered diagnoses for a patient to understand their complete medical history.

Request Example:

patientId: 191212121212
patientId.type: 1.2.752.129.2.1.3.1 (Swedish personnummer)

Use Case: Retrieve Recent Diagnoses

Retrieve diagnoses registered within the last year.

Request Example:

patientId: 191212121212
timePeriod.start: 20240101
timePeriod.end: 20241231

Use Case: Retrieve Diagnoses from Specific Care Unit

Retrieve diagnoses registered by a specific care unit.

Request Example:

patientId: 191212121212
careUnitHSAId: SE2321000016-1234

Data Quality Requirements

  • Diagnoses must be coded according to ICD-10-SE (Swedish version of ICD-10)
  • Each diagnosis must have an accountable healthcare professional
  • Document ID must be unique within the source system
  • Time stamps must be in YYYYMMDDHHmmss format

Error Handling

The service may return the following error conditions:

  • Patient not found: No patient with the specified ID exists
  • No diagnoses found: Patient exists but no diagnoses match the search criteria
  • Access denied: Healthcare professional lacks legitimate relationship
  • Invalid input: Request parameters are malformed or invalid

Interaction Flow

The GetDiagnosis service follows the standard request-response pattern:

Consumer                    Aggregator/Producer
   |                               |
   |------- GetDiagnosis --------->|
   |        (SOAP Request)          |
   |                               |
   |<------ Response --------------|
   |   (Diagnosis Collection)      |
   |                               |

When using an aggregator, the flow includes parallel queries:

Consumer          Aggregator           EI          Source Systems
   |                  |                 |              |
   |-- GetDiagnosis ->|                 |              |
   |                  |-- Query EI ---->|              |
   |                  |<- HSA-IDs ------|              |
   |                  |                                |
   |                  |--------- Parallel Queries ---->|
   |                  |                 |         System A
   |                  |                 |         System B
   |                  |                 |         System C
   |                  |<-------- Responses ------------|
   |                  |                 |              |
   |<- Aggregated ----|                 |              |
   |    Response      |                 |              |

Message Examples

Request Example

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:add="http://www.w3.org/2005/08/addressing"
               xmlns:ns="urn:riv:clinicalprocess:healthcond:description:GetDiagnosisResponder:2">
  <soap:Header>
    <add:To>https://aggregator.example.se/GetDiagnosis/2</add:To>
    <add:Action>urn:riv:clinicalprocess:healthcond:description:GetDiagnosisResponder:2:GetDiagnosis</add:Action>
    <add:MessageID>urn:uuid:12345678-1234-1234-1234-123456789abc</add:MessageID>
    <urn:LogicalAddress xmlns:urn="urn:riv:itintegration:registry:1">SE2321000016-1234</urn:LogicalAddress>
  </soap:Header>
  <soap:Body>
    <ns:GetDiagnosis>
      <ns:patientId>
        <ns:id>197001011234</ns:id>
        <ns:type>1.2.752.129.2.1.3.1</ns:type>
      </ns:patientId>
      <ns:timePeriod>
        <ns:start>20240101</ns:start>
        <ns:end>20241231</ns:end>
      </ns:timePeriod>
      <ns:careUnitHSAId>SE2321000016-5678</ns:careUnitHSAId>
    </ns:GetDiagnosis>
  </soap:Body>
</soap:Envelope>

Response Example

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:ns="urn:riv:clinicalprocess:healthcond:description:GetDiagnosisResponder:2">
  <soap:Body>
    <ns:GetDiagnosisResponse>
      <ns:result>
        <ns:resultCode>OK</ns:resultCode>
        <ns:message>Successfully retrieved 2 diagnoses</ns:message>
      </ns:result>
      <ns:diagnosis>
        <ns:diagnosisHeader>
          <ns:documentId>d12345-2024</ns:documentId>
          <ns:sourceSystemHSAId>SE2321000016-1234</ns:sourceSystemHSAId>
          <ns:documentTime>20240315101500</ns:documentTime>
          <ns:patientId>
            <ns:id>197001011234</ns:id>
            <ns:type>1.2.752.129.2.1.3.1</ns:type>
          </ns:patientId>
          <ns:accountableHealthcareProfessional>
            <ns:healthcareProfessionalHSAId>SE2321000016-A123</ns:healthcareProfessionalHSAId>
            <ns:healthcareProfessionalName>Dr. Anna Andersson</ns:healthcareProfessionalName>
          </ns:accountableHealthcareProfessional>
        </ns:diagnosisHeader>
        <ns:diagnosisBody>
          <ns:diagnosisCode>
            <ns:code>I10</ns:code>
            <ns:codeSystem>1.2.752.116.1.1.1.1.3</ns:codeSystem>
            <ns:displayName>Essentiell (primär) hypertoni</ns:displayName>
          </ns:diagnosisCode>
          <ns:typeOfDiagnosis>Huvuddiagnos</ns:typeOfDiagnosis>
          <ns:diagnosisText>Hypertoni, välinställd</ns:diagnosisText>
        </ns:diagnosisBody>
      </ns:diagnosis>
      <ns:diagnosis>
        <ns:diagnosisHeader>
          <ns:documentId>d12346-2024</ns:documentId>
          <ns:sourceSystemHSAId>SE2321000016-1234</ns:sourceSystemHSAId>
          <ns:documentTime>20240815143000</ns:documentTime>
          <ns:patientId>
            <ns:id>197001011234</ns:id>
            <ns:type>1.2.752.129.2.1.3.1</ns:type>
          </ns:patientId>
          <ns:accountableHealthcareProfessional>
            <ns:healthcareProfessionalHSAId>SE2321000016-A123</ns:healthcareProfessionalHSAId>
            <ns:healthcareProfessionalName>Dr. Anna Andersson</ns:healthcareProfessionalName>
          </ns:accountableHealthcareProfessional>
        </ns:diagnosisHeader>
        <ns:diagnosisBody>
          <ns:diagnosisCode>
            <ns:code>E11</ns:code>
            <ns:codeSystem>1.2.752.116.1.1.1.1.3</ns:codeSystem>
            <ns:displayName>Typ 2-diabetes mellitus</ns:displayName>
          </ns:diagnosisCode>
          <ns:typeOfDiagnosis>Bidiagnos</ns:typeOfDiagnosis>
          <ns:diagnosisText>Typ 2 diabetes, HbA1c 48 mmol/mol</ns:diagnosisText>
        </ns:diagnosisBody>
      </ns:diagnosis>
    </ns:GetDiagnosisResponse>
  </soap:Body>
</soap:Envelope>

Technical Notes

  • Endpoint Pattern: /clinicalprocess/healthcond/description/GetDiagnosis/2
  • Protocol: HTTPS
  • Message Format: XML (SOAP envelope)
  • Character Encoding: UTF-8