This page provides guidance on what files contain the source for managing different types of core maintenance tasks.
Git
All changes to the core specification are managed using Git. All changes must be managed by submitting a pull request against the https://github.com/HL7/fhir.git project (or for technical corrections or special release like R4B, one of the branches to that project). Within the project, almost all maintenance will happen within the 'source' folder. Other folders contain either generated content, tooling infrastructure or files that most individuals won't need to change or modify.
Before attempting to make changes to any FHIR resources, the first thing to do is to ensure that your environment is set up to properly build. Guidance for doing this can be found on the FHIR Build Process page.
Normative content
WARNING: The file location process described below has not been fully implemented yet.
Resources and pages that have passed ballot such that all or part of their content is now normative are managed slightly differently from everything else.
- First, all such files live in sub-folders called 'normative'. Thus regular spec pages that are normative will live in the source/normative folder and pages that contain normative content for a particular resource will live in the source/[ResourceName]/normative folder. (Note that when a resource is normative, not all of the resource will be normative, so it will be common for a normative resource folder to contain content in both the 'base' folder (e.g. examples, non-normative operations & extensions) as well as a normative folder containing the resource, intro and notes pages as well as any normative operations, value sets and code systems.
Maintaining Pages
Maintaining stand-alone pages is the 'simpler' aspect of maintaining FHIR content. Any pages that aren't directly associated with a specific resource, pattern, extension or profile are managed as [root]/source/*.html
with the file name as it will be in the published specification (generally) the same as what the page name will be in the published specification. For example, [root]/source/index.html
corresponds to [root]/publish/index.html
.
All such files are XHTML files, though many of them also contain embedded rendering commands, of the form [% some command %]
. The location of these commands sometimes result in the source files not being valid XHTML. The most common of these commands - [%file somename%]
, causes the file with the name somename.html
to be included at that location. Note that some of the included files are not maintained in [root]/source
, but are instead maintained in [root]/tools/templates
.
In order for a file to be propagated to the publication, it must be listed in the [pages]
or [special-pages]
section of [root]/publish.ini
. "[pages]" is used for 'regular' pages that have maturity levels and ballot levels (and which will throw an error if the relevant table isn't present), while "[special-pages]" is used for pages that do not have such information (and will throw an error if the table is present). In addition, the [root]/source/hierarchy.xml
also needs an entry. The location of the page in the hierarchy determines where it will appear in the table of contents.
Where a page references image content or other 'static' content that needs to be propagated unchanged to the publish folder, such content should be placed in the source/images
folder and an entry must be placed in [root]/publish.ini under the [images]
or [files]
entries to cause the image or file to be propagated.
Maintaining Resources
Resources fall into two categories - infrastructure resources that are tightly incorporated into FHIR tooling, and everything else. Descriptive changes (definitions, comments, short descriptions, mappings, etc.) can be made to any resource without going through special processes, however substantive changes to 'infrastructure' resources (renaming resources or elements, changing data types, changing cardinality or other constraints, etc.) will often result in a need to make changes to the Java code used to manage core publication, shared Java libraries, and/or the IG Publisher. At some point, we may document how to manage changes to these resources, but for now, it's best to assign issues involving substantive changes to conformance resources to Grahame, Mark or one of the other tooling committers.
This section will focus on descriptive changes to all resources and substantive changes to non-infrastructure resources. In addition to the basic rules for changing resources, there are a few types of changes that require 'extra' steps. Consult this additional guidance if you are Adding new resources, Renaming resources, or Deprecating resources.
Resource content consists of a variety of resource types as well as supplemental files. All content can be managed as XML resources instances or XHTML files. This is the 'source of truth' content that is actually maintained inside Git. In addition, some content can be managed using an Excel interface.
Using Excel
The Excel interface is provided as an integrated 'simpler' mechanism for maintaining resource content. It's intended to be used by non-technical editors which may be uncomfortable editing XML. Also, for certain types of bulk changes or for quickly scanning a resource, the Excel view can be more efficient. However, working with Excel files adds complexity, so for simple changes, it is often more straight-forward to directly edit the XML files and ignore the Excel files entirely. If you wish to use the Excel files, the name of the spreadsheet will be [resourcename]-spreadsheet.xlsx. There will be a companion file called [resourcename]-spreadsheet.datestamp that captures when the spreadsheet was last generated. The process is as follows:
1. Generate the Excel files
The Excel files will not exist when the core build is first cloned from Git. In order to see Excel files (or to ensure Excel files are up-to-date after pulling down new changes), you must run a local build. This will generate Excel files that reflect the 'current' state of the source files in the build directory. Note that it is essential to run a local copy of the build after pulling down a new copy if you plan to work with Excel. That's because the publication process proceeds on a basis of timestamp comparison. If the publisher determines that XML files are newer than the spreadsheet.datestamp file, then it will force the spreadsheet to be regenerated, meaning you'll need to re-do your work. Also, don't run the build with any of the Excel resource files open in Excel - the build process won't be able to update them and will fail.
2. Edit the Excel files
All of the Excel content is generated and will be re-generated, so don't fuss too much with changing formatting and don't try to introduce new columns - they'll just go away.
The Excel files consist of a set of tabs. Some pertain directly to the resource. Others deal with managing the list of content that is 'related' to the resource (profiles, extensions, examples, etc.). Full guidance on the content of the Excel file can be found in FHIR Resource Excel Files.
If you're editing Excel files don't mess around with the XML files at the same time unless you really know what you're doing. Some of the XML files are safe (e.g. example files), but any XML files that are used to generate the Excel file can't be touched until all changes you've made from Excel have been propagated back to XML. If you edit both XML and Excel, the publisher will fail and you'll be faced with rolling back your Excel changes and re-generating the Excel file.
Once you're finished editing, save and close Excel
3. Re-generate XML files from the Excel files
Excel files are not committed in Git. In order for the changes made in Excel to be committed, they must first be propagated into the relevant XML file(s). To do this, the core build must be run again. (This is always a good idea even if you're not using Excel as it's generally better to catch issues locally than to submit a pull request when your build has a problem.) Running the build will update all of the XML files to align with the changes made in Excel to allow the content to be checked in
4. Commit the changed XML files
To make the changes available to others, the content needs to be committed to a branch, then pushed to core and a pull request created and, once it builds successfully, the pull request needs to be merged.
Where content lives
The resource folder will contain a large number of files (possibly into the hundreds). The following section describes what file(s) contain the content needed to maintain certain sections of the resource page.
Adding new resources
Adding new resources is a complex process involving changes to many files. The full process is described Here
Renaming resources
Todo
Deprecating resources
Todo