001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2024 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.pub.hl7v2.out;
011
012import ca.cdr.api.model.enm.TransactionLogEventSubTypeEnum;
013import ca.cdr.api.pub.hl7v2.model.MappingMessage;
014import ca.uhn.hl7v2.model.Message;
015
016import java.util.ArrayList;
017import java.util.List;
018
019public class MappingTarget<T extends Message> {
020        private T myMessage;
021        private final List<MappingMessage> myIssues = new ArrayList<>();
022        private TransactionLogEventSubTypeEnum myTransactionLogSubType;
023        private String myTransactionId;
024
025        public void addIssue(MappingMessage theIssue) {
026                myIssues.add(theIssue);
027        }
028
029        public MappingMessage addIssue() {
030                MappingMessage retVal = new MappingMessage();
031                addIssue(retVal);
032                return retVal;
033        }
034
035        public List<MappingMessage> getIssues() {
036                return myIssues;
037        }
038
039        public T getMessage() {
040                return myMessage;
041        }
042
043        public void setMessage(T theMessage) {
044                myMessage = theMessage;
045        }
046
047        public String getTransactionId() {
048                return myTransactionId;
049        }
050
051        public void setTransactionId(String theTransactionId) {
052                myTransactionId = theTransactionId;
053        }
054
055        public TransactionLogEventSubTypeEnum getTransactionLogSubType() {
056                return myTransactionLogSubType;
057        }
058
059        public void setTransactionLogSubType(TransactionLogEventSubTypeEnum theTransactionLogSubType) {
060                myTransactionLogSubType = theTransactionLogSubType;
061        }
062}