HL7-FHIR accepting absolute foreign references on

2019-09-05 01:14发布

In 2.6.3 Copying Resources and re-identification of DSTU1 there's a description of how clients may have to re-assign ids on resources pulled from a server. My question is what should be allowed when going in the opposite direction. I see no issue with accepting foreign absolute references when there's no re-interpretation needed (ie you accept the URI on POST/PUT and return the same URI on GET), but I'm wondering if they should be accepted if a re-identification is needed on the server side (ie you accept the URI on POST/PUT but assign a new id no the object such that subsequent GET's return a local relative URI).

Are there any guidelines in DSTU1 (or even DSTU2) related to this?

Example

The client POSTs the following:

{
    "resourceType": "Patient",
    "name": [{"text": "Irene"}],
    "careProvider": [{"reference": "https://fhir.example.com/api/Organization/12345"}]
}

The client then does a GET and receives the following:

{
    "resourceType": "Patient",
    "id": "abc",
    "name": [{"text": "Irene"}],
    "careProvider": [{"reference": "Organization/987"}]
}

You can see that the server re-identified the Organization into a local reference.

标签: rest hl7-fhir
1条回答
叛逆
2楼-- · 2019-09-05 01:53

There's no more material than what you already referenced. The material isn't meant to dictate the answers, only to suggest the kind of solutions that might be needed. Generally, then, it's not really possible to talk about what's allowed - except or one thing you mentioned: the server isn't allowed to accept a PUT and then not honor the PUT by moving the resource; it should reject the PUT and insist on a POST. But generally, the mix of clients, servers and middleware in an eco-system, I don't know that we can usefully make rules about what should and shouldn't happen

查看更多
登录 后发表回答