---
title: "Facade Communication"
canonical: "https://wiki.patientsknowbest.com/space/api/3365011756/Facade%20Communication"
format: markdown
---
[http://fhir.patientsknowbest.com/structuredefinition/facade-communication](http://fhir.patientsknowbest.com/structuredefinition/facade-communication)

[https://www.hl7.org/fhir/STU3/communication.html](https://www.hl7.org/fhir/STU3/communication.html)

## Overview

A [[Message]] from a [[Conversation]] is represented in our FHIR API as a Communication.

These are normally human-authored but can sometimes be generated in other situations, e.g. when a patient completes a consultation.

Note: messages still in draft (i.e. not yet sent) will not be returned.

## Relevant PKB entities

- [[[Conversation]]](https://wiki.patientsknowbest.com/space/api/3744628737/Entity%3A+Conversation)
- [[[Message]]](https://wiki.patientsknowbest.com/space/api/3744628737/Entity%3A+Conversation)

## Mappings

| **FHIR** | **PKB** | **Notes** |
| --- | --- | --- |
| Resource id | [[Message.Data Point ID]] |  |
| Resource meta | - meta: Meta
  - lastUpdated = [[Data Point.Persisted Timestamp]]
  - security: Coding
    - system = "[http://fhir.patientsknowbest.com/codesystem/privacy-label](http://fhir.patientsknowbest.com/codesystem/privacy-label)"
    - code = [[Data Point.Privacy Label]]<br>[[Data Point.Privacy Label]] code mappings (PKB → FHIR):<br>- GENERAL_HEALTH → GENERAL_HEALTH
- MENTAL_HEALTH → MENTAL_HEALTH
- SEXUAL_HEALTH → SEXUAL_HEALTH
- SOCIAL_CARE → SOCIAL_CARE |  |
| Communication.extension | - extension[0]: Extension
  - url =  "[http://fhir.patientsknowbest.com/structuredefinition/communication-title](http://fhir.patientsknowbest.com/structuredefinition/communication-title)"
  - valueString = [[Message.Subject]]
- extension[1]: Extension
  - url =  "[http://fhir.patientsknowbest.com/structuredefinition/conversation-id](http://fhir.patientsknowbest.com/structuredefinition/conversation-id)"
  - valueString = [[Message->Conversation.Conversation ID]] |  |
| Communication.status | "unknown" |  |
| Communication.subject | - subject: Reference
  - reference = the relative URL of the Patient resource
  - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]] |  |
| Communication.recipient | For each [[Message->Recipient]] who was not the Communication.sender, add an entry to the recipient list.<br>- recipient: Reference
  - reference = <conditional>
  - If Recipient is a Professional or a Team Coordinator:
    - reference = the relative URL of the Practitioner resource
    - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]]
  - Else if Recipient is a Patient: <conditional>
    - If Recipient is same as Communication.subject:
      - reference = the relative URL of the Patient resource
      - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]]
    - Else:
      - reference = a reference to a contained RelatedPerson instance (see RelatedPerson mappings)
      - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]] |  |
| Communication.sent | [[Message.Timestamp]] |  |
| Communication.sender | - sender: Reference
  - reference = <conditional>
  - If [[Message.Sender]] is a Professional or a Team Coordinator:
    - reference = the relative URL of the Practitioner resource
    - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]]
  - Else if [[Message.Sender]] is a Patient: <conditional>
    - If [[Message.Sender]] is same as Communication.subject:
      - reference = the relative URL of the Patient resource
      - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]]
    - Else:
      - reference = a reference to a contained RelatedPerson instance (see RelatedPerson mappings)
      - display = [[User.Title]] [[User.Given Name]] [[User.Family Name]] |  |
| Communication.payload | For each [[Attachment]], add an entry to the payload list:<br>- payload: BackboneElement
  - contentAttachment: Attachment
    - title = [[Attachment.Filename]]
    - creation = [[Message.Persisted Timestamp]] | Only attachment metadata is returned; the content of any attachments, or of the message itself, is not currently returned. |