How Does InterSystems FHIR profile validation works?
Hi folks!
Examining FHIR profile validation with InterSystems FHIR server. FHIR profiles is a very useful feature of FHIR standard that helps an organization or solution to establish constraints to a very disperse FHIR standards that are relevant to a particular business solution. Learn more on FHIR profiles.
I created a very simple FHIR profile with the following JSON:
Spoiler
{
"resourceType": "StructureDefinition",
"url": "http://example.org/fhir/StructureDefinition/TutorialPatient",
"name": "TutorialPatient",
"status": "draft",
"fhirVersion": "4.0.1",
"mapping": [
{
"identity": "rim",
"uri": "http://hl7.org/v3",
"name": "RIM Mapping"
},
{
"identity": "cda",
"uri": "http://hl7.org/v3/cda",
"name": "CDA (R2)"
},
{
"identity": "w5",
"uri": "http://hl7.org/fhir/fivews",
"name": "FiveWs Pattern Mapping"
},
{
"identity": "v2",
"uri": "http://hl7.org/v2",
"name": "HL7 V2 Mapping"
},
{
"identity": "loinc",
"uri": "http://loinc.org",
"name": "LOINC code for the element"
}
],
"kind": "resource",
"abstract": false,
"type": "Patient",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
"derivation": "constraint",
"differential": {
"element": [
{
"id": "Patient. identifier",
"path": "Patient. identifier",
"min": 1
},
{
"id": "Patient.name",
"path": "Patient .name",
"min": 1,
"max": "1"
},
{
"id": "Patient.gender",
"path": "Patient.gender",
"min": 1
}
]
}
}
As you can see in "differential" section it makes mandatory fields of id, name and gender.
I managed to successfully submit the profile via the POST request to:
localhost:52773/fhir/r4/StructureDefinition
Then I submitted the following test Patient profile, where I omitted the "id" field and included the FHIR profile link in the meta section to:
localhost:52773/fhir/r4/Patient
{
"resourceType": "Patient",
"meta": {
"profile": [
"http://example.org/fhir/StructureDefinition/TutorialPatient"
]
},
"text": {
"div": "‹div xmlns=\"http://ww.w3.org/1999/xhtml\"><h1>Elon Musk</hi>/div>",
"status": "generated"
},
"name": [
{
"use": "official",
"given": [
"Elon"
],
"family": "Ramesh"
}
],
"gender": "male",
"birthDate": "1997-09-08",
"telecom": [
{
"value": "9876543210",
"use": "mobile",
"system": "phone"
},
{
"system": "email",
"value": "elon.musk@gmai.com"
}
]
}And instead of the expected error I'm getting the successfully created patient.
What am i doing wrong? How are the FHIR validation profiles supposed to be used in InterSystems FHIR server?
Comments
Please check my below article about resource validation.
https://community.intersystems.com/post/creating-and-validating-any-hl7…
Thanks
Thanks @Muhammad Waseem !
I know about FHIR schema json opportunity and use it too.
But what I'm talking about here in this question is revealed in this video.
Besides Patient resource we can submit "StructureDefinition" resource (listed above in a spoiler), which introduces constraints in the FHIR standard in this particular FHIR server I'm working with.
And the second example above is the Patient resource with this profile in meta section which FHIR server should use to "fire" constraints. But it doesn't.
@Patrick Jamieson , could you please help here?
As per the documentation The I had raised the same question Currently, InterSystems products do not provide the ability to validate a resource against a profile. Validation is limited to the base FHIR specification.
.png)
Thanks @Luis Angel Pérez Ramos for pointing the documentation
Hi, FHIR Profile Validation will be support with IRIS 2023.3.
https://community.intersystems.com/post/intersystems-announces-its-seco…
Highlights
There are several exciting new features in this release, such as support to base HL7® FHIR® version R5, and the integration with the IBM FHIR® Validator. There are also runtime performance improvements for ObjectScript. Note that these features are expected, but nor assured to appear in the final release.
Mean while, you can use community edition of Profile Validation :
Thanks you @Guillaume Rongier !
Hopefully this will be helpful
Until 2023.3 is GA, and you can upgrade to it, see also this related Global Summit 2023 session recording:
https://www.intersystems.com/performing-advanced-fhir-validation-inters…
[Not sure I fully trust the presenter though 😉]
And the related Open Exchange app (and GitHub repo):
https://openexchange.intersystems.com/package/fhir-profile-validation
Thanks for the posts all, just wanted to correct the link to the advanced fhir validator . . .(existing link gives a 404)
https://community.intersystems.com/post/video-performing-advanced-fhir-…
Curious, if there is an official support of profile validation in IRIS for Health 2024?