All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.linuxforhealth.hl7.parsing.result.Hl7ParsingStructureResult Maven / Gradle / Ivy

Go to download

FHIR converter is a Java based library that enables converting Hl7v2 messages to FHIR resources

There is a newer version: 1.0.19
Show newest version
/*
 * (C) Copyright IBM Corp. 2020
 *
 * SPDX-License-Identifier: Apache-2.0
 */
package io.github.linuxforhealth.hl7.parsing.result;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import ca.uhn.hl7v2.model.Structure;

/**
 * Represents the result of parsing HL7 message.
 * 
 *
 * @author {user}
 */
public class Hl7ParsingStructureResult implements ParsingResult {


  private List values;

  public Hl7ParsingStructureResult(List values) {
    this.values = new ArrayList<>();
    if (values != null) {
      values.removeIf(Objects::isNull);
    this.values.addAll(values);
    }


  }

  public Hl7ParsingStructureResult(Structure value) {
    this.values = new ArrayList<>();
    if (value != null) {
      this.values.add(value);
    }

  }





  public boolean isEmpty() {
    return this.values.isEmpty();
  }

  @Override
  public Structure getValue() {
    if (!this.values.isEmpty()) {
      return this.values.get(0);
    }
    return null;
  }

  @Override
  public List getValues() {
    return new ArrayList<>(this.values);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy