From c4d8e29916d62c837a7bb5b21b95b0f87a01a44e Mon Sep 17 00:00:00 2001 From: Ann Holmes Date: Mon, 30 Sep 2024 13:07:39 -0400 Subject: [PATCH 1/3] :zap: added DRS preference to File profile --- input/fsh/modules/files.fsh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/input/fsh/modules/files.fsh b/input/fsh/modules/files.fsh index 9dd9d9968..7a4d9a2cb 100644 --- a/input/fsh/modules/files.fsh +++ b/input/fsh/modules/files.fsh @@ -111,6 +111,20 @@ Description: "Provides a list of hashes for confirming file transfers" * extension contains HashType named hash-type 1..1 * extension[hash-type] ^short = "Algorithm used to calculate the hash (and size, where applicable)" +Invariant: drs-uri-preferred +Description: "attachment.url must start with ^drs://. A drs:// hostname-based URI, as defined in the DRS documentation, that tells clients how to access this object. The intent of this field is to make DRS objects self-contained, and therefore easier for clients to store and pass around. For example, if you arrive at this DRS JSON by resolving a compact identifier-based DRS URI, the `self_uri` presents you with a hostname and properly encoded DRS ID for use in subsequent `access` endpoint calls." +Expression: "$this.url.matches('^drs://.*')" +Severity: #warning + +Profile: DRSAttachment +Parent: Attachment +Id: ncpi-drs-attachment +Title: "DRS Attachment" +Description: "A FHIR Attachment with a DRS url." +* ^version = "0.1.0" +* ^status = #draft +* obeys drs-uri-preferred + /** TODO Add Related file to metadata - AH 2024-07-30 */ Profile: NcpiFile @@ -126,8 +140,9 @@ Description: "Information about a file related to a research participant" * subject ^short = "The participant(s) for whom this file contains data (i.e., ParticipantID)" * extension contains FileFormat named file-format 1..1 /*File Format*/ * extension[file-format] ^short = "The file format used (EDAM is preferred)" -* content.attachment.url 1..1 /*Location uri*/ -* content.attachment.url ^short = "The URI at which this data can be accessed" +* content.attachment only DRSAttachment +* content.attachment 1..1 /*Location uri*/ +* content.attachment ^short = "The URI at which this data can be accessed" * extension contains LocationAccess named location-access 0..* /*Location Access Policy*/ * extension[location-access] ^short = "If present, only those under the specific Access Policy can access the file in this location." * extension contains FileSize named file-size 1..1 /*File Size*/ From 63b64abf11e3f0d2fda95aec691e174f669f54dd Mon Sep 17 00:00:00 2001 From: Ann Holmes Date: Tue, 1 Oct 2024 14:43:18 -0400 Subject: [PATCH 2/3] :recycle: created DRS Profile and allowed multiple attachments in NCPI File --- input/fsh/modules/files.fsh | 41 ++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/input/fsh/modules/files.fsh b/input/fsh/modules/files.fsh index 7a4d9a2cb..0bed64edd 100644 --- a/input/fsh/modules/files.fsh +++ b/input/fsh/modules/files.fsh @@ -111,10 +111,10 @@ Description: "Provides a list of hashes for confirming file transfers" * extension contains HashType named hash-type 1..1 * extension[hash-type] ^short = "Algorithm used to calculate the hash (and size, where applicable)" -Invariant: drs-uri-preferred +Invariant: must-be-drs-uri Description: "attachment.url must start with ^drs://. A drs:// hostname-based URI, as defined in the DRS documentation, that tells clients how to access this object. The intent of this field is to make DRS objects self-contained, and therefore easier for clients to store and pass around. For example, if you arrive at this DRS JSON by resolving a compact identifier-based DRS URI, the `self_uri` presents you with a hostname and properly encoded DRS ID for use in subsequent `access` endpoint calls." Expression: "$this.url.matches('^drs://.*')" -Severity: #warning +Severity: #error Profile: DRSAttachment Parent: Attachment @@ -123,7 +123,7 @@ Title: "DRS Attachment" Description: "A FHIR Attachment with a DRS url." * ^version = "0.1.0" * ^status = #draft -* obeys drs-uri-preferred +* obeys must-be-drs-uri /** TODO Add Related file to metadata - AH 2024-07-30 */ @@ -140,9 +140,16 @@ Description: "Information about a file related to a research participant" * subject ^short = "The participant(s) for whom this file contains data (i.e., ParticipantID)" * extension contains FileFormat named file-format 1..1 /*File Format*/ * extension[file-format] ^short = "The file format used (EDAM is preferred)" -* content.attachment only DRSAttachment -* content.attachment 1..1 /*Location uri*/ -* content.attachment ^short = "The URI at which this data can be accessed" +* content.attachment.url 1..1 /*Location uri*/ +* content.attachment.url ^short = "The URI at which this data can be accessed" +* content ^slicing.discriminator.type = #pattern +* content ^slicing.discriminator.path = "code" +* content ^slicing.rules = #openAtEnd +* content ^slicing.ordered = false +* content ^slicing.description = "Slicing pattern to make content.attachment require a DRS file type and allow other file types" +* content contains + AdditionalFile 0..* +* content[AdditionalFile].attachment only Attachment * extension contains LocationAccess named location-access 0..* /*Location Access Policy*/ * extension[location-access] ^short = "If present, only those under the specific Access Policy can access the file in this location." * extension contains FileSize named file-size 1..1 /*File Size*/ @@ -154,4 +161,24 @@ Description: "Information about a file related to a research participant" * description ^short = "A description of the file" * type 0..1 /*File Type*/ * type from edam-ontology-terms (extensible) -* type ^short = "The type of data contained in this file." \ No newline at end of file +* type ^short = "The type of data contained in this file." + +Profile: NcpiDRSFile +Parent: NcpiFile +Id: ncpi-drs-file +Title: "NCPI DRS File" +Description: "Information about a DRS file related to a research participant" +* ^version = "0.0.1" +* ^status = #draft +* content ^slicing.discriminator.type = #pattern +* content ^slicing.discriminator.path = "code" +* content ^slicing.rules = #openAtEnd +* content ^slicing.ordered = false +* content ^slicing.description = "Slicing pattern to make content.attachment require a DRS file type and allow other file types" +* content contains + DRS 1..1 and + Other 0..* +* content[DRS].attachment only DRSAttachment +//* content[DRS].profile only +* content[Other].attachment only Attachment +//* content[Other]. only uri \ No newline at end of file From 6936d856fdf21e9521008a6efb2ed0d6520c419c Mon Sep 17 00:00:00 2001 From: Ann Holmes Date: Thu, 3 Oct 2024 16:07:17 -0400 Subject: [PATCH 3/3] :construction: fine-tuned the slicing rules for files with DRS --- input/fsh/modules/files.fsh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/input/fsh/modules/files.fsh b/input/fsh/modules/files.fsh index 0bed64edd..384dd4caf 100644 --- a/input/fsh/modules/files.fsh +++ b/input/fsh/modules/files.fsh @@ -142,14 +142,6 @@ Description: "Information about a file related to a research participant" * extension[file-format] ^short = "The file format used (EDAM is preferred)" * content.attachment.url 1..1 /*Location uri*/ * content.attachment.url ^short = "The URI at which this data can be accessed" -* content ^slicing.discriminator.type = #pattern -* content ^slicing.discriminator.path = "code" -* content ^slicing.rules = #openAtEnd -* content ^slicing.ordered = false -* content ^slicing.description = "Slicing pattern to make content.attachment require a DRS file type and allow other file types" -* content contains - AdditionalFile 0..* -* content[AdditionalFile].attachment only Attachment * extension contains LocationAccess named location-access 0..* /*Location Access Policy*/ * extension[location-access] ^short = "If present, only those under the specific Access Policy can access the file in this location." * extension contains FileSize named file-size 1..1 /*File Size*/ @@ -173,12 +165,8 @@ Description: "Information about a DRS file related to a research participant" * content ^slicing.discriminator.type = #pattern * content ^slicing.discriminator.path = "code" * content ^slicing.rules = #openAtEnd -* content ^slicing.ordered = false +* content ^slicing.ordered = true * content ^slicing.description = "Slicing pattern to make content.attachment require a DRS file type and allow other file types" * content contains - DRS 1..1 and - Other 0..* -* content[DRS].attachment only DRSAttachment -//* content[DRS].profile only -* content[Other].attachment only Attachment -//* content[Other]. only uri \ No newline at end of file + DRS 1..1 +* content[DRS].attachment only DRSAttachment \ No newline at end of file