Making PowerShell “Posh”
Back in the days when DOS and Windows were separate programs, the default Command Prompt didn’t look exactly the way that it does now. I can’t recall if it w...
As a Data Engineer using Mirth Connect, it’s often tricky to review my team’s merge requests because the merge request document contains the XML representation of the channel. In order to understand what we’re looking at without loading the Mirth Connect Console, we have to be able to sight-inspect XML, which is not easy. Fortunately, there are a few things we can do in PowerShell to make this easier to read through, but it does require a copy of the file being reviewed.
First, we can check out the list of transformer steps in each of the destinations with some Select-Xml and Select-Object manipulation:
Select-Xml .\CHANNEL.xml -XPath '//channel/destinationConnectors/connector' `
| Select-Object -Property @{Name='Destination'; Expression={$_.node.name}}, `
@{Name='TransformerStep'; Expression={$_.node.transformer.elements.ForEach({$_.ChildNodes.name.Where({$_ -ne '#whitespace'})})}} `
| ConvertTo-Json
Note: that there’s a ConvertTo-Json at the end only to make the output more readable.
If we want to take a closer look at the transformer steps, we can do that as well:
$connector="DATA_EXTRACTION";
Select-Xml .\CHANNEL.xml -XPath "//channel/destinationConnectors/connector[name='$connector']/transformer/elements/*" `
| Select-Object -ExpandProperty Node
We can also take a look at the names of the filter steps:
Get-Childitem .\CHANNEL.xml | ForEach-Object { $ChannelFile = $_.Name; Select-Xml $_ -XPath '//channel/destinationConnectors/connector' `
| Select-Object -Property @{Name='Channel'; Expression={$ChannelFile}}, `
@{Name='Destination'; Expression={$_.node.name}}, `
@{Name='FilterStep'; Expression={$_.node.filter.elements.ForEach({$_.ChildNodes.name.Where({$_ -ne '#whitespace'})})}}} `
| ConvertTo-Json
This obviously doesn’t show absolutely all of the details so it’s not a substitute for viewing the channel in the Mirth Connect Editor, but it can give us a way to take a quick look when we’re in a pinch.
Back in the days when DOS and Windows were separate programs, the default Command Prompt didn’t look exactly the way that it does now. I can’t recall if it w...
Sometimes it’s the little things…
As a Data Engineer using Mirth Connect, it’s often tricky to review my team’s merge requests because the merge request document contains the XML representati...
When dealing with Python dependencies, it’s sometimes necessary to determine if a given project is using a given version of a library. Since our team is usin...
A while ago, I wrote about using a bare git repository to manage my dotfiles. That worked somewhat well, but it had some shortcomings. Since, I’ve started us...
One of my current projects involves some improvements to code that I wrote last year – specifically enhancing the “Patient Identity Fixer”, which is my pet p...
To borrow from a favorite web comic: whenever I learn a new skill, I concoct elaborate fantasy scenarios where it lets me save the day. Actually, it feels li...
This one bugged me for a few days. I don’t think this script is the best solution to the problem at hand, but it was still fun to figure out.
My team at work has a custom FHIR resource that we work with often called an Operation Outcome. We generate one of these for nearly every record we process, ...
a.k.a. Why I Don’t Use Nano
COVID-19 has us many of us working from home. My husband and I are both fortunate enough to be in this group. However, as a teacher, his schedule is very pre...
When I set up a Raspberry Pi, there are a few things that I have to do right out of the gate to make things easier on myself. They involve putting a few file...
While I don’t use Linux as my primary operating system, I do use it a lot both at home and at work. It can be frustrating to try to sync up configurations be...
Anyone who knows my husband or me knows that we really like our cold brew, and they also know that we make our own at home. Nitro cold brew has become a bit ...
So you want to run an OpenVPN Server on a Raspberry Pi? I did too, but it wasn’t easy to figure out the first time. If you want to skip all of this and do it...