### startChannels Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Examples of starting multiple channels, including starting all channels and starting a specific set of channels. ```java // Start all channels channelStatusServlet.startChannels(null, false); // Start specific channels Set channels = new HashSet<>(); channels.add("channel-001"); channels.add("channel-002"); channelStatusServlet.startChannels(channels, true); ``` -------------------------------- ### startConnectors Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Example usage for starting multiple connectors. ```java Map> connectors = new HashMap<>(); connectors.put("channel-001", Arrays.asList(2, 3)); // Start destinations 2 and 3 connectors.put("channel-002", Arrays.asList(1)); // Start source channelStatusServlet.startConnectors(connectors, true); ``` -------------------------------- ### startConnector Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Example usage for starting connectors. ```java // Start source connector (metadata ID 1) channelStatusServlet.startConnector("channel-001", 1, true); // Start specific destination (metadata ID 2) channelStatusServlet.startConnector("channel-001", 2, true); ``` -------------------------------- ### Get Configuration Map Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-other.md Example of retrieving and printing server configuration properties. ```java Properties config = configServlet.getConfigurationMap(); System.out.println("Max Message Size: " + config.getProperty("max.message.size")); System.out.println("Database URL: " + config.getProperty("database.url")); System.out.println("HTTP Port: " + config.getProperty("http.port")); ``` -------------------------------- ### startChannel Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Examples of starting a single channel, both ignoring errors and reporting them. ```java // Start channel, ignore errors channelStatusServlet.startChannel("channel-001", false); // Start and report errors try { channelStatusServlet.startChannel("channel-001", true); } catch (ClientException e) { System.out.println("Failed to start: " + e.getMessage()); } ``` -------------------------------- ### Get All Users Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-users.md Demonstrates how to retrieve a list of all users and display their details. ```java try { List allUsers = userServlet.getAllUsers(); System.out.println("Total users: " + allUsers.size()); for (User user : allUsers) { System.out.println("\nUsername: " + user.getUsername()); System.out.println("Name: " + user.getFirstName() + " " + user.getLastName()); System.out.println("Email: " + user.getEmail()); System.out.println("Roles: " + user.getRoles()); System.out.println("Last Login: " + user.getLastLogin()); } } catch (ClientException e) { System.out.println("Failed to retrieve users: " + e.getMessage()); } ``` -------------------------------- ### Interactive Program Notice Example Source: https://github.com/nextgenhealthcare/connect/blob/development/server/docs/thirdparty/MYSQL-CONNECTOR-LICENSE.txt An example of a short notice to be displayed when an interactive program starts, including version, copyright, warranty, and redistribution information. ```text Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details. ``` -------------------------------- ### Interactive Program Notice Example Source: https://github.com/nextgenhealthcare/connect/blob/development/server/docs/thirdparty/GPLv2+CE.txt An example of a short notice to be displayed by an interactive program when it starts, informing users about its version, copyright, warranty, and redistribution conditions. ```text Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details. ``` -------------------------------- ### Get Extensions Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-other.md Retrieves all installed extensions. ```java public List getExtensions() throws ClientException ``` -------------------------------- ### Get Channel Statistics Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-other.md Example of retrieving and printing channel statistics. ```java ChannelStatistics stats = statsServlet.getChannelStatistics("channel-001"); System.out.println("Received: " + stats.getReceived()); System.out.println("Sent: " + stats.getSent()); System.out.println("Error: " + stats.getError()); System.out.println("Filtered: " + stats.getFiltered()); System.out.println("Queued: " + stats.getQueued()); ``` -------------------------------- ### Mirth Connect Server Startup Log Source: https://github.com/nextgenhealthcare/connect/wiki/Clone-Build-and-Run-from-Source Example log output indicating a successful Mirth Connect Server startup. ```bash ERROR 2020-04-29 16:27:29,327 [main] com.mirth.connect.server.extprops.ExtensionStatuses: Unable to find appdata directory: appdata INFO 2020-04-29 16:27:48,474 [Main Server Thread] com.mirth.connect.server.Mirth: Mirth Connect 3.9.0 (Built on April 29, 2020) server successfully started. INFO 2020-04-29 16:27:48,477 [Main Server Thread] com.mirth.connect.server.Mirth: This product was developed by NextGen Healthcare (https://www.nextgen.com) and its contributors (c)2005-2020. INFO 2020-04-29 16:27:48,478 [Main Server Thread] com.mirth.connect.server.Mirth: Running Java HotSpot(TM) 64-Bit Server VM 1.8.0_241 on Mac OS X (10.14.6, x86_64), derby, with charset UTF-8. INFO 2020-04-29 16:27:48,480 [Main Server Thread] com.mirth.connect.server.Mirth: Web server running at http://192.168.1.31:8080/ and https://192.168.1.31:8443/ ``` -------------------------------- ### Create User Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-users.md Demonstrates how to create a new user with various fields and assign roles. ```java User newUser = new User(); newUser.setUsername("jsmith"); newUser.setPassword("initial_password"); newUser.setFirstName("John"); newUser.setLastName("Smith"); newUser.setEmail("jsmith@example.com"); newUser.setOrganization("Healthcare Org"); newUser.setDescription("Integration Specialist"); // Assign roles Set roles = new HashSet<>(); roles.add("INTEGRATOR"); roles.add("VIEWER"); newUser.setRoles(roles); try { userServlet.createUser(newUser); System.out.println("User " + newUser.getUsername() + " created successfully"); } catch (ClientException e) { if (e.getMessage().contains("duplicate")) { System.out.println("Username already exists"); } else { System.out.println("Failed to create user: " + e.getMessage()); } } ``` -------------------------------- ### Login Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-users.md Authenticates a user and initiates a server session. ```java public LoginStatus login(String username, String password) throws ClientException ``` ```java try { LoginStatus loginStatus = userServlet.login("admin", "admin"); System.out.println("User: " + loginStatus.getUsername()); System.out.println("User ID: " + loginStatus.getUserId()); System.out.println("Session ID: " + loginStatus.getSessionId()); System.out.println("Roles: " + loginStatus.getRoles()); System.out.println("Login Time: " + loginStatus.getLoginTime()); System.out.println("Session Timeout: " + loginStatus.getTimeout() + " seconds"); // Store session token for subsequent requests String sessionToken = loginStatus.getSessionId(); } catch (ClientException e) { System.out.println("Login failed: " + e.getMessage()); if (e.getMessage().contains("credentials")) { System.out.println("Invalid username or password"); } } ``` -------------------------------- ### Applying License to New Programs Source: https://github.com/nextgenhealthcare/connect/blob/development/server/docs/thirdparty/MYSQL-CONNECTOR-LICENSE.txt Instructions on how to apply the GNU General Public License to new programs, including copyright notices and warranty disclaimers. ```text Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ``` -------------------------------- ### Error Handling: State Conflict Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Example of handling a ClientException when trying to start an already running channel. ```java try { // Try to start an already running channel channelStatusServlet.startChannel("channel-001", true); } catch (ClientException e) { System.out.println("Channel is already started"); } ``` -------------------------------- ### ADT^A04 Message Example Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt This is an example of an ADT^A04 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302121431||ADT^A04|603266|D|2.3.1 EVN|A04|20060302121430 PID|1|800866^^^AccMgr^PN|999965423^^^AccMgr^MR^1||TEST^PATIENT LB||19570219|F||O|14 VOLLEY WAY^^VENICE^FL^342930000^^M|88|9415248956|||R|S||6635095^^^AccMgr^VN^1|000453212|||2|UKRAINE||||NOT A VETERAN|||N PD1||||735^KAPLAN^PHILIP^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARGARET|M|14 VOLLEY WAY^^VENICE^FL^342930000|9415248956||Y PV1|1|E|ED^^^1|1|||1281^MARKHAM^JOSEPH^^^^^^AccMgr^^^^CI|||ED||||7|A|||62|6635095^^^AccMgr^VN^1|200^MEDICAID|||||||||||||||||||1||A|||20060302121344 PV2||^NO||||||20060302121344||||||||||||||||||||||||||||||A GT1|1|382560|TEST^PATIENT LB||14 VOLLEY WAY^^VENICE^FL^342930000|9415248956||19570219|F|||000453212||||||||3 IN1|1|MEDICAID|636|MEDICAID|800 N PEARL ST^^ALBANY^NY^122040000||||||||||3|TEST^PATIENT LB|1|19570219|14 VOLLEY WAY^^VENICE^FL^342930000|||||||||||||||||AG34234P||||||3|F||||||382560 IN1|2|SELF PAY|705|SELFPAY|||||||||||5||1 ``` -------------------------------- ### SecureMirthClient Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-users.md An example Java implementation of a secure client that handles login, session expiration checks, and logout. ```java public class SecureMirthClient { private String sessionToken; private Calendar sessionExpire; public void login(String username, String password) throws ClientException { LoginStatus status = userServlet.login(username, password); this.sessionToken = status.getSessionId(); // Calculate expiration: login time + timeout this.sessionExpire = Calendar.getInstance(); this.sessionExpire.add(Calendar.SECOND, status.getTimeout()); } private void checkSession() throws ClientException { if (sessionExpire.before(Calendar.getInstance())) { // Session expired, must re-authenticate throw new ClientException("Session expired. Please login again."); } } public void logout() throws ClientException { try { userServlet.logout(); } finally { this.sessionToken = null; this.sessionExpire = null; } } } ``` -------------------------------- ### ADT^A04 Message Example Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A04 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302121431||ADT^A04|603266|D|2.3.1 EVN|A04|20060302121430 PID|1|800866^^^AccMgr^PN|999965423^^^AccMgr^MR^1||TEST^PATIENT LB||19570219|F||O|14 VOLLEY WAY^^VENICE^FL^342930000^^M|88|9415248956||R|S||6635095^^^AccMgr^VN^1|000453212|||2|UKRAINE||||NOT A VETERAN|||N PD1||||735^KAPLAN^PHILIP^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARGARET|M|14 VOLLEY WAY^^VENICE^FL^342930adm,000|9415248956||Y PV1|1|E|ED^^^1|1|||1281^MARKHAM^JOSEPH^^^^^^AccMgr^^^^CI|||ED||||7|A|||62|6635095^^^AccMgr^VN^1|200^MEDICAID|||||||||||||||||||1||A|||20060302121344 PV2||^NO||||||20060302121344||||||||||||||||||||||||||||||A GT1|1|382560|TEST^PATIENT LB||14 VOLLEY WAY^^VENICE^FL^342930000|9415248956||19570219|F|||000453212||||||||3 IN1|1|MEDICAID|636|MEDICAID|800 N PEARL ST^^ALBANY^NY^122040000||||||||||3|TEST^PATIENT LB|1|19570219|14 VOLLEY WAY^^VENICE^FL^342930000|||||||||||||||||AG34234P||||||3|F||||||382560 IN1|2|SELF PAY|705|SELFPAY|||||||||||5||1 IN2|1||000453212|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||9415248956 ``` -------------------------------- ### ADT^A01 Message Example Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A01 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302120851||ADT^A01|603262|D|2.3.1 EVN|A01|20060302120848 PID|1|800865^^^AccMgr^PN|999945612^^^AccMgr^MR^1||TEST^PATIENT LA||19450106|M||W|23 POST LA^^SYRACUSE^NY^132150000^^M|31|2548526|6525245|E|M|RC|6635094^^^AccMgr^VN^1|000856542|||2|USA||||NOT A VETERAN|||N PD1||||271^SIMON^DAVID^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARTHA|W|23 POST LA^^SYRACUSE^NY^132150000|2548526||Y PV1|1|I|3E^324^01^1|3|||851^WESTLAKE^ROBERT^^^^^^AccMgr^^^^CI|851^WESTLAKE^ROBERT^^^^^^AccMgr^^^^CI||MD||||1|||851^WESTLAKE^ROBERT^^^^^^AccMgr^^^^CI|10|6635094^^^AccMgr^VN^1|400^BLUE CROSS|||||||||||||||||||1||A|||20060302120600 PV2||S^NO||||||20060302120600 DG1|1|I9|^Back pain^I9|Back pain||A|||||||||0 GT1|1|382559|TEST^PATIENT LA||23 POST LA^^SYRACUSE^NY^132150000|2548526||19450106|M|||000856542||||^mclane|4922 HINSDALE RD^^SYRACUSE^^132190000|6525245||1|||||||||||||||||||||||||||||SALES IN1|1|BC-CNY|608|BLUE CROSS CNY|344 S WARREN ST^PO BOX 4809^SYRACUSE^NY^132214809|||||||20060302|||1|TEST^PATIENT^BC|2|19800617|600 ERIE BLVD^^SYRACUSE^NY^132120000|||||||||||||||||YNZ4562U45951|||||||M||||||382506 IN1|2|SELF PAY|705|SELFPAY|||||||||||5||1 IN2|1||NONE ``` -------------------------------- ### Error Handling - Permission Denied Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channels.md Example demonstrating how to catch a ClientException and check for permission denied errors. ```java try { channelServlet.removeChannel("channel-001"); } catch (ClientException e) { if (e.getMessage().contains("permission")) { System.out.println("Insufficient permissions"); } } ``` -------------------------------- ### Create Code Template Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-other.md Example of creating a new code template. ```java CodeTemplate template = new CodeTemplate(); template.setId(UUID.randomUUID().toString()); template.setName("Date Utilities"); template.setCode("function formatDate(date) { return date.toISOString(); }"); codeTemplateServlet.createCodeTemplate(template); ``` -------------------------------- ### ADT^A31 Message Example 3 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt This is an example of an ADT^A31 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302121346||ADT^A31|603265|D|2.3.1 EVN|A31|20060302121342 PID|1|800866^^^AccMgr^PN|999965423^^^AccMgr^MR^1||TEST^PATIENT LB||19570219|F||O|14 VOLLEY WAY^^VENICE^FL^342930000^^M|88|9415248956|||R|S|||000453212|||2|UKRAINE||||NOT A VETERAN|||N PD1||||735^KAPLAN^PHILIP^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARGARET|M|14 VOLLEY WAY^^VENICE^FL^342930000|9415248956||Y ``` -------------------------------- ### Applying GPLv2+CE to Your Program Source: https://github.com/nextgenhealthcare/connect/blob/development/server/docs/thirdparty/GPLv2+CE.txt This snippet shows the recommended way to apply the GPLv2+CE notices to your new programs to ensure they are free software and accessible to the public. ```text One line to give the program's name and a brief idea of what it does. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ``` -------------------------------- ### ADT^A01 Message Example 4 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A01 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302120851||ADT^A01|603262|D|2.3.1 EVN|A01|20060302120848 PID|1|800865^^^AccMgr^PN|999945612^^^AccMgr^MR^1||TEST^PATIENT LA||19450106|M||W|23 POST LA^^SYRACUSE^NY^132150000^^M|31|2548526|6525245|E|M|RC|6635094^^^AccMgr^VN^1|000856542|||2|USA||||NOT A VETERAN|||N PD1||||271^SIMON^DAVID^^^^^^AccMgr^^^^CI|||I ``` -------------------------------- ### Database Connection String Formats Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/configuration.md Examples of JDBC connection string formats for various supported databases. ```sql jdbc:mysql://hostname:3306/mirthdb?useSSL=false&allowPublicKeyRetrieval=true ``` ```sql jdbc:postgresql://hostname:5432/mirthdb ``` ```sql jdbc:oracle:thin:@hostname:1521:MIRTHDB ``` ```sql jdbc:sqlserver://hostname:1433;databaseName=mirthdb;encrypt=true;trustServerCertificate=true ``` -------------------------------- ### ADT^A01 Message Example 2 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A01 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302123504||ADT^A01|6032623|D|2.3.1 EVN|A01|20060302123503 PID|1|800870^^^AccMgr^PN|999985245^^^AccMgr^MR^1||TEST^PATIENT LF||19661015|M||B|904 BEVERLY DR^^SYRACUSE^NY^132190000^^M|31||4777000|E|M||6635099^^^AccMgr^VN^1|235456852|||1|USA||||VETERAN|||N PD1||||703^BROWN^DENNIS^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARY|W|904 BEVERLY DR^^SYRACUSE^NY^132190000|||Y PV1|1|I|4W^413^00^1|3|||183^HARTZHEIM^THOMAS^^^^^^AccMgr^^^^CI|183^HARTZHEIM^THOMAS^^^^^^AccMgr^^^^CI||SU||||1|||183^HARTZHEIM^THOMAS^^^^^^AccMgr^^^^CI|2|6635099^^^AccMgr^VN^1|300^COMMERCIAL|||||||||||||||||||1||A|||20060302123300 PV2||P^NO||||||20060302123300 DG1|1|I9|486^PNEUMONIA, ORGANISM NOS ^I9|PNEUMONIA, ORGANISM NOS ||A|||||||||0 GT1|1|382564|TEST^PATIENT LF||904 BEVERLY DR^^SYRACUSE^NY^132190000|||19661015|M|||235456852||||282^CROUSE HINDS|WOLF AND 7TH NORTH STREET^^SYRACUSE^NY^13210000|4777000||2|||||||||||||||||||||||||||||HR IN1|1|AARP|1|AARP|P O BOX 13999^^PHILADELPHIA^PA^191870216||||||CARRIER CORP||||2|TEST^PATIENT^BI|2|19620917|78 SUNSET DR^^SYRACUSE^NY^132150000|||||||||||||||||125852465||||||1|F|CARRIER PARKWAY^^EAST SYRACUSE^NY^130570000|||||382512 IN1|2|SELF PAY|705|SELFPAY|||||||||||5||1 IN2|1||NONE|CARRIER CORP||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||2254465 ``` -------------------------------- ### getChannels Examples Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channels.md Examples of retrieving channels, including all channels, specific channels, and polling channels with code templates. ```java // Get all channels List allChannels = channelServlet.getChannels(null, false, false); // Get specific channels Set ids = new HashSet<>(); ids.add("channel-001"); ids.add("channel-002"); List specific = channelServlet.getChannels(ids, false, true); // Get only polling channels with code templates List polling = channelServlet.getChannels(null, true, true); ``` -------------------------------- ### ADT^A31 Message Example 4 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A31 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302123338||ADT^A31|6032622|D|2.3.1 EVN|A31|20060302123338 PID|1|800870^^^AccMgr^PN|999985245^^^AccMgr^MR^1||TEST^PATIENT LF||19661015|M||B|904 BEVERLY DR^^SYRACUSE^NY^132190000^^M|31||4777000|E|M|||235456852|||1|USA||||VETERAN|||N PD1||||703^BROWN^DENNIS^^^^^^AccMgr^^^^CI|||I ``` -------------------------------- ### ADT^A01 Message Example 3 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A01 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302123504||ADT^A01|6032623|D|2.3.1 EVN|A01|20060302123503 PID|1|800870^^^AccMgr^PN|999985245^^^AccMgr^MR^1||TEST^PATIENT LF||19661015|M||B|904 BEVERLY DR^^SYRACUSE^NY^132190000^^M|31||4777000|E|M||6635099^^^AccMgr^VN^1|235456852|||1|USA||||VETERAN|||N PD1||||703^BROWN^DENNIS^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARY|W|904 BEVERLY DR^^SYRACUSE^NY^132190000|||Y PV1|1|I|4W^413^00^1|3|||183^HARTZHEIM^THOMAS^^^^^^AccMgr^^^^CI|183^HARTZHEIM^THOMAS^^^^^^AccMgr^^^^CI||SU||||1|||183^HARTZHEIM^THOMAS^^^^^^AccMgr^^^^CI|2|6635099^^^AccMgr^VN^1|300^COMMERCIAL|||||||||||||||||||1||A|||20060302123300 PV2||P^NO||||||20060302123300 DG1|1|I9|486^PNEUMONIA, ORGANISM NOS ^I9|PNEUMONIA, ORGANISM NOS ||A|||||||||0 ``` -------------------------------- ### ADT^A01 Message Example 2 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A01 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302123048||ADT^A01|6032619|D|2.3.1 EVN|A01|20060302123046 PID|1|800869^^^AccMgr^PN|999923458^^^AccMgr^MR^1||TEST^PATIENT^LE||19660205|F||W|67 BEACH RD^^SYRACUSE^NY^132190000^^M|31||||S||6635098^^^AccMgr^VN^1|000000000|||2|USA||||NOT A VETERAN|||N PD1||||271^SIMON^DAVID^^^^^^AccMgr^^^^CI|||I PV1|1|I|3E^340^01^1|3|||851^WESTLAKE^ROBERT^^^^^^AccMgr^^^^CI|851^WESTLAKE^ROBERT^^^^^^AccMgr^^^^CI||MD||||1|||851^WESTLAKE^ROBERT^^^^^^AccMgr^^^^CI|10|6635098^^^AccMgr^VN^1|865^SP KOPP|||||||||||||||||||1||A|||20060302122934 PV2||S^NO||||||20060302122934 DG1|1|I9|11510^HISTOPLASMA DUBOISII NOS^I9|HISTOPLASMA DUBOISII NOS||A|||||||||0 GT1|1|382563|TEST^PATIENT^LE||67 BEACH RD^^SYRACUSE^NY^132190000|||19660205|F|||NONE||||||||3 IN1|1|SELF PAY NYS|734|SELF PAY NYS|||||||||||5|TEST^PATIENT^LE|1|19660205|67 BEACH RD^^SYRACUSE^NY^132190000|||||||||||||||||||||||3|F||||||382563 IN1|2|SELF PAY|705|SELFPAY|||||||||||5||1 IN2|1||NONE ``` -------------------------------- ### Clone Mirth Connect Repository Source: https://github.com/nextgenhealthcare/connect/wiki/Clone-Build-and-Run-from-Source Command to clone the Mirth Connect GitHub repository. ```bash git clone https://github.com/nextgenhealthcare/connect.git ``` -------------------------------- ### ADT^A01 Message Example 1 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A01 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302122637||ADT^A01|6032615|D|2.3.1 EVN|A01|20060302122634 PID|1|800868^^^AccMgr^PN|500097867^^^AccMgr^MR^1||TEST^PATIENT LD||19351212|F||W|45 JAMES WAY^^EAST SYRACUSE^NY^130570000^^M|31|6572356|4645540|E|M||6635097^^^AccMgr^VN^1|000231564||||||||NOT A VETERAN|||N PD1||||876^WATTS^JAMES^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARK|H|45 JAMES WAY^^EAST SYRACUSE^NY^130570000|6572356||Y PV1|1|I|2E^243^00^1|3|||1186^MARZIALE^JENNIFER^^^^^^AccMgr^^^^CI|1186^MARZIALE^JENNIFER^^^^^^AccMgr^^^^CI||MA||||1|||1186^MARZIALE^JENNIFER^^^^^^AccMgr^^^^CI|14|6635097^^^AccMgr^VN^1|700^HMO|||||||||||||||||||1||A|||20060302122450 PV2||POB^NO||||||20060302122450 DG1|1|I9|64410^THREAT LABOR NEC-UNSPEC ^I9|THREAT LABOR NEC-UNSPEC ||A|||||||||0 GT1|1|382562|TEST^PATIENT LD||45 JAMES WAY^^EAST SYRACUSE^NY^130570000|6572356||19351212|F|||000231564||||644^UNIVERSITY HOSPITAL|750 EAST ADAMS ST^^SYRACUSE^NY^132100000|4645540||2|||||||||||||||||||||||||||||RN IN1|1|MVP HEALTH PLAN|600|MVP HEALTH PLAN|PO BOX 2207^625 STATE STREET^SCHENECTADY^NY^123012207||8006849286||||UNIVERSITY HOSPITAL|20060302|||7|TEST^PATIENT LD|1|19351212|45 JAMES WAY^^EAST SYRACUSE^NY^130570000|||||||||||||||||80434567834||||||2|F|750 EAST ADAMS ST^^SYRACUSE^NY^132100000|||||382562 IN1|2|SELF PAY|705|SELFPAY|||||||||||5||1 IN2|1||000231564|UNIVERSITY HOSPITAL|||||||||||||||||||||||||||||||||||||||||||RN|||||||||||||||||6572356 ``` -------------------------------- ### getDashboardChannelInfo Example Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Example of how to retrieve initial dashboard channel information, including the first batch of statuses and remaining channel IDs, and then fetch subsequent batches. ```java // Get first 100 statuses and remaining IDs DashboardChannelInfo info = channelStatusServlet.getDashboardChannelInfo(100, null); List statuses = info.getStatuses(); System.out.println("Received " + statuses.size() + " statuses"); Set remaining = info.getRemainingChannelIds(); System.out.println("Remaining channels: " + remaining.size()); // Retrieve remaining channels in batches while (!remaining.isEmpty()) { List nextBatch = channelStatusServlet.getChannelStatusList(remaining, null, false); // Process nextBatch... } ``` -------------------------------- ### getChannelStatusList Examples Source: https://github.com/nextgenhealthcare/connect/blob/development/_autodocs/api-reference-channel-status.md Demonstrates retrieving channel statuses for all channels, specific channels, filtered results, and including undeployed channels. ```java // Get all channel statuses List allStatus = channelStatusServlet.getChannelStatusList(null, null, false); System.out.println("Total channels: " + allStatus.size()); for (DashboardStatus status : allStatus) { System.out.println(status.getChannelId() + ": " + status.getState()); } // Get specific channels Set ids = new HashSet<>(); ids.add("channel-001"); ids.add("channel-002"); List specific = channelStatusServlet.getChannelStatusList(ids, null, false); // Filter by name pattern List filtered = channelStatusServlet.getChannelStatusList(null, "HL7", false); // Include undeployed channels List all = channelStatusServlet.getChannelStatusList(null, null, true); ``` -------------------------------- ### ADT^A31 Message Example 1 Source: https://github.com/nextgenhealthcare/connect/blob/development/simplesender/samples/TestADT.txt An example of an ADT^A31 message. ```hl7 MSH|^~\&|AccMgr|1|||20060302122447||ADT^A31|6032614|D|2.3.1 EVN|A31|20060302122445 PID|1|800868^^^AccMgr^PN|500097867^^^AccMgr^MR^1||TEST^PATIENT LD||19351212|F||W|45 JAMES WAY^^EAST SYRACUSE^NY^130570000^^M|31|6572356|4645540|E|M|||000231564||||||||NOT A VETERAN|||N PD1||||876^WATTS^JAMES^^^^^^AccMgr^^^^CI|||I NK1|1|TEST^MARK|H|45 JAMES WAY^^EAST SYRACUSE^NY^130570000|6572356||Y ```