nHapiNET/nHapi

ADT_A28 / ADT_A31 / ADT_A47 missed since v2.4

MathieuMauron opened this issue · 4 comments

in v2.3.1 models for :
ADT_A28
ADT_A31
ADT_A47

are ok, but in v2.4 and all other versions missed.
it's really a big problem because those messages are for common things

ok thanks,
so in v2.4 for ADT_A28 => its ADT_A05 Model
but for ADT_A31 too

so you can't make a clean switch and cast like that :

internal static void Parse(IMessage message)
{
    switch (message)
    {
        case ORU_R01 oru:
            Parse(oru);
            break;
        case ADT_A28 adt_a28:
......

for version 2.6 to 2.8 there is a link like this https://github.com/nHapiNET/nHapi/wiki/Decoding-a-message#event-map-to-code-structure-mappings ?

@MathieuMauron they are all in the source code but I have gone a head and added them to the wiki.
https://github.com/nHapiNET/nHapi/wiki/Decoding-a-message#event-map-to-code-structure-mappings

you could possibly do something like this, using pattern matching:

internal static void Parse(IMessage message)
{
    switch (message)
    {
        case ADT_A01 adt && adt.MSH.MessageType.TriggerEvent.Value == "A04":
            Parse(adt);
            break;
......

@MathieuMauron I am going to close this issue for now, since this is how nHapi works by design, if you feel like this is still an issue please feel free to re-open with details as to why.