/*
 * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.snomed.importer.net4j;

import java.util.List;

import com.google.common.collect.Lists;

/**
 * Contains information about the imported reference set and stores the
 * unimported members from the reference set in a {@link StoreRefSetMember}
 * format.
 * 
 * 
 */
public class SnomedUnimportedRefSets {

	private final String fileName;
	private final String refSetName;
	private final String nameSpace;
	private final String effectiveTime;
	private List<StoreRefSetMember> unimportedRefSetMembers;

	public SnomedUnimportedRefSets(String fileName, String refSetName, String nameSpace, String effectiveTime) {
		this.fileName = fileName;
		this.refSetName = refSetName;
		this.nameSpace = nameSpace;
		this.effectiveTime = effectiveTime;
		this.unimportedRefSetMembers = Lists.newArrayList();
	}

	public String getRefSetName() {
		return refSetName;
	}

	public String getNameSpace() {
		return nameSpace;
	}

	public String getEffectiveTime() {
		return effectiveTime;
	}

	public List<StoreRefSetMember> getUnimportedRefSetMembers() {
		return unimportedRefSetMembers;
	}

	/**
	 * Creates a {@link StoreRefSetMember} from the given parameters and stores
	 * it in the {@link SnomedUnimportedRefSets}.
	 * 
	 * @param reason
	 *            why the refset member was not imported
	 * @param conceptId
	 *            the concept id for the refset member
	 * @param fullySpecifiedName
	 *            the fully specified name for the refset member
	 */
	public void addRefSetMember(String reason, String conceptId, String fullySpecifiedName) {
		StoreRefSetMember storeRefSetMembers = new StoreRefSetMember(reason, conceptId, fullySpecifiedName);
		unimportedRefSetMembers.add(storeRefSetMembers);
	}

	public String getFileName() {
		return fileName;
	}

	/**
	 * Contains information about a reference set member.
	 * 
	 * 
	 */
	public final class StoreRefSetMember {
		private String reason;
		private String conceptId;
		private String fullySpecifiedName;

		public StoreRefSetMember(String reason, String conceptId, String fullySpecifiedName) {
			this.reason = reason;
			this.conceptId = conceptId;
			this.fullySpecifiedName = fullySpecifiedName;
		}

		public String getReason() {
			return reason;
		}

		public String getConceptId() {
			return conceptId;
		}

		public String getFullySpecifiedName() {
			return fullySpecifiedName;
		}
	}

}
@@ -2262,16 +2262,22 @@
 tMember(
+this, 
 reason, 
@@ -2481,18 +2481,8 @@
 er.%0A
-%09 * %0A%09 * %0A
 %09 */
@@ -2616,36 +2616,111 @@
 me;%0A
-%0A%09%09public StoreRefSetMember(
+%09%09private SnomedUnimportedRefSets parent;%0A%0A%09%09private StoreRefSetMember(SnomedUnimportedRefSets parent, 
 Stri
@@ -2777,16 +2777,41 @@
 Name) %7B%0A
+%09%09%09this.parent = parent;%0A
 %09%09%09this.
@@ -3100,13 +3100,84 @@
 me;%0A%09%09%7D%0A
+%0A%09%09public SnomedUnimportedRefSets getParent() %7B%0A%09%09%09return parent;%0A%09%09%7D%0A%0A
 %09%7D%0A%0A%7D

Allow export of multiple reference set import results