1

As the title says really. I've authored some extensions, and some profiles around those. Now I'm not really sure how to upload a resource instance to that profile.

All the profiles are based on the basic resource, and from what I understand I upload my instances to the basic resource as normal, but they are checked for consistency against the profile I want. How do I set this profile?

Andy
  • 3,228
  • 8
  • 40
  • 65

1 Answers1

0

The used profile for a resource is set in the meta tag: https://www.hl7.org/fhir/resource.html#Meta

If you want to POST a profiled resource you still are POSTing against the normal resource path, e.g.: http://fhirtest.uhn.ca/baseDstu2/Patient This just uploads the resource and doesn't validate the resource against a profile. In order to do this there is the $validate operation.

Usage: POST [base]/Patient/$validate?profile=http://hl7.org/fhir/StructureDefinition/daf-patient

More about validation here: https://www.hl7.org/fhir/validation.html, https://www.hl7.org/fhir/resource-operations.html#validate

Patrick Werner
  • 1,106
  • 9
  • 24
  • See also the answers to this question: http://stackoverflow.com/questions/40044494/how-to-add-profiles-via-the-fhir-rest-api-hapi/40085299#40085299 – Ewout Kramer Oct 24 '16 at 13:16