You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the QRF that needs to be transformed. How can this be done? I can get the Data below but I could not find a way to change the data on the fourth component.
ST part5 = qry_r02.QRF.GetOtherQRYSubjectFilter(0);
var msg = part5.ExtraComponents.GetComponent(3).Data
Original QRF|MON||||168430091^5^1^0^2005&2005&2005&2005&2005
Can you provide some additional data, what version of nHapi? what version of dotnet?
Could you provide complete sample code? perhaps on https://dotnetfiddle.net/
Also I'm not 100% certain on your desired outcome.
usingSystem;usingNHapi.Base.Parser;usingNHapi.Base.Model;usingNHapi.Model.V26.Message;usingNHapi.Model.V26.Datatype;varer7=""" MSH|^~\&||KC1234F3|||20230810160302+0800||QRY^R02|202308101603020042|P|2.6 QRD|20230810160302+0800|R|I|Q101||||TXE107200400230|RES QRF|MON||||168430091&5^5^1^0^2005&2005&2005&2005&2005 """.ReplaceLineEndings("\r");varpipeParser=newPipeParser();varqryR02=pipeParser.Parse(er7)asQRY_R02;STpart5=qryR02.QRF.GetOtherQRYSubjectFilter(0);// getting non-existent component at index 4 component will create itvarnewComponent=part5.ExtraComponents.GetComponent(4);((GenericPrimitive)newComponent.Data).Value="test";// getting non-existent sub component at index 0 will create itvarnewSubComponent=newComponent.ExtraComponents.GetComponent(0);((GenericPrimitive)newSubComponent.Data).Value="subcomponent";Console.WriteLine(PipeParser.Encode(qryR02.QRF,EncodingCharacters.FromMessage(qryR02)));
Activity
milkshakeuk commentedon Aug 10, 2023
Hi @alberk8
Can you provide some additional data, what version of nHapi? what version of dotnet?
Could you provide complete sample code? perhaps on https://dotnetfiddle.net/
Also I'm not 100% certain on your desired outcome.
alberk8 commentedon Aug 10, 2023
Hi,
I am using the latest version of NHapi 3.2, nhapi.model.v26 on net 7.0
I can extract the data from the code above but I want to transform the the QRF segment. I can't find a way to rebuild or change the field no 5.
milkshakeuk commentedon Aug 12, 2023
@alberk8 thanks for the extra info, I'll take a look in the coming week.
alberk8 commentedon Aug 12, 2023
@milkshakeuk I have tried a few combinations. Is there a way to add non standard segment without the Terser?.
milkshakeuk commentedon Aug 13, 2023
@alberk8 to add the non-standard segment
PIDwithout theTerseryou can do this:outputs the following:
https://dotnetfiddle.net/DP6OMd
milkshakeuk commentedon Aug 13, 2023
@alberk8 here is how you could customise
QRF-5:outputs the following:
https://dotnetfiddle.net/b4Hf5b
milkshakeuk commentedon Aug 14, 2023
@alberk8 can you let me know if these solve your issues?
alberk8 commentedon Aug 14, 2023
@milkshakeuk , Thank you. It worked like a charm. I think this needs to go into an example. Thank you again.