Reverse chaining not returning any results

Hello,

I am new to the FHIR logic and I am trying to create some API calls that will give me the Patients that match certain criteria. Specifically, I am trying to create some API calls that use reverse chaining, but they don’t return any results and I am not sure why.

For example, I want to get all Patients that have a specific cancer type, with code “781382000”. Thus my request is as follows: [base]/fhir-server/api/v4/Patient?_has:Observation:patient:code=781382000.
However I get 0 results. Is there something wrong with my request?

The following request gives me the correct observations: [base]/fhir-server/api/v4/Observation?code=781382000, but I need the patients…

In case it helps, here is my Observation resource:

        <resource>
            <Observation xmlns="http://hl7.org/fhir">
                <id value="ob-1"/>
                <status value="final"/>
                <code>
                    <coding>
                        <system value="http://snomed.org"/>
                        <code value="781382000"/>
                        <display value="X cancer"/>
                    </coding>
                </code>
                <subject>
                    <reference value="Patient/ABCD123"/>
                    <type value="Patient"/>
                </subject>
                <performer>
                    <reference value="Organization/org-1"/>
                    <type value="Organization"/>
                </performer>
            </Observation>
        </resource>

And my Patient resource:

<resource>
            <Patient xmlns="http://hl7.org/fhir">
                <id value="ABCD123"/>
                <extension url="http://example.com/currentstatus">
                    <valueCode value="0"/>
                </extension>
                <identifier>
                    <type>
                        <text value="Identifier"/>
                    </type>
                    <value value="ABCD123"/>
                </identifier>
                <name>
                    ...
                </name>
                <telecom>
                    ...
                </telecom>
                <telecom>
                    ...
                </telecom>
                <gender value="..."/>
                <birthDate value="..."/>
                <maritalStatus>
                    ...
                </maritalStatus>
                <managingOrganization>
                    <reference value="Organization/organization-id-01"/>
                </managingOrganization>
            </Patient>
</resource>

Thanks

Does the server support reverse chaining? What gets echoed back in the “self” link?

Yes it does.

My mistake was on the way I was handling the patient ids, thus all references to them were incomplete.

In order for reverse chaining to work as expected, I must upload all Patient resources using a “PUT” request at [base]/Patient<p_id>,
while I was uploading them using a “POST” request at [base]/Patient