0

So I've been tearing my hair out the past couple of days trying to create a fhir profile based on the Basic resource, and create an instance of that resource compliant with the profile.

I cannot for the life of me find a simple straight forward example of how you are supposed to do this as the documentation is explains everything in functional chunks and doesn't at any point seem to put anything together.

Essentially I'm just looking for one xml StructureDefition defining a profile based on Basic, and another xml Basic resource which can correctly validate against the profile. I've tried writing it myself but I can't make sense of the documentation and HAPI throws an error with each attempt.

If there are no straight forward examples, please could someone write one in place here to serve for other people looking for the same thing, as an example, the profile has the following:

Name: String, Required, min:1, max:1
TimeOfRecording: Timestamp, Required, min:1, max:1
AttendingStaff: String, Not Required, min: 1, max: unlimited.

Thanks

Andy
  • 3,228
  • 8
  • 40
  • 65

1 Answers1

2

Profile: http://hl7.org/fhir/us/qicore/2016Sep/StructureDefinition-qicore-adverseevent.xml

Instance: http://hl7.org/fhir/us/qicore/2016Sep/Basic-basic-adverseevent-example.xml

Be sure to view both as source so you don't just see the narrative. They were created against the September 2016 release, so you'll need to validate them using that infrastructure (and that's a little tricky to do, so I haven't verified that they actually validate). Actually, as I visually inspect the instance, I can already see at least one issue - the urls inside complex extensions should just be the name of the nested node. I.e.

<extension url="http://hl7.org/fhir/qicore/StructureDefinition/adverseevent-cause#item">
  <valueReference>
    <reference value="Medication/qicore"/>
  </valueReference>
</extension>

Should be

<extension url="item">
  <valueReference>
    <reference value="Medication/qicore"/>
  </valueReference>
</extension>

The validator in place at the time that IG was published wasn't smart enough to detect the issue. The new one will be (but won't work with the Sept 2016 release).

If you're looking at using DSTU 2, the structure definition for the profile will be a bit different, but the instance should be pretty much the same - I don't think Basic has changed much.

Hope that helps.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • Thanks for that, how do I navigate to the definitions of the extensions used by the profile? They're not publicly available at their urls and I haven't been able to find them via http://hl7.org/fhir/us/qicore/2016Sep/ – Andy Nov 04 '16 at 11:37
  • Yeah, the qicore implementation guide needs a bit of work. We changed the tooling used to publish IGs a short while before the Sept. 2016 ballot was due and not all of the necessary infrastructure was put in place by all IG authors. I found those links through a combination of educated guesses and the source material in HL7's SVN. I've passed on the issue to the authors so that hopefully the content will be more easily navigable when the final STU 3 version is published. – Lloyd McKenzie Nov 05 '16 at 21:13