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

org.milyn.edi.unedifact.d98a.MEDREQ.SegmentGroup12 Maven / Gradle / Ivy

There is a newer version: 1.7.1.0
Show newest version
/**
 * This class was generated by Smooks EJC (http://www.smooks.org).
 */
package org.milyn.edi.unedifact.d98a.MEDREQ;

import java.io.Serializable;    
import org.milyn.smooks.edi.EDIWritable;    
import org.milyn.edi.unedifact.d98a.common.ItemDescription;    
import java.util.List;    
import org.milyn.edi.unedifact.d98a.common.DosageAdministration;    
import org.milyn.edi.unedifact.d98a.common.FreeText;    
import org.milyn.edi.unedifact.d98a.common.PartiesAndInstruction;    
import java.io.Writer;    
import org.milyn.edisax.model.internal.Delimiters;    
import java.io.IOException;    

public class SegmentGroup12 implements Serializable, EDIWritable {

    private static final long serialVersionUID = 1L;

    private ItemDescription itemDescription;
    private List dosageAdministration;
    private List freeText;
    private List partiesAndInstruction;

    public void write(Writer writer, Delimiters delimiters) throws IOException {
        
        Writer nodeWriter = writer;

        if(itemDescription != null) {
            nodeWriter.write("IMD");
            nodeWriter.write(delimiters.getField());
            itemDescription.write(nodeWriter, delimiters);
        }
        if(dosageAdministration != null && !dosageAdministration.isEmpty()) {
            for(DosageAdministration dosageAdministrationInst : dosageAdministration) {
                nodeWriter.write("DSG");
                nodeWriter.write(delimiters.getField());
                dosageAdministrationInst.write(nodeWriter, delimiters);
            }
        }
        if(freeText != null && !freeText.isEmpty()) {
            for(FreeText freeTextInst : freeText) {
                nodeWriter.write("FTX");
                nodeWriter.write(delimiters.getField());
                freeTextInst.write(nodeWriter, delimiters);
            }
        }
        if(partiesAndInstruction != null && !partiesAndInstruction.isEmpty()) {
            for(PartiesAndInstruction partiesAndInstructionInst : partiesAndInstruction) {
                nodeWriter.write("INP");
                nodeWriter.write(delimiters.getField());
                partiesAndInstructionInst.write(nodeWriter, delimiters);
            }
        }
    }

    public ItemDescription getItemDescription() {
        return itemDescription;
    }

    public SegmentGroup12 setItemDescription(ItemDescription itemDescription) {
        this.itemDescription = itemDescription;  return this;
    }

    public List getDosageAdministration() {
        return dosageAdministration;
    }

    public SegmentGroup12 setDosageAdministration(List dosageAdministration) {
        this.dosageAdministration = dosageAdministration;  return this;
    }

    public List getFreeText() {
        return freeText;
    }

    public SegmentGroup12 setFreeText(List freeText) {
        this.freeText = freeText;  return this;
    }

    public List getPartiesAndInstruction() {
        return partiesAndInstruction;
    }

    public SegmentGroup12 setPartiesAndInstruction(List partiesAndInstruction) {
        this.partiesAndInstruction = partiesAndInstruction;  return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy