wildcardExclusions, boolean doThrow) throws Exception {
30 |
31 | try {
32 | AddressConfigurationLoader.loadAddressConfiguration(Paths.get(iniz.getConfigDirPath()),
33 | Paths.get(iniz.getChecksumsDirPath()));
34 | }
35 | catch (Exception e) {
36 | log.error(e.getMessage());
37 | if (doThrow) {
38 | log.error("The loading of the '" + getDomainName() + "' configuration was aborted.", e);
39 | throw new RuntimeException(e);
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loaders/BaseInputStreamLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loaders;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.InputStream;
6 |
7 | import org.apache.commons.io.IOUtils;
8 | import org.openmrs.module.initializer.api.utils.IgnoreBOMInputStream;
9 |
10 | /**
11 | * A base loader to focus the implementation on what to do with the {@link InputStream} for the
12 | * configuration file being loaded.
13 | *
14 | * @since 2.1.0
15 | */
16 | public abstract class BaseInputStreamLoader extends BaseFileLoader {
17 |
18 | private File loadedFile = null;
19 |
20 | private void setLoadedFile(File file) {
21 | loadedFile = file;
22 | }
23 |
24 | /**
25 | * Provides access to the file being currently loaded.
26 | *
27 | * @return The file being currently loaded.
28 | */
29 | protected File getLoadedFile() {
30 | return loadedFile;
31 | }
32 |
33 | protected abstract void load(InputStream is) throws Exception;
34 |
35 | @Override
36 | protected void load(File file) throws Exception {
37 | log.info("Loading file {}", file.getAbsolutePath());
38 | setLoadedFile(file);
39 | try (InputStream is = new IgnoreBOMInputStream(new FileInputStream(file));) {
40 | load(is);
41 | }
42 | finally {
43 | setLoadedFile(null);
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loaders/CsvLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loaders;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 |
6 | import org.openmrs.module.initializer.api.CsvParser;
7 |
8 | /**
9 | * All CSV loaders should implement this interface, @see {@link BaseCsvLoader}
10 | */
11 | @SuppressWarnings("rawtypes")
12 | public interface CsvLoader extends Loader {
13 |
14 | /**
15 | * @return The domain parser built on the provided CSV file as input stream.
16 | */
17 | CsvParser getParser(InputStream is) throws IOException;
18 |
19 | /**
20 | * Sets the domain parser bean for this CSV loader.
21 | *
22 | * @param parser A Spring bean CSV parser.
23 | */
24 | // void setParser(P parser);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loaders/DispositionsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loaders;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.emrapi.disposition.DispositionService;
5 | import org.openmrs.module.initializer.Domain;
6 | import org.openmrs.module.initializer.api.ConfigDirUtil;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 |
9 | import java.io.File;
10 |
11 | @OpenmrsProfile(modules = { "emrapi:2.0.0-9.*" })
12 | public class DispositionsLoader extends BaseFileLoader {
13 |
14 | @Autowired
15 | private DispositionService dispositionService;
16 |
17 | private boolean fileFound = false;
18 |
19 | @Override
20 | protected Domain getDomain() {
21 | return Domain.DISPOSITIONS;
22 | }
23 |
24 | @Override
25 | protected String getFileExtension() {
26 | return "json";
27 | }
28 |
29 | @Override
30 | public void load() {
31 | fileFound = false;
32 | super.load();
33 | }
34 |
35 | @Override
36 | protected void load(File file) throws Exception {
37 | if (fileFound) {
38 | throw new IllegalArgumentException(
39 | "Multiple disposition files found in the disposition configuration directory.");
40 | }
41 | fileFound = true;
42 | dispositionService.setDispositionConfig("file:" + iniz.getBasePath().relativize(file.toPath()));
43 | }
44 |
45 | @Override
46 | public ConfigDirUtil getDirUtil() {
47 | // skip checksums, this needs to be processed every time
48 | return new ConfigDirUtil(iniz.getConfigDirPath(), iniz.getChecksumsDirPath(), getDomainName(), true);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loaders/JsonKeyValuesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loaders;
2 |
3 | import java.io.InputStream;
4 |
5 | import org.openmrs.module.initializer.Domain;
6 | import org.openmrs.module.initializer.api.ConfigDirUtil;
7 | import org.springframework.stereotype.Component;
8 |
9 | @Component
10 | public class JsonKeyValuesLoader extends BaseInputStreamLoader {
11 |
12 | @Override
13 | protected Domain getDomain() {
14 | return Domain.JSON_KEY_VALUES;
15 | }
16 |
17 | @Override
18 | protected String getFileExtension() {
19 | return "json";
20 | }
21 |
22 | @Override
23 | protected void load(InputStream is) throws Exception {
24 | iniz.addKeyValues(is);
25 | }
26 |
27 | @Override
28 | public ConfigDirUtil getDirUtil() {
29 | return new ConfigDirUtil(iniz.getConfigDirPath(), iniz.getChecksumsDirPath(), getDomainName(), true);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loaders/LiquibaseLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loaders;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.Domain;
5 | import org.openmrs.module.initializer.api.ConfigDirUtil;
6 | import org.openmrs.util.DatabaseUpdater;
7 |
8 | import java.io.File;
9 |
10 | @OpenmrsProfile(openmrsPlatformVersion = "2.1.1 - 2.5.4")
11 | public class LiquibaseLoader extends BaseFileLoader {
12 |
13 | public static final String LIQUIBASE_FILE_NAME = "liquibase";
14 |
15 | @Override
16 | protected Domain getDomain() {
17 | return Domain.LIQUIBASE;
18 | }
19 |
20 | @Override
21 | protected String getFileExtension() {
22 | return "xml";
23 | }
24 |
25 | @Override
26 | protected void load(File file) throws Exception {
27 | if (file.getName().equalsIgnoreCase(LIQUIBASE_FILE_NAME + "." + getFileExtension())) {
28 | DatabaseUpdater.executeChangelog(file.getPath(), null);
29 | }
30 | }
31 |
32 | @Override
33 | public ConfigDirUtil getDirUtil() {
34 | return new ConfigDirUtil(iniz.getConfigDirPath(), iniz.getChecksumsDirPath(), getDomainName(), true);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loaders/MdsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loaders;
2 |
3 | import java.io.InputStream;
4 |
5 | import org.openmrs.annotation.OpenmrsProfile;
6 | import org.openmrs.module.initializer.Domain;
7 | import org.openmrs.module.metadatasharing.ImportConfig;
8 | import org.openmrs.module.metadatasharing.ImportType;
9 | import org.openmrs.module.metadatasharing.MetadataSharing;
10 | import org.openmrs.module.metadatasharing.wrapper.PackageImporter;
11 |
12 | @OpenmrsProfile(modules = { "metadatasharing:*" })
13 | public class MdsLoader extends BaseInputStreamLoader {
14 |
15 | private PackageImporter importer;
16 |
17 | private PackageImporter getImporter() {
18 | if (importer == null) {
19 | importer = MetadataSharing.getInstance().newPackageImporter();
20 | ImportConfig importConfig = new ImportConfig();
21 | importConfig.setPossibleMatch(ImportType.PREFER_THEIRS);
22 | importConfig.setExactMatch(ImportType.PREFER_THEIRS);
23 | importer.setImportConfig(importConfig);
24 | }
25 | return importer;
26 | }
27 |
28 | @Override
29 | protected Domain getDomain() {
30 | return Domain.METADATASHARING;
31 | }
32 |
33 | @Override
34 | protected String getFileExtension() {
35 | return "zip";
36 | }
37 |
38 | @Override
39 | protected void load(InputStream is) throws Exception {
40 | getImporter().loadSerializedPackageStream(is);
41 | getImporter().importPackage();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loc/LocationTagLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loc;
2 |
3 | import org.openmrs.LocationTag;
4 | import org.openmrs.api.LocationService;
5 | import org.openmrs.module.initializer.api.BaseLineProcessor;
6 | import org.openmrs.module.initializer.api.CsvLine;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.beans.factory.annotation.Qualifier;
9 | import org.springframework.stereotype.Component;
10 |
11 | @Component("initializer.locationTagLineProcessor")
12 | public class LocationTagLineProcessor extends BaseLineProcessor {
13 |
14 | private LocationService locationService;
15 |
16 | @Autowired
17 | public LocationTagLineProcessor(@Qualifier("locationService") LocationService locationService) {
18 | this.locationService = locationService;
19 | }
20 |
21 | @Override
22 | public LocationTag fill(LocationTag tag, CsvLine line) throws IllegalArgumentException {
23 |
24 | tag.setName(line.get(HEADER_NAME));
25 | tag.setDescription(line.get(HEADER_DESC));
26 |
27 | return tag;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loc/LocationTagMapsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loc;
2 |
3 | import org.openmrs.Location;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class LocationTagMapsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(LocationTagMapsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loc/LocationTagsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loc;
2 |
3 | import org.openmrs.LocationTag;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class LocationTagsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(LocationTagsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/loc/LocationsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.loc;
2 |
3 | import org.openmrs.Location;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class LocationsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(LocationsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/logging/InitializerLogConfigurator.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.logging;
2 |
3 | import java.nio.file.Path;
4 | import java.nio.file.Paths;
5 |
6 | import org.apache.log4j.Level;
7 | import org.openmrs.util.OpenmrsUtil;
8 |
9 | import static org.openmrs.module.initializer.InitializerConstants.MODULE_ARTIFACT_ID;
10 |
11 | public interface InitializerLogConfigurator {
12 |
13 | /**
14 | * Method called to setup Initializer logging. Should provide a Level, which is the level of
15 | * filtering applied to the appender, and a path where the log file will be written.
16 | *
17 | * @param level Allow log message of this level or higher to be written to the appender
18 | * @param logFilePath The path the log file should be created at
19 | */
20 | void setupLogging(Level level, Path logFilePath);
21 |
22 | default Path getDefaultLogFile() {
23 | return Paths.get(OpenmrsUtil.getApplicationDataDirectory(), MODULE_ARTIFACT_ID + ".log");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/mdm/MetadataTermMappingsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.mdm;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.openmrs.module.metadatamapping.MetadataTermMapping;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | @OpenmrsProfile(modules = { "metadatamapping:*" })
9 | public class MetadataTermMappingsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(MetadataTermMappingsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/mds/MetadataSetLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.mds;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.api.BaseLineProcessor;
5 | import org.openmrs.module.initializer.api.CsvLine;
6 | import org.openmrs.module.metadatamapping.MetadataSet;
7 |
8 | @OpenmrsProfile(modules = { "metadatamapping:*" })
9 | public class MetadataSetLineProcessor extends BaseLineProcessor {
10 |
11 | @Override
12 | public MetadataSet fill(MetadataSet metadataSet, CsvLine line) throws IllegalArgumentException {
13 | metadataSet.setName(line.getName());
14 | metadataSet.setDescription(line.get(HEADER_DESC));
15 | return metadataSet;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/mds/MetadataSetMemberLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.mds;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.api.BaseLineProcessor;
5 | import org.openmrs.module.initializer.api.CsvLine;
6 | import org.openmrs.module.initializer.api.mdm.MetadataTermMappingsLineProcessor;
7 | import org.openmrs.module.metadatamapping.MetadataSet;
8 | import org.openmrs.module.metadatamapping.MetadataSetMember;
9 | import org.openmrs.module.metadatamapping.api.MetadataMappingService;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 |
12 | @OpenmrsProfile(modules = { "metadatamapping:*" })
13 | public class MetadataSetMemberLineProcessor extends BaseLineProcessor {
14 |
15 | final public static String METADATA_SET_UUID = "metadata set uuid";
16 |
17 | final public static String METADATA_CLASS = "metadata class";
18 |
19 | final public static String SORT_WEIGHT = "sort weight";
20 |
21 | @Autowired
22 | private MetadataMappingService service;
23 |
24 | @Override
25 | public MetadataSetMember fill(MetadataSetMember setMember, CsvLine line) throws IllegalArgumentException {
26 | setMember.setName(line.get(HEADER_NAME));
27 | setMember.setDescription(line.get(HEADER_DESC));
28 | setMember.setSortWeight(line.getDouble(SORT_WEIGHT));
29 | setMember.setMetadataClass(line.get(METADATA_CLASS, true));
30 | setMember.setMetadataUuid(line.get(MetadataTermMappingsLineProcessor.METADATA_UUID, true));
31 | MetadataSet set = service.getMetadataSetByUuid(line.get(METADATA_SET_UUID, true));
32 | setMember.setMetadataSet(set);
33 | return setMember;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/mds/MetadataSetMembersLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.mds;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.openmrs.module.metadatamapping.MetadataSetMember;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | @OpenmrsProfile(modules = { "metadatamapping:*" })
9 | public class MetadataSetMembersLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(MetadataSetMembersCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/mds/MetadataSetsCsvParser.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.mds;
2 |
3 | import org.apache.commons.lang.StringUtils;
4 | import org.openmrs.annotation.OpenmrsProfile;
5 | import org.openmrs.module.initializer.Domain;
6 | import org.openmrs.module.initializer.api.BaseLineProcessor;
7 | import org.openmrs.module.initializer.api.CsvLine;
8 | import org.openmrs.module.initializer.api.CsvParser;
9 | import org.openmrs.module.metadatamapping.MetadataSet;
10 | import org.openmrs.module.metadatamapping.api.MetadataMappingService;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 |
13 | @OpenmrsProfile(modules = { "metadatamapping:*" })
14 | public class MetadataSetsCsvParser extends CsvParser> {
15 |
16 | private MetadataMappingService mdmService;
17 |
18 | @Autowired
19 | protected MetadataSetsCsvParser(MetadataMappingService mds, BaseLineProcessor lineProcessor) {
20 | super(lineProcessor);
21 | mdmService = mds;
22 | }
23 |
24 | @Override
25 | public MetadataSet bootstrap(CsvLine line) throws IllegalArgumentException {
26 | MetadataSet metadataSet = null;
27 | String uuid = line.getUuid();
28 | if (StringUtils.isNotBlank(uuid)) {
29 | metadataSet = mdmService.getMetadataSetByUuid(uuid);
30 | }
31 | if (metadataSet == null) {
32 | metadataSet = new MetadataSet();
33 | metadataSet.setUuid(uuid);
34 | }
35 | return metadataSet;
36 | }
37 |
38 | @Override
39 | public MetadataSet save(MetadataSet metadataSet) {
40 | return mdmService.saveMetadataSet(metadataSet);
41 | }
42 |
43 | @Override
44 | public Domain getDomain() {
45 | return Domain.METADATA_SETS;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/mds/MetadataSetsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.mds;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.openmrs.module.metadatamapping.MetadataSet;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | @OpenmrsProfile(modules = { "metadatamapping:*" })
9 | public class MetadataSetsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(MetadataSetsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/ot/OrderTypesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.ot;
2 |
3 | import org.openmrs.OrderType;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class OrderTypesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(OrderTypesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/pat/PersonAttributeTypesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.pat;
2 |
3 | import org.openmrs.PersonAttributeType;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class PersonAttributeTypesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(PersonAttributeTypesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/pit/PatientIdentifierTypesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.pit;
2 |
3 | import org.openmrs.PatientIdentifierType;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class PatientIdentifierTypesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(PatientIdentifierTypesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/privileges/PrivilegeLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.privileges;
2 |
3 | import org.openmrs.Privilege;
4 | import org.openmrs.module.initializer.api.BaseLineProcessor;
5 | import org.openmrs.module.initializer.api.CsvLine;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class PrivilegeLineProcessor extends BaseLineProcessor {
10 |
11 | protected static String HEADER_PRIVILEGE_NAME = "privilege name";
12 |
13 | @Override
14 | public Privilege fill(Privilege privilege, CsvLine line) throws IllegalArgumentException {
15 | privilege.setPrivilege(line.get(HEADER_PRIVILEGE_NAME, true));
16 | privilege.setName(privilege.getPrivilege());
17 | privilege.setDescription(line.get(HEADER_DESC));
18 | return privilege;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/privileges/PrivilegesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.privileges;
2 |
3 | import java.io.File;
4 |
5 | import org.openmrs.Privilege;
6 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.stereotype.Component;
9 |
10 | @Component
11 | public class PrivilegesLoader extends BaseCsvLoader {
12 |
13 | @Autowired
14 | public void setParser(PrivilegesCsvParser parser) {
15 | this.parser = parser;
16 | }
17 |
18 | @Override
19 | protected void preload(File file) {
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/programs/ProgramsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.programs;
2 |
3 | import org.openmrs.Program;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class ProgramsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(ProgramsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/programs/workflows/ProgramWorkflowsLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.programs.workflows;
2 |
3 | import org.openmrs.ProgramWorkflow;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class ProgramWorkflowsLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(ProgramWorkflowsCsvParser parser) {
13 | this.parser = parser;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/programs/workflows/states/ProgramWorkflowStatesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.programs.workflows.states;
2 |
3 | import org.openmrs.ProgramWorkflowState;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class ProgramWorkflowStatesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(ProgramWorkflowStatesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/providerroles/ProviderRolesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.providerroles;
2 |
3 | import org.openmrs.annotation.OpenmrsProfile;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.openmrs.module.providermanagement.ProviderRole;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | @OpenmrsProfile(modules = { "providermanagement:*" })
9 | public class ProviderRolesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(ProviderRolesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/relationship/types/RelationshipTypeLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.relationship.types;
2 |
3 | import org.openmrs.RelationshipType;
4 | import org.openmrs.module.initializer.api.BaseLineProcessor;
5 | import org.openmrs.module.initializer.api.CsvLine;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class RelationshipTypeLineProcessor extends BaseLineProcessor {
10 |
11 | final public static String WEIGHT = "weight";
12 |
13 | final public static String PREFERRED = "preferred";
14 |
15 | final public static String A_IS_TO_B = "a is to b";
16 |
17 | final public static String B_IS_TO_A = "b is to a";
18 |
19 | @Override
20 | public RelationshipType fill(RelationshipType instance, CsvLine line) throws IllegalArgumentException {
21 | instance.setName(line.get(HEADER_NAME));
22 | instance.setDescription(line.get(HEADER_DESC));
23 | instance.setaIsToB(line.get(A_IS_TO_B, true));
24 | instance.setbIsToA(line.get(B_IS_TO_A, true));
25 |
26 | Boolean preferred = line.getBool(PREFERRED);
27 | if (preferred != null) {
28 | instance.setPreferred(line.getBool(PREFERRED));
29 | }
30 | Integer weight = line.getInt(WEIGHT);
31 | if (weight != null) {
32 | instance.setWeight(weight);
33 | }
34 | return instance;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/relationship/types/RelationshipTypesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.relationship.types;
2 |
3 | import org.openmrs.RelationshipType;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class RelationshipTypesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(RelationshipTypesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/roles/RoleLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.roles;
2 |
3 | import java.util.HashSet;
4 |
5 | import org.openmrs.Privilege;
6 | import org.openmrs.Role;
7 | import org.openmrs.module.initializer.api.BaseLineProcessor;
8 | import org.openmrs.module.initializer.api.CsvLine;
9 | import org.openmrs.module.initializer.api.utils.PrivilegeListParser;
10 | import org.openmrs.module.initializer.api.utils.RoleListParser;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.stereotype.Component;
13 |
14 | @Component
15 | public class RoleLineProcessor extends BaseLineProcessor {
16 |
17 | protected static String HEADER_ROLE_NAME = "role name";
18 |
19 | protected static String HEADER_INHERITED_ROLES = "inherited roles";
20 |
21 | protected static String HEADER_PRIVILEGES = "privileges";
22 |
23 | private PrivilegeListParser privilegeListParser;
24 |
25 | private RoleListParser roleListParser;
26 |
27 | @Autowired
28 | public RoleLineProcessor(PrivilegeListParser privilegeListParser, RoleListParser roleListParser) {
29 | this.privilegeListParser = privilegeListParser;
30 | this.roleListParser = roleListParser;
31 | }
32 |
33 | @Override
34 | public Role fill(Role role, CsvLine line) throws IllegalArgumentException {
35 | role.setRole(line.get(HEADER_ROLE_NAME, true));
36 | role.setName(role.getRole());
37 | role.setDescription(line.get(HEADER_DESC));
38 | role.setInheritedRoles(new HashSet(roleListParser.parseList(line.get(HEADER_INHERITED_ROLES))));
39 | role.setPrivileges(new HashSet(privilegeListParser.parseList(line.get(HEADER_PRIVILEGES))));
40 | return role;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/roles/RolesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.roles;
2 |
3 | import java.io.File;
4 |
5 | import org.openmrs.Role;
6 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.stereotype.Component;
9 |
10 | @Component
11 | public class RolesLoader extends BaseCsvLoader {
12 |
13 | @Autowired
14 | public void setParser(RolesCsvParser parser) {
15 | this.parser = parser;
16 | }
17 |
18 | @Override
19 | protected void preload(File file) {
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/utils/ConceptClassListParser.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.utils;
2 |
3 | import org.openmrs.ConceptClass;
4 | import org.openmrs.api.ConceptService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.beans.factory.annotation.Qualifier;
7 | import org.springframework.stereotype.Component;
8 |
9 | @Component
10 | public class ConceptClassListParser extends ListParser {
11 |
12 | private ConceptService conceptService;
13 |
14 | @Autowired
15 | public ConceptClassListParser(@Qualifier("conceptService") ConceptService conceptService) {
16 | this.conceptService = conceptService;
17 | }
18 |
19 | @Override
20 | protected ConceptClass fetch(String id) {
21 | return Utils.fetchConceptClass(id, conceptService);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/utils/ConceptListParser.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.utils;
2 |
3 | import org.openmrs.Concept;
4 | import org.openmrs.api.ConceptService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.beans.factory.annotation.Qualifier;
7 | import org.springframework.stereotype.Component;
8 |
9 | @Component
10 | public class ConceptListParser extends ListParser {
11 |
12 | private ConceptService conceptService;
13 |
14 | @Autowired
15 | public ConceptListParser(@Qualifier("conceptService") ConceptService conceptService) {
16 | this.conceptService = conceptService;
17 | }
18 |
19 | @Override
20 | protected Concept fetch(String id) {
21 | return Utils.fetchConcept(id, conceptService);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/utils/LocationTagListParser.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.utils;
2 |
3 | import org.openmrs.LocationTag;
4 | import org.openmrs.api.LocationService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | /* Parses the "Location Tags" entry of the Locations domain and dynamically
9 | * creates tags as needed.
10 | */
11 | @Component
12 | public class LocationTagListParser extends ListParser {
13 |
14 | private LocationService locationService;
15 |
16 | @Autowired
17 | public LocationTagListParser(LocationService locationService) {
18 | this.locationService = locationService;
19 | }
20 |
21 | @Override
22 | protected LocationTag lastMinuteSave(String id) {
23 | LocationTag tag = locationService.getLocationTagByName(id);
24 | if (tag == null) {
25 | log.info("The location tag identified by the name '" + id + "' was not found in database. Creating it...");
26 | tag = locationService.saveLocationTag(new LocationTag(id, ""));
27 | }
28 | return tag;
29 | }
30 |
31 | @Override
32 | protected LocationTag fetch(String id) {
33 | return Utils.fetchLocationTag(id, locationService);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/utils/PrivilegeListParser.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.utils;
2 |
3 | import org.openmrs.Privilege;
4 | import org.openmrs.api.UserService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.beans.factory.annotation.Qualifier;
7 | import org.springframework.stereotype.Component;
8 |
9 | @Component
10 | public class PrivilegeListParser extends ListParser {
11 |
12 | @Autowired
13 | @Qualifier("userService")
14 | private UserService us;
15 |
16 | protected PrivilegeListParser() {
17 | }
18 |
19 | public PrivilegeListParser(UserService us) {
20 | this.us = us;
21 | }
22 |
23 | @Override
24 | protected Privilege fetch(String id) {
25 | return Utils.fetchPrivilege(id, us);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/utils/RoleListParser.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.utils;
2 |
3 | import org.openmrs.Role;
4 | import org.openmrs.api.UserService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.beans.factory.annotation.Qualifier;
7 | import org.springframework.stereotype.Component;
8 |
9 | @Component
10 | public class RoleListParser extends ListParser {
11 |
12 | private UserService userService;
13 |
14 | @Autowired
15 | public RoleListParser(@Qualifier("userService") UserService userService) {
16 | this.userService = userService;
17 | }
18 |
19 | @Override
20 | protected Role fetch(String id) {
21 | return Utils.fetchRole(id, userService);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/visittypes/VisitTypeLineProcessor.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.visittypes;
2 |
3 | import org.openmrs.VisitType;
4 | import org.openmrs.api.VisitService;
5 | import org.openmrs.module.initializer.api.BaseLineProcessor;
6 | import org.openmrs.module.initializer.api.CsvLine;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.beans.factory.annotation.Qualifier;
9 | import org.springframework.stereotype.Component;
10 |
11 | /**
12 | * This is the first level line processor for visit types. It allows to parse and save visit types
13 | * with the minimal set of required fields.
14 | */
15 | @Component
16 | public class VisitTypeLineProcessor extends BaseLineProcessor {
17 |
18 | private VisitService visitService;
19 |
20 | @Autowired
21 | public VisitTypeLineProcessor(@Qualifier("visitService") VisitService visitService) {
22 | this.visitService = visitService;
23 | }
24 |
25 | @Override
26 | public VisitType fill(VisitType visitType, CsvLine line) throws IllegalArgumentException {
27 |
28 | visitType.setName(line.getName(true));
29 | visitType.setDescription(line.getString(HEADER_DESC));
30 |
31 | return visitType;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/api/src/main/java/org/openmrs/module/initializer/api/visittypes/VisitTypesLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.visittypes;
2 |
3 | import org.openmrs.VisitType;
4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | public class VisitTypesLoader extends BaseCsvLoader {
10 |
11 | @Autowired
12 | public void setParser(VisitTypesCsvParser parser) {
13 | this.parser = parser;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/main/resources/messages.properties:
--------------------------------------------------------------------------------
1 | initializer.title=Initializer
2 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/MockLoader.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api;
2 |
3 | import java.util.List;
4 |
5 | import org.openmrs.module.initializer.Domain;
6 | import org.openmrs.module.initializer.api.loaders.BaseLoader;
7 |
8 | public class MockLoader extends BaseLoader {
9 |
10 | private Domain domain;
11 |
12 | private boolean throwException = false;
13 |
14 | private int numberOfTimesLoadUnsafeCompleted = 0;
15 |
16 | public MockLoader(Domain domain) {
17 | this.domain = domain;
18 | }
19 |
20 | /**
21 | * @param domain the domain that this loader should represent
22 | * @param throwException set to true to throw an Exception during the loading process, to simulate
23 | * this behavior
24 | */
25 | public MockLoader(Domain domain, boolean throwException) {
26 | this(domain);
27 | this.throwException = throwException;
28 | }
29 |
30 | @Override
31 | public void loadUnsafe(List wildcardExclusions, boolean doThrow) throws Exception {
32 | if (doThrow && throwException) {
33 | throw new RuntimeException("ERROR IN MOCK LOADER");
34 | }
35 | System.out.println("Method load() invoked on mock loader for domain '" + getDomainName() + "'.");
36 | numberOfTimesLoadUnsafeCompleted++;
37 | }
38 |
39 | @Override
40 | protected Domain getDomain() {
41 | return domain;
42 | }
43 |
44 | public int getNumberOfTimesLoadUnsafeCompleted() {
45 | return numberOfTimesLoadUnsafeCompleted;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/OrderedFileTest.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 |
6 | import java.io.File;
7 |
8 | public class OrderedFileTest {
9 |
10 | @Test
11 | public void orderedFileShouldCompareByNameIfNoOrderSpecified() {
12 | OrderedFile file1 = new OrderedFile("/configuration/domain/file1.txt");
13 | OrderedFile file2 = new OrderedFile("/configuration/domain/file2.txt");
14 | OrderedFile file3 = new OrderedFile("/configuration/domain/concepts/file3.txt");
15 |
16 | Assert.assertTrue(file1.compareTo(file2) < 0);
17 | Assert.assertTrue(file1.compareTo(file3) > 0);
18 | }
19 |
20 | @Test
21 | public void orderedFileShouldFirstCompareByOrderIfSpecified() {
22 | OrderedFile file1 = new NumericFile("/configuration/domain/10");
23 | OrderedFile file2 = new NumericFile("/configuration/domain/9");
24 | OrderedFile file3 = new NumericFile("/configuration/concepts/concepts.csv");
25 |
26 | Assert.assertTrue(file1.compareTo(file2) > 0);
27 | Assert.assertTrue(file1.compareTo(file3) < 0);
28 | Assert.assertTrue(file2.compareTo(file3) < 0);
29 | }
30 |
31 | public class NumericFile extends OrderedFile {
32 |
33 | public NumericFile(String path) {
34 | super(path);
35 | }
36 |
37 | @Override
38 | protected Integer fetchOrder(File file) throws Exception {
39 | try {
40 | return Integer.valueOf(file.getName());
41 | }
42 | catch (Exception e) {
43 | return super.fetchOrder(file);
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/appt/speciality/AppointmentsSpecialityLineProcessorTest.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.appt.speciality;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 | import org.openmrs.module.appointments.model.Speciality;
6 | import org.openmrs.module.initializer.api.CsvLine;
7 | import org.openmrs.module.initializer.api.appt.specialities.SpecialityLineProcessor;
8 |
9 | /*
10 | * This kind of test case can be used to quickly trial the parsing routines on test CSVs
11 | */
12 | public class AppointmentsSpecialityLineProcessorTest {
13 |
14 | @Test
15 | public void fill_shouldParseSpeciality() {
16 |
17 | // Setup
18 | String[] headerLine = { "Name" };
19 | String[] line = { "Speciality name" };
20 |
21 | // Replay
22 | SpecialityLineProcessor p = new SpecialityLineProcessor();
23 | Speciality speciality = p.fill(new Speciality(), new CsvLine(headerLine, line));
24 |
25 | // Verif
26 | Assert.assertEquals("Speciality name", speciality.getName());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/c/BaseConceptLineProcessorTest.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.c;
2 |
3 | import static org.mockito.Mockito.mock;
4 |
5 | import org.apache.commons.collections.CollectionUtils;
6 | import org.junit.Assert;
7 | import org.junit.Test;
8 | import org.openmrs.Concept;
9 | import org.openmrs.api.ConceptService;
10 | import org.openmrs.module.initializer.api.CsvLine;
11 |
12 | /*
13 | * This kind of test case can be used to quickly trial the parsing routines on test CSVs
14 | */
15 | public class BaseConceptLineProcessorTest {
16 |
17 | private ConceptService cs = mock(ConceptService.class);
18 |
19 | @Test
20 | public void fill_shouldHandleMissingHeaders() {
21 |
22 | // Setup
23 | String[] headerLine = {};
24 | String[] line = {};
25 |
26 | // Replay
27 | ConceptLineProcessor p = new ConceptLineProcessor(cs);
28 | Concept c = p.fill(new Concept(), new CsvLine(headerLine, line));
29 |
30 | // Verif
31 | Assert.assertTrue(CollectionUtils.isEmpty(c.getNames()));
32 | Assert.assertTrue(CollectionUtils.isEmpty(c.getDescriptions()));
33 | Assert.assertNull(c.getConceptClass());
34 | Assert.assertNull(c.getDatatype());
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/display/DisplayLineProcessorTest.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.display;
2 |
3 | import static org.mockito.Matchers.any;
4 | import static org.mockito.Mockito.mock;
5 | import static org.mockito.Mockito.times;
6 | import static org.mockito.Mockito.verify;
7 | import static org.mockito.Mockito.when;
8 |
9 | import org.junit.Before;
10 | import org.junit.Test;
11 | import org.mockito.Mock;
12 | import org.mockito.MockitoAnnotations;
13 | import org.openmrs.OpenmrsObject;
14 | import org.openmrs.module.initializer.InitializerMessageSource;
15 | import org.openmrs.module.initializer.api.CsvLine;
16 |
17 | public class DisplayLineProcessorTest {
18 |
19 | @Mock
20 | private InitializerMessageSource msgSource;
21 |
22 | @Mock
23 | private OpenmrsObject instance;
24 |
25 | @Before
26 | public void setup() {
27 | MockitoAnnotations.initMocks(this);
28 | }
29 |
30 | @Test
31 | public void fill_shouldParseMessageProperties() {
32 | // Setup
33 | DisplayLineProcessor processor = new DisplayLineProcessor(msgSource);
34 | CsvLine line = new CsvLine(new String[] { "display:en", "display:km" },
35 | new String[] { "display-english", "display-cambodia" });
36 | when(instance.getUuid()).thenReturn("display-uuid");
37 |
38 | // Replay
39 | processor.fill(instance, line);
40 |
41 | // Verify
42 | verify(msgSource, times(4)).addPresentation(any());
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/display/DisplaysCsvParserTest.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.display;
2 |
3 | import static org.junit.Assert.assertEquals;
4 | import static org.mockito.Mockito.mock;
5 | import static org.mockito.Mockito.times;
6 | import static org.mockito.Mockito.verify;
7 |
8 | import org.junit.Before;
9 | import org.junit.Test;
10 | import org.mockito.Mock;
11 | import org.openmrs.api.APIException;
12 | import org.mockito.MockitoAnnotations;
13 | import org.openmrs.OpenmrsObject;
14 | import org.openmrs.module.initializer.InitializerMessageSource;
15 | import org.openmrs.module.initializer.api.CsvLine;
16 | import org.openmrs.module.initializer.api.CsvParser;
17 |
18 | public class DisplaysCsvParserTest {
19 |
20 | @Mock
21 | private InitializerMessageSource msgSource;
22 |
23 | @Mock
24 | private CsvParser someParser;
25 |
26 | private DisplayLineProcessor displayProcessor;
27 |
28 | private DisplaysCsvParser displayParser;
29 |
30 | @Before
31 | public void setup() {
32 | MockitoAnnotations.initMocks(this);
33 | displayParser = new DisplaysCsvParser(new DisplayLineProcessor(msgSource));
34 | displayParser.setBootstrapParser(someParser);
35 | }
36 |
37 | @Test
38 | public void bootstrap_shouldBootstrapObjectGivenUuidPresentAndObjectNotVoid() {
39 | // Setup
40 | CsvLine line = new CsvLine(new String[] { "uuid", "void/retire" },
41 | new String[] { "d9e04a9d-d534-4a02-9c40-1c173f3d1d4b", "False" });
42 |
43 | // Replay
44 | OpenmrsObject obj = displayParser.bootstrap(line);
45 |
46 | // Verify
47 | verify(someParser, times(1)).bootstrap(line);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/api/src/test/java/org/openmrs/module/initializer/api/logging/InitializerLogConfigurator2_0Test.java:
--------------------------------------------------------------------------------
1 | package org.openmrs.module.initializer.api.logging;
2 |
3 | import org.apache.log4j.Level;
4 | import org.apache.log4j.Logger;
5 | import org.apache.log4j.spi.Filter;
6 | import org.apache.log4j.varia.LevelRangeFilter;
7 | import org.junit.Assert;
8 | import org.junit.Test;
9 | import org.openmrs.module.initializer.InitializerActivator;
10 |
11 | import java.lang.reflect.InvocationTargetException;
12 |
13 | public class InitializerLogConfigurator2_0Test {
14 |
15 | @Test
16 | public void shouldSetupLoggerWithAppropriateNameAndLevel() throws ClassNotFoundException, InvocationTargetException,
17 | InstantiationException, IllegalAccessException, NoSuchMethodException {
18 | // setup
19 | Level level = Level.WARN;
20 | InitializerLogConfigurator2_0 logConfigurator20 = new InitializerLogConfigurator2_0();
21 |
22 | // replay
23 | logConfigurator20.setupLogging(level, null);
24 |
25 | // verify
26 | Assert.assertEquals(level, Logger.getLogger(InitializerActivator.class.getPackage().getName()).getLevel());
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/api/src/test/resources/TestingApplicationContext.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
18 |
19 | classpath:hibernate.cfg.xml
20 | classpath:test-hibernate.cfg.xml
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | org.openmrs
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/api/src/test/resources/messages.properties:
--------------------------------------------------------------------------------
1 | messageFileLocale=Default
2 | messageOnlyInDefault=Only In Default
3 | greeting=Hello
--------------------------------------------------------------------------------
/api/src/test/resources/messages_fr.properties:
--------------------------------------------------------------------------------
1 | messageFileLocale=fr
2 | messageOnlyInFr=Only In fr
3 | greeting=Bonjour
--------------------------------------------------------------------------------
/api/src/test/resources/messages_fr_FR.properties:
--------------------------------------------------------------------------------
1 | messageFileLocale=fr_FR
2 | messageOnlyInFrFr=Only In fr FR
3 | greeting=Bonjour from France
--------------------------------------------------------------------------------
/api/src/test/resources/messages_ht.properties:
--------------------------------------------------------------------------------
1 | messageFileLocale=ht
2 | messageOnlyInHt=Only In ht
3 | greeting=Bonjou
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/addresshierarchy/include/exti18n.omod:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/addresshierarchy/include/exti18n.omod
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/concepts_no_fsn.csv:
--------------------------------------------------------------------------------
1 | Uuid,Short name:en,Short name:km_KH,Description:en,Description:km_KH,Data class,Data type,_version:base,_order:1000
2 | foo,bar,foo,bar,foo,bar,foo,bar,foo
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/concepts_no_shortname.csv:
--------------------------------------------------------------------------------
1 | Uuid,Fully specified name:en,Fully specified name:km_KH,Description:en,Description:km_KH,Data class,Data type,_version:base,_order:1000
2 | foo,bar,foo,bar,foo,bar,foo,bar,foo
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/concepts_no_uuid.csv:
--------------------------------------------------------------------------------
1 | Fully specified name:en,Fully specified name:km_KH,Short name:en,Short name:km_KH,Description:en,Description:km_KH,Data class,Data type,_version:base,_order:1000
2 | foo,bar,foo,bar,foo,bar,foo,bar,foo,bar
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/orders/1_order_1500.csv:
--------------------------------------------------------------------------------
1 | _order:1500,foo,bar1,bar2,_baz:foo,baz
2 | ,id,er,vv,,sS
3 | ,TQ,Ll,Oy,,WG
4 | ,wv,sD,ih,,DS
5 | ,RJ,zs,vK,,sC
6 | ,lL,lY,uR,,hp
7 | ,xC,IM,ak,,dn
8 | ,kn,Hn,jP,,mm
9 | ,TZ,zk,At,,yn
10 | ,lN,BP,Vv,,rr
11 | ,IV,sL,eP,,Sp
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/orders/2_order_e00.csv:
--------------------------------------------------------------------------------
1 | foo,_order:e00,_bar,bar,_baz:foo,baz
2 | Po,,,GI,,uZ
3 | PV,,,mo,,EB
4 | eM,,,pa,,gD
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/orders/3_order_missing.csv:
--------------------------------------------------------------------------------
1 | foo,bar1,bar2,_baz:foo,baz
2 | XU,WI,sH,,uS
3 | Xt,IE,Vm,,FU
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/orders/4_order_1000.csv:
--------------------------------------------------------------------------------
1 | foo,bar,_bar,_order:1000,_baz:foo,baz
2 | ca,KA,,,,dW
3 | Va,Rt,,,,uO
4 | Tr,UY,,,,Sq
5 | Ix,hV,,,,Tr
6 | Lt,TR,,,,Ok
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/orders/5_order_500.csv:
--------------------------------------------------------------------------------
1 | foo,_order:500,_bar,bar,_baz:foo,baz
2 | CS,,,uq,,kr
3 | qk,,,IP,,tV
4 | pA,,,NX,,AF
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/csv/with_bom.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Fully specified name:en,Fully specified name:km_KH,Short name:en,Short name:km_KH,Description:en,Description:km_KH,Data class,Data type,_version:1,_order:1000
2 | 4c93c34e-37c2-11ea-bd28-d70ffe7aa802,,Cambodia_Nationality,កម្ពុជា_សញ្ជាតិ,Nationality,សញ្ជាតិ,Nationality,សញ្ជាតិ,Question,Coded,,
3 |
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/diagnoses.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/diagnoses.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/diagnoses_02.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/diagnoses_02.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/diagnoses_03.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/diagnoses_03.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/drugs.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/drugs.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/interventions.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/interventions.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/newer_diagnoses.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/newer_diagnoses.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/retired_diagnoses.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/org/openmrs/module/initializer/include/file_patterns/retired_diagnoses.csv
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/gp.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | addresshierarchy.i18nSupport
5 | true
6 |
7 |
8 | locale.allowed.list
9 | en, km_KH
10 |
11 |
12 |
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/gp_error.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | bar
4 |
5 | addresshierarchy.i18nSupport
6 | true
7 |
8 |
9 | locale.allowed.list
10 | en, km_KH
11 |
12 |
13 |
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/gp_unmmaped_fields.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | addresshierarchy.i18nSupport
5 | true
6 |
7 |
8 | locale.allowed.list
9 | en, km_KH
10 |
11 |
12 | bar
13 |
14 | bar1
15 | bar2
16 | bar3
17 |
18 |
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/jsonKeyValues.json:
--------------------------------------------------------------------------------
1 | {
2 | "key1" : "value1",
3 | "key2" : "value2",
4 | "key3" : "value3"
5 | }
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/nested_txt_files/config.txt:
--------------------------------------------------------------------------------
1 | foo
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/nested_txt_files/level1/config.txt:
--------------------------------------------------------------------------------
1 | bar
--------------------------------------------------------------------------------
/api/src/test/resources/org/openmrs/module/initializer/include/nested_txt_files/level1/level2/config.txt:
--------------------------------------------------------------------------------
1 | b@z
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/ampathformstranslations/test_form_translations_fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "uuid" : "c5bf3efe-3798-4052-8dcb-09aacfcbabdc",
3 | "form" : "Test Form 1",
4 | "form_name_translation" : "Formulaire d'essai 1",
5 | "description" : "French Translations",
6 | "language" : "fr",
7 | "translations" : {
8 | "Encounter" : "Encontre",
9 | "Other" : "Autre",
10 | "Child" : "Enfant"
11 | }
12 | }
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/appointmentservicedefinitions/servicedefinitions.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Duration,Start Time,End Time,Max Load,Speciality,Location,Label Colour,_order:1000
2 | fc46dedf-5e96-44d4-bd99-bec1d80d15d5,,Surgery,Appointment for surgery,,8:00,17:00,,,,,
3 | 762e165a-af27-45fe-ad6e-1fe19db78198,,Casting,,30,,,15,,9356400c-a5a2-4532-8f2b-2361b3446eb8,,
4 | bfff3484-320a-4c1e-84c8-dbe8f0d44e8b,,Orthopaedic Follow-up,A follow-up appointment at the orthopedic clinic,,,,,,Xanadu,,
5 | c12829d8-6bdd-426c-a386-104eed0d2c41,,Bracing,,,,,,Orthopaedic,,#8FBC8F,
6 | b4b96cea-a0ed-4bbc-84f0-6c6b4e79f447,,Tenotomy,,,,,,cf213609-11ab-11ea-a6a0-080027405b36,,,
7 | 6b220700-4ba2-4846-86a7-a2afa5b6f2eb,,Specialized Appointment,,,,,,,,,
8 | a1039051-6f34-420d-9779-24e77eb0ca00,,On-site Appointment,,,,,,,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/appointmentservicetypes/servicetypes.csv:
--------------------------------------------------------------------------------
1 | Void/Retire,UUID,Name,Service definition,Duration,_order:1000
2 | ,f378bec4-2d0d-4509-a56e-b709e0a53700,Short follow-up,On-site Appointment,10,
3 | TRUE,4e0f61df-d1f7-4cff-8d69-6264666daf3b,,,,
4 | ,ffd7e0f4-33f1-4802-b87a-8d610ba1132d,Simple Bracing,Specialized Appointment,45,
5 | ,0a4624a6-ca81-42e2-a1ab-8f8dca033b83,Short follow-up,Specialized Appointment,45,
6 | ,2526359e-cb9e-45d4-b83a-2b588744eb05,Complex Bracing,6b220700-4ba2-4846-86a7-a2afa5b6f2eb,75,
7 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/appointmentspecialities/specialities.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name
2 | 21ec1632-420f-473c-b380-31ed45214362,,Psychiatric
3 | 65ae95d9-d1a5-4979-a534-dc17671f2469,,Neonatal
4 | ,,Speciality C
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/attributetypes/attribute_types.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Entity name,Name,Description,Min occurs,Max occurs,Datatype classname,Datatype config,Preferred handler classname,Handler config,_order:1000
2 | 0bb29984-3193-11e7-93ae-92367f002671,,Location,Location Height,Location Height's description,1,1,org.openmrs.customdatatype.datatype.FloatDatatype,,,,
3 | 0bc29982-3193-11e3-93ae-92367f222671,,Visit,Visit Color,Visit Color's description,1,1,org.openmrs.customdatatype.datatype.FreeTextDatatype,,,,
4 | 9eca4f4e-707f-4bb8-8289-2f9b6e93803c,,Location,Location ISO Code,Location ISO Code's description,1,10,org.openmrs.customdatatype.datatype.FreeTextDatatype,,,,
5 | ,,Provider,Provider Speciality,Clinical speciality for this provider,0,7,org.openmrs.customdatatype.datatype.FreeTextDatatype,,,,
6 | ,TRUE,Provider,Provider Rating,,,,,,,,
7 | 7d002484-0fcd-4759-a67a-04dbf8fdaab1,,Concept,Concept Location,,1,1,org.openmrs.customdatatype.datatype.LocationDatatype,,,,
8 | 3884c889-35f5-47b4-a6b7-5b1165cee218,,Program,Program Assessment,Program Assessment's description,1,,org.openmrs.customdatatype.datatype.FreeTextDatatype,,,,
9 | 9398c839-4f39-428c-9022-e457980ccfa8,,Program,CodedConcept attribute type,This is a Program's CodedConcept attribute type,0,1,org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype,8295308d-e5b2-41c7-adc1-2e0e83f0f16e,,,
10 | b1d98f27-c058-46f2-9c12-87dd7c92f7e3,,Program,Program Efficiency Indicator,Metric of the program efficiency,0,1,org.openmrs.customdatatype.datatype.FloatDatatype,,,,
11 | ,TRUE,Concept,Concept Family,,,,,,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/autogenerationoptions/autogenerationoptions.csv:
--------------------------------------------------------------------------------
1 | Uuid,Identifier Type,Location,Identifier Source,Manual Entry Enabled,Auto Generation Enabled,_order:2000
2 | eade77b6-3365-47ed-9ee3-2324598629eb,Legacy ID,f0f8ba64b-ea57-4a41-b33c-9dfc59b0c60a,9eca4f4e-707f-4lb8-8289-2f9b6e93803f,true,false,
3 | ca5cc0bf-38f0-41a6-9759-dd2a6763155a,OpenMRS ID,,0d47284f-9e9b-4a81-a88b-8bb42bc0a901,false,true,
4 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/cohortattributetypes/cohortattributetypes.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Datatype classname,Min occurs,Max occurs,Preferred handler classname,Handler config,_order:1000
2 | 09790099-9190-429d-811a-aac9edb8d98e,,Test,This is a test group.,org.openmrs.customdatatype.datatype.FreeTextDatatype,0,,,,
3 | 8a234a2c-02c7-4222-afb3-6116ea5c9553,TRUE,Control,This is a control group.,org.openmrs.customdatatype.datatype.FreeTextDatatype,0,,,,
4 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/cohorttypes/cohorttypes.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,_order:1000
2 | 3ab0118c-ba0c-42df-ac96-c573c72eed5e,,System,System lists,
3 | 58dfd8c3-f42f-4424-8106-3ce6b51d7171,TRUE,Old Personal,Personal lists (retired),
4 | 9ebd4eb9-d9c6-4fd5-930a-30563fc5004c,,Personal,Personal lists,
5 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/conceptclasses/conceptclasses.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description
2 | 69d620da-93c4-4767-916e-48f5fe8824c4,,Medical supply,Materials used in the facility
3 | ,true,Procedure,
4 | ,,Animal,
5 | ,,Drug,Not what it sounds like
6 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_complex.csv:
--------------------------------------------------------------------------------
1 | Uuid,Fully specified name:en,Data class,Data type,Complex data handler,_version:1,_order:5000
2 | ,CC_1,Misc,Complex,ImageHandler,,
3 | b0b15817-79d6-4c33-b7e9-bfa079d46f5f,CC_2_EDIT,Misc,Complex,BinaryDataHandler,,
4 | ,CC_3_ERROR,Misc,Complex,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_forsets.csv:
--------------------------------------------------------------------------------
1 | Uuid,Fully specified name:en,Same as mappings,Description:en,Data class,Data type,Answers,Members,_version:1,_order:1000
2 | 54014540-311d-11ec-8d2b-0242ac110002,Set of senses,CIEL:SENSE_SET,Set of all available senses,ConvSet,N/A,,,,
3 | 5a393db9-311d-11ec-8d2b-0242ac110002,How did you sense it?,CIEL:SENSE_QUESTION,Question about sense,Question,Coded,,,,
4 | 5d1e9aa1-311d-11ec-8d2b-0242ac110002,Smell,CIEL:SMELL,Smell,Misc,N/A,,,,
5 | 6878804b-311d-11ec-8d2b-0242ac110002,Taste,CIEL:TASTE,Taste,Misc,N/A,,,,
6 | 6b29ee43-311d-11ec-8d2b-0242ac110002,Touch,CIEL:TOUCH,Touch,Misc,N/A,,,,
7 | 6da4eb30-311d-11ec-8d2b-0242ac110002,Sight,CIEL:SIGHT,Sight,Misc,N/A,,,,
8 | 703404f7-311d-11ec-8d2b-0242ac110002,Sound,CIEL:SOUND,Sound,Misc,N/A,,,,
9 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_mappings.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Same as mappings,mappings|broader-than|CIEL,Fully specified name:en,Data class,Data type,_version:1,_order:3000
2 | 2c4da504-33d4-11e7-a919-92ebcb67fe33,,Cambodia:1234; CIEL:159392,broader-test-1,CONFIRMED DIAGNOSIS,Misc,N/A,,
3 | ,,foobar:456,,Unexisting mapping,Misc,Text,,
4 | ,TRUE,Cambodia:foo12bar,,CONCEPT_WITH_MAPPING_TO_RETIRE,,,,
5 | ,,Cambodia:foo12bar,broader-test-2a; broader-test-2b,NEW_CONCEPT_REUSING_MAPPING,Misc,Text,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_names.csv:
--------------------------------------------------------------------------------
1 | Uuid,Fully specified name:en:UUID,Fully specified name:en,Fully specified name:es,Short name:en,Short name:es,Synonym 1:en:uuid,Synonym 1:en,Synonym 1:en:Preferred,Synonym 1:es,Synonym 2:en,Data class,Data type,_version:1,_order:1000
2 | 58083852-303f-11ec-8d2b-0242ac110002,e91ab3ad-303f-11ec-8d2b-0242ac110002,Red,Rojo,R,R,,Maroon,,,,Misc,N/A,,
3 | 5dcaf167-303f-11ec-8d2b-0242ac110002,fe9c8c03-303f-11ec-8d2b-0242ac110002,Blue,Azul,B,A,,Navy,TRUE,Azulado,Baby Blue,Misc,N/A,,
4 | 61214827-303f-11ec-8d2b-0242ac110002,,Green,Verde,,,,,,,,Misc,N/A,,
5 | 4cfe07b0-3061-11ec-8d2b-0242ac110002,,Lemon Yellow,,Y,,c0c238b3-3061-11ec-8d2b-0242ac110002,Yellow,TRUE,,,Misc,N/A,,
6 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_nested.csv:
--------------------------------------------------------------------------------
1 | Uuid,Answers,Members,Fully specified name:en,Data class,Data type,_version:1,_order:2000
2 | 8bc5043c-3221-11e7-93ae-92361f002671,,,Kingdom of Cambodia,Misc,Text,,
3 | 8bc506bc-3221-11e7-93ae-92361f002671,,,United States of America,Misc,Text,,
4 | 8bc50946-3221-11e7-93ae-92361f002671,Kingdom of Cambodia; 8bc506bc-3221-11e7-93ae-92361f002671,,Country name,Question,Coded,,
5 | c84c3f88-3221-11e7-93ae-92361f002671,,8bc5043c-3221-11e7-93ae-92361f002671; United States of America,All country names,Misc,Text,,
6 | ,Kingdom of Cambodia; 8bc506bc-3221-11e7-93ae-92361f002671; Lao PDR,,Unexisting concept answer,Misc,Text,,
7 | ,,8bc5043c-3221-11e7-93ae-92361f002671; United States of America; mysource:1234,Unexisting set member,Misc,Text,,
8 | d803e973-1010-4415-8659-c011dec707c0,,,CONCEPT_REMOVE_MEMBERS,Misc,Text,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_numeric.csv:
--------------------------------------------------------------------------------
1 | Uuid,Fully specified name:en,Data class,Data type,Absolute low,Critical low,Normal low,Normal high,Critical high,Absolute high,Units,Allow decimals,Display precision,_version:1,_order:4000
2 | ,CN_1,Misc,Numeric,-100.5,-85.7,-50.3,45.1,78,98.8,foo,yes,1,,
3 | 4280217a-eb93-4e2f-9684-28bed4690e7b,CN_2_EDIT,Misc,Numeric,,,45.7,55.6,,,,,,,
4 | ,CN_3_ERROR,Misc,Numeric,,,,55.8a,,,,,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/concepts_without_members_or_answers_column.csv:
--------------------------------------------------------------------------------
1 | Uuid,Fully specified name:en,Data class,Data type,_version:1,_order:3000
2 | 8bc50946-3221-11e7-93ae-92361f002671,Update concept name but do not remove answers,Question,Coded,,
3 | c84c3f88-3221-11e7-93ae-92361f002671,Update concept name but do not remove members,Misc,Text,,
4 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/concepts/fullyspecified_and_short_named_concepts.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Fully specified name:en,Fully specified name:km_KH,Short name:en,Short name:km_KH,Synonym:en,Description:en,Description:km_KH,Data class,Data type,Members,Version,Attribute|Email Address,Attribute|Audit Date,_version:1,_order:10000
2 | 835c8868-4608-454c-8ede-f1789d9de28e,,False vital signs,VSFM-KH,,VSFM,Vital signs,,,Misc,Text,,,,,,
3 | 71ef16f7-6250-440b-be0d-62b8c75fe860,,Vital signs,VS-KH,Vital signs short,,,Actual vital signs,,Misc,Text,,,vitalsigns@short.example.com,2020-04-06,,
4 | 23542fd3-4315-4e51-b68e-bce887331c0a,,Overall signs set,,Overall signs,,,,,ConvSet,N/A,Vital signs,,,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/conceptsets/concept_sets.csv:
--------------------------------------------------------------------------------
1 | Concept,Member,Member Type,Sort Weight,_version:1,_order:1000
2 | 54014540-311d-11ec-8d2b-0242ac110002,5d1e9aa1-311d-11ec-8d2b-0242ac110002,concept-set,1,,
3 | Set of senses,Taste,CONCEPT-SET,2.0,,
4 | CIEL:SENSE_SET,CIEL:TOUCH,,4.0,,
5 | 54014540-311d-11ec-8d2b-0242ac110002,Sight,,3,,
6 | 54014540-311d-11ec-8d2b-0242ac110002,Sound,,50,,
7 | 5a393db9-311d-11ec-8d2b-0242ac110002,CIEL:SMELL,Q-AND-A,"",,
8 | How did you sense it?,CIEL:SIGHT,q-and-a,200,,
9 | CIEL:SENSE_QUESTION,CIEL:SOUND,,100,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/conceptsources/sources.csv:
--------------------------------------------------------------------------------
1 | UUID,Void/Retire,Name,Description,HL7 Code,Unique ID
2 | adbd4dc1-eb52-4670-8a69-bb646cef9cd7,,Mexico,Reference codes for the Mexican MoH,,
3 | ,TRUE,Cambodia,Reference terms for Cambodia,,
4 | ,,Peru,Reference terms for Peru,,
5 | ,,CIEL,The people's terminology source,,
6 | ,,SNOMED CT,SNOMED Preferred mapping,SCT,
7 | ,,RadLex,Radiology Terms,RADLEX,2.16.840.1.113883.6.256
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/datafiltermappings/mappings.csv:
--------------------------------------------------------------------------------
1 | Void/Retire,Entity UUID,Entity class,Basis UUID,Basis class,_order:1000
2 | ,3f8f0ab7-c240-4b68-8951-bb7020be01f6,org.openmrs.Role,787ec1bd-19a6-4577-9121-899588795737,org.openmrs.Program,
3 | TRUE,4604e928-96bf-4e2c-be08-cbbc40dd000c,org.openmrs.Privilege,a03e395c-b881-49b7-b6fc-983f6bddc7fc,org.openmrs.Location,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/drugs/drugs.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Concept Drug,Concept Dosage Form,Strength,_version:1
2 | ,,Cetirizine 10mg Tablet,Cetirizine,Tablet,10mg,
3 | ,,Erythromycine 500mg Tablet,Erythromycine,,500mg,
4 | 2bcf7212-d218-4572-8893-25c4b5b71934,,Metronidazole 500mg Tablet,Metronidazole (new),Tablet,500mg,
5 | ,,d4T 30,d4T,,30mg,
6 | 6e764d43-ae8b-11eb-8168-0242ac110002,true,Metronidazole 250mg Tablet,Metronidazole (new),Tablet,250mg,
7 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/encounterroles/encounterroles.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description
2 | 54ce9816-1062-4636-af95-655066cd6aba,,Surgeon,Does surgery
3 | ,TRUE,Plague Doctor,
4 | ,,Anesthesiologist,
5 | ,,Phlebotomist,Responsible for drawing blood
6 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/encountertypes/encountertypes.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,View privilege,Edit privilege,display:en,display:km_KH,_order:1000
2 | ,,Triage Encounter,An encounter for triaging patients.,,,Triage Encounter (translated),ទ្រីយ៉ាហ្គេនស៊ើរ,
3 | aaa1a367-3047-4833-af27-b30e2dac9028,,Medical History Encounter,An interview about the patient medical history.,,,Medical History Encounter (translated),ប្រវត្តិសាស្រ្តវេជ្ជសាស្រ្ត,
4 | 439559c2-a3a4-4a25-b4b2-1a0299e287ee,,X-ray Encounter,An encounter during wich X-rays are performed on the patient.,Can: View X-ray encounter,Can: Edit X-ray encounter,,,
5 | 400d7e07-6de6-40ac-8611-dcce12408e71,,Foo Encounter,An foo encounter that should not be created.,Can: View foo encounter,,,,
6 | bed6f0f6-ab07-481f-929f-3d26e6cb1138,TRUE,,,,,,,
7 | ,,Oncology Encounter,A new description for the oncology encounter.,Can: View oncology encounter,,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/fhirconceptsources/conceptsources.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Concept source,Url,_order:1000
2 | ,,CIEL,http://api.openconceptlab.org/orgs/CIEL/sources/CIEL,
3 | befca738-1704-4a47-9f6a-0fcacf786061,,SCT,http://snomed.info/sct/,
4 | ,true,Test Concept Source,,,,,,
5 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/fhirpatientidentifiersystems/identifiersystems.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Patient identifier type,Url,_order:1000
2 | 87c87473-b394-430b-93d3-b46d0faca26e,,73f4f1d6-6086-41d5-a0f1-6d688a4b10af,http://openmrs.org/identifier,
3 | ,,Second ID,http://openmrs.org/identifier/2,
4 | ed2571ad-6a0b-413d-8506-362266c7595e,true,Third ID,,
5 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/globalproperties/gp1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | gp.gp11
5 | GP one one
6 |
7 |
8 | gp.gp12
9 | GP one two
10 |
11 |
12 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/globalproperties/gp2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | gp.gp21
5 | GP two one
6 |
7 |
8 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/globalproperties/gp3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | It should be ok to just add some comments like this.
4 |
5 |
6 |
7 | gp.gp31
8 | GP three one
9 |
10 |
11 | gp.gp32
12 | GP three two
13 |
14 |
15 | gp.gp33
16 | GP three three
17 |
18 |
19 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/htmlforms/allAttributeForm.xml:
--------------------------------------------------------------------------------
1 |
11 | Date:
12 | Location:
13 | Provider:
14 | Weight:
15 |
16 |
17 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/htmlforms/secondLevelForm.xml:
--------------------------------------------------------------------------------
1 |
11 | Date:
12 | Location:
13 | Provider:
14 | Weight:
15 |
16 |
17 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/htmlforms/thirdLevelForm.xml:
--------------------------------------------------------------------------------
1 |
9 | Date:
10 | Location:
11 | Provider:
12 | Weight:
13 |
14 |
15 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/idgen/idgen_pool.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Identifier type,Name,Description,Pool Identifier Source,Pool refill batch size,Pool minimum size,Pool refill with task,Pool sequential allocation,_version:1,_order:3000
2 | 30799e8f-59cf-11ec-8885-0242ac110002,,PATIENTIDENTIFIERTYPE_1_OPENMRS_ID,New pool name,New pool description,1af1422c-8c65-438d-9770-cbb723821bc8,20,60,true,true,,
3 | ef35fb58-6618-411a-a331-bff960a29d40,,PATIENTIDENTIFIERTYPE_1_OPENMRS_ID,Edited pool name,Edited pool description,d2a10e86-59ce-11ec-8885-0242ac110002,10,40,false,false,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/idgen/idgen_remote.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Identifier type,Name,Description,Url,User,Password,_version:1,_order:2000
2 | d2a10e86-59ce-11ec-8885-0242ac110002,,PATIENTIDENTIFIERTYPE_1_OPENMRS_ID,New remote name,New remote description,http://localhost,property:idgen_remote_user,property:idgen_remote_password,,
3 | c1d90956-3f10-11e4-adec-0800271c1b75,,PATIENTIDENTIFIERTYPE_1_OPENMRS_ID,Edited remote name,Edited remote description,http://example.com/edit,editUser,editPass,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/idgen/idgen_sequential.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Identifier type,Name,Description,Prefix,Suffix,First identifier base,Min length,Max length,Base character set,_version:1,_order:1000
2 | 1af1422c-8c65-438d-9770-cbb723821bc8,,PATIENTIDENTIFIERTYPE_1_OPENMRS_ID,New sequential name,New sequential description,A,Z,001,5,7,0123456789,,
3 | c1d8a345-3f10-11e4-adec-0800271c1b75,,PATIENTIDENTIFIERTYPE_1_OPENMRS_ID,Edited sequential name,Edited sequential description,Y,,1000,6,6,ACDEFGHJKLMNPRTUVWXY1234567890,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/jsonkeyvalues/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "impl.purpose.concept.uuid" : "4421da0d-42d0-410d-8ffd-47ec6f155d8f",
3 | "impl.purpose.concept.fsn" : "CONCEPT_FOR_FETCHING",
4 | "impl.purpose.concept.mapping" : "Cambodia:123",
5 | "impl.purpose.pat.uuid" : "9eca4f4e-707f-4bb8-8289-2f9b6e93803c",
6 | "impl.purpose.pat.name" : "PAT_FOR_FETCHING",
7 | "structured.json" : {
8 | "foo" : "bar",
9 | "fooz" : {
10 | "baz" : "value"
11 | }
12 | },
13 | "impl.purpose.concepts" : [
14 | "0cbe2ed3-cd5f-4f46-9459-26127c9265ab",
15 | "32d3611a-6699-4d52-823f-b4b788bac3e3"
16 | ]
17 | }
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/liquibase/concepts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 | Set concept 'Affirmative' UUID
10 |
11 |
12 |
13 | concept_id='7'
14 |
15 |
16 |
17 |
18 | Set concept 'Negative' UUID
19 |
20 |
21 |
22 | concept_id='8'
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/liquibase/liquibase.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Set encounter type 'Scheduled' UUID
13 |
14 |
15 |
16 | name='Scheduled'
17 |
18 |
19 |
20 |
21 | Set encounter type 'Emergency' UUID
22 |
23 |
24 |
25 | name='Emergency'
26 |
27 |
28 |
29 |
30 | Set encounter type 'Laboratory' UUID
31 |
32 |
33 |
34 | name='Laboratory'
35 |
36 |
37 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/locations/locations.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Parent,Tags,Tag|Facility Location,Attribute|9eca4f4e-707f-4bb8-8289-2f9b6e93803c,Attribute|Last Audit Date,Address 1,Address 2,Address 3,Address 4,Address 5,Address 6,City/Village,County/District,State/Province,Postal Code,Country,display:en,display:km_KH,_order:1000
2 | ,,The Lake Clinic-Cambodia,,,Login Location; Another Location Tag,,CODE-TLC-123,2017-05-15,Paradise Street,,,,,,,Siem Reap,Siem Reap,,Cambodia,The Lake Clinic-Cambodia (translated),គ្លីនីកគ្លីនិក - ប្រទេសកម្ពុជា,
3 | ,,OPD Room,,The Lake Clinic-Cambodia,,TRUE,,,,,,,,,,,,,,,,
4 | a03e395c-b881-49b7-b6fc-983f6bddc7fc,,Acme Clinic,This now becomes a child of TLC,The Lake Clinic-Cambodia,Login Location,,,2019-03-13,,,,,,,,,,,,Acme Clinic (translated),គ្លីនិកអាមី,
5 | cbaaaab4-d960-4ae9-9b6a-8983fbd947b6,TRUE,Legacy Location,Legacy location that must be retired,,,,,,,,,,,,,,,,,,,
6 | ,,LOCATION_NO_UUID,,,,,,,Main Street,,,,,,,Siem Reap,Siem Reap,,Cambodia,,,
7 | 1cb58794-3c49-11ea-b3eb-f7801304f314,,New Location,,,,,,,,,,,,,,,,,,,,
8 | 2b9824a3-92f0-4966-8f34-1b105624b267,,Invalid parent location,This location shouldn not be loaded as it has an invalid parent,Invalid parent,,,,,,,,,,,,,,,,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/locationtagmaps/locationtagmaps.csv:
--------------------------------------------------------------------------------
1 | Location,Facility Location,a1417745-1170-5752-fc8a-dd0ba131f40e,Appointment Location
2 | Patient Home,,false,true
3 | a03e395c-b881-49b7-b6fc-983f6bddc7fc,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/locationtags/locationtags.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description
2 | ,,Sparse,
3 | b03e395c-b881-49b7-b6fc-983f6befc7fc,,Filled in,A tag with all its fields
4 | a2327745-2970-4752-ac8a-dd0ba131f40e,TRUE,Facility Location,
5 | a1417745-1170-5752-fc8a-dd0ba131f40e,,Supply Room,Don't call it a shed
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/messageproperties/metadata_additions_en.properties:
--------------------------------------------------------------------------------
1 | _order=2
2 | shouldOverride=Overridden
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/messageproperties/metadata_en.properties:
--------------------------------------------------------------------------------
1 | _order=1
2 | metadata.healthcenter=Health center
3 | metadata.healthcenter.description=This is the description of a health centre.
4 | metadata.healthcenter.onlyInEnglish=Only defined in English
5 | englishAndSpanishOnly=English
6 | shouldOverride=Not Overridden
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/messageproperties/metadata_es.properties:
--------------------------------------------------------------------------------
1 | englishAndSpanishOnly=Spanish
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/messageproperties/metadata_fr.properties:
--------------------------------------------------------------------------------
1 | metadata.healthcenter=Clinique
2 | metadata.healthcenter.description=Ceci est la description d'une clinique.
3 | metadata.healthcenter.description.named=Ceci est la description de la clinique {0}.
4 | greeting=Bonjour from Iniz
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatasetmembers/metadatasetmembers.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Metadata Set Uuid,Metadata Class,Metadata Uuid,Sort Weight,_order:1000
2 | ee00777d-0cbe-41b7-4c67-8ff93de67b9e,,Legacy Id,,f0ebcb99-7618-41b7-b0bf-8ff93de67b9e,org.openmrs.PatientIdentifierType,n0ebcb90-m618-n1b1-b0bf-kff93de97b9j,,
3 | f0ebcb99-272d-41b7-4c67-078de9342492,True,Old OpenMRS Id,,f0ebcb99-7618-41b7-b0bf-8ff93de67b9e,org.openmrs.PatientIdentifierType,8f6ed8bb-0cbe-4c67-bc45-c5c0320e1324,,
4 | dbfd899d-e9e1-4059-8992-73737c924f88,,Outpatient Id,IdentifierType for OPD,f0ebcb99-7618-41b7-b0bf-8ff93de67b9e,org.openmrs.PatientIdentifierType,7b0f5697-27e3-40c4-8bae-f4049abfb4ed,34,
5 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatasets/metadatasets.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,_order:1000
2 | f0ebcb99-7618-41b7-b0bf-8ff93de67b9e,,Extra Identifiers Set,Set of extra patient identifiers,
3 | 97f94721-2f01-463a-95bb-3ce780bdfea6,TRUE,Secondary Identifier Types,,
4 | e3410148-a7df-447c-9bde-1a08aaecc0f5,,Required Attribute Types,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatasharing/PatientIdentifierType.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/testAppDataDir/configuration/metadatasharing/PatientIdentifierType.zip
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatasharing/PersonAttributeType.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/testAppDataDir/configuration/metadatasharing/PersonAttributeType.zip
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatasharing/RelationshipType.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/testAppDataDir/configuration/metadatasharing/RelationshipType.zip
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatasharing/_faulty_.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/testAppDataDir/configuration/metadatasharing/_faulty_.zip
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/metadatatermmappings/metadataterms.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Mapping code,Mapping source,Metadata class name,Metadata Uuid,_order:2000
2 | 21e24b36-f9e3-4b0e-986d-9899665597f7,,emr.primaryIdentifierType,org.openmrs.module.emrapi,org.openmrs.PatientIdentifierType,264c9e75-77da-486a-8361-31558e051930,
3 | "",,emr.atFacilityVisitType,org.openmrs.module.emrapi,org.openmrs.VisitType,7b0f5697-27e3-40c4-8bae-f4049abfb4ed,
4 | 5f84b986-232d-475b-aad2-2094306bd655,TRUE,emr.extraPatientIdentifierTypes,org.openmrs.module.emrapi,org.openmrs.module.metadatamapping.MetadataSet,05a29f94-c0ed-11e2-94be-8c13b969e334,
5 | dbfd899d-e9e1-4059-8992-73737c924f84,,emr.admissionEncounterType,org.openmrs.module.emrapi,org.openmrs.EncounterType,e22e39fd-7db2-45e7-80f1-60fa0d5a4378,
6 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/ocl/test.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/src/test/resources/testAppDataDir/configuration/ocl/test.zip
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/orderfrequencies/orderfrequencies.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Frequency per day,Concept frequency,_version:1,_order:7000
2 | ,,24,Hourly,,
3 | 4b33b729-1fe3-4fa5-acc4-084beb069b68,TRUE,,,,
4 | 136ebdb7-e989-47cf-8ec2-4e8b2ffe0ab3,,0.5,Bidaily,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/ordertypes/ordertypes.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Java class name,Parent,Concept Classes,_order:1000
2 | 01727040-a587-484d-b66a-f0afbae6c281,,Parent Order Type,A test order type to be used as a parent.,org.openmrs.Order,,,
3 | 8189b409-3f10-11e4-adec-0800271c1b75,,Iniz Lab Order,An order for laboratory tests created by Iniz,org.openmrs.Order,01727040-a587-484d-b66a-f0afbae6c281,Lab orders #1;9ce20038-c1de-4856-b2b1-297d06e58326,
4 | 8be5f714-ee92-4d09-939e-2d1897bb2f95,,New Order Type Name,For testing renaming an order type.,org.openmrs.Order,,,
5 | 96f94b64-6c9e-489d-b258-633878b9af69,TRUE,,,org.openmrs.Order,,,
6 | ,,Order Type Without UUID,For testing loading order types by name.,org.openmrs.Order,,,
7 | 6721493b-ec7c-4e3f-980a-5be3a09585ce,,Sub-Drug Order Type,For testing an order type for drug orders..,org.openmrs.DrugOrder,,,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/patientidentifiertypes/pit.csv:
--------------------------------------------------------------------------------
1 | "Uuid","Void/Retire","Name","Description","Required","Format","Format description","Validator","Location behavior","Uniqueness behavior"
2 | "73f4f1d6-6086-41d5-a0f1-6d688a4b10af",,"Hospital ID","The patient ID for the hospital. You know the one",TRUE,"H-\\d\\d\\d\\d-\\d","Must have format H-####-C where C is the Luhn check digit","org.openmrs.patient.impl.LuhnIdentifierValidator","NOT_USED","UNIQUE"
3 | ,TRUE,"Old Identification Number",,,,,,,
4 | ,,"Test National ID No","Changing all the fields",TRUE,"\\a\\a\\a\\d\\d\\d\\d","Three letters and four numbers","org.openmrs.patient.impl.LuhnIdentifierValidator","REQUIRED","LOCATION"
5 | ,,"Minimal ID",,FALSE,,,,,
6 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/personattributetypes/pat_base.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Format,Foreign uuid,Searchable,Edit privilege,_order:1000
2 | ,,PAT_with_concept,,org.openmrs.Concept,5825d19a-bafe-4348-b1ce-2ea03bfc1a10,,Edit:PAT,
3 | 9eca4f4e-707f-4bb8-8289-2f9b6e93803c,,PAT_RENAME_NEW_NAME,,java.lang.String,,,,
4 | bd1adb89-ba65-40ad-8eb9-21751281432f,,PAT_CHANGE_FOREIGNKEY,,org.openmrs.Concept,5825d19a-bafe-4348-b1ce-2ea03bfc1a10,yes,,
5 | ,,PAT_NO_UUID,a description,java.lang.String,,,,
6 | 717ec942-3c4a-11ea-b024-ffc81a23382e,,NEW_PAT,,java.lang.String,,,,
7 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/privileges/privileges.csv:
--------------------------------------------------------------------------------
1 | Uuid,Privilege name,Description
2 | ,Add People,Able to add people.
3 | ,Add Apples, Able to add apples.
4 | cf68a296-2700-102b-80cb-0017a47871b2,Add Reports,Able to add reports.
5 | 36404041-c255-4c5b-9b47-0d757d2afa95,Add Chickens,Able to add poultry.
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/programs/programs.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Program concept,Outcomes concept,_order:1000
2 | eae98b4c-e195-403b-b34a-82d94103b2c0,,TB Program,TB Program Outcomes
3 | d7477c21-bfc3-4922-9591-e89d8b9c8efa,,AIDS Program,AIDS Program Outcomes
4 | 5dc2a3b0-863c-4074-8f84-45762c3aa04c,,Oncology Program,Oncology Program Outcomes
5 | ,,Mental Health Program,Mental Health Program Outcomes
6 | 28f3da50-3f56-4e4e-93cd-66f334970480,TRUE,Ayurvedic Medicine Program,Ayurvedic Medicine Program Program Outcomes
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/programworkflows/workflows.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Program,Workflow concept,_order:1000
2 | 2b98bc76-245c-11e1-9cf0-00248140a5eb,,TB Program,TB Treatment Status (workflow)
3 | 2b98bc76-245c-11e1-9cf0-00248140a5ee,,eae98b4c-e195-403b-b34a-82d94103b2c0,Standard Treatment Status (workflow)
4 | ,,AIDS Program,Palliative Care (workflow)
5 | 1b42d0e8-20ad-4bd8-b05d-fbad80a3b665,,AIDS Program,Extended Discharge (workflow)
6 | 45a28ee9-20a3-4065-9955-9cb7a0c6a24b,TRUE,Mental Health Program,
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/programworkflowstates/states.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Workflow,State concept,Initial,Terminal
2 | cfa241f4-2700-102b-80cb-0017a47871b2,,TB Treatment Status (workflow),Active treatment (initial),true,
3 | cfa244b0-2700-102b-80cb-0017a47871b2,,1b42d0e8-20ad-4bd8-b05d-fbad80a3b665,Defaulted,,true
4 | 88b717c0-f580-497a-8d2b-026b60dd6bfd,,TB Treatment Status (workflow),Deceased,true,true
5 | ,,Standard Treatment Status (workflow),Transferred out,,
6 | cfa24690-2700-102b-80cb-0017a47871b2,true,Extended Discharge (workflow),Moribund,true,
7 |
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/providerroles/providerroles.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Supervisee Provider Role 1,Supervisee Provider Role 2,Relationship Type,Provider Attribute Type 1,Provider Attribute Type 2,_order:2000
2 | 68624C4C-9E10-473B-A849-204820D16C45,,CHW,,,53d8a8f3-0084-4a52-8666-c655f5bd2689,c8ef8a16-a8cd-4748-b0ea-e8a1ec503fbb,0c267ae8-f793-4cf8-9b27-93accaa45d86
3 | 11C1A56D-82F7-4269-95E8-2B67B9A3D837,,CHW Supervisor,68624C4C-9E10-473B-A849-204820D16C45,9a4b44b2-8a9f-11e8-9a94-a6cf71072f73,,c8ef8a16-a8cd-4748-b0ea-e8a1ec503fbb,
4 | 9a4b44b2-8a9f-11e8-9a94-a6cf71072f73,,Nurse Accompagnateur,,,53d8a8f3-0084-4a52-8666-c655f5bd2689,c8ef8a16-a8cd-4748-b0ea-e8a1ec503fbb,0c267ae8-f793-4cf8-9b27-93accaa45d86
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/relationshiptypes/relationshiptypes.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,Weight,Preferred,A is to b,B is to a
2 | c86d9979-b8ac-4d8c-85cf-cc04e7f16315,,Uncle/Nephew,A relationship of an uncle and his nephew,1,true,Uncle,Nephew
3 | 3982f469-cedc-4b2d-91ea-fe38f881e1a0,true,Aunt/Niece,A relationship of an aunt and her niece,,,Aunt,Niece
4 | 53d8a8f3-0084-4a52-8666-c655f5bd2689,,Supervisor/Supervisee,A new description for supervisor to supervisee relationship,,,Supervisor,Supervisee
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/roles/roles.csv:
--------------------------------------------------------------------------------
1 | Uuid,Role name,Description,Inherited roles,Privileges
2 | d2fcb604-2700-102b-80cb-0017a47871b2,Organizational: Doctor,Doctor role,Application: Records Allergies; Application: Uses Patient Summary,Add Allergies; Add Patient; cf688946-2700-102b-80cb-0017a47871b2
3 | ,Organizational: Nurse,Nurse role,Application: Sees Appointment Schedule; d2fcc9fa-2700-102b-80cb-0017a47871b2,Add Orders; Add Users
--------------------------------------------------------------------------------
/api/src/test/resources/testAppDataDir/configuration/visittypes/visittypes.csv:
--------------------------------------------------------------------------------
1 | Uuid,Void/Retire,Name,Description,_version:1
2 | 2bcf7212-d218-4572-88o9-25c4b5b71934,,HIV,HIV Description,
3 | abcf7209-d218-4572-8893-25c4b5b71934,,General,,
4 | e1d02b2e-cc85-48ac-a5bd-b0e4beea96e0,,Antenatal,,
5 | ,,Return TB Clinic Visit,Edited Return TB Clinic Visit Description,
6 | e1d02b2e-cc85-48ac-a5bd-b0e4beea96e0,True,,,
7 | ,True,Initial HIV Clinic Visit,,
8 | 287463d3-2233-4c69-9851-5841a1f5e109,,OPD,OPD Visit,
--------------------------------------------------------------------------------
/api/src/test/resources/testdata/test-concepts-numeric.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/api/src/test/resources/testdata/test-metadatasets.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
18 |
19 |
20 |
29 |
30 |
39 |
--------------------------------------------------------------------------------
/api/src/test/resources/testdata/testAmpathformstranslations/invalid_form_missing_formName_translations_fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "uuid" : "c5bf3efe-3798-4052-8dcb-09aacfcbabdc",
3 | "description" : "French Translations",
4 | "language" : "fr",
5 | "translations" : {
6 | "Encounter" : "Encontre",
7 | "Other" : "Autre",
8 | "Child" : "Enfant"
9 | }
10 | }
--------------------------------------------------------------------------------
/api/src/test/resources/testdata/testAmpathformstranslations/invalid_form_missing_language_translations_fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "uuid" : "c5bf3efe-3798-4052-8dcb-09aacfcbabdc",
3 | "form" : "Test Form 1",
4 | "description" : "French Translations",
5 | "translations" : {
6 | "Encounter" : "Encontre",
7 | "Other" : "Autre",
8 | "Child" : "Enfant"
9 | }
10 | }
--------------------------------------------------------------------------------
/api/src/test/resources/testdata/testAmpathformstranslations/invalid_form_missing_uuid_translations_fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "form" : "Test Form 1",
3 | "description" : "French Translations",
4 | "language" : "fr",
5 | "translations" : {
6 | "Encounter" : "Encontre",
7 | "Other" : "Autre",
8 | "Child" : "Enfant"
9 | }
10 | }
--------------------------------------------------------------------------------
/api/src/test/resources/testdata/testAmpathformstranslations/test_form_updated_translations_fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "uuid" : "c5bf3efe-3798-4052-8dcb-09aacfcbabdc",
3 | "form" : "Test Form 1",
4 | "description" : "French Translations Updated",
5 | "language" : "fr",
6 | "translations" : {
7 | "Aunt" : "Tante",
8 | "Uncle" : "Oncle",
9 | "Nephew" : "Neveu"
10 | }
11 | }
--------------------------------------------------------------------------------
/omod/src/main/resources/webModuleApplicationContext.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/readme/ampathformstranslations.md:
--------------------------------------------------------------------------------
1 | ## Domain 'ampathformstranslations'
2 | The **ampathtranslationsforms** subfolder contains AMPATH Translation Forms JSON schema files. Each JSON file defines the translations for forms. For example,
3 |
4 | ```bash
5 | ampathformstranslations/
6 | ├── form1_translations_fr.json
7 | └── form2_translations_en.json
8 | ```
9 |
10 | ###### JSON file example:
11 | ```json
12 | {
13 | "uuid": "c5bf3efe-3798-4052-8dcb-09aacfcbabdc",
14 | "form": "Form 1",
15 | "form_name_translation": "Formulaire 1",
16 | "description": "French Translations for Form 1",
17 | "language": "fr",
18 | "translations": {
19 | "Encounter": "Rencontre",
20 | "Other": "Autre",
21 | "Child": "Enfant"
22 | }
23 | }
24 | ```
25 |
26 | **NOTE:**
27 | * The `form` attribute must be provided with an existing form name for the translations to load successfully. The translations form resources get names following the following pattern `_translations_`.
28 | * The `form_name_translation` attribute is treated as the localized name for the form in the translation locale.
29 |
30 | ###### Further examples:
31 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
32 |
--------------------------------------------------------------------------------
/readme/appointmentspecialities.md:
--------------------------------------------------------------------------------
1 | ## Domain 'appointmentsspecialities'
2 |
3 | The **appointmentsspecialities** subfolder contains CSV configuration files that help modify and create Bahmni appointments specialities. It should be possible in most cases to configure them via a single CSV configuration file, however there can be as many CSV files as desired.
4 | This is a possible example of how the configuration subfolder may look like:
5 | ```bash
6 | appointmentsspecialities/
7 | └── appointmentsspecialities.csv
8 | ```
9 | The CSV configuration allows to either modify exisiting appointments specialities or to create new appointments specialities. Here is a sample CSV:
10 |
11 | |Uuid| Void/Retire | Name |
12 | |--------------------------------------|-------------|-
13 | | aaa1a367-3047-4833-af27-b30e2dac9028 | | Radiology |
14 | | 439559c2-a3a4-4a25-b4b2-1a0299e287ee | | Cardiology
15 |
16 | ###### Header `Name` *(mandatory)*
17 |
18 | #### Further examples:
19 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/cashpoints.md:
--------------------------------------------------------------------------------
1 | ## Domain 'cashpoints'
2 | **Cash Points** subfolder contains CSV import files for saving Cash Points that are locations where a bill has been made over a billable service in a facility e.g. ART Clinic, OPD among others. This is a possible example of its content:
3 |
4 | ```bash
5 | cashpoints/
6 | ├──cashPoints.csv
7 | └── ...
8 | ```
9 | Below are the possible headers with a sample data set:
10 |
11 | | Uuid | name | description | location |
12 | |--------------------------------------|-------------|-----------------------------|---------------|
13 | | 54065383-b4d4-42d2-af4d-d250a1fd2590 | OPD Cash Point | Opd cash point for billing | ART Clinic |
14 |
15 | Let's review the headers as below
16 |
17 | ###### Header `UUID` *(optional)*
18 | This is the UUID of the billable service
19 |
20 | ###### Header `Name` *(required)*
21 | This is the name of the cash point such as OPD Cash Point.
22 |
23 | ###### Header `Description` *(optional)*
24 | The description of the cash point
25 |
26 | ###### Header `Location` *(optional)*
27 | This is a reference to the location of the cash point e.g ART Clinic
28 |
29 | #### Requirements
30 | * The [billing module](https://github.com/openmrs/openmrs-module-billing) version 1.1.0 or higher must be installed
31 | * The OpenMRS version must be 2.4 or higher
32 |
33 | #### Further examples:
34 | Please look at the test configuration folder for sample import files for all domains, see [here](../api-2.4/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/conceptclasses.md:
--------------------------------------------------------------------------------
1 | ## Domain 'conceptclasses'
2 |
3 | The **conceptclasses** subfolder contains CSV configuration files that help
4 | modify and create concept classes. It should be possible in most cases to
5 | configure them via a single CSV configuration file, however there can be as
6 | many CSV files as desired.
7 |
8 | This is a possible example of how the configuration subfolder may look like:
9 | ```bash
10 | conceptclasses/
11 | └── conceptclasses.csv
12 | ```
13 | The CSV configuration allows to either modify existing concept classes or to
14 | create new concept classes. Here is a sample CSV:
15 |
16 | |Uuid | Void/Retire | Name | Description |
17 | |--------------------------------------|-------------|---------------------------|-------------|
18 | | | true | Procedure |
19 | | | | New concept class with random UUID | Has some description too
20 | | 1dd85dab-f6d6-4bec-bde6-c4cddea92d35 | | A concept class with UUID specified |
21 |
22 | There is only one mandatory header specific to this domain:
23 |
24 | ###### Header `Name`
25 | The concept class **name** is mandatory. It is not localized.
26 |
27 | #### Further examples:
28 | Please look at the test configuration folder for sample import files for all domains, see
29 | [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/conceptsources.md:
--------------------------------------------------------------------------------
1 | ## Domain 'conceptsources'
2 |
3 | The **conceptsources** subfolder contains CSV configuration files that help
4 | modify and create concept sources. It should be possible in most cases to
5 | configure them via a single CSV configuration file, however there can be as
6 | many CSV files as desired.
7 |
8 | This is a possible example of how the configuration subfolder may look like:
9 | ```bash
10 | conceptsources/
11 | └── conceptsources.csv
12 | ```
13 | The CSV configuration allows to either modify existing concept sources or to
14 | create new concept sources. Here is a sample CSV:
15 |
16 | |Uuid | Void/Retire | Name | Description | HL7 Code | Unique ID |
17 | |----------------|------------------------|-----------------|------------------------|---------------------|----------------------|
18 | | | true | Ministry Code | A source to be retired | |
19 | | | | New concept source with random UUID | Has some description too | |
20 | | | | SNOMED CT | SNOMED Preferred mapping | SCT | |
21 | | | | RadLex | Radiology Terms | RADLEX | 2.16.840.1.113883.6.256
22 |
23 | Both `name` and `description` are mandatory headers. Neither is localized.
24 |
25 | #### Further examples:
26 | Please look at the test configuration folder for sample import files for all domains, see
27 | [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/dispositions.md:
--------------------------------------------------------------------------------
1 | ## Domain 'dispositions'
2 | **Dispositions** subfolder contains a single JSON that defines the dispositions available in the system::
3 |
4 | ```bash
5 | dispositions/
6 | ├──dispositions.json
7 | ```
8 |
9 | #### Requirements
10 | * The [emr-api](https://github.com/openmrs/openmrs-module-emrapi) version 2.0.0 or higher must be installed
11 |
12 | #### Further examples:
13 | Please look at the test configuration folder for dispositions file, see [here](../api/src/test/resources/testAppDataDir/configuration/dispositions/dispositionConfig.json).
--------------------------------------------------------------------------------
/readme/encounterroles.md:
--------------------------------------------------------------------------------
1 | ## Domain 'encounterroles'
2 |
3 | The **encounterroles** subfolder contains CSV configuration files that help
4 | modify and create encounter roles. It should be possible in most cases to
5 | configure them via a single CSV configuration file, however there can be as
6 | many CSV files as desired.
7 |
8 | This is a possible example of how the configuration subfolder may look like:
9 | ```bash
10 | encounterroles/
11 | └── encounterroles.csv
12 | ```
13 | The CSV configuration allows to either modify existing encounter roles or to
14 | create new encounter roles. Here is a sample CSV:
15 |
16 | |Uuid | Void/Retire | Name | Description |
17 | |--------------------------------------|-------------|---------------------------|-------------|
18 | | | true | Surgeon |
19 | | | | New encounter role with random UUID | Has some description too
20 | | 1dd85dab-f6d6-4bec-bde6-c4cddea92d35 | | A encounter role with UUID specified |
21 |
22 | There is only one mandatory header specific to this domain:
23 |
24 | ###### Header `Name`
25 | The encounter role **name** is mandatory. It is not localized.
26 |
27 | #### Further examples:
28 | Please look at the test configuration folder for sample import files for all domains, see
29 | [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/freqs.md:
--------------------------------------------------------------------------------
1 | ## Domain 'orderfrequencies'
2 |
3 | The **orderfrequencies** subfolder contains CSV configuration files that help modify and create order frequencies. It should be possible in most cases to configure them via a single CSV configuration file, however there can be as many CSV files as desired.
4 | This is a possible example of how the configuration subfolder may look like:
5 | ```bash
6 | orderfrequencies/
7 | └── freqs.csv
8 | ```
9 | The CSV configuration allows to either modify exisiting order frequencies or to create new order frequencies, here are the possible headers:
10 |
11 | | Uuid | Void/Retire | Frequency per day | Concept frequency |
12 | | - | - | - | - |
13 |
14 | ###### Header `Concept frequency`
15 | A `Concept` of data class 'Frequency' and data type 'N/A' that represents the order frequency. Typically the name of the order frequency will be obtained through that concept. Examples: "bidaily", "daily", "weekly" ... etc.
16 |
17 | ###### Header `Frequency per day`
18 | A `Double` that represents the actual numerical frequency per day. The consistency would demand to ensure that it matches the representation given in the `Concept frequency` column. Examples: a bidaily frequency should have a frequency per day of 0.5 (or 2 depending on the interpretation of 'bidaily'), a daily frequency should have a frequency per day of 1.0, a weekly frequency should have a frequency per day of 1/7... etc.
19 |
20 | #### Further examples:
21 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/globalproperties.md:
--------------------------------------------------------------------------------
1 | ## Domain 'globalproperties'
2 | The **globalproperties** subfolder contains XML configuration files that specify which global properties to override. Note that existing global properties will be overridden and missing ones will be created.
3 | This is a possible example of how the configuration subfolder may look like:
4 | ```bash
5 | globalproperties/
6 | ├── gp_core.xml
7 | ├── gp_coreapps.xml
8 | └── ...
9 | ```
10 | There can be as many XML files as desired. One may be enough in most cases, but providing multiples files is also a possibility if the implementation requires to manage them by modules, areas or categories. Beware that the behaviour will be undefined iif a global property is overridden in several places.
11 |
12 | ###### Global properties XML configuration file example:
13 | ```xml
14 |
15 |
16 |
17 | addresshierarchy.i18nSupport
18 | true
19 |
20 |
21 | locale.allowed.list
22 | en, km_KH
23 |
24 |
25 |
26 | ```
27 | The above XML configuration will set **addresshierarchy.i18nSupport** to `true` and **locale.allowed.list** to `"en, km_KH"`.
28 |
29 | ##### Further examples:
30 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/loctags.md:
--------------------------------------------------------------------------------
1 | ## Domain 'locationtags'
2 | The **locationtags** subfolder contains CSV import files for saving location tags in bulk.
3 |
4 | This is useful if you want to manage location tags explicitly. This complements the
5 | `Tag|TagName` headers of the location loader. However, location tags can also be created
6 | dynamically by the locations loader, using its `Tags` header. If using that header,
7 | you do not need to use this location tag loader. Please see the
8 | locations domain [README](./loc.md) for details.
9 |
10 | This is an example of the content of the `locationtags` subfolder:
11 | ```bash
12 | locationtags/
13 | ├──locationtags.csv
14 | └── ...
15 | ```
16 | There is currently only one format for the location tag CSV line,
17 | here are the possible headers with a sample data set:
18 |
19 | | Uuid | Void/Retire | Name | Description |
20 | |--------------------------------------|-------------|--------------------------|-------------|
21 | | b03e395c-b881-49b7-b6fc-983f6bddc7fc | | Yoga Location | |
22 | | | | Nice Sofa | |
23 |
24 |
25 |
26 | ###### Header `Name` *(mandatory)*
27 | This is _not_ a localized header.
28 |
29 | #### Further examples:
30 | Please look at the test configuration folder for sample import files for all domains, see
31 | [here](../api/src/test/resources/testAppDataDir/configuration).
32 |
--------------------------------------------------------------------------------
/readme/mds.md:
--------------------------------------------------------------------------------
1 | ## Domain 'metadatasharing'
2 | The **metadatasharing** subfolder contains all the Metadata Sharing (MDS) packages as .zip files to be imported. This is a possible example of its content:
3 | ```bash
4 | metadatasharing/
5 | ├── PatientIdentifierType.zip
6 | ├── PersonAttributeType.zip
7 | └── ...
8 | ```
9 | There can be as many MDS packages as desired. Providing multiples .zip files allows to split the metadata to be imported by areas, categories or any other segmentation that the implementors deem relevant.
10 |
They will all be imported following the 'prefer theirs' rule, meaning that the the metadata shipped with the packages is considered being the master metadata. Existing objects will be overwritten, missing objects will be created... etc.
11 |
MDS packages are a convenient way to bring in metadata, especially while other methods have not yet been implemented. However when otherwise possible, other ways should be preferred.
12 |
13 | #### Further examples:
14 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/messageproperties.md:
--------------------------------------------------------------------------------
1 | ## Domain 'messageproperties'
2 | The **messageproperties** subfolder allows to drop in message properties files for i18n support. This is a possible example of its content:
3 | ```bash
4 | messageproperties/
5 | ├── metadata_en.properties
6 | ├── metadata_km_KH.properties
7 | └── ...
8 | ```
9 | There can be as many message properties internationalization files as needed.
10 | This domain differs from most others since nothing from its configuration is persisted in database, everything is stored in the runtime memory upon starting the Initializer.
11 |
12 | If one needs to configure the order in which message properties files load, for example if one message properties file contains message codes that should override those in another in the same locale, one can do this by utilizing a special message code named "_order". Two message properties files in the same locale will be loaded in order based first on the value of any "_order" property defined, and second based on the alphabetical order of the absolute path of the file. If a file does not have an "_order" property defined, it will have an implicit order of 2147483647 (Integer.MAX_VALUE). So a file with an "_order" defined less than this value will always load prior to one with no explicit order defined.
13 |
14 | #### Further examples:
15 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/pat.md:
--------------------------------------------------------------------------------
1 | ## Domain 'personattributetypes'
2 | The **personattributetypes** subfolder contains CSV import files for saving person attribute types in bulk. This is a possible example of its content:
3 | ```bash
4 | personattributetypes/
5 | ├── registration_pat.csv
6 | └── ...
7 | ```
8 | There is currently only one format for the person attribute type CSV line, here are the possible headers:
9 |
10 | | Uuid | Void/Retire | Name | Description | Format | Foreign uuid | Searchable | _order:1000 |
11 | | - | - | - | - | - | - | - | - |
12 |
13 | Headers that start with an underscore such as `_order:1000` are metadata headers. The values in the columns under those headers are never read by the CSV parser.
14 |
Let's review some important headers.
15 |
16 | ###### Header `Name`
17 | This is _not_ a localized header.
18 |
19 | ###### Header `Format`
20 | Here are the possible values for this column: `java.lang.Boolean`, `java.lang.Character`, `java.lang.Float`, `java.lang.Integer`, `java.lang.String`, `org.openmrs.Concept`, `org.openmrs.Drug`, `org.openmrs.Encounter`, `org.openmrs.Location`, `org.openmrs.Patient`, `org.openmrs.Person`, `org.openmrs.ProgramWorkflow`, `org.openmrs.Provider`, `org.openmrs.User`, `org.openmrs.util.AttributableDate`.
21 |
22 | ###### Header `Foreign uuid`
23 | When the header `Format` refers to an OpenMRS class (such as `org.openmrs.Concept` for example), `Foreign uuid` should point to the UUID of an existing instance of that class.
24 |
25 | #### Further examples:
26 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/priv.md:
--------------------------------------------------------------------------------
1 | ## Domain 'privileges'
2 | The **privileges** subfolder contains CSV import files for saving privileges in bulk. This is a possible example of its content:
3 | ```bash
4 | privileges/
5 | ├──privileges.csv
6 | └── ...
7 | ```
8 | There is currently only one format for the privilege CSV line, here are the possible headers with a sample data set:
9 |
10 | |Uuid |Privilege name | Description | _order:1000 |
11 | | - | - | - | - |
12 | || Read Attachments | Has read access to attachments. ||
13 | | 9d4cbaeb-9c87-442f-bfdd-0d17402f319f | Create Attachments | Has write access to attachments. ||
14 |
15 | Headers that start with an underscore such as `_order:1000` are metadata headers. The values in the columns under those headers are never read by the CSV parser.
16 |
17 | The privilege domain is somewhat different than other domains in the sense that privileges cannot almost not be edited. This domain will mainly be used to create new privileges.
18 |
19 |
Let's review some important headers.
20 |
21 | ###### Header `Privilege name`
22 | This is _not_ a localized header.
23 |
The privilege name is a primary identifier (alongside its UUID) to access a privilege, therefore the privilege name cannot be edited once the privilege has been created.
24 |
25 | #### Further examples:
26 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/roles.md:
--------------------------------------------------------------------------------
1 | ## Domain 'roles'
2 | The **roles** subfolder contains CSV import files for saving roles in bulk. This is a possible example of its content:
3 | ```bash
4 | roles/
5 | ├──roles.csv
6 | └── ...
7 | ```
8 | There is currently only one format for the role CSV line, here are the possible headers with a sample data set:
9 |
10 | |Uuid |Role name |Description | Inherited roles | Privileges | _order:1000 |
11 | | - | - | - | - | - | - |
12 | |79e05171-afcb-47a3-84ec-3f7df078628f|Organizational: Clinician| A doctor having direct contact with patients rather than being involved with theoretical or laboratory studies. | Application: Records Allergies; Application: Uses Patient Summary | Add Allergies; Add Patient |
13 |
14 | Headers that start with an underscore such as `_order:1000` are metadata headers. The values in the columns under those headers are never read by the CSV parser.
15 |
16 |
17 | Let's review some important headers.
18 |
19 | ###### Header `role name`
20 | This is _not_ a localized header.
21 |
The role name is a primary identifier to access a role, therefore the role name cannot be edited once the role has been created.
22 |
23 | ###### Header `Inherited roles`
24 | A list of roles to inherit from. This list is made of a semicolon `;` separated list of role names.
25 |
26 | ###### Header `Privileges`
27 | The list of privileges that this role contains. This list is made of a semicolon `;` separated list of privilege names.
28 |
29 |
30 | #### Further examples:
31 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
--------------------------------------------------------------------------------
/readme/visittypes.md:
--------------------------------------------------------------------------------
1 | ## Domain 'visittypes'
2 | The **visittypes** subfolder contains CSV import files for saving visit types in bulk. This is a possible example of its content:
3 | ```bash
4 | visittypes/
5 | ├──visittypes.csv
6 | └── ...
7 | ```
8 | There is currently only one format for the visit type CSV line, here are the possible headers with a sample data set:
9 |
10 | |Uuid |Void/Retire |Name | Description | _order:1000 |
11 | | - | - | - | - | - |
12 | |32176576-1652-4835-8736-826eb0237482|| General | A General Visit ||
13 |
14 | Headers that start with an underscore such as `_order:1000` are metadata headers. The values in the columns under those headers are never read by the CSV parser.
15 |
16 | Let's review some important headers.
17 |
18 | ###### Header `Name` *(mandatory)*
19 | This is _not_ a localized header.
20 |
The name is a secondary identifier to access a visit type, it will be used to attempt fetching the visit type if no UUID is provided.
21 |
22 | ###### Header `Description`
23 | A description is used to give more information about the visit type.
24 |
25 | #### Further examples:
26 | Please look at the test configuration folder for sample import files for all domains, see [here](../api/src/test/resources/testAppDataDir/configuration).
27 |
--------------------------------------------------------------------------------
/validator-first-dependency/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 |
6 | org.openmrs.module
7 | initializer
8 | 2.10.0-SNAPSHOT
9 |
10 |
11 | initializer-validator-first-dependency
12 | jar
13 | Initializer Validator First Dependency
14 | First dependency for the Validator project for Initializer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/validator/.gitignore:
--------------------------------------------------------------------------------
1 | dependency-reduced-pom.xml
--------------------------------------------------------------------------------