From 452563dcf88c3c0270eaee4053ac866367039c2a Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Tue, 26 Nov 2024 14:06:34 -0500 Subject: [PATCH 1/2] Add two attachment-focused metrics - c_attachment_count: looks at attachment metadata - c_content_type_use: looks at content types available among resources --- metrics.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/metrics.md b/metrics.md index f503459..bd88888 100644 --- a/metrics.md +++ b/metrics.md @@ -572,6 +572,57 @@ Choice elements: Notes: - These are the choice fields in US Core, but could use the FHIR definitions to create a full list, or could do a more general query based on JSON key prefix (not supported by all databases and potentially slow even where supported) +### c_attachment_count +**[structure]** Survey of attachment data and formats + +Stratified +by [status](#by-status), +by content type, +by language, +by presence of data and/or URL fields, +by format (when applicable). + +| Resource Type | Element | +|-------------------|---------------| +| DiagnosticReport | presentedForm | +| DocumentReference | content | + +Notes: +- This metric counts _attachments_ inside resources and their associated metadata. + Most other metrics count resources, but this one is looking at each attachment. + Only the status field is taken from the outer resource. +- When examining the content type, you should strip off extra info like charset + information (e.g. `text/plain; charset=utf8`) since the primary focus here is on + available MIME types. +- Only DocumentReference has a `format` field associated with the attachment. + +### c_content_type_use +**[structure]** Distribution of content types among attachment resources + +Stratified +by [status](#by-status), +by content types, +by document type, +by document status (when applicable). + +| Resource Type | Attachment Element | Document Type Element | +|-------------------|--------------------|-----------------------| +| DiagnosticReport | presentedForm | code | +| DocumentReference | content | type | + +Notes: +- Present all the content types available for a given resource. + That is, if a resource has both text/plain and text/html content types, present both. +- When examining the content type, you should strip off extra info like charset + information (e.g. `text/plain; charset=utf8`) since the primary focus here is on + available MIME types. +- If neither `data` nor `url` fields are present in an attachment, + that means there is no content available for the given content type & language. + Thus, you should skip that attachment when surfacing content types. + (See the `att-1` constraint for + [Attachments](https://www.hl7.org/fhir/R4/datatypes.html#Attachment).) +- Only DocumentReference has a `docStatus` field. + ## Stratification Many metrics will require stratification by date or category or resource type. From cce88d2626903af22c88cccea4dcbfc1aea40a00 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Wed, 27 Nov 2024 16:01:49 -0500 Subject: [PATCH 2/2] Review feedback --- metrics.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/metrics.md b/metrics.md index bd88888..aff7584 100644 --- a/metrics.md +++ b/metrics.md @@ -573,7 +573,7 @@ Notes: - These are the choice fields in US Core, but could use the FHIR definitions to create a full list, or could do a more general query based on JSON key prefix (not supported by all databases and potentially slow even where supported) ### c_attachment_count -**[structure]** Survey of attachment data and formats +**[structure]** Count of attachment metadata Stratified by [status](#by-status), @@ -591,16 +591,18 @@ Notes: - This metric counts _attachments_ inside resources and their associated metadata. Most other metrics count resources, but this one is looking at each attachment. Only the status field is taken from the outer resource. -- When examining the content type, you should strip off extra info like charset - information (e.g. `text/plain; charset=utf8`) since the primary focus here is on - available MIME types. +- Normalize content types for better comparison. + - Strip off extra info like charset information (e.g. `text/plain; charset=utf8`) + since the primary focus here is on available MIME types. + - Convert to lowercase, since MIME types are case-insensitive. - Only DocumentReference has a `format` field associated with the attachment. ### c_content_type_use -**[structure]** Distribution of content types among attachment resources +**[structure]** Count of resources by attachment content types Stratified by [status](#by-status), +by [year](#by-date). by content types, by document type, by document status (when applicable). @@ -611,11 +613,13 @@ by document status (when applicable). | DocumentReference | content | type | Notes: -- Present all the content types available for a given resource. - That is, if a resource has both text/plain and text/html content types, present both. -- When examining the content type, you should strip off extra info like charset - information (e.g. `text/plain; charset=utf8`) since the primary focus here is on - available MIME types. +- Normalize content types for better comparison. + - Strip off extra info like charset information (e.g. `text/plain; charset=utf8`) + since the primary focus here is on available MIME types. + - Convert to lowercase, since MIME types are case-insensitive. +- If a resource has multiple content types, present them all. + - Remove duplicates (a resource might have the same content type in multiple languages). + - Sort multiple content types in ascending alphabetical order. - If neither `data` nor `url` fields are present in an attachment, that means there is no content available for the given content type & language. Thus, you should skip that attachment when surfacing content types.