xml-parsingapache-nific-cda

How to implement ExtractCCDAAttributes processor in Apache Nifi?


I am on the process to extract some healthcare Data. Initially started with CCDA which is XML file format. How can i config the ExtractCCDAAttributes to extract the attributes with its value?


Solution

  • You can refer to this minimal flow that demonstrates use of ExtractCCDAAttributes processor.

    enter image description here

    1) Get CDA Document (Processor type: GetFile)

    This will create a FlowFile with the document contents. The sample data file (XML) used is available here.

    enter image description here

    2) ExtractCCDAAttributes (Processor type: ExtractCCDAAttributes)

    This processor has a single property (Skip Validation) to indicate whether or not to validate CDA message values. We accept the default value of true. The processor outputs individual attributes as FlowFile attributes.

    enter image description here

    3) Success (Processor type: LogAttribute)

    This is to log attributes upon success of ExtractCCDAAttributes processor.

    4) Failure (Processor type: LogAttribute)

    This is to log attributes upon failure of ExtractCCDAAttributes processor.

    Verification:

    When the sample file is processed, two of the (many) attributes logged by the Success processor are:

    Key: 'vitalSignsSection.organizer_01.observations_02.code.displayName'
        Value: 'Intravascular Systolic'
    
    Key: 'vitalSignsSection.organizer_02.observations_03.code.displayName'
        Value: 'Intravascular Systolic'
    

    In the sample file, the two places where these appear are on lines 3592 and 3700: enter image description here

    and

    enter image description here