org.openmrs.migration
Class MigrationHelper
java.lang.Object
org.openmrs.migration.MigrationHelper
public class MigrationHelper
- extends java.lang.Object
Field Summary |
protected static org.apache.commons.logging.Log |
log
|
Method Summary |
static int |
importLocations(org.w3c.dom.Document document)
Takes XML like: returns the
number of locations added |
static int |
importProgramsAndStatuses(java.util.List<java.lang.String> programWorkflow)
|
static int |
importRelationships(java.util.Collection<java.lang.String> relationships,
boolean autoCreateUsers,
boolean autoAddRole)
Takes a list of Strings of the format RELATIONSHIP:,,,, so if user hfraser
if the cardiologist of the patient with patient_id 8039 in PIH's old emr, then:
RELATIONSHIP:hfraser,Cardiologist,HIV-EMRV1,8039 (the "RELATIONSHIP:" is not actually
necessary. |
static int |
importUsers(org.w3c.dom.Document document)
Takes XML like: Returns the number of users added |
static java.util.Date |
parseDate(java.lang.String s)
|
static org.w3c.dom.Document |
parseXml(java.lang.String xml)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final org.apache.commons.logging.Log log
MigrationHelper
public MigrationHelper()
parseDate
public static java.util.Date parseDate(java.lang.String s)
throws java.text.ParseException
- Throws:
java.text.ParseException
parseXml
public static org.w3c.dom.Document parseXml(java.lang.String xml)
throws javax.xml.parsers.ParserConfigurationException
- Throws:
javax.xml.parsers.ParserConfigurationException
importUsers
public static int importUsers(org.w3c.dom.Document document)
throws java.text.ParseException
- Takes XML like: Returns the number of users added
- Throws:
java.text.ParseException
importLocations
public static int importLocations(org.w3c.dom.Document document)
- Takes XML like: returns the
number of locations added
importRelationships
public static int importRelationships(java.util.Collection<java.lang.String> relationships,
boolean autoCreateUsers,
boolean autoAddRole)
- Takes a list of Strings of the format RELATIONSHIP:,,,, so if user hfraser
if the cardiologist of the patient with patient_id 8039 in PIH's old emr, then:
RELATIONSHIP:hfraser,Cardiologist,HIV-EMRV1,8039 (the "RELATIONSHIP:" is not actually
necessary. Anything before and including the first : will be dropped If autoCreateUsers is
true, and no user exists with the given username, one will be created. If autoAddRole is
true, then whenever a user is auto-created, if a role exists with the same name as
relationshipType.name, then the user will be added to that role
importProgramsAndStatuses
public static int importProgramsAndStatuses(java.util.List<java.lang.String> programWorkflow)
throws java.text.ParseException
- Throws:
java.text.ParseException
Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change