FHIR Profiles
In FHIR (Fast Healthcare Interoperability Resources) Shorthand, profiles are a key mechanism for defining how FHIR resources should be used in specific contexts. Here's a detailed explanation of what profiles are and their significance:
Definition: A FHIR Profile is a set of rules and constraints that customize a base FHIR resource for a specific use case. Profiles allow implementers to define how a FHIR resource should be structured and used within a particular domain or application.
Components of a FHIR Profile:
-
Constraints: Profiles can impose constraints on the FHIR resource by specifying which elements are required, which are optional, and which can be repeated. This includes defining cardinality (e.g., how many times an element can appear).
-
Extensions: Profiles can include extensions to add additional elements that are not part of the base FHIR resource but are necessary for the specific use case.
-
Value Sets: Profiles can specify which code systems and value sets should be used for coded elements within the resource.
-
Bindings: Profiles can define how elements should be bound to specific value sets, either required or preferred.
Purpose and Benefits:
-
Interoperability: Profiles ensure consistent use of FHIR resources across different systems and applications, enhancing interoperability.
-
Customization: Profiles allow for the customization of FHIR resources to meet the specific requirements of various healthcare domains, such as cardiology, oncology, or public health.
-
Validation: Profiles provide a framework for validating FHIR resources against specific requirements, ensuring that data conforms to expected structures and values.
Creating and Using Profiles:
-
FHIR Shorthand: FHIR Shorthand (FSH) is a domain-specific language used to define FHIR profiles, extensions, value sets, and other artifacts. FSH simplifies the process of creating and maintaining FHIR profiles by providing a concise, human-readable syntax.
-
Implementation Guide (IG): Profiles are often included in FHIR Implementation Guides, which provide detailed instructions on how to implement FHIR in specific contexts, including profiles, examples, and other resources.
Profiling a New Zealand Māori Patient
The initalised implementation guide places the profile and instance in the same file. It is best practice to split these into separate files, e.g.
- PatientProfile.fsh
- PatientExample.fsh
Patient Profile
Profiling is the action of selection resources which best fulfill your requirements, the results of this process are Profile
definitions. Because this material focuses on the New Zealand context, a suitable profiling use case is for a New Zealand Māori Patient, using the inialised Patient:
the template Parent definition is
Patient
, this is replaced by theNzPatient
definition, which is now available via the dependency declared in New Zealand Base Implementation Guide.
Profile: PatientProfile
Parent: NzPatient
Description: "An example profile of the Patient resource."
* ^version = "0.0.1"
* name 1..* // The Patient resource must have at least one name
* birthDate 1..1 // The Patient resource must have exactly one birth date
* gender 1..1 // The Patient resource must have exactly one gender
* address 0..* // The Patient resource can have zero or more addresses
Patient Example
This defines an example Instance. Note that indentation is supported for readability, but has no syntactical importance. the ethnicity
extension is available via the dependency declared in New Zealand Base Implementation Guide.
Instance: PatientExample
InstanceOf: PatientProfile
Description: "An example of a New Zealand Māori Patient."
* extension[ethnicity].url = "http://hl7.org.nz/fhir/StructureDefinition/nz-ethnicity"
* extension[ethnicity].valueCodeableConcept = https://standards.digital.health.nz/ns/ethnic-group-level-4-code#21111 "Māori"
* name
* given[0] = "James"
* family = "Pond"
* birthDate = "1956-10-31"
* gender = #male
* address[0].use = #home
* address[=].text = "39 Oleander Grove, Waikanae Beach, Waikanae 5036, New Zealand"
* address[=].line[0] = "39 Oleander Grove"
* address[=].line[+] = "Waikanae Beach"
* address[=].city = "Waikanae"
* address[=].postalCode = "5036"
* address[=].country = "NZL"
Profile Artefacts
The resulting Implementation Guide will have two artefacts, the Patient profile and corresponding example.
Conclusion
FHIR Profiles are essential for tailoring FHIR resources to specific use cases, ensuring data consistency and interoperability across healthcare systems. Using FHIR Shorthand to define these profiles makes the process more efficient and accessible for developers and implementers.
In FHIR, profiles are primarily applied to resources to constrain and extend their definitions for specific use cases. However, the way profiles interact with different types of FHIR resources like CapabilityStatements and Questionnaires varies based on their purpose and design.
See free-form documentation and Quality Assurance Report for incremental change considerations.