### Example: SetContext Rule Set with Parameter Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of a parameterized rule set named 'SetContext' that takes a 'path' parameter. This rule set defines how to set the context of an extension, using the parameter for the expression value. The example also shows how to insert this rule set with different resource types. ```fsh RuleSet: SetContext(path) * ^context[+].type = #element * ^context[=].expression = "{path}" // Applying the rule set: * insert SetContext(Procedure) * insert SetContext(MedicationRequest) * insert SetContext(MedicationAdministration) // Expanded equivalent: * ^context[+].type = #element * ^context[=].expression = "Procedure" * ^context[+].type = #element * ^context[=].expression = "MedicationRequest" * ^context[+].type = #element * ^context[=].expression = "MedicationAdministration" // Interpreted soft indices: * ^context[0].type = #element * ^context[0].expression = "Procedure" * ^context[1].type = #element * ^context[1].expression = "MedicationRequest" * ^context[2].type = #element * ^context[2].expression = "MedicationAdministration" ``` -------------------------------- ### FSH Caret Path Example: ElementDefinition.binding.description Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example demonstrating how to specify a path to an ElementDefinition's property, specifically targeting the 'binding.description' of the 'communication.language' element within a Patient profile. ```fsh communication.language ^binding.description ``` -------------------------------- ### FSH Reference Syntax Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Provides examples of how to represent references to FHIR resources and profiles in FSH, including references by name, ID, or URL, and handling of reference choices. ```FSH Reference(USCorePatientProfile) Reference(us-core-patient) Reference(http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient) Reference(Patient or Group) Reference(JaneDoe) ``` -------------------------------- ### FSH Caret Path Example: StructureDefinition.experimental Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference A concrete example showing how to use the caret path syntax in an FSH profile definition to access the 'experimental' attribute of the StructureDefinition resource. ```fsh ^experimental ``` -------------------------------- ### FSH Code and Coding Syntax Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Examples of FSH syntax for defining codes and codings. This includes simple codes, codes with whitespace, and full Coding definitions with code system, version, code, and display. ```FSH #postal ``` ```FSH #<= ``` ```FSH #"VL 1-1, 18-65_1.2.2" ``` ```FSH http://snomed.info/sct#363346000 "Malignant neoplastic disease (disorder)" ``` ```FSH $SCT#363346000 "Malignant neoplastic disease (disorder)" ``` ```FSH $ICD#C004 "Malignant neoplasm of lower lip, inner aspect" ``` ```FSH http://hl7.org/fhir/CodeSystem/example-supplement|201801103#chol-mmol ``` -------------------------------- ### Examples of Assigning CodeableConcept in FSH Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Provides concrete examples of assigning a CodeableConcept, including using the shortcut, explicit array index, and adding multiple Codings to the array. It also shows how to set the text attribute. ```FSH * myCodeableConcept = $SCT#363346000 "Malignant neoplastic disease (disorder)" * myCodeableConcept.coding[0] = $SCT#363346000 "Malignant neoplastic disease (disorder)" * myCodeableConcept.coding = $SCT#363346000 "Malignant neoplastic disease (disorder)" * myCodeableConcept.coding[1] = $ICD#C80.1 "Malignant (primary) neoplasm, unspecified" * myCodeableConcept.text = "Diagnosis of malignant neoplasm left breast." ``` -------------------------------- ### Example: Inserting a Simple Rule Set into a Profile (FHIR Shorthand) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example showing the insertion of a rule set named 'RuleSet1' into a FHIR profile definition. This illustrates how to reuse common rules across different profiles. ```fhir-shorthand Profile: MyPatientProfile Parent: Patient Id: my-patient-profile Title: "My Patient Profile" Description: "An example patient profile." * insert RuleSet1 * deceased[x] only boolean // More profile rules ``` -------------------------------- ### FSH Example: Add String Element Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference A basic example of adding a string-typed element named 'email' with a cardinality of 0 or more and a short description. This demonstrates the fundamental structure of an add element rule. ```fsh * email 0..* string "The person's email addresses" ``` -------------------------------- ### FSH Rule: Flag Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates applying flags to one or more elements. ```FSH * {flag(s)} ``` -------------------------------- ### FSH Rule: Insert Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows how to insert a predefined RuleSet, with or without parameters, into the current context or a specific element. ```FSH * insert {RuleSet} * insert {RuleSet}({parameter1}, {parameter2}, ...) * insert {RuleSet}({parameter1}, {parameter2}, ...) ``` -------------------------------- ### FSH Canonical Reference Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Examples demonstrating how to use the Canonical() function in FSH to reference FHIR resources by their canonical URLs. It shows referencing by name/ID/URL, within the same project, and with specific versions. ```FSH Canonical(yesnodontknow) ``` ```FSH Canonical(ExampleValueSet) ``` ```FSH Canonical(us-core-allergyintolerance|3.1.1) ``` ```FSH Canonical(ActivityDefinition or PlanDefinition) ``` -------------------------------- ### FSH Quantity Shorthand Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Examples illustrating the FSH shorthand for defining Quantity values. This covers using UCUM codes for units and specifying units via code systems like NCI Thesaurus. ```FSH 155.0 '[lb_av]' "lb" ``` ```FSH 155.0 http://ncithesaurus-stage.nci.nih.gov#C48531 "Pound" ``` -------------------------------- ### Define US Core Patient Instance (FSH) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Defines an example instance of a US Core Patient profile. It specifies the instance name, the profile it adheres to, a title, usage as an example, and populates key fields like name, birthDate, and race/ethnicity extensions. ```fsh Instance: EveAnyperson InstanceOf: http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient Title: "Eve Anyperson" Usage: #example * name.given = "Eve" * name.family = "Anyperson" * birthDate = 1960-04-25 * extension[us-core-race].extension[ombCategory].valueCoding = RaceAndEthnicityCDC#2106-3 "White" * extension[us-core-ethnicity].extension[ombCategory].valueCoding = RaceAndEthnicityCDC#2186-5 "Non Hispanic or Latino" ``` -------------------------------- ### Example: Questionnaire Item Rule Set with Parameters Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of a parameterized rule set named 'Question' designed to define items within a FHIR Questionnaire. It accepts parameters for 'linkId', 'text', 'type', and 'repeats', and demonstrates how to apply this rule set to populate a Questionnaire instance. ```fsh RuleSet: Question(linkId, text, type, repeats) * item[+].linkId = "{linkId}" * item[=].text = "{text}" * item[=].type = #{type} * item[=].repeats = {repeats} // Applying the rule set to a Questionnaire: Instance: TravelRecord InstanceOf: Questionnaire // skip some * insert Question(tr1, When did you leave?, date, false) * insert Question(tr2, When did you return?, date, false) * insert Question(tr3, What countries did you visit?, code, true) ``` -------------------------------- ### FSH Rule: Binding Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates binding an element to a ValueSet with an optional strength. ```FSH * from {ValueSet} ({strength}) ``` -------------------------------- ### FSH Rule: Add Element Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Illustrates how to add an element with cardinality, flags, datatype, short description, and definition. ```FSH * {card} {flag(s)} {datatype(s)} "{short}" "{definition}" * {card} {flag(s)} contentReference {contentUrl} "{short}" "{definition}" ``` -------------------------------- ### FSH Rule: Cardinality Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Explains how to define the cardinality (min..max) for an element. ```FSH * {min}..{max} // min, max, or both MUST be present ``` -------------------------------- ### FSH Rule: Include Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Illustrates different ways to include specific codes or code ranges into a ValueSet or CodeSystem. ```FSH * include {Coding} * include codes from valueset {ValueSet}|{version} * include codes from system {CodeSystem}|{version} * include codes from system {CodeSystem}|{version} where {filter1} and {filter2}... * include codes from system {CodeSystem}|{version} and valueset {ValueSet1}|{version1} and valueset {ValueSet2}|{version2} ``` -------------------------------- ### Example: Equivalent of Inserted Rule Set (FHIR Shorthand) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference This code shows the expanded version of the profile after the 'RuleSet1' has been inserted, demonstrating how the rules are effectively copied and pasted into the profile. ```fhir-shorthand Profile: MyPatientProfile Parent: Patient Id: my-patient-profile Title: "My Patient Profile" Description: "An example patient profile." * ^status = #draft * ^experimental = true * ^publisher = "Elbonian Medical Society" * deceased[x] only boolean // More profile rules ``` -------------------------------- ### FSH Caret Path Example: Extension Short Description Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows the FSH syntax for accessing the 'short' description metadata of an extension, which is represented by the first ElementDefinition in the StructureDefinition. ```fsh . ^short ``` -------------------------------- ### Example Rule Set for Metadata in FHIR Shorthand Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of defining a rule set named 'RuleSet1' in FHIR Shorthand (FSH). This specific rule set defines metadata elements like status, experimental flag, and publisher, intended for reuse in multiple profiles. ```FSH RuleSet: RuleSet1 * ^status = #draft * ^experimental = true * ^publisher = "Elbonian Medical Society" ``` -------------------------------- ### Complete Slicing Example for Tumor Dimensions in FSH Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates a comprehensive FSH example for slicing the 'component' element of an Observation to represent tumor dimensions. It includes defining slicing discriminators, rules, and constraining properties for 'tumorLongestDimension' and 'tumorOtherDimension' slices. ```FSH Profile: TumorSize Parent: Observation Id: example-tumor-size Title: "Tumor Size" Description: "Records the one to three dimensions of a tumor" * code = $LNC#21889-1 //"Size Tumor" // other rules omitted * component ^slicing.discriminator.type = #pattern * component ^slicing.discriminator.path = "code" * component ^slicing.rules = #open * component ^slicing.description = "Slice based on the component.code pattern" // Contains rule * component contains tumorLongestDimension 1..1 and tumorOtherDimension 0..2 // Set properties of each slice * component[tumorLongestDimension] ^short = "Longest tumor dimension" * component[tumorLongestDimension] ^definition = "The longest tumor dimension in cm or mm." * component[tumorLongestDimension].code = $LNC#33728-7 // "Size.maximum dimension in Tumor" * component[tumorLongestDimension].value[x] only Quantity * component[tumorLongestDimension].value[x] from TumorSizeUnitsVS (required) // value set defined elsewhere * component[tumorOtherDimension] ^short = "Other tumor dimension(s)" * component[tumorOtherDimension] ^definition = "The second or third tumor dimension in cm or mm." * component[tumorOtherDimension] ^comment = "Additional tumor dimensions should be ordered from largest to smallest." * component[tumorOtherDimension].code = $LNC#33729-5 // "Size additional dimension in Tumor" * component[tumorOtherDimension].value[x] only Quantity * component[tumorOtherDimension].value[x] from TumorSizeUnitsVS (required) ``` -------------------------------- ### FSH Rule: Path Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference A simple rule defining the path to an element. ```FSH * ``` -------------------------------- ### FSH Profile Definition Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of defining a FHIR profile using FHIR Shorthand for an 'Exposure to a pathogen' scenario. It specifies the profile name, its parent resource (Observation), and includes rules for binding value sets and constraining data types. ```FSH Profile: KnownExposureSetting Parent: Observation Id: known-exposure-setting Title: "Known Exposure Setting Profile" Description: "The setting where an individual was exposed to a contagion." // url, status, purpose, and other metadata could be defined here using caret syntax (omitted) * code = $LNC#81267-7 // Setting of exposure to illness * value[x] only CodeableConcept * value[x] from https://loinc.org/vs/LL3991-8 (extensible) ``` -------------------------------- ### FSH RuleSet Definition Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of defining a parameterized rule set named 'Name' in FSH. This rule set takes 'first' and 'last' names as parameters and applies them to the 'given' and 'family' fields of a patient's name. ```FSH RuleSet: Name(first, last) * name[+].given = "{first}" * name[=].family = "{last}" ``` -------------------------------- ### FSH Rule Ordering: Acceptable Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows an acceptable rule order where a choice element's type is defined before constraining its properties. ```FSH * value[x] only Quantity * value[x].unit 0..0 ``` -------------------------------- ### FSH Whitespace Handling Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates how repeated whitespace is handled in FSH, showing that it is generally ignored except within string literals and for indentation. It illustrates reformatting for readability. ```FSH * component contains appearanceScore 0..3 and pulseScore 0..3 and grimaceScore 0..3 and activityScore 0..3 and respirationScore 0..3 * component contains appearanceScore 0..3 and pulseScore 0..3 and grimaceScore 0..3 and activityScore 0..3 and respirationScore 0..3 ``` -------------------------------- ### FSH Example: Add BackboneElement with Indentation Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An alternative way to define a 'BackboneElement' and its nested elements using indentation to maintain path context. This approach improves readability for complex structures. ```fsh * serviceAnimal 0..* BackboneElement "Service animals" "Animals trained to assist the person by performing certain tasks." * name 0..1 string "Name of service animal" "The name by which the service animal responds." * breed 1..* CodeableConcept "Breed of service animal" "The dominant breed or breeds of the service animal." * startDate 0..1 date "Date the service animal began work" "The date on which the service animal began working for the person." ``` -------------------------------- ### FSH Rule: Assignment Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows how to assign a value to an element, optionally with 'exactly' modifier. ```FSH * = {value} (exactly) ``` -------------------------------- ### FSH Rule Ordering: Ambiguous Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates a problematic rule order where a choice element's property is constrained before its type is defined. ```FSH * value[x].unit 0..0 * value[x] only Quantity ``` -------------------------------- ### Apply Standalone FHIR Extensions (FSH) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Example of applying standalone FHIR extensions (patient-disability, individual-genderIdentity) to a Patient resource profile using their canonical URLs and local names in FSH. ```FSH * extension contains http://hl7.org/fhir/StructureDefinition/patient-disability named disability 0..1 MS and http://hl7.org/fhir/StructureDefinition/individual-genderIdentity named genderIdentity 0..1 MS ``` -------------------------------- ### FSH RuleSet for TestScript Variables Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of a parameterized rule set named 'AddVariableToTestScript' in FSH. It takes 'name' and 'expression' parameters to define variables within a TestScript resource. ```FSH RuleSet: AddVariableToTestScript(name, expression) * variable[+].name = "{name}" * variable[=].expression = "{expression}" ``` -------------------------------- ### FSH Flag Rules: Implementing FHIR Flags (MS, SU) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/overview Flag rules in FSH add informational bits to elements, guiding implementers on how to handle them according to FHIR specifications. FSH uses shorthand flags like 'MS' for must-support and 'SU' for summary. Examples show applying these flags to individual elements or combinations. ```FSH * communication MS SU ``` ```FSH * identifier and identifier.system and identifier.value MS ``` -------------------------------- ### FSH Assignment Rule: CodeableConcept Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates how an assignment rule is interpreted differently in an instance versus a profile. In an instance, it sets the value of the CodeableConcept. In a profile, it acts as a constraint, requiring the CodeableConcept to match the specified system and code. ```fsh * code = https://loinc.org#69548-6 ``` -------------------------------- ### FSH: Profile Declaration Source: https://build.fhir.org/ig/HL7/fhir-shorthand/overview Provides an example of a FHIR Shorthand (FSH) declaration for a Profile. Declarations introduce and name new FSH items, and the 'Profile' declaration is one of the frequently used types. This example declares a profile named 'CancerDiseaseStatus'. ```FSH Profile: CancerDiseaseStatus ``` -------------------------------- ### FSH Mapping Definition Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example demonstrating the definition of a mapping between USCorePatient and Argonaut profiles using FHIR Shorthand. It includes keywords like Mapping, Source, Target, Id, and Title, along with specific mapping rules for the profile and its elements. ```FSH Mapping: USCorePatientToArgonaut Source: USCorePatient Target: "http://unknown.org/Argonaut-DQ-DSTU2" Id: argonaut-dq-dstu2 Title: "Argonaut DSTU2" * -> "Patient" * extension[USCoreRaceExtension] -> "Patient.extension[http://fhir.org/guides/argonaut/StructureDefinition/argo-race]" * extension[USCoreEthnicityExtension] -> "Patient.extension[http://fhir.org/guides/argonaut/StructureDefinition/argo-ethnicity]" * extension[USCoreBirthSexExtension] -> "Patient.extension[http://fhir.org/guides/argonaut/StructureDefinition/argo-birthsex]" * identifier -> "Patient.identifier" * identifier.system -> "Patient.identifier.system" * identifier.value -> "Patient.identifier.value" ``` -------------------------------- ### FSH Binding Rules: Specifying Coded Value Sets Source: https://build.fhir.org/ig/HL7/fhir-shorthand/overview Binding rules in FSH are applied to elements expecting coded values, defining the specific set of values that can be used. They include FHIR's binding strengths: example, preferred, extensible, or required. The example shows binding to a value set with a specified strength. ```FSH * gender from http://hl7.org/fhir/ValueSet/administrative-gender (required) ``` ```FSH * address.state from USPSTwoLetterAlphabeticCodes (extensible) // USPSTwoLetterAlphabeticCodes is a value set defined in US Core ``` -------------------------------- ### FSH Rule: Type Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Constrains an element to only specific datatypes. ```FSH * only {datatype(s)} ``` -------------------------------- ### FSH Rule: Obeys Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Specifies that an element obeys one or more invariants. ```FSH * obeys {Invariant} and {Invariant2} and {Invariant3}... ``` -------------------------------- ### Define US Core Practitioner Instance for Inlining (FSH) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Defines an instance of a US Core Practitioner profile intended for inlining within another resource. It specifies the instance name, profile, usage as '#inline', and populates name and NPI identifier. ```fsh Instance: DrDavidAnydoc InstanceOf: http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner Usage: #inline * name.family = "Anydoc" * name.given = "David" * name.suffix = "MD" * identifier[NPI].value = "8274017284" ``` -------------------------------- ### FSH Instance with Parameterized Rule Set Insertion Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference An example of an FSH instance ('MrSmith') that inserts the 'Name' parameterized rule set multiple times with different first and last names. This demonstrates how to populate a Patient resource with multiple names. ```FSH Instance: MrSmith InstanceOf: Patient Title: "Mr. Smith" Description: "The patient Robert Smith" // some rules * insert Name(Robert, Smith) * insert Name(Rob, Smith) * insert Name(Bob, Smith) // more rules ``` -------------------------------- ### Define CapabilityStatement Instance using FSH Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference This snippet demonstrates how to define a CapabilityStatement resource using FSH instance grammar. It utilizes 'InstanceOf' to declare the resource type and 'Usage' to specify its definition. The resource content is populated using assignment statements. ```FSH InstanceOf: CapabilityStatement Usage: #definition ``` -------------------------------- ### Example: Using Rule Sets for National Profiles (FHIR Shorthand) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Illustrates the use of distinct rule sets ('USObservationRuleSet' and 'FranceObservationRuleSet') to define national variations of a common clinical profile, promoting code reuse. ```fhir-shorthand Profile: USBreastRadiologyObservationProfile Parent: BreastRadiologyObservationProfile Id: us-breast-radiology Title: "US Breast Radiology Profile" Description: "Breast Radiology Profile with US-specific constraints" * insert USObservationRuleSet ``` ```fhir-shorthand Profile: FranceBreastRadiologyObservationProfile Parent: BreastRadiologyObservationProfile Id: france-breast-radiology Title: "France Breast Radiology Profile" Description: "Breast Radiology Profile with France-specific constraints" * insert FranceObservationRuleSet ``` -------------------------------- ### FSH Assignment Rule: Exact CodeableConcept Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows an exact match constraint for a CodeableConcept in FSH. This requires the conforming instance's code element to precisely match the specified system and code, disallowing any display text, additional codes, or extensions. ```fsh * code = $LNC#69548-6 (exactly) ``` -------------------------------- ### FSH Rule: Mapping Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Defines a mapping for an element to a string, with an optional comment and MIME type. ```FSH * -> "{map string}" "{comment string}" #{mime-type code} ``` -------------------------------- ### FSH Rule: Contains (Standalone Extensions) Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Defines standalone extensions that can be contained within an element. ```FSH * contains {Extension1} named {name1} {card} {flag(s)} and {Extension2} named {name2} {card} {flag(s)} and {Extension3} named {name3} {card} {flag(s)}... ``` -------------------------------- ### FSH Rule: Contains (Inline Extensions) Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Defines inline extensions that are part of an element's definition. ```FSH * contains {name1} {card} {flag(s)} and {name2} {card} {flag(s)} and {name3} {card} {flag(s)}... ``` -------------------------------- ### FSH Example: Add Element Using Content Reference Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Illustrates adding an element using the `contentReference` keyword. The element 'email' inherits its properties from the 'email' element within 'http://example.org/StructureDefinition/AnotherResource#AnotherResource'. ```fsh * email 0..* contentReference http://example.org/StructureDefinition/AnotherResource#AnotherResource.email "The person's email addresses" ``` -------------------------------- ### FSH Rule: Local Code Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Defines local codes with their display strings and definitions, including hierarchical codes. ```FSH * #{code} "{display string}" "{definition string}" * #{parentCode} #{childCode} "{display string}" "{definition string}" ``` -------------------------------- ### FSH Example: Add String Element with Flags and Definition Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows how to add a string-typed element with additional modifiers, including a 'SU' (summary) flag and a more detailed longer definition. This allows for richer documentation and metadata. ```fsh * email 0..* SU string "The person's email addresses" "Email addresses by which the person may be contacted." ``` -------------------------------- ### FSH Rule: Exclude Examples Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Shows different ways to exclude specific codes or code ranges from a ValueSet or CodeSystem. ```FSH * exclude {Coding} * exclude codes from valueset {ValueSet}|{version} * exclude codes from system {CodeSystem}|{version} * exclude codes from system {CodeSystem}|{version} where {filter1} and {filter2}... * exclude codes from system {CodeSystem}|{version} and valueset {ValueSet1}|{version1} and valueset {ValueSet2}|{version2} ``` -------------------------------- ### Apply Standalone Extensions with Aliases (FSH) Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Demonstrates using aliases in FSH to simplify the application of standalone FHIR extensions, improving readability when referencing canonical URLs. ```FSH Alias: $Disability = http://hl7.org/fhir/StructureDefinition/patient-disability Alias: $GenderIdentity = http://hl7.org/fhir/StructureDefinition/individual-genderIdentity // intervening lines not shown * extension contains $Disability named disability 0..1 MS and $GenderIdentity named genderIdentity 0..1 MS ``` -------------------------------- ### FSH Rule: Contains (Slicing) Example Source: https://build.fhir.org/ig/HL7/fhir-shorthand/reference Illustrates slicing an array by defining contained elements with specific names and properties. ```FSH * contains {name} {card} {flag(s)} and {name2} {card} {flag2} and {name3} {card} {flag(s)}... ```