---
title: "Entity: Diagnosis Web Specification"
canonical: "https://wiki.patientsknowbest.com/space/api/3923771393/Entity%3A%20Diagnosis%20Web%20Specification"
format: markdown
---
> Macro (toc)

# Overview

This page provides more detail on how the web interface displays diagnosis information, which it fetches from the Aggregated FHIR API. Note:

- Whilst this page explains which elements are inspected, the web interface does not provide any feedback about which/whether other FHIR elements are present in the database that are not being displayed.

The [Manual provides more information](https://manual.patientsknowbest.com/patient/diagnoses) on the functionality; this page is aimed at a technical audience who need to understand the relationship between the FHIR resources and the web interface.

# FHIR® Resources

The web interface populates Diagnoses from the following FHIR resources:

- [Condition](https://www.hl7.org/fhir/R4/condition.html)

# Summary

The web interface shows a list of diagnoses. These are separated into “Current” and “Past”.

A diagnosis is shown in the past list if either of the following are true:

- The status value is inactive (calculated as: clinicalStatus.coding[0].code equal to “inactive”)
- There is a populated end timestamp which is in the past

The PKB web interface will only show Condition resources which have a populated Condition.category element.

# Mappings

| **Component** | **Condition** |
| --- | --- |
| **Diagnosis** | - <span style="color: #ff991f">If code.text is populated:</span> the same text
- <span style="color: #ff991f">else:</span> if a Coding is present and contains the [http://fhir.patientsknowbest.com/structuredefinition/primary-coding](http://fhir.patientsknowbest.com/structuredefinition/primary-coding) extension: the display of the same Coding
- <span style="color: #ff991f">else:</span> the first populated code.coding[x].display
- <span style="color: #ff991f">else:</span> the empty string |
| **Start** | <span style="color: #ff991f">If onsetDateTime is present:</span> the same<br><span style="color: #ff991f">Else if onsetPeriod is present:</span> onsetPeriod.start |
| **End** | <span style="color: #ff991f">If abatementDateTime is present:</span> the same<br><span style="color: #ff991f">Else if onsetPeriod is present:</span> onsetPeriod.end |
| **Details** | note[0].text |
| **Date asserted** | recordedDate |