Skip to content

Instantly share code, notes, and snippets.

@niquola
Created October 17, 2019 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niquola/8be550fb0503845cf4cb9fa4636deee3 to your computer and use it in GitHub Desktop.
Save niquola/8be550fb0503845cf4cb9fa4636deee3 to your computer and use it in GitHub Desktop.
---
resourceType: SugarProfile
id: Patient
attrs:
race:
# if url and id are provided - this means attribute is an extension
id: us-core-race
url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
desc: US Core Race Extension
# complex extensions can be defined just by nested attributes
attrs:
category:
url: American Indian or Alaska Native|Asian|Black or African American|Native
Hawaiian or Other Pacific Islander|White
id: ombCategory
type: Coding
# local valueset and bindings can be placed right with extension definition
valueset:
url: omb-race-category
id: race-category
concepts:
- code: 1002-5
display: american indian or alaska native american indian or alaska
native
- code: 2028-9
display: asian asian
- code: 2054-5
display: black or african american black or african american
- code: 2076-8
display: native hawaiian or other pacific islander native hawaiian or
other pacific islander
- code: 2106-3
display: white white
detailed:
url: detailed
type: Coding
valueset:
id: race
concepts: []
text:
type: string
ethnicity:
id: us-core-ethnicity
...
identifier:
isRequired: true
attrs:
system:
isRequired: true
value:
isRequired: true
name:
isRequired: true
# rule system is decalrative way to define invariants
rule:
atLeast:
- given
- family
attrs:
given: {}
family: {}
telecom:
desc: each telecom should have system and value
attrs:
system:
isRequired: true
value:
isRequired: true
gender:
isRequired: true
valueset:
id: gender
address:
line: {}
city: {}
state:
valueset:
id: states
postalCode:
desc: US Postal Code
communication:
language:
valueset:
id: languages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment