0

I am attempting to import a code library into Mirth Connect using the REST API.

According to the API documentation, there are 2 endpoints that may be used to do this:

POST /codeTemplateLibraries/_bulkUpdate
PUT /codeTemplateLibraries

Hitting either of these endpoints using curl and passing the required data, I receive a positive response from the Mirth server, but when I open the Mirth Connect GUI and look at the code libraries, all of the libraries are empty; however, each library should have multiple code templates.

Has anyone experienced anything like this with Mirth 3.5.0? I have searched the Mirth Community forums and tried all the proposed fixes such as the ones in the thread here:

http://www.mirthproject.org/community/forums/showthread.php?t=216331

spookymodem
  • 345
  • 5
  • 12

1 Answers1

1

This question was answered on the "Mirth Project" forums.

Below is the answer.

For importing a code template library or channel group:

  1. Import the grouping element (channel group/template library) by using the bulk import and assure that:

    • all ids of the child elements (channels respectively templates) are included and
    • all sections are present (update, add, delete, if I remember right)
  2. Import the corresponding channels or code templates with the respective REST call

http://www.mirthproject.org/community/forums/showthread.php?p=260881#post260881

spookymodem
  • 345
  • 5
  • 12
  • can you please share the code that can be used to achieve this in a javascript template? Myself I am trying to export and import channel groups from within code templates and I have been searching for clear documentation on how to consume the mirth connect rest api in a javascript transformer in vain. Can you help with that? maybe an example of how its done in a JS transformer? – Mike Aono Oct 31 '17 at 05:59