By using AWS re:Post, you agree to the Terms of Use

Questions tagged with Amazon HealthLake

Sort by most recent
  • 1
  • 12 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

FHIR Works xml type example

Hello, I am trying to get an item created in AWS FHIR Works. It works fine with the json data type, but fails when using the xml type. I am using standard FHIR syntax. Please see below the two examples: ################################################### The json example below works fine. and returns following: ################################################### "name":[{"family":"RADES2","given":["PAULO"],"use":"official"}],"resourceType":"Patient","id":"38d424da-35f7-4e14-9e4a-c1ba174d26b9","meta":{"versionId":"1","lastUpdated":"2022-05-22T06:21:46.859Z"}} curl \ -H "Content-Type: application/json; charset=utf-8" \ -H "Authorization: $(python3 scripts/init-auth.py xxxxxxxx us-west-2)" \ -H "x-api-key:xxxxxxxxxxx" \ --request POST \ --data '{"name": [{"family": "RADES2", "given": ["PAULO"], "use": "official"}], "resourceType": "Patient"}' \ "https://xxxxxxx.execute-api.us-west-2.amazonaws.com/dev/tenant/TenantA/Patient" ################################################### XML examples fail below. Both the below fail. The first one is the standard FHIR syntax, but also tried by adding the resourceType, but both fail with same error: ################################################### "resourceType":"OperationOutcome","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">error</td><td>[]</td><td><pre>resource should have required property 'resourceType'</pre></td></tr></table></div>"},"issue":[{"severity":"error","code":"invalid","diagnostics":"resource should have required property 'resourceType'"}]} ##### curl \ -H "Content-Type: application/xml; charset=utf-8" \ -H "Authorization: $(python3 scripts/init-auth.py xxxxxxx us-west-2)" \ -H "x-api-key:xxxxxxx" \ --request POST \ -d "<Patient xmlns=\"http://hl7.org/fhir\"><name><family value=\"RADES3\"/><given value=\"PAULO\"/></name></Patient>" \ "https://xxxxxxx.execute-api.us-west-2.amazonaws.com/dev/tenant/TenantA/Patient" ####### curl \ -H "Content-Type: application/xml; charset=utf-8" \ -H "Authorization: $(python3 scripts/init-auth.py xxxxxxx us-west-2)" \ -H "x-api-key:xxxxxxx" \ --request POST \ -d "<Patient xmlns=\"http://hl7.org/fhir\"><resourceType><\"Patient\"/></resourceType><name><family value=\"RADES3\"/><given value=\"PAULO\"/></name></Patient>" \ "https://xxxxxxx.execute-api.us-west-2.amazonaws.com/dev/tenant/TenantA/Patient"
1
answers
0
votes
40
views
asked 4 months ago

Best way to overcome HIVE_PARTITION_SCHEMA_MISMATCH error in Athena while preserving structure of structs?

I ran the following Amazon Athena query on a table created by AWS Glue, which had crawled an Amazon S3 export of Synthea data from Amazon HealthLake: ``` SELECT * FROM "glue01234567890_fhir_export_abcdefghijklmnopqrst"; ``` That resulted in this error: > HIVE_PARTITION_SCHEMA_MISMATCH: There is a mismatch between the table and partition schemas. The types are incompatible and cannot be coerced. The column 'code' in table 'demo.glue01234567890_fhir_export_abcdefghijklmnopqrst' is declared as type 'struct<coding:array<struct<system:string,code:string,display:string>>,text:string>', but partition 'partition_0=ImagingStudy' declared column 'id' as type 'string'. This query ran against the "demo" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id I saw [one answer](https://repost.aws/questions/QU1vPk1069Q5qg4iyuQWTk6Q/while-importing-s-3-data-into-quicksight-from-glue-database-getting-the-following-error) to go to edit the Crawler and then to output -->configuration and "Update all new and existing partitions with metadata from the table." However, that didn't resolve the error for me. When I edit the schema manually an change column 'code' from `struct` to `string`, the error goes away, and Athena brings my attention to the next mismatch: > partition 'partition_0=Immunization' declared column 'patient' as type 'struct<reference:string>'. I don't think, however, manually replacing all structs with strings will get me the results I want, because I need Glue and Athena to be aware of the fields inside the structs. What is the best approach to overcoming this error while preserving the structure of the data, in this situation where I want to make the HealthLake export queryable by Athena? I understand I'll want to add a step to the ETL in Glue to first convert to Parquet or ORC for Athena performance reasons, but right now I'm dealing with a small sample dataset and just want to focus on getting a minimum viable end-to-end flow going.
1
answers
0
votes
127
views
asked 5 months ago
  • 1
  • 12 / page