-
Notifications
You must be signed in to change notification settings - Fork 283
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
[BUG] Channel Step sequenceNumber
is not respected when POST
ing
#4635
Comments
Tested this locally and it looks like this only happens when exporting the channel as JSON. For the time being if you stick to XML it should work properly, keeping your transformer steps in the correct order. |
@cturczynskyj is there a way to import and export the channel in xml format over the API? From the examples I've seen, it's only been using json. |
@prestontw Yes, you can set the accept parameter to "application/xml". In your example code you are using curl so you can add the curl parameter |
@cturczynskyj thank you. I have made changes in the repo above (prestontw/mirth-sequencenumber-repro@1e0f641) to reflect your hint. However, now I'm seeing that the I can work around this by not having a comment on the first line, but it would lead to issues if I have a comment anywhere at all. It also removes the newlines in general JS steps, leading to hard-to-edit code: Exporting the channels in JSON was a workaround for XML not respecting newlines. Do you have any recommendations? I'm on MacOS 11.4. The curious thing to me is that importing the channel through the GUI respects line endings. What is the difference between using the API and using the GUI? I know the GUI is implemented over the API, so it's unexpected to me that there would be a difference. |
It looks like it's an issue exporting the channel over the api: https://github.com/prestontw/mirth-sequencenumber-repro/blob/1e0f64171519b2f795bda2d1c85f885498207b28/saved-channel.xml#L1585 doesn't have a newline separating the comment from the |
This may be how Curl is handling the POST body. I see you are using |
This worked, thank you so much @cturczynskyj ! This fixes the issue I had with exporting/importing over xml. Should we leave this issue open since the issue with importing over JSON still remains? |
Glad you got it working with XML 👍 And, yes, we'll leave this issue open for now. |
@cturczynskyj one other note is that I can reproduce this with XML format too---if I reorder the steps, it imports them in that order rather than the order specified by |
Describe the bug
When posting a channel through the channels API, steps'
sequenceNumber
has lower priority than the type of step it is, leading to a misordering of steps.To Reproduce
Setup steps (if required). Small reproducing repo is available here. The following steps will use this repo.
Example:
git clone https://github.com/prestontw/mirth-sequencenumber-repro.git
docker compose up -d
to start up the Mirth server within a docker containerSteps to reproduce the behavior:
example_hl7_to_fhir_channel.xml
1
)save-channel.sh
in the directorysequenceNumber: 1
:import-channel.sh
Expected behavior
After importing with
import-channel.sh
, the intermediate logging step should retain its original position in the transformation.Actual behavior
After importing with
import-channel.sh
, the intermediate logging step is in a new position. Notably, it is now grouped with the other javascript step.Screenshots
(pasted inline above)
Environment (please complete the following information):
FROM nextgenhealthcare/connect:3.11
Workaround(s)
Convert all of the steps to a common format, such as JS. This removes a lot of the benefits of the Mirth GUI, though.
Additional Context
Reproducing repo is available at https://github.com/prestontw/mirth-sequencenumber-repro
The text was updated successfully, but these errors were encountered: