Hey all,
I'm using the JPA-Starter server on version 6.0.1, loaded with data from Synthea. I have been experimenting with bulk import/export operations, and have a few questions. Apologies in advance if I'm missing something obvious, I'm still rather new to FHIR!Â
Problem Overview:
- Most importantly, the $import consistently throws an error that the server doesn't know how to handle the operation with null parameters. From reading online, it seems that a Parameters resource configured with respect to this page on SmileCDR. I'll include more details below. There are two questions on this:
- Is the JPA starter server updated to permit bulk import/export operations? It appears so from the recent version release notes, but neither hapi.fhir.org nor the local server I created recognize this operation.
- I have tried a workaround of parsing through the ndjson files and importing resources individually, however, I run into an issue with resources references other resources that don't exist. Importing them in an more preferred order doesn't seem to work, as somewhere down the line there's always a reference to something not yet imported. Is there a workaround or better approach to this, if $import is not available?
- The bulk export works, however when calling against the Patient/ resources, I am only retrieving Patients - never the associated resources. My scripts for executing the export operation work fine on other endpoints, and can retrieve ndjson files without issue. The local server seems to be the problem, which I suspect is rooted in my Synthea data.
What I've Tried/Done:
Note that I'm using PHP to initiate the request for testing, and to effectively act as a client for downstream request/responses. $import alone is explored here, because $export seems to work fine against other endpoints.
Here is the error returned from the local server on request:
 "issue": [ {
  "severity": "error",
  "code": "not-supported",
  "diagnostics": "Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[$import] with parameters [[]]"
 } ]
And what I have tried:
- Built resource parameter into request body, like so (the encoded json was verified through an online resource):
    $body = array(
        "resourceType" => "Parameters",
        "parameter" => array(
            array(
                "name" => "inputFormat",
                "valueCode" => "application/fhir+ndjson"
            ),
            array(
                "name" => "inputSource",
                "valueUrl" => "http://example.com/fhir/"
            ),
            array(
                "name" => "storageDetail",
                "part" => array(
                    array(
                        "name" => "type",
                        "valueCode" => "https"
                    )
                )
            ),
            array(
                "name" => "input",
                "part" => array(
                    array(
                        "name" => "type",
                        "valueCode" => $resource_type,
                    ),
                    array(
                        "name" => "url",
                        "valueUrl" = "https://example.com/observations.ndjson"
                    )
                )
            )
        )
    );
- The headers include the following:
        array(
                "Content-type: application/json",
                "Accept: fhir+json",
                "Prefer: respond-async"
        )
- I've updated application.yaml to the following changes from default:
enable_index_missing_fields: true
binary_storage_enabled: true
bulk_export_enabled: true
Any help or advice is greatly appreciated!