Skip to content

Commit

Permalink
DRS preference in File profile (#60)
Browse files Browse the repository at this point in the history
* ⚡ added DRS preference to File profile

* ♻️ created DRS Profile and allowed multiple attachments in NCPI File

* 🚧 fine-tuned the slicing rules for files with DRS
  • Loading branch information
a-l-holmes authored Oct 28, 2024
1 parent 613e922 commit 3613fe5
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion input/fsh/modules/files.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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: 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: #error

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 must-be-drs-uri

/** TODO Add Related file to metadata - AH 2024-07-30 */

Profile: NcpiFile
Expand Down Expand Up @@ -139,4 +153,20 @@ 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."
* 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 = 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
* content[DRS].attachment only DRSAttachment

0 comments on commit 3613fe5

Please sign in to comment.