0
votes

I am using mirth connect to for fhir data, i am able to separate the data into separate variables but don't know how to store into mongoDB as database writer doesn't have any mongoDB option. Thanks in advance.

2

2 Answers

1
votes

In this case you can use the DB connection through Javascript, try using the below script this is a basic connectivity.

var mongoClient = new Packages.com.mongodb.MongoClient("localhost", 27017);
var database = mongoClient.getDatabase("mongoDB");
var collection = database.getCollection("testDB");

By default, mongoDB listens in the port 27017. And If you are parsing FHIR then you may need to store entire resource as JSON.

you can append the values in the JSON data using .append function and insert them into your db. I hope this code helps.

0
votes

Use JavaScript Writer or, even better, Channel Writer destination and code everything as a transformer step(s).