Amar Jaiswal
Amar Jaiswal

Reputation: 11

Conformance Profile for ORU^R01 message with HAPI sample

I am not able to validate an ORU_R01 and ADT_A04 (HL7 v2.3.1) messages with HAPI api (version 2.2) against the conformance profile generated from MWB (Message Workbench).

Below are the validation logs for the above mentioned problem:

  1. ValidationException - PATIENT_RESULT not found in message
  2. ValidationException - The structure PIDPD1NK1NTEPV1PV2ORCOBRNTEOBXNTECTI appears in the message but not in the profile

The second problem is in OBX segment for the datatype to be used in OBX.5 field. Since my message contains multiple OBXs and also have multiple datatypes say NM and ST in OBX.2 field, Thus I cannot have a fixed datatype for OBX.5 in conformance profile, so I tried "VARIES" provided by HAPI api for datatype placeholder in conformance profile at OBX.5 datatype declaration. But this also didn't work.

Below are the validation logs for the above mentioned problem:

  1. ValidationException - HL7 datatype NM doesn't match profile datatype VARIES at OBX-5

  2. ValidationException - HL7 datatype ST doesn't match profile datatype VARIES at OBX-5


Below is the message:


Below is the Profile Snippet :

    <SegGroup Name="**PATIENT_RESULT**" LongName="PATIENT_RESULT" Usage="R" Min="1" Max="*">
        <SegGroup Name="**PATIENT**" LongName="PATIENT" Usage="O" Min="0" Max="1">
            <Segment Name="**PID**" LongName="patient identification segment" Usage="R" Min="1" Max="1">
                <Field Name="Set ID - PID" Usage="O" Min="0" Max="1" Datatype="SI" Length="4" ItemNo="00104">

    <Segment Name="OBX" LongName="observation/result segment" Usage="O" Min="0" Max="*">

        <Field Name="Set ID - OBX" Usage="O" Min="0" Max="1" Datatype="SI" Length="4" ItemNo="00569">
            <Reference>OBX-1</Reference>
        </Field>
        <Field Name="Value Type" Usage="R" Min="1" Max="1" Datatype="ID" Length="3" Table="0125" ItemNo="00570">
            <Reference>OBX-2</Reference>
        </Field>
        <Field Name="Observation Identifier" Usage="R" Min="1" Max="1" Datatype="CE" Length="1000" ItemNo="00571">
            <Reference>OBX-3</Reference>
            <Component Name="identifier" Usage="O" Datatype="ST" Length="1000">
                <Reference>OBX-3-1</Reference>
            </Component>
            <Component Name="text" Usage="O" Datatype="ST" Length="1000">
                <Reference>OBX-3-2</Reference>
            </Component>
            <Component Name="name of coding system" Usage="O" Datatype="ST" Length="3">
                <Reference>OBX-3-3</Reference>
            </Component>
            <Component Name="alternate identifier" Usage="O" Datatype="ST" Length="3">
                <Reference>OBX-3-4</Reference>
            </Component>
            <Component Name="alternate text" Usage="O" Datatype="ST" Length="3">
                <Reference>OBX-3-5</Reference>
            </Component>
            <Component Name="name of alternate coding system" Usage="O" Datatype="ST" Length="3">
                <Reference>OBX-3-6</Reference>
            </Component>
        </Field>
        <Field Name="Observation Sub-ID" Usage="O" Min="1" Max="1" Datatype="ST" Length="20" ItemNo="00572">
            <Reference>OBX-4</Reference>
        </Field>
        <Field Name="Observation Value" Usage="O" Min="0" Max="1" Datatype="**VARIES**" Length="65536" ItemNo="00573">
            <Reference>OBX-5</Reference>
        </Field>

Regards, Amar Jaiswal

Upvotes: 1

Views: 1555

Answers (2)

Amar Jaiswal
Amar Jaiswal

Reputation: 11

There is a workaround for the problem with segment group names. (i.e the first problem I had posted earlier)

Change need to be made in regular expression '([A-Z]|)+' of message_profile.xml file at ca\uhn\hl7v2\conf\parser in hapi-base jar.

i.e. replace regular expression '([A-Z]|)+' of segment group name to '([A-Z0-9]|)+' in the message_profile.xml and rebuild the jar for hapi-base.

Now the ProfileException will not be thrown when using PIDPD1NK1NTEPV1PV2ORCOBRNTEOBXNTECTI as segment group name.

Upvotes: 0

Gabe
Gabe

Reputation: 86838

I think you should use ST as the data type for OBX.5 because I don't think there's any way to tell MWB that it needs to look in OBX.2 for the actual data type.

Upvotes: 0

Related Questions