POST bundle to hapi FHIR server #474
                  
                    
                      1hamzaiqbal
                    
                  
                
                  started this conversation in
                General
              
            Replies: 1 comment
-
| I am also learning the peculiarities of this library. I am only sharing what I know (which is limited). It is a "wrapper", where the (result of the transformation, aka the FHIR-resource itself) is nested under "FhirResource": json element. The below wrapper is defined here: https://github.com/microsoft/FHIR-Converter/blob/main/src/Microsoft.Health.Fhir.Liquid.Converter.Tool/Models/ConverterResult.cs#L11L22 ) I don't think there is a way to make it "just-the-fhir-resource" itself. But I am sharing a breadcrumb of the source of that wrapper. Again, sharing what I discovered. I am learning this library. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently working on converting HL7v2 messages given some sample data from a lab I am working with. I have had partial success with this process but am unclear about how to convert the data into JSON form and POST the json (send to restful api) to a hapi FHIR R4 server.
I have this sample data file:
hemo2.txt
And I can successfully convert it using the command (in the command line):
>./Microsoft.Health.Fhir.Liquid.Converter.Tool convert -n ~/Documents/ms_fhir/FHIR-Converter/data/Sample\ Auto\ Outbound\ Results/hemo2.hl7 -d ~/Documents/ms_fhir/FHIR-Converter/data/Templates/HL7v2/ -f ~/Documents/ms_fhir/FHIR-Converter/data/output_test/fhir_outs/hemo2_test.json -r ORU_R01And I get a successful conversion into a valid JSON file, but if I want to use the json bundle I have to remove the initial fields and 'outer layer' of the json, ie: 'Status' and 'FhirResource' labels in the initial part of the message
{ "Status": "OK", "FhirResource": { "resourceType": "Bundle", ... } }Basically, I want to setup my system to convert my messages from HL7v2 into FHIR bundles, and then POST them to my FHIR server, but it seems like I'd have to remove the outer Status and FhirResource, then do a POST with the JSON main body starting with
{"resourceType": "Bundle",.Is there a better way to go about this? Or is there a more elegant way to transform my data and send it to the REST api endpoint of my choosing?
Beta Was this translation helpful? Give feedback.
All reactions