Logical Model + Custom Resource¶
If you’re working with a custom format that you want to transform, you need create a model of your data to describe it to the FHIR Mapper. If you’re working with FHIR resources as your source data, Vonk already has the models available, so you can skip this step.
- Describe your logical model in Forge. An example model is available and we’ll use it in this documentation.
Next, convert the logical model you’ve made to a custom resource:
2.1. Ensure the
http://hl7.org/fhir/StructureDefinition(this is a temporary limitation).
2.1.1. In our example, change from
2.3. Remove the URL from
.typeand set it to just a name.
2.3.1. In our example, change from
2.4. Add a
.idelement at the root level with the name of the custom resource.
2.4.1. In our example, set
2.5. Set the
2.6. Delete the
typefield from the first
.snapshot.elementif you have it):
2.7. If you only have a
.snapshotin your model and no
.differential, rename the
.differential(this is a temporary limitation - basically, ensure that you have a
If you’d like to double-check, this is how our example custom resource looks like now with all the changes applied.
Finally, upload your custom resource to Vonk’s
PUTthe resource to
http(s)://<vonk-endpoint>/administration/StructureDefinition/<custom resource name>.
3.1.1 In our example,
PUT http://localhost:4080/administration/StructureDefinition/FakeInpatientDrugChartwith the resource in the body.
With the custom resource uploaded to Vonk’s administration point, we have now taught Vonk about a new resource type!
You can verify this by running
GET http(s)://localhost:4080/<custom resource name> (in our example
GET http://localhost:4080/FakeInpatientDrugChart). The query will return 0 search results instead of an error message “Request for not-supported ResourceType(s)”.
Next we’ll create a mapping between our custom resource and FHIR STU3 resources.