Skip to content

POST Bundle With ifNoneExist Clause Incorrectly Rejected With Invalid Match URL ERROR #4580

Closed
@KevinDougan

Description

@KevinDougan

Describe the bug
When POSTing a Bundle with a ifNoneExist clause, the server incorrectly rejects it with:

IllegalArgumentException: Invalid match URL format (must match "[resourceType]?[params]").

To Reproduce

  1. PUT the following SearchParameter to the server at http://localhost:8080/fhir/SearchParameter/patient-first-identifier:
{
    "resourceType": "SearchParameter",
    "status": "active",
    "id": "patient-first-identifier",
    "code": "patient-first-identifier",
    "type": "token",
    "base": [
        "Patient"
    ],
    "expression": "Patient.identifier.first()"
}
  1. POST the following Bundle to the server at http://localhost:8080/fhir:
{
    "resourceType": "Bundle",
    "type": "transaction",
    "entry": [
        {
            "fullUrl": "urn:uuid:3155007d-6761-4275-bbad-31fba2b09d62",
            "resource": {
                "resourceType": "Patient",
                "identifier": [
                    {
                        "use": "official",
                        "type": {
                            "coding": [
                                {
                                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                                    "code": "MR"
                                }
                            ]
                        },
                        "system": "MRN",
                        "value": "123456789"
                    }
                ],
                "name": [
                    {
                        "use": "official",
                        "family": "Doe",
                        "given": [
                            "John"
                        ]
                    }
                ],
                "gender": "male",
                "birthDate": "1990-12-21",
                "deceasedBoolean": false
            },
            "request": {
                "method": "POST",
                "url": "/Patient",
                "ifNoneExist": "patient-first-identifier=MRN%7C123456789"
            }
        }
    ]
}
  1. Notice that the server rejects it with the following ERROR:
{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "HAPI-0389: Failed to call access method: java.lang.IllegalArgumentException: Invalid match URL format (must match \"[resourceType]?[params]\")"
        }
    ]
}

Observed behavior
The server rejects the Bundle with an IllegalArgumentException and does not create the Patient resource.

Expected behavior
The server should accept the Bundle and create the Patient resource.

Environment:

  • HAPI FHIR Version 6.5.0-SNAPSHOT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions