Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create custom search parameter for Careplan medicaldevice #2146

Closed
sasireha opened this issue Aug 5, 2021 · 12 comments
Closed

Unable to create custom search parameter for Careplan medicaldevice #2146

sasireha opened this issue Aug 5, 2021 · 12 comments
Labels
Question Issue is a question? Review Tag for PM/Dev Review VSTS-Backlog On VSTS Backlog
Milestone

Comments

@sasireha
Copy link

sasireha commented Aug 5, 2021

Description
I tried to create the following custom search parameter for CarePlan but server returns bad request error.

{
   "resourceType": "SearchParameter",
   "id": "careplan-medicaldevice",
   "url": "http://nictiz.nl/fhir/SearchParameter/careplan-medicaldevice",
   "version": "1.0.0",
   "name": "careplan-medicaldevice",
   "status": "active",
   "publisher": "Nictiz",
   "contact": `[`
       {
           "name": "Nictiz",
           "telecom": [
               {
                   "system": "email",
                   "value": "info@nictiz.nl",
                   "use": "work"
               }
           ]
       }
   ],
   "purpose": "To search on a DeviceUseStatement resource, referenced from an extension in CarePlan. Main purpose is to use this search parameter for including DeviceUseStating resouces in the result for a search on CarePlan.",
   "code": "medicaldevice",
   "base": [
       "CarePlan"
   ],
   "type": "reference",
   "description": "To alow a search (_include) on the materials used in nursing procedures, such as bandages.",
   "expression": "CarePlan.activiy.detail.extension('http://nictiz.nl/fhir/StructureDefinition/extension-medicaldevice')"
 }

FHIR Version
Stu3

Data provider
CosmosDB

Expected behavior
Should be able to create the custom search parameter with the url 'http://nictiz.nl/fhir/SearchParameter/careplan-medicaldevice'

Actual behavior
Fhir server returns the following error message

{
    "resourceType": "OperationOutcome",
    "id": "1b3598f0-f3af-40b7-8739-41b121106d80",
    "issue": [
        {
            "severity": "error",
            "code": "not-supported",
            "diagnostics": "The search parameter with definition URL 'http://nictiz.nl/fhir/SearchParameter/careplan-medicaldevice' is not supported."
        },
        {
            "severity": "error",
            "code": "exception",
            "diagnostics": "An error occurred updating the custom search parameter.  The issue must be resolved and the update resubmitted to be applied."
        }
    ]
}

AB#101795

@sasireha sasireha added the Bug Bug bug bug. label Aug 5, 2021
@brendankowitz brendankowitz added Question Issue is a question? and removed Bug Bug bug bug. labels Aug 5, 2021
@brendankowitz
Copy link
Member

The expression needs to be a type that can converted from the Model Type to a Search type, so it can be indexed. In the example above the expression ends with type Extension.

If you take http://hl7.org/fhir/us/core/STU3.1.1/SearchParameter-us-core-race.html for example, it specifies Patient.extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race').extension.value.code which would be able to be converted to a token search type.

If the extension data was similar to:

"extension":  [
                    {
                        "url": "http://nictiz.nl/fhir/StructureDefinition/extension-medicaldevice",
                        "valueReference": {
                            "reference": "DeviceUseStatement/zib-wound-medicaldevice-01",
                            "display": "Verband"
                        }
                    }
                ]

The parser would need something like the following to detect support correctly:
CarePlan.activiy.detail.extension('http://nictiz.nl/fhir/StructureDefinition/extension-medicaldevice').value

@sasireha
Copy link
Author

sasireha commented Aug 5, 2021

Thanks for the update!
I modified the expression as you mentioned but still I get the same error.

{
    "resourceType": "OperationOutcome",
    "id": "f84282eb-ad9e-4618-bffd-d993b7a93bb9",
    "issue": [
        {
            "severity": "error",
            "code": "not-supported",
            "diagnostics": "The search parameter with definition URL 'http://nictiz.nl/fhir/SearchParameter/careplan-medicaldevice' is not supported."
        },
        {
            "severity": "error",
            "code": "exception",
            "diagnostics": "An error occurred updating the custom search parameter.  The issue must be resolved and the update resubmitted to be applied."
        }
    ]
}

@CaitlinV39
Copy link
Contributor

Can you send the updated search parameter you posted?

@sasireha
Copy link
Author

sasireha commented Aug 5, 2021

Here it is

{
                "resourceType": "SearchParameter",
                "id": "careplan-medicaldevice",
                "url": "http://nictiz.nl/fhir/SearchParameter/careplan-medicaldevice",
                "version": "1.0.0",
                "name": "careplan-medicaldevice",
                "status": "active",
                "publisher": "Nictiz",
                "contact": [
                    {
                        "name": "Nictiz",
                        "telecom": [
                            {
                                "system": "email",
                                "value": "info@nictiz.nl",
                                "use": "work"
                            }
                        ]
                    }
                ],
                "purpose": "To search on a DeviceUseStatement resource, referenced from an extension in CarePlan. Main purpose is to use this search parameter for including DeviceUseStating resouces in the result for a search on CarePlan.",
                "code": "medicaldevice",
                "base": [
                    "CarePlan"
                ],
                "type": "reference",
                "description": "To alow a search (_include) on the materials used in nursing procedures, such as bandages.",
                "expression": "CarePlan.activiy.detail.extension('http://nictiz.nl/fhir/StructureDefinition/extension-medicaldevice').value"
            }

@Ivanidzo4ka
Copy link
Contributor

Let me recall my previous statement...
Main reason why it's not working:
CarePlan.activiy is misspelled it should be CarePlan.activity

@sasireha
Copy link
Author

Thanks I have corrected the spelling as mentioned but I get a different error now. I have provided value for all the mandatory properties, I'm not sure what I'm missing still.

{
                "resourceType": "SearchParameter",
                "id": "careplan-medicaldevice",
                "url": "http://nictiz.nl/fhir/SearchParameter/careplan-medicaldevice",
                "version": "1.0.0",
                "name": "careplan-medicaldevice",
                "status": "active",
                "publisher": "Nictiz",
                "contact": [
                    {
                        "name": "Nictiz",
                        "telecom": [
                            {
                                "system": "email",
                                "value": "info@nictiz.nl",
                                "use": "work"
                            }
                        ]
                    }
                ],
                "purpose": "To search on a DeviceUseStatement resource, referenced from an extension in CarePlan. Main purpose is to use this search parameter for including DeviceUseStating resouces in the result for a search on CarePlan.",
                "code": "medicaldevice",
                "base": [
                    "CarePlan"
                ],
                "type": "reference",
                "description": "To alow a search (_include) on the materials used in nursing procedures, such as bandages.",
                "expression": "CarePlan.activity.detail.extension('http://nictiz.nl/fhir/StructureDefinition/extension-medicaldevice').value"
            }
{
    "resourceType": "OperationOutcome",
    "id": "a7be835d-3d8e-4e99-974f-daee7060ba99",
    "issue": [
        {
            "severity": "error",
            "code": "exception",
            "diagnostics": "An error occurred updating the custom search parameter.  The issue must be resolved and the update resubmitted to be applied."
        },
        {
            "severity": "error",
            "code": "exception",
            "diagnostics": "Value cannot be null. (Parameter 'uriString')"
        }
    ]
}

@CaitlinV39 CaitlinV39 added the Review Tag for PM/Dev Review label Aug 13, 2021
@CaitlinV39
Copy link
Contributor

@CaitlinV39

@CaitlinV39
Copy link
Contributor

@rotodd Would you mind taking a look at this one?

@CaitlinV39 CaitlinV39 removed the Review Tag for PM/Dev Review label Sep 16, 2021
@CaitlinV39 CaitlinV39 added the VSTS-Pending Prioritization We would like to add this to the backlog label Sep 24, 2021
@sasireha
Copy link
Author

sasireha commented Dec 7, 2021

Hi, Is there any update on this issue?

@CraigP68
Copy link

CraigP68 commented Dec 9, 2021

AB#87251

@CraigP68 CraigP68 added VSTS-Backlog On VSTS Backlog and removed VSTS-Pending Prioritization We would like to add this to the backlog labels Dec 9, 2021
@CraigP68 CraigP68 added this to the backlog milestone Dec 9, 2021
@EXPEkesheth EXPEkesheth added the Review Tag for PM/Dev Review label Mar 20, 2023
@EXPEkesheth
Copy link
Contributor

@sasireha - are you still facing the issue? This is a good reference page : https://learn.microsoft.com/en-us/azure/healthcare-apis/fhir/how-to-do-custom-search.

Please let us know if you have additional questions. If we have no response - this issue will be closed (given it was created more than year ago)

@EXPEkesheth
Copy link
Contributor

Closing the issue due to no response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Issue is a question? Review Tag for PM/Dev Review VSTS-Backlog On VSTS Backlog
Projects
None yet
Development

No branches or pull requests

6 participants