Stream: IG creation
Topic: YML
Eric Haas (Sep 23 2019 at 00:48):
The whole FHIRScript discussion prompted me to play with differentials in YAML. ( I edited a StructureDefintiion0-us-core-patient.yml file and after conversion to JSON format - published. ) It may not be a scripting language but it does provided some benefits: it is a helluva lot easier to read and maintain for those of us who are used to dealing with indents. I imagine the same when looking at diffs, has nice editor support. One drawback is the author may wind up having to round trip to JSON to validate using JSON Schema on their end. This may be a nice format option to add to the ig-pub in addition to xml and json formats.
resourceType: StructureDefinition
id: yaml-example
url: http://www.fhir.org/guides/test3/StructureDefinition/yaml-example
version: 3.0.1
name: USCorePatientProfile
title: US Core Patient Profile
status: active
experimental: false
date: '2019-08-26T00:00:00-07:00'
publisher: HL7 US Realm Steering Committee
contact:
- telecom:
- system: url
value: http://www.healthit.gov
description: Defines constraints and extensions on the patient resource for the minimal
set of data to query and retrieve patient demographic information.
jurisdiction:
- coding:
- system: urn:iso:std:iso:3166
code: US
display: United States of America
fhirVersion: 4.0.0
mapping:
- identity: argonaut-dq-dstu2
uri: http://unknown.org/Argonaut-DQ-DSTU2
name: Argonaut-DQ-DSTU2
- identity: rim
uri: http://hl7.org/v3
name: RIM Mapping
- identity: cda
uri: http://hl7.org/v3/cda
name: CDA (R2)
- identity: w5
uri: http://hl7.org/fhir/fivews
name: FiveWs Pattern Mapping
- identity: v2
uri: http://hl7.org/v2
name: HL7 v2 Mapping
- identity: loinc
uri: http://loinc.org
name: LOINC code for the element
kind: resource
abstract: false
type: Patient
baseDefinition: http://hl7.org/fhir/StructureDefinition/Patient
derivation: constraint
differential:
element:
- id: Patient
path: Patient
definition: The US Core Patient Profile is based upon the core FHIR Patient Resource
and designed to meet the applicable patient demographic data elements from the
2015 Edition Common Clinical Data Set.
mustSupport: false
mapping:
- identity: argonaut-dq-dstu2
map: Patient
- id: Patient.extension:race
path: Patient.extension
sliceName: race
min: 0
max: '1'
type:
- code: Extension
profile:
- http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.extension
# ********* start new extension **************
- id: Patient.extension:direct
path: Patient.extension
sliceName: direct
min: 0
max: '1'
type:
- code: Extension
profile:
- http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
# ************ end new extension **************
- id: Patient.extension:ethnicity
path: Patient.extension
sliceName: ethnicity
min: 0
max: '1'
type:
- code: Extension
profile:
- http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.extension
- id: Patient.extension:birthsex
path: Patient.extension
sliceName: birthsex
min: 0
max: '1'
type:
- code: Extension
profile:
- http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
mustSupport: true
binding:
strength: required
description: Code for sex assigned at birth
valueSet: http://hl7.org/fhir/us/core/ValueSet/birthsex
mapping:
- identity: argonaut-dq-dstu2
map: Patient.extension
- id: Patient.identifier
path: Patient.identifier
min: 1
max: '*'
type:
- code: Identifier
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.identifier
- id: Patient.identifier.system
path: Patient.identifier.system
min: 1
max: '1'
type:
- code: uri
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.identifier.system
- id: Patient.identifier.value
path: Patient.identifier.value
short: The value that is unique within the system.
min: 1
max: '1'
type:
- code: string
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.identifier.value
- id: Patient.name
path: Patient.name
min: 1
max: '*'
type:
- code: HumanName
constraint:
- key: us-core-8
severity: error
human: Patient.name.given or Patient.name.family or both SHALL be present
expression: family.exists() or given.exists()
xpath: f:given or f:family
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.name
- id: Patient.name.family
path: Patient.name.family
min: 0
max: '1'
type:
- code: string
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.name.family
- id: Patient.name.given
path: Patient.name.given
min: 0
max: '*'
type:
- code: string
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.name.given
- id: Patient.telecom
path: Patient.telecom
min: 0
max: '*'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.telecom.system
path: Patient.telecom.system
min: 1
max: '1'
mustSupport: true
binding:
strength: required
description: Telecommunications form for contact point.
valueSet: http://hl7.org/fhir/ValueSet/contact-point-system
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.telecom.value
path: Patient.telecom.value
min: 1
max: '1'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.telecom.use
path: Patient.telecom.use
min: 0
max: '1'
mustSupport: true
binding:
strength: required
valueSet: http://hl7.org/fhir/ValueSet/contact-point-use
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.gender
path: Patient.gender
min: 1
max: '1'
type:
- code: code
mustSupport: true
binding:
strength: required
valueSet: http://hl7.org/fhir/ValueSet/administrative-gender
mapping:
- identity: argonaut-dq-dstu2
map: Patient.gender
- id: Patient.birthDate
path: Patient.birthDate
min: 0
max: '1'
type:
- code: date
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.birthDate
- id: Patient.address
path: Patient.address
min: 0
max: '*'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.birthDate
- id: Patient.address.line
path: Patient.address.line
min: 0
max: '*'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.address.city
path: Patient.address.city
min: 0
max: '1'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.address.state
path: Patient.address.state
min: 0
max: '1'
mustSupport: true
binding:
strength: extensible
description: Two Letter USPS alphabetic codes.
valueSet: http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.address.postalCode
path: Patient.address.postalCode
short: US Zip Codes
alias:
- Zip Code
min: 0
max: '1'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.address.period
path: Patient.address.period
min: 0
max: '1'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: NA
- id: Patient.communication
path: Patient.communication
min: 0
max: '*'
mustSupport: true
mapping:
- identity: argonaut-dq-dstu2
map: Patient.communication
- id: Patient.communication.language
path: Patient.communication.language
min: 1
max: '1'
type:
- code: CodeableConcept
mustSupport: true
binding:
strength: extensible
valueSet: http://hl7.org/fhir/us/core/ValueSet/simple-language
mapping:
- identity: argonaut-dq-dstu2
map: Patient.communication.language
Grahame Grieve (Sep 23 2019 at 01:18):
I like it better than json but I think fsh has legs
Eric Haas (Sep 23 2019 at 02:00):
its not a priority for me personally so I agree we can wait until we see what fsh begats.
Chris Moesel (Sep 23 2019 at 03:14):
Bizarre-looking 'fish with legs' found in New Zealand
David Hay (Sep 23 2019 at 03:36):
Oddly enough - not all that far from where I live... (though the 2 facts are completely unrelated....)
Brian Postlethwaite (Sep 23 2019 at 09:12):
The other thought I had was a yaml style representation that used indenting for the paths too, rather than in the path property.
Grahame Grieve (Sep 23 2019 at 09:18):
baaaaaaad idea
Mark Kramer (Sep 23 2019 at 11:43):
It would be interesting to see how this translates to FSH. Just so everyone concerned knows, at the risk of repeating myself, I started a Fishy Wiki for design and critique: https://github.com/HL7/fhir-shorthand/wiki
Last updated: Apr 12 2022 at 19:14 UTC