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

OperationOutcome "Patient // OperationOutcome.Location is deprecated, please use OperationOutcome.Expression" #3119

Open
arjun8001 opened this issue Feb 13, 2023 · 13 comments
Labels
Bug Bug bug bug. VSTS-Backlog On VSTS Backlog

Comments

@arjun8001
Copy link

arjun8001 commented Feb 13, 2023

Describe the bug
I stored my custom FHIR profile, and even though it stores the profile properly, it is unable to create and validate new resource properly.

FHIR Version?
Stu3/R4/R5
Stu3

Data provider?
CosmosDB/SQL Server

To Reproduce
Steps to reproduce the behavior:

  1. Create Patient Profile structure as given below. Using POSTMAN
    x-ms-profile-validation is set to TRUE
    POST {{fhirurl}}/StructureDefinition

Body

{
  "resourceType": "StructureDefinition",
  "url": "http://cihi.ca/fhir/nsir/StructureDefinition/TutorialPatient",
  "name": "TutorialPatient",
  "status": "draft",
  "fhirVersion": "3.0.2",
  "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
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "min": 1
      }
    ]
  }
}

  1. Create new Patient
{
    "resourceType" : "Patient",
    "meta" : {
        "profile":[
            "http://cihi.ca/fhir/nsir/StructureDefinition/TutorialPatient"
        ]
    },
    "birthDate": "1950-01-02", 
    "gender": "male",
    "identifier": [
        {
            "system": "http://example.com/something",
            "value": "test"
        }
    ],
    "name": [
        {
            "use":"official",
            "given": ["ABC"],
            "family": "DEF"

        }
        
    ]
}

Expected behavior

Once you create, it should give you below

{
    "resourceType": "Patient",
    "id": "25b4123e-4123-48c1-9e84-9605cef78ea3",
    "meta": {
        "versionId": "1",
        "lastUpdated": "2023-02-13T21:48:40.303+00:00",
        "profile": [
            "http://cihi.ca/fhir/nsir/StructureDefinition/TutorialPatient"
        ]
    },
    "identifier": [
        {
            "system": "http://example.com/something",
            "value": "arjun"
        }
    ],
    "name": [
        {
            "use": "official",
            "family": "DEF",
            "given": [
                "ABC"
            ]
        }
    ],
    "gender": "male",
    "birthDate": "1950-01-02"
}

Actual behavior
When I try to create new Patient, I receive this error
POST {{fhirurl}}/Patient

{
    "resourceType": "OperationOutcome",
    "id": "31a5faf4ba6c5f8b5777be0a9eb836be",
    "meta": {
        "lastUpdated": "2023-02-13T22:03:37.6992072+00:00"
    },
    "issue": [
        {
            "severity": "error",
            "code": "incomplete",
            "details": {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
                        "code": "4000"
                    }
                ],
                "text": "Unable to resolve reference to profile 'http://cihi.ca/fhir/nsir/StructureDefinition/TutorialPatient'"
            },
            "location": [
                "Patient // OperationOutcome.Location is deprecated, please use OperationOutcome.Expression"
            ],
            "expression": [
                "Patient"
            ]
        }
    ]
}

After hitting POST second time, the new patient is created.

Same is happening when I try to validate.

AB#101364

@arjun8001 arjun8001 added the Bug Bug bug bug. label Feb 13, 2023
@brendankowitz
Copy link
Member

@LTA-Thinking could this be related to caching?

@LTA-Thinking
Copy link
Collaborator

@brendankowitz yes, I think this is due to caching.
@arjun8001, does this deployment have multiple instances? If it is one of our managed offerings it does. The instances poll the database for new definitions every 10 minutes. It looks like the request that failed hit an instance that hadn't picked up the new definition yet, while the successful request hit the service that created the definition and was updated at that time. Does the new definition work reliably after waiting a few minutes?
@feordin, does this sound correct?

@arjun8001
Copy link
Author

@LTA-Thinking
The new definition was picked up.

  1. I made the definition.
  2. Made a request to create tutorial patient- rejected
  3. Made a request to create tutorial patient- accepted
  4. Made a request to create tutorial patient- rejected
  5. Made a request to create tutorial patient- accepted

below are the two services that I created one is for R4 and one is for STU 3 and I have been using for STU3
image

@EXPEkesheth
Copy link
Collaborator

EXPEkesheth commented Feb 25, 2023

@arjun8001 - is this issue resolved, can we close the issue?

@arjun8001
Copy link
Author

@EXPEkesheth ,
It is not resolved. I have been waiting to hear from you guys.

@LTA-Thinking
Copy link
Collaborator

Hi @arjun8001
Sorry for the delay. We are aware of some users having issues with the polling not picking up new Profiles on instances they weren't created on. My question, and I believe Ketki's follow up, was trying to find out if the issue persisted after some time had passed. This will help us determine if you are being affected by the known bug, or if the polling worked correctly for you but just is taking too long.

@visharadsharmaji
Copy link

We are also facing the same issue. I am posting messages bundles from the custom created utility and getting the below error when posting. Utility posts around 4 messages at every 30 seconds delay. However when i post using Postman it posts bundle successfully.

Error:

28T13:12:03.4069764+00:00"},"issue":[{"severity":"error","code":"invalid","diagnostics":"Resource type in the URL must match resourceType in the resource.","location":["TypeName // OperationOutcome.Location is deprecated, please use OperationOutcome.Expression"],"expression":["TypeName"]}]}

@EXPEkesheth
Copy link
Collaborator

Thanks for providing information. We have added this in backlog for further investigation.
AB#98127

@moloneyd-draeger
Copy link

moloneyd-draeger commented Mar 2, 2023

We have also noticed the same issue. Based on our logs, this seems to have started to occur on 2023-02-15, and has been happening sporadically since.

The error reported in issue[0].details.text is always "Unable to resolve reference to profile '{profile_url}'". The profile resources definitely exist on the server, and the validation process works before and after the "issue" is seen in the logs.

Any update on this issue is appreciated as we have disabled profile validation on some services as a workaround for this problem.

FHIR Version?
R4

Data provider?
CosmosDB

{
    "resourceType": "OperationOutcome",
    "id": "a8831a235e1c1633109b0177c2c8ceb5",
    "meta": {
        "lastUpdated": "2023-03-01T13:16:44.9637258+00:00"
    },
    "issue": [
        {
            "severity": "error",
            "code": "incomplete",
            "details": {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
                        "code": "4000"
                    }
                ],
                "text": "Unable to resolve reference to profile 'http://hl7.org/fhir/uv/pocd/StructureDefinition/MdsDevice'"
            },
            "location": [
                "Device // OperationOutcome.Location is deprecated, please use OperationOutcome.Expression"
            ],
            "expression": [
                "Device"
            ]
        }
    ]
}

@WhiteOlivierus
Copy link

I did have this problem too, what fixed it for me was checking if this folder C:\Users\%USER%\AppData\Local\Temp\FhirArtifactCache-4.3.0....\specification was empty. If it's not, then it's not causing this problem. Otherwise, remove the cache folder and restart.

@EXPEkesheth EXPEkesheth added the VSTS-Current We are working on this item in the current sprint label Mar 7, 2023
@WardEerland
Copy link

We are also experiencing the same issue on the managed service. I tried both with a built-in profile (us-core-patient) and a custom profile, both are present in the service. Both validation outcomes give the "Unable to resolve reference to profile ..." error.

{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "incomplete", "details": { "coding": [ { "system": "http://hl7.org/fhir/dotnet-api-operation-outcome", "code": "4000" } ], "text": "Unable to resolve reference to profile 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient'" }, "location": [ "Patient // OperationOutcome.Location is deprecated, please use OperationOutcome.Expression" ], "expression": [ "Patient" ] } ] }

@EXPEkesheth
Copy link
Collaborator

Thanks for reporting the issue . Backlog feature [#105394]

@EXPEkesheth EXPEkesheth added VSTS-Backlog On VSTS Backlog and removed VSTS-Current We are working on this item in the current sprint labels Jul 17, 2023
@edwinnswift
Copy link

We are experiencing the same issue with the OSS version running as an App Service. We cannot make use of $validate due to this issue. Is there an expected fix date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug bug bug. VSTS-Backlog On VSTS Backlog
Projects
None yet
Development

No branches or pull requests

9 participants