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

Importing data into FHIR store failing #124

Closed
sanjaykhobragade opened this issue Jun 19, 2019 · 2 comments
Closed

Importing data into FHIR store failing #124

sanjaykhobragade opened this issue Jun 19, 2019 · 2 comments
Labels
fhir Issues relating to FHIR projects

Comments

@sanjaykhobragade
Copy link

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -d '{"gcsSourceLocation":{"gcsUri":"gs://'${PROJECT_ID?}'/'demo_data.ndjson'"}}' "https://healthcare.googleapis.com/${API_VERSION?}/projects/${PROJECT_ID?}/locations/${REGION?}/datasets/${DATASET_ID?}/fhirStores/${FHIR_STORE_ID?}:import"
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name "{"gcsSourceLocation":{"gcsUri":"gs://dicom-poc/demo_data.ndjson"}}": Cannot bind query parameter. Field '{"gcsSourceLocation":{"gcsUri":"gs://dicom-poc/demo_data' could not be found in request message.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON payload received. Unknown name "{"gcsSourceLocation":{"gcsUri":"gs://dicom-poc/demo_data.ndjson"}}": Cannot bind query parameter. Field '{"gcsSourceLocation":{"gcsUri":"gs://dicom-poc/demo_data' could not be found in request message."
}
]
}
]
}
}

Not sure why it's looking for demo_data instead of demo_data.ndjson resource

@nikklassen nikklassen added the fhir Issues relating to FHIR projects label Jun 25, 2019
@nikklassen
Copy link
Collaborator

It looks like the issue is the API isn't interpreting your request as JSON. You'll need to add -H "Content-Type: application/json". I'll update the documentation to reflect this. Also, if you're using the v1beta1 version of the API the request format has changed. docs. You'll need to change the request to

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -d '{"gcsSource":{"uri":"gs://'${PROJECT_ID?}'/'demo_data.ndjson'"}}' "https://healthcare.googleapis.com/${API_VERSION?}/projects/${PROJECT_ID?}/locations/${REGION?}/datasets/${DATASET_ID?}/fhirStores/${FHIR_STORE_ID?}:import"

I'll also fix this in the doc.

@nikklassen
Copy link
Collaborator

Closed in #135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fhir Issues relating to FHIR projects
Projects
None yet
Development

No branches or pull requests

2 participants