- You suspect long running, slow, or stuck connections
- You suspect infinite loops
- You have problems that are only fixed by redeploying channels or restarting Mirth
- You have high memory usage
- When Mirth just seems generally backed up and not right
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clientBuilder = new Packages.software.amazon.awssdk.services.s3.S3Client.builder(); | |
// Set the AWS account Access Key, AWS account Secret Key | |
var awsCreds = new Packages.software.amazon.awssdk.auth.credentials.AwsBasicCredentials.create(access_key, secret_key); | |
var awsCredProvider = new Packages.software.amazon.awssdk.auth.credentials.StaticCredentialsProvider.create(awsCreds) | |
var east_region = Packages.software.amazon.awssdk.regions.Region.US_EAST_1 | |
// build s3client with options | |
var s3client = clientBuilder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- replace d_mmX where X is the local channel ID of the channel you want to check | |
-- processing time | |
with started as (select message_id, received_date from d_mm19 where connector_name = 'Source' and status = 'T'), | |
max_send_date as (select message_id, max(response_date) as final_send_date | |
from d_mm19 | |
where status = 'S' | |
and connector_name != 'Source' | |
group by message_id), | |
per_message_start_end as (select s.message_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Credit to Mike Klemens and Chris Gibson in Mirth Slack | |
// Get the server ID using ConfigurationController | |
var serverInstance = Packages.com.mirth.connect.server.controllers.ConfigurationController.getInstance(); | |
var serverId = serverInstance.getServerId(); | |
//Use Dashboard Status plugin | |
var defController = Packages.com.mirth.connect.server.controllers.DefaultExtensionController.create(); | |
var monitor = defController.getServicePlugins().get(com.mirth.connect.plugins.dashboardstatus.DashboardConnectorStatusServletInterface.PLUGIN_POINT); | |
connectorListener = monitor.getConnectorListener(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
dm.message_id, status,connector_name , | |
to_char(received_date AT TIME ZONE 'US/Eastern', 'YYYY-MM-DD hh24:mi') || ' US/Eastern' as message_date, | |
(regexp_matches(mc.content, 'PID\|(?:.*?\|){2}(.*?)\|'))[1] as pid_3_mrns, | |
(regexp_matches(mc.content, 'PV1\|(?:.*?\|){18}(.*?)\|'))[1] as pv1_19_visit_id, | |
(regexp_matches(mc_error.content, '.*ERROR MESSAGE:\s+(.*?)', 'n'))[1] as error_message, | |
(regexp_matches(mc_error.content, '.*DETAILS:\s+(.*?)', 'n'))[1] as detail_message | |
from mirth.public.d_mm76 dm | |
inner join d_mc76 mc on mc.message_id = dm.message_id and mc.metadata_id = 0 and mc.content_type = 1 | |
inner join d_mc76 mc_error on mc_error.message_id = dm.message_id and mc_error.metadata_id = dm.id and mc_error.content_type = 12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//can use this to get the message content and check state and send attempts | |
// we have channelId and messageId | |
// pass metadataIds as null -> the connector message returned will then have one or many connector messages. #0 is the source, and source has connectorMessage.getDestinationIdMap(); which we can iterate to turn our connector name into the numeric metadata id | |
var shouldAlert = true; | |
var metaDataIds = null; | |
var alertedChannelId = msg['channelId']; | |
var messageId = parseInt(msg['messageId']); | |
var messageController = Packages.com.mirth.connect.server.controllers.messageController.getInstance(); | |
var message = messageController.getMessageContent(alertedChannelId, messageId, metaDataIds); | |
var sourceMessage = message.getConnectorMessages().get(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with channel_xml as ( | |
select | |
name, | |
xmlparse(document channel) as channel_xml | |
from channel c | |
) | |
, destination_connector_xml as ( | |
SELECT | |
name as channel_name, | |
unnest(xpath('//destinationConnectors/connector/name/text()', channel_xml))::TEXT as connector_name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nextgenhealthcare/connect:4.3.0 as connect | |
#clone some boilerplate from MC image | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US:en | |
ENV LC_ALL en_US.UTF-8 | |
#TODO using a tarball and ADD also sets us up to get these artifacts from artifactory instead of from git | |
#TODO the parent entrypoint.sh does something with a custom-extensions directory, review it and see if it does this unpacking for us | |
#TODO I still think ADD is best here since it can fetch from remote URLs, it sets us up to use artifactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH attribute_rows AS (select e.name, | |
e.date_created, | |
xml_element.* | |
from "event" e, | |
xmltable('//linked-hash-map/entry' | |
passing (e."attributes"::xml) | |
columns "key" text PATH 'string[1]', | |
"value" text PATH 'string[2]' | |
) as xml_element | |
where e.name like '%Deploy%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with channel_xml as ( | |
select | |
name, | |
xmlparse(document channel) as channel_xml | |
from channel c | |
) | |
, destination_connector_xml as ( | |
SELECT | |
name as channel_name, | |
unnest(xpath('//destinationConnectors/connector/name/text()', channel_xml))::TEXT as connector_name, |
NewerOlder