[openempi~source-repository:50] Added support for loading domains from the configuration file in addition
- From: odysseas@kenai.com
- To: commits@openempi.kenai.com
- Subject: [openempi~source-repository:50] Added support for loading domains from the configuration file in addition
- Date: Fri, 26 Feb 2010 02:10:05 +0000
Project: openempi
Repository: source-repository
Revision: 50
Author: odysseas
Date: 2010-02-26 02:09:55 UTC
Link:
Log Message:
------------
Added support for loading domains from the configuration file in addition to
domains from the repository.
Revisions:
----------
50
Modified Paths:
---------------
branches/2.0.4-development/openempi/pixpdq-adapter/src/main/java/org/openhie/openempi/openpixpdqadapter/BasePixPdqAdapter.java
Diffs:
------
Index:
branches/2.0.4-development/openempi/pixpdq-adapter/src/main/java/org/openhie/openempi/openpixpdqadapter/BasePixPdqAdapter.java
===================================================================
---
branches/2.0.4-development/openempi/pixpdq-adapter/src/main/java/org/openhie/openempi/openpixpdqadapter/BasePixPdqAdapter.java
(revision 49)
+++
branches/2.0.4-development/openempi/pixpdq-adapter/src/main/java/org/openhie/openempi/openpixpdqadapter/BasePixPdqAdapter.java
(revision 50)
@@ -1,7 +1,11 @@
package org.openhie.openempi.openpixpdqadapter;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.openhie.openempi.context.Context;
import org.openhie.openempi.model.IdentifierDomain;
@@ -10,6 +14,8 @@
public class BasePixPdqAdapter
{
+ protected final Log log = LogFactory.getLog(getClass());
+
// The initialization of the context should preferably be done
// during a lifecycle event from the PixPdqManager but currently the
start() event
// does not get propagated out to the adapter.
@@ -19,11 +25,19 @@
}
public List<Identifier> getDomainIdentifiers(IConnectionDescription
connection) {
+ Set<Identifier> idSet = new HashSet<Identifier>();
+ idSet.addAll(connection.getAllIdentifiersByType("domain"));
+ log.debug("Loaded from the configuration file " +
idSet.size() + " entries.");
+
List<IdentifierDomain> domains =
Context.getPersonQueryService().getIdentifierDomains();
- List<Identifier> identifiers = new
java.util.ArrayList<Identifier>(domains.size());
for (IdentifierDomain domain : domains) {
-
identifiers.add(ConversionHelper.convertIdentifierDomain(domain));
+
idSet.add(ConversionHelper.convertIdentifierDomain(domain));
}
+
+ List<Identifier> identifiers = new
java.util.ArrayList<Identifier>(idSet.size());
+ identifiers.addAll(idSet);
+ log.debug("Loaded another " + domains.size() + " from the
repository for a total of " + identifiers.size() +
+ " unique entries.");
return identifiers;
}
}
|
[openempi~source-repository:50] Added support for loading domains from the configuration file in addition |
odysseas | 02/26/2010 |





