- Download and set up Forge from https://fire.ly/forge (it's a FHIR profile editor)
- Clone and check out the FHIR-Profiles repo from our older Git org
- Open forge
- Find and open one of the XML files for an existing extension (in that repo) - so you can compare against something
- Create a new extension (you need to click on the "session" node before the "new" button is enabled)
- Select the Properties tab
- Paste your extension URL in the URL field (e.g. http://endeavourhealth.org/fhir/StructureDefinition/primarycare-appointment-dna-reason-extension)
- Copy and paste the last part of the extension URL into the Resource ID field (e.g. primarycare-appointment-dna-reason-extension)
- Copy and paste the last part of the extension URL into the Name field and change to start words with caps (e.g. PrimaryCare-AppointmentDnaReason-Extension)
- Enter something in the Description box
- Set the Publishing Date to today
- Change Context Type to "Resource"
- Click the + button next to the Context field and select the resource type(s) your extension applies to
- Select the Element Tree tab
- Click on "Value[x]"
- On the right, uncheck all the options and then just check the option(s) for the data types your extension will store
- Click "Save" to save your extension to XML, name it the same as the Resource ID (e.g. primarycare-appointment-dna-reason-extension.xml) - save to the Extensions folder in the repo (\FHIR-Profiles\Profiles\PrimaryCare\Extensions) That's your new extension created, but you have to update the profile for the resource(s) that use it...
- Still in Forge, and with your new extension still open, click the Session node on the left
- Click Open and select the XML file for the Resource profile you need to amend (the files are in the Resources folder in the repo, e.g. \FHIR-Profiles\Profiles\PrimaryCare\Resources)
- With your resource profile open, select the Element Tree tab at the top
- Click the top-most node in the tree below the tab
- Click Extend to add a new extension to the resource, which you should see appear at the bottom
- Click the new extension
- Click the top-right drop down (extension) combo and you should see your new extension listed (any open extension files are shown here) - select it
- Enter a Name for your extension (e.g. DnaReason)
- Select the appropriate cardinality for your extension (e.g. 0..1)
- Save the resource XML file
- Close Forge
- Commit and push your changes to Git. You should be committing the new XML file for your extension, plus the XML files for any resources you updated too.