Stream: implementers
Topic: Extensions as search parameter
Sahil Khanna (Jan 12 2020 at 16:04):
@All,
I am using HAPI public server and trying to fetch Patient resource using mothersMaidenName.
For this i have created a new StructureDefinition resource on HAPI using below JSON:
{
"resourceType": "StructureDefinition",
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
"name": "mothersMaidenName",
"status": "draft",
"fhirVersion": "4.0.0",
"kind": "resource",
"abstract": false,
"type": "HumanName",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
"differential": {
"element": [
{
"id": "Patient.mothersMaidenName",
"path": "Patient.mothersMaidenName",
"min": 1
}
]
}
}
I have created new SearchParameter resource in HAPI using below resource:
{
"resourceType": "SearchParameter",
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
"name": "mothersMaidenName",
"status": "active",
"experimental": true,
"date": "2020-01-11",
"publisher": "Health Level Seven International (Health Care Devices Work Group)",
"description": "Search by parent reference.",
"base": [
"Patient"
],
"type": "reference",
"expression": "Patient.mothersMaidenName",
"target": [
"Patient"
]
}
GET API : http://hapi.fhir.org/baseR4/Patient?mothersMaidenName=TestMaidenName
but no luck... any help on this would be much appreciated.
Lloyd McKenzie (Jan 12 2020 at 16:15):
You can't add new elements to a resource. You should instead be defining and using an extension. (There's already an existing extension for mothers maiden name - http://hl7.org/fhir/extension-patient-mothersmaidenname.html
Sahil Khanna (Jan 12 2020 at 16:50):
Modified the expression.. now it is not giving any error for mothersMaidenName tag.. but still not getting the output
Igor Sirkovich (Jan 12 2020 at 21:09):
You would need to define a new SearchParameter for this extension: https://www.hl7.org/fhir/searchparameter.html#srch
Last updated: Apr 12 2022 at 19:14 UTC