SGHI FHIR Profile Implementation Guide
0.1.0 - ci-build

SGHI FHIR Profile Implementation Guide, published by Kathurima Kimathi. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/savannahghi/sil_fhir_profile_ig/ and changes regularly. See the Directory of published versions

## Data Type Profile: SGHI Attachment

Official URL: https://fhir.slade360.co.ke/fhir/StructureDefinition/attachment | Version: 0.1.0
Draft as of 2026-04-27 | Computable Name: SGHIAttachment

A custom document used for capturing the source of consent

Usages:

- Use this DataType Profile: SGHI Consent and SGHI Observation

You can also check for usages in the FHIR IG Statistics

### Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

- Key Elements Table
- Differential Table
- Snapshot Table
- Statistics/References
- All

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Attachment | C | 0..* | Attachment | Content in a format defined elsewhere Constraints: att-1
contentType | Σ C | 1..1 | code | Mime type of the content, with charset etc. Binding: MimeTypes (required): BCP 13 (RFCs 2045, 2046, 2047, 4288, 4289 and 2049) Required Pattern: application/json
url | Σ | 1..1 | url | Uri where the data can be found Example General: http://www.acme.com/logo-small.png
creation | Σ | 1..1 | dateTime | Date attachment was first created
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Attachment.contentType | Base | required | Mime Types | 📍5.0.0 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
att-1 | error | Attachment | If the Attachment has data, it SHALL have a contentType | `data.empty() or contentType.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`

This structure is derived from Attachment

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Attachment |  | 0..* | Attachment | Content in a format defined elsewhere
contentType |  | 1..1 | code | Mime type of the content, with charset etc. Required Pattern: application/json
url |  | 1..1 | url | Uri where the data can be found
creation |  | 1..1 | dateTime | Date attachment was first created
Documentation for this format

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Attachment | C | 0..* | Attachment | Content in a format defined elsewhere Constraints: att-1
id |  | 0..1 | id | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations Slice: Unordered, Open by value:url
contentType | Σ C | 1..1 | code | Mime type of the content, with charset etc. Binding: MimeTypes (required): BCP 13 (RFCs 2045, 2046, 2047, 4288, 4289 and 2049) Required Pattern: application/json
language | Σ | 0..1 | code | Human language of the content (BCP-47) Binding: AllLanguages (required): IETF language tag for a human language.
Additional Bindings | Purpose
CommonLanguages | Starter
Example General: en-AU
data | C | 0..1 | base64Binary | Data inline, base64ed
url | Σ | 1..1 | url | Uri where the data can be found Example General: http://www.acme.com/logo-small.png
size | Σ | 0..1 | integer64 | Number of bytes of content (if url provided)
hash | Σ | 0..1 | base64Binary | Hash of the data (sha-1, base64ed)
title | Σ | 0..1 | string | Label to display in place of the data Example General: Official Corporate Logo
creation | Σ | 1..1 | dateTime | Date attachment was first created
height |  | 0..1 | positiveInt | Height of the image in pixels (photo/video)
width |  | 0..1 | positiveInt | Width of the image in pixels (photo/video)
frames |  | 0..1 | positiveInt | Number of frames if > 1 (photo)
duration |  | 0..1 | decimal | Length in seconds (audio / video)
pages |  | 0..1 | positiveInt | Number of printed pages
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Attachment.contentType | Base | required | Mime Types | 📍5.0.0 | FHIR Std.
Attachment.language | Base | required | All Languages | 📍5.0.0 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
att-1 | error | Attachment | If the Attachment has data, it SHALL have a contentType | `data.empty() or contentType.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`

This structure is derived from Attachment

Summary

Mandatory: 3 elements

Key Elements View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Attachment | C | 0..* | Attachment | Content in a format defined elsewhere Constraints: att-1
contentType | Σ C | 1..1 | code | Mime type of the content, with charset etc. Binding: MimeTypes (required): BCP 13 (RFCs 2045, 2046, 2047, 4288, 4289 and 2049) Required Pattern: application/json
url | Σ | 1..1 | url | Uri where the data can be found Example General: http://www.acme.com/logo-small.png
creation | Σ | 1..1 | dateTime | Date attachment was first created
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Attachment.contentType | Base | required | Mime Types | 📍5.0.0 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
att-1 | error | Attachment | If the Attachment has data, it SHALL have a contentType | `data.empty() or contentType.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`

Differential View

This structure is derived from Attachment

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Attachment |  | 0..* | Attachment | Content in a format defined elsewhere
contentType |  | 1..1 | code | Mime type of the content, with charset etc. Required Pattern: application/json
url |  | 1..1 | url | Uri where the data can be found
creation |  | 1..1 | dateTime | Date attachment was first created
Documentation for this format

Snapshot View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Attachment | C | 0..* | Attachment | Content in a format defined elsewhere Constraints: att-1
id |  | 0..1 | id | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations Slice: Unordered, Open by value:url
contentType | Σ C | 1..1 | code | Mime type of the content, with charset etc. Binding: MimeTypes (required): BCP 13 (RFCs 2045, 2046, 2047, 4288, 4289 and 2049) Required Pattern: application/json
language | Σ | 0..1 | code | Human language of the content (BCP-47) Binding: AllLanguages (required): IETF language tag for a human language.
Additional Bindings | Purpose
CommonLanguages | Starter
Example General: en-AU
data | C | 0..1 | base64Binary | Data inline, base64ed
url | Σ | 1..1 | url | Uri where the data can be found Example General: http://www.acme.com/logo-small.png
size | Σ | 0..1 | integer64 | Number of bytes of content (if url provided)
hash | Σ | 0..1 | base64Binary | Hash of the data (sha-1, base64ed)
title | Σ | 0..1 | string | Label to display in place of the data Example General: Official Corporate Logo
creation | Σ | 1..1 | dateTime | Date attachment was first created
height |  | 0..1 | positiveInt | Height of the image in pixels (photo/video)
width |  | 0..1 | positiveInt | Width of the image in pixels (photo/video)
frames |  | 0..1 | positiveInt | Number of frames if > 1 (photo)
duration |  | 0..1 | decimal | Length in seconds (audio / video)
pages |  | 0..1 | positiveInt | Number of printed pages
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Attachment.contentType | Base | required | Mime Types | 📍5.0.0 | FHIR Std.
Attachment.language | Base | required | All Languages | 📍5.0.0 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
att-1 | error | Attachment | If the Attachment has data, it SHALL have a contentType | `data.empty() or contentType.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`

This structure is derived from Attachment

Summary

Mandatory: 3 elements

Other representations of profile: CSV, Excel, Schematron