Skip to content

Parse MSA segment using Terser #415

Discussion options

You must be logged in to vote

Hi @jorge-zapata-medstone I can't replicate, I have created a dotnet fiddle showing it working here.

using System;
using NHapi.Base.Parser;
using NHapi.Base.Util;

var newline = '\r';
// adding new line into the string on linux, not needed on windows
var message = $"""
	MSH|^~\&|RAMSOFT|SENDING FACILITY|RAMSOFT|RECEIVING FACILITY|20101223202939-0400||ACK|101|P|2.5||||||||{newLine}
	MSA|AA|104|Request was Successfully processed{newLine}
	""";
		
var pipeParser = new PipeParser();
var parsed = pipeParser.Parse(message);
var terser = new Terser(parsed);

Console.WriteLine($"MSH.1: {terser.Get("/MSA-1")}");
Console.WriteLine($"MSH.2: {terser.Get("/MSA-2")}");
Console.WriteLine($"MSH.3: {terser.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jorge-zapata-medstone
Comment options

Answer selected by jorge-zapata-medstone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants