---
title: "Aggregated ValueSet"
canonical: "https://wiki.patientsknowbest.com/space/api/3711172639/Aggregated%20ValueSet"
format: markdown
---
[http://fhir.patientsknowbest.com/structuredefinition/aggregated-valueset](http://fhir.patientsknowbest.com/structuredefinition/aggregated-valueset)

[https://www.hl7.org/fhir/R4/valueset.html](https://www.hl7.org/fhir/R4/valueset.html) 

## Description

This profile is…

- a description of how non-FHIR reference sets will be mapped to FHIR in the [Aggregated FHIR endpoint](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/3364388935) by PKB

This profile is not…

- a spec for all ValueSet resources returned from the Aggregated FHIR endpoint; resources sent to a Customer FHIR endpoint are not guaranteed to conform to this profile
- a spec describing how ValueSet resources must be sent to a Customer FHIR endpoint; some of the elements used in this profile might only be meaningful for migrated data and cannot be provided to a Customer FHIR endpoint

## Overview

ValueSet resources are generated from 2 types of PKB reference information:

- Each [[Reference Set]], which groups together multiple [[Reference Datum]] values, will have its own ValueSet created.
- Each [[Coding Match]] has a dedicated ValueSet created containing just the single code from that entry.

## Relevant PKB entities

- [[[Reference Set]] / [[Reference Datum]]](https://wiki.patientsknowbest.com/space/api/3765338113/Entity%3A+Reference+Datum)
- [[[Coding Match]]](https://pkbdev.atlassian.net/wiki/spaces/api/pages/3765338113/Entity+Reference+Datum+Coding+Match)

| **FHIR** | **Reference Set / Reference Datum** | **Coding Match** | **Notes** |
| --- | --- | --- | --- |
| Resource id | [[Reference Set.Aggregated ID]] | [[Coding Match.Aggregated ID]] |  |
| Resource meta |  |  |  |
| url | Generated in the form:<br>http://fhir.patientsknowbest.com/valueset/specialty-[[Reference Set->Organisation.Code]]-[[Reference Set.Type]] | Generated in the form:<br>http://fhir.patientsknowbest.com/valueset/specialty/[[Coding Match.System]]/[[Coding Match.Code]] |  |
| status | <span style="color: #0747a6">“active”</span> | <span style="color: #0747a6">“active”</span> |  |
| compose | - include: BackboneElement
  - system = Generated in the form:
    http://fhir.patientsknowbest.com/codesystem/specialty-[[Reference Set->Organisation.Code]]-[[Reference Set.Type]]
  - For each [[Reference Datum]] being grouped:
  - concept: BackboneElement
    - extension[x]: Extension
      - url = “[http://fhir.patientsknowbest.com/structuredefinition/privacy-label“](#)
      - valueCoding: Coding
        - system = “[http://fhir.patientsknowbest.com/codesystem/privacy-label”](#)
        - code = [[Reference Datum.Privacy Label]]
    - code = [[Reference Datum.Value]]
    - display = [[Reference Datum.Text]] | - include: BackboneElement
  - <span style="color: #ff991f"><conditional></span>
  - <span style="color: #ff991f">If [[Coding Match.Exclude]] is true:</span>
  - extension[x]: Extension
    - url = “[http://fhir.patientsknowbest.com/structuredefinition/sensitive-exclusion-code”](#)
    - valueBoolean = true
  - <span style="color: #ff991f">Else: omit the extension</span>
  - system = Generated in the form: http://fhir.patientsknowbest.com/codessytem/specialty/[[Coding Match.System]]/[[Coding Match.Code]]
  - concept: BackboneElement
    - extension[x]: Extension
      - url = “[http://fhir.patientsknowbest.com/structuredefinition/privacy-label“](#)
      - valueCoding: Coding
        - system = “[http://fhir.patientsknowbest.com/codesystem/privacy-label”](#)
        - code = [[Coding Match.Privacy Label]]
    - extension[x]: Extension
      - url = “[http://fhir.patientsknowbest.com/structuredefinition/data-type”](#)
      - valueCoding: Coding
        - system = “[http://fhir.patientsknowbest.com/codesystem/data-type”](#)
        - code = [[Coding Match.Type]]
    - code = [[Coding Match.Code]]
    - display = [[Coding Match.Text]] |  |