├── .github └── workflows │ ├── build-test-publish.yml │ └── build-test.yml ├── .gitignore ├── .ocd3.yml ├── LICENSE.txt ├── README.md ├── api-2.2 ├── .gitignore ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── attributes │ │ └── types │ │ ├── AttributeTypeCsvLineHandlerImpl2_2.java │ │ └── AttributeTypesProxyServiceImpl2_2.java │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ ├── api │ │ └── AttributeTypesLoaderTest2_2.java │ │ └── attributes │ │ └── types │ │ └── AttributeTypesProxyServiceTest.java │ └── resources │ └── testdata │ └── test-metadata-2.2.xml ├── api-2.3 ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ ├── datafilter │ │ └── mappings │ │ │ ├── DataFilterMapping.java │ │ │ ├── DataFilterMappingLineProcessor.java │ │ │ ├── DataFilterMappingsCsvParser.java │ │ │ └── DataFilterMappingsLoader.java │ │ └── queues │ │ ├── QueueCsvParser.java │ │ ├── QueueLineProcessor.java │ │ └── QueueLoader.java │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ ├── DomainBaseModuleContextSensitive_2_3_Test.java │ │ └── api │ │ ├── DataFilterMappingsLoaderTest.java │ │ ├── DrugsLoaderWithMappingsIntegrationTest.java │ │ ├── loaders │ │ ├── LoadersOrderTest.java │ │ └── ZeroOrderLoader.java │ │ └── queues │ │ └── QueueLoaderIntegrationTest.java │ └── resources │ └── testAppDataDir │ └── configuration │ ├── drugs │ └── drugs.csv │ └── queues │ └── queues.csv ├── api-2.4 ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ ├── billing │ │ ├── BillableServicesCsvParser.java │ │ ├── BillableServicesLineProcessor.java │ │ ├── BillableServicesLoader.java │ │ ├── CashPointsCsvParser.java │ │ ├── CashPointsLineProcessor.java │ │ ├── CashPointsLoader.java │ │ ├── PaymentModesCsvParser.java │ │ ├── PaymentModesLineProcessor.java │ │ └── PaymentModesLoader.java │ │ └── logging │ │ ├── InitializerLogConfigurator2_4.java │ │ └── InitializerLogConfigurator2_4Test.java │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ ├── BillableServicesCsvParserTest.java │ │ ├── BillableServicesLoaderIntegrationTest.java │ │ ├── CashPointsLoaderIntegrationTest.java │ │ ├── DomainBaseModuleContextSensitive_2_4_test.java │ │ └── PaymentModesLoaderIntegrationTest.java │ └── resources │ ├── log4j2.xml │ ├── test-hibernate.cfg.xml │ ├── testAppDataDir │ └── configuration │ │ ├── billableservices │ │ └── billableServices.csv │ │ ├── cashpoints │ │ └── cashPoints.csv │ │ └── paymentmodes │ │ └── paymentModes.csv │ └── testdata │ └── test-concepts-2.4.xml ├── api-2.5 ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ └── loaders │ │ └── LiquibaseLoader2_5.java │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ └── loaders │ │ └── LiquibaseLoader25IntegrationTest.java │ └── resources │ ├── liquibase-schema.sql │ ├── log4j2.xml │ └── testAppDataDir │ └── configuration │ └── liquibase │ ├── liquibase.xml │ └── sql │ ├── test_changes_1.sql │ └── test_changes_2.sql ├── api-2.7 ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ └── conceptreferencerange │ │ ├── ConceptReferenceRangeLineProcessor.java │ │ ├── ConceptReferenceRangeLoader.java │ │ └── ConceptReferenceRangeParser.java │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ ├── DomainBaseModuleContextSensitive_2_7_Test.java │ │ └── api │ │ ├── lineprocessor │ │ └── ConceptReferenceRangeLineProcessorTest.java │ │ └── loaders │ │ ├── ConceptReferenceRangeLoaderIntegrationTest.java │ │ ├── GlobalPropertiesLoaderIntegration_2_7_Test.java │ │ └── LocationsLoader_2_7_IntegrationTest.java │ └── resources │ └── testAppDataDir │ └── configuration │ ├── conceptreferencerange │ └── conceptreferencerange.csv │ ├── globalproperties │ ├── gp1.xml │ ├── gp2.xml │ └── gp3.xml │ ├── locations │ └── locations.csv │ └── locationtags │ └── locationtags.csv ├── api-bahmni ├── .gitignore ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ └── attributes │ │ └── types │ │ ├── BahmniAttributeTypeCsvLineHandlerImpl.java │ │ └── BahmniAttributeTypesProxyServiceImpl.java │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── api │ │ ├── BahmniAttributeTypesLoaderTest.java │ │ └── attributes │ │ └── types │ │ └── BahmniAttributeTypesProxyServiceTest.java │ └── resources │ ├── test-hibernate.cfg.xml │ └── testdata │ └── bahmni-test-metadata.xml ├── api ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── openmrs │ │ │ └── module │ │ │ └── initializer │ │ │ ├── Domain.java │ │ │ ├── InitializerActivator.java │ │ │ ├── InitializerConfig.java │ │ │ ├── InitializerConstants.java │ │ │ ├── InitializerMessageSource.java │ │ │ ├── api │ │ │ ├── BaseAttributeLineProcessor.java │ │ │ ├── BaseLineProcessor.java │ │ │ ├── ConfigDirUtil.java │ │ │ ├── CsvFailingLines.java │ │ │ ├── CsvLine.java │ │ │ ├── CsvParser.java │ │ │ ├── HibernateInitializerDAO.java │ │ │ ├── InitializerDAO.java │ │ │ ├── InitializerSerializer.java │ │ │ ├── InitializerService.java │ │ │ ├── InitializerServiceImpl.java │ │ │ ├── OrderedCsvFile.java │ │ │ ├── OrderedFile.java │ │ │ ├── OrderedPropertiesFile.java │ │ │ ├── appt │ │ │ │ ├── servicedefinitions │ │ │ │ │ ├── AppointmentServiceDefinitionLineProcessor.java │ │ │ │ │ ├── AppointmentServiceDefinitionsCsvParser.java │ │ │ │ │ └── AppointmentServiceDefinitionsLoader.java │ │ │ │ ├── servicetypes │ │ │ │ │ ├── AppointmentServiceTypeLineProcessor.java │ │ │ │ │ ├── AppointmentServiceTypesCsvParser.java │ │ │ │ │ └── AppointmentServiceTypesLoader.java │ │ │ │ └── specialities │ │ │ │ │ ├── SpecialitiesCsvParser.java │ │ │ │ │ ├── SpecialitiesLoader.java │ │ │ │ │ └── SpecialityLineProcessor.java │ │ │ ├── attributes │ │ │ │ └── types │ │ │ │ │ ├── AttributeTypeCsvLineHandler.java │ │ │ │ │ ├── AttributeTypeCsvLineHandlerImpl.java │ │ │ │ │ ├── AttributeTypeEntity.java │ │ │ │ │ ├── AttributeTypesCsvParser.java │ │ │ │ │ ├── AttributeTypesLoader.java │ │ │ │ │ ├── AttributeTypesProxyService.java │ │ │ │ │ ├── AttributeTypesProxyServiceImpl.java │ │ │ │ │ └── BaseAttributeTypeLineProcessor.java │ │ │ ├── c │ │ │ │ ├── ConceptAttributeLineProcessor.java │ │ │ │ ├── ConceptClassLineProcessor.java │ │ │ │ ├── ConceptClassesCsvParser.java │ │ │ │ ├── ConceptClassesLoader.java │ │ │ │ ├── ConceptComplexLineProcessor.java │ │ │ │ ├── ConceptLineProcessor.java │ │ │ │ ├── ConceptNumericLineProcessor.java │ │ │ │ ├── ConceptSetLineProcessor.java │ │ │ │ ├── ConceptSetsCsvParser.java │ │ │ │ ├── ConceptSetsLoader.java │ │ │ │ ├── ConceptSourceLineProcessor.java │ │ │ │ ├── ConceptSourcesCsvParser.java │ │ │ │ ├── ConceptSourcesLoader.java │ │ │ │ ├── ConceptsCsvParser.java │ │ │ │ ├── ConceptsLoader.java │ │ │ │ ├── LocalizedHeader.java │ │ │ │ ├── MappingsConceptLineProcessor.java │ │ │ │ └── NestedConceptLineProcessor.java │ │ │ ├── cohort │ │ │ │ ├── cat │ │ │ │ │ ├── CohortAttributeTypeCsvParser.java │ │ │ │ │ ├── CohortAttributeTypeLineProcessor.java │ │ │ │ │ └── CohortAttributeTypeLoader.java │ │ │ │ └── ct │ │ │ │ │ ├── CohortTypeCsvParser.java │ │ │ │ │ ├── CohortTypeLineProcessor.java │ │ │ │ │ └── CohortTypeLoader.java │ │ │ ├── display │ │ │ │ ├── DisplayLineProcessor.java │ │ │ │ ├── DisplaysCsvParser.java │ │ │ │ └── DisplaysPreLoader.java │ │ │ ├── drugs │ │ │ │ ├── DrugLineProcessor.java │ │ │ │ ├── DrugsCsvParser.java │ │ │ │ ├── DrugsLoader.java │ │ │ │ └── MappingsDrugLineProcessor.java │ │ │ ├── er │ │ │ │ ├── EncounterRoleLineProcessor.java │ │ │ │ ├── EncounterRolesCsvParser.java │ │ │ │ └── EncounterRolesLoader.java │ │ │ ├── et │ │ │ │ ├── EncounterTypeLineProcessor.java │ │ │ │ ├── EncounterTypesCsvParser.java │ │ │ │ └── EncounterTypesLoader.java │ │ │ ├── fhir │ │ │ │ ├── cs │ │ │ │ │ ├── FhirConceptSourceCsvParser.java │ │ │ │ │ ├── FhirConceptSourceLineProcessor.java │ │ │ │ │ └── FhirConceptSourcesLoader.java │ │ │ │ └── pis │ │ │ │ │ ├── FhirPatientIdentifierSystemCsvParser.java │ │ │ │ │ ├── FhirPatientIdentifierSystemLineProcessor.java │ │ │ │ │ └── FhirPatientIdentifierSystemLoader.java │ │ │ ├── freq │ │ │ │ ├── OrderFrequenciesCsvParser.java │ │ │ │ ├── OrderFrequenciesLoader.java │ │ │ │ └── OrderFrequencyLineProcessor.java │ │ │ ├── gp │ │ │ │ ├── GlobalPropertiesConfig.java │ │ │ │ └── GlobalPropertiesLoader.java │ │ │ ├── idgen │ │ │ │ ├── CommonIdentifierSourceLineProcessor.java │ │ │ │ ├── IdentifierPoolLineProcessor.java │ │ │ │ ├── IdentifierSourceLineProcessor.java │ │ │ │ ├── IdentifierSourceType.java │ │ │ │ ├── IdentifierSourcesCsvParser.java │ │ │ │ ├── IdentifierSourcesLoader.java │ │ │ │ ├── IdgenSourceWrapper.java │ │ │ │ ├── RemoteIdentifierSourceLineProcessor.java │ │ │ │ ├── SequentialIdentifierGeneratorLineProcessor.java │ │ │ │ └── autogen │ │ │ │ │ ├── AutoGenerationOptionLineProcessor.java │ │ │ │ │ ├── AutoGenerationOptionsCsvParser.java │ │ │ │ │ └── AutoGenerationOptionsLoader.java │ │ │ ├── loaders │ │ │ │ ├── AddressHierarchyLoader.java │ │ │ │ ├── AmpathFormsLoader.java │ │ │ │ ├── AmpathFormsTranslationsLoader.java │ │ │ │ ├── BahmniFormsLoader.java │ │ │ │ ├── BaseCsvLoader.java │ │ │ │ ├── BaseFileLoader.java │ │ │ │ ├── BaseInputStreamLoader.java │ │ │ │ ├── BaseLoader.java │ │ │ │ ├── CsvLoader.java │ │ │ │ ├── DispositionsLoader.java │ │ │ │ ├── HtmlFormsLoader.java │ │ │ │ ├── JsonKeyValuesLoader.java │ │ │ │ ├── LiquibaseLoader.java │ │ │ │ ├── Loader.java │ │ │ │ ├── MdsLoader.java │ │ │ │ └── OpenConceptLabLoader.java │ │ │ ├── loc │ │ │ │ ├── LocationAttributeLineProcessor.java │ │ │ │ ├── LocationLineProcessor.java │ │ │ │ ├── LocationTagLineProcessor.java │ │ │ │ ├── LocationTagMapsCsvParser.java │ │ │ │ ├── LocationTagMapsLineProcessor.java │ │ │ │ ├── LocationTagMapsLoader.java │ │ │ │ ├── LocationTagsCsvParser.java │ │ │ │ ├── LocationTagsLoader.java │ │ │ │ ├── LocationsCsvParser.java │ │ │ │ └── LocationsLoader.java │ │ │ ├── logging │ │ │ │ ├── InitializerLogConfigurator.java │ │ │ │ └── InitializerLogConfigurator2_0.java │ │ │ ├── mdm │ │ │ │ ├── MetadataTermMappingsCsvParser.java │ │ │ │ ├── MetadataTermMappingsLineProcessor.java │ │ │ │ └── MetadataTermMappingsLoader.java │ │ │ ├── mds │ │ │ │ ├── MetadataSetLineProcessor.java │ │ │ │ ├── MetadataSetMemberLineProcessor.java │ │ │ │ ├── MetadataSetMembersCsvParser.java │ │ │ │ ├── MetadataSetMembersLoader.java │ │ │ │ ├── MetadataSetsCsvParser.java │ │ │ │ └── MetadataSetsLoader.java │ │ │ ├── ot │ │ │ │ ├── OrderTypeLineProcessor.java │ │ │ │ ├── OrderTypesCsvParser.java │ │ │ │ └── OrderTypesLoader.java │ │ │ ├── pat │ │ │ │ ├── PersonAttributeTypeLineProcessor.java │ │ │ │ ├── PersonAttributeTypesCsvParser.java │ │ │ │ └── PersonAttributeTypesLoader.java │ │ │ ├── pit │ │ │ │ ├── PatientIdentifierTypeLineProcessor.java │ │ │ │ ├── PatientIdentifierTypesCsvParser.java │ │ │ │ └── PatientIdentifierTypesLoader.java │ │ │ ├── privileges │ │ │ │ ├── PrivilegeLineProcessor.java │ │ │ │ ├── PrivilegesCsvParser.java │ │ │ │ └── PrivilegesLoader.java │ │ │ ├── programs │ │ │ │ ├── ProgramLineProcessor.java │ │ │ │ ├── ProgramsCsvParser.java │ │ │ │ ├── ProgramsLoader.java │ │ │ │ └── workflows │ │ │ │ │ ├── ProgramWorkflowLineProcessor.java │ │ │ │ │ ├── ProgramWorkflowsCsvParser.java │ │ │ │ │ ├── ProgramWorkflowsLoader.java │ │ │ │ │ └── states │ │ │ │ │ ├── ProgramWorkflowStateLineProcessor.java │ │ │ │ │ ├── ProgramWorkflowStatesCsvParser.java │ │ │ │ │ └── ProgramWorkflowStatesLoader.java │ │ │ ├── providerroles │ │ │ │ ├── ProviderRolesCsvParser.java │ │ │ │ ├── ProviderRolesLineProcessor.java │ │ │ │ └── ProviderRolesLoader.java │ │ │ ├── relationship │ │ │ │ └── types │ │ │ │ │ ├── RelationshipTypeLineProcessor.java │ │ │ │ │ ├── RelationshipTypesCsvParser.java │ │ │ │ │ └── RelationshipTypesLoader.java │ │ │ ├── roles │ │ │ │ ├── RoleLineProcessor.java │ │ │ │ ├── RolesCsvParser.java │ │ │ │ └── RolesLoader.java │ │ │ ├── utils │ │ │ │ ├── ConceptClassListParser.java │ │ │ │ ├── ConceptListParser.java │ │ │ │ ├── IgnoreBOMInputStream.java │ │ │ │ ├── ListParser.java │ │ │ │ ├── LocationTagListParser.java │ │ │ │ ├── PrivilegeListParser.java │ │ │ │ ├── RoleListParser.java │ │ │ │ └── Utils.java │ │ │ └── visittypes │ │ │ │ ├── VisitTypeLineProcessor.java │ │ │ │ ├── VisitTypesCsvParser.java │ │ │ │ └── VisitTypesLoader.java │ │ │ └── liquibase │ │ │ └── DeleteDomainChecksumsChangeset.java │ └── resources │ │ ├── liquibase.xml │ │ ├── messages.properties │ │ └── moduleApplicationContext.xml │ └── test │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ ├── DomainBaseModuleContextSensitiveTest.java │ │ ├── InitializerActivatorTest.java │ │ ├── InitializerMessageSourceIntegrationTest.java │ │ ├── InitializerMessageSourceTest.java │ │ ├── api │ │ ├── AddressHierarchyLoaderIntegrationTest.java │ │ ├── AppointmentServiceDefinitionsLoaderIntegrationTest.java │ │ ├── AppointmentServiceTypesLoaderIntegrationTest.java │ │ ├── AttributeTypesLoaderTest.java │ │ ├── AutoGenerationOptionsLoaderIntegrationTest.java │ │ ├── BaseLineProcessorTest.java │ │ ├── CohortTypeLoaderIntegrationTest.java │ │ ├── ConceptClassesLoaderIntegrationTest.java │ │ ├── ConceptSetsLoaderIntegrationTest.java │ │ ├── ConceptSourcesLoaderIntegrationTest.java │ │ ├── ConceptsLoaderIntegrationTest.java │ │ ├── ConfigDirUtilTest.java │ │ ├── DispositionsLoaderIntegrationTest.java │ │ ├── DrugsLoaderIntegrationTest.java │ │ ├── EncounterRolesLoaderIntegrationTest.java │ │ ├── EncounterTypesLoaderIntegrationTest.java │ │ ├── FhirConceptSourcesLoaderIntegrationTest.java │ │ ├── FhirPatientIdentifierSystemIntegrationTest.java │ │ ├── GlobalPropertiesLoaderIntegrationTest.java │ │ ├── IdentifierSourcesLoaderIntegrationTest.java │ │ ├── InitializerServiceImplTest.java │ │ ├── JsonKeyValuesLoaderIntegrationTest.java │ │ ├── LiquibaseLoaderIntegrationTest.java │ │ ├── LocationTagMapsLoaderIntegrationTest.java │ │ ├── LocationTagsLoaderIntegrationTest.java │ │ ├── LocationsLoaderIntegrationTest.java │ │ ├── MdsLoaderIntegrationTest.java │ │ ├── MetadataSetMembersLoaderIntegrationTest.java │ │ ├── MetadataSetsLoaderIntegrationTest.java │ │ ├── MetadataTermMappingsLoaderIntegrationTest.java │ │ ├── MockLoader.java │ │ ├── OpenConceptLabLoaderIntegrationTest.java │ │ ├── OrderFrequenciesLoaderIntegrationTest.java │ │ ├── OrderTypesLoaderIntegrationTest.java │ │ ├── OrderedFileTest.java │ │ ├── PatientIdentifierTypesLoaderIntegrationTest.java │ │ ├── PersonAttributeTypesLoaderIntegrationTest.java │ │ ├── PrivilegesLoaderIntegrationTest.java │ │ ├── ProgramWorkflowStatesLoaderIntegrationTest.java │ │ ├── ProgramWorkflowsLoaderIntegrationTest.java │ │ ├── ProgramsLoaderIntegrationTest.java │ │ ├── ProviderRolesLoaderIntegrationTest.java │ │ ├── RelationshipTypesLoaderIntegrationTest.java │ │ ├── RolesLoaderIntegrationTest.java │ │ ├── SpecialitiesLoaderIntegrationTest.java │ │ ├── UtilsTest.java │ │ ├── VisitTypesLoaderIntegrationTest.java │ │ ├── appt │ │ │ ├── servicedefinition │ │ │ │ └── AppointmentsServicesDefinitionLineProcessorTest.java │ │ │ └── speciality │ │ │ │ └── AppointmentsSpecialityLineProcessorTest.java │ │ ├── attributes │ │ │ └── types │ │ │ │ └── AttributeTypesProxyServiceTest.java │ │ ├── c │ │ │ ├── BaseConceptLineProcessorTest.java │ │ │ ├── ConceptAttributeLineProcessorTest.java │ │ │ ├── ConceptNumericLineProcessorTest.java │ │ │ ├── ConceptsCsvParserTest.java │ │ │ ├── MappingsConceptLineProcessorTest.java │ │ │ └── NestedConceptLineProcessorTest.java │ │ ├── cohort │ │ │ └── cat │ │ │ │ └── CohortAttributeTypesLoaderIntegrationTest.java │ │ ├── display │ │ │ ├── DisplayLineProcessorTest.java │ │ │ └── DisplaysCsvParserTest.java │ │ ├── form │ │ │ ├── AmpathFormsLoaderIntegrationTest.java │ │ │ ├── AmpathFormsTranslationsLoaderIntegrationTest.java │ │ │ ├── BahmniFormsLoaderIntegrationTest.java │ │ │ └── HtmlFormsLoaderIntegrationTest.java │ │ ├── gp │ │ │ └── GlobalPropertiesConfigDeserializerTest.java │ │ ├── loaders │ │ │ └── BaseFileLoaderTest.java │ │ ├── loc │ │ │ ├── LocationAttributeLineProcessorTest.java │ │ │ └── LocationLineProcessorTest.java │ │ ├── logging │ │ │ └── InitializerLogConfigurator2_0Test.java │ │ ├── ot │ │ │ └── OrderTypeLineProcessorTest.java │ │ └── pat │ │ │ └── PersonAttributeTypeLineProcessorTest.java │ │ └── liquibase │ │ └── DeleteDomainChecksumsChangesetIntegrationTest.java │ └── resources │ ├── TestingApplicationContext.xml │ ├── messages.properties │ ├── messages_fr.properties │ ├── messages_fr_FR.properties │ ├── messages_ht.properties │ ├── org │ └── openmrs │ │ └── module │ │ ├── addresshierarchy │ │ └── include │ │ │ └── exti18n.omod │ │ └── initializer │ │ └── include │ │ ├── csv │ │ ├── concepts_no_fsn.csv │ │ ├── concepts_no_shortname.csv │ │ ├── concepts_no_uuid.csv │ │ ├── orders │ │ │ ├── 1_order_1500.csv │ │ │ ├── 2_order_e00.csv │ │ │ ├── 3_order_missing.csv │ │ │ ├── 4_order_1000.csv │ │ │ └── 5_order_500.csv │ │ └── with_bom.csv │ │ ├── file_patterns │ │ ├── diagnoses.csv │ │ ├── diagnoses_02.csv │ │ ├── diagnoses_03.csv │ │ ├── drugs.csv │ │ ├── interventions.csv │ │ ├── newer_diagnoses.csv │ │ └── retired_diagnoses.csv │ │ ├── gp.xml │ │ ├── gp_error.xml │ │ ├── gp_unmmaped_fields.xml │ │ ├── jsonKeyValues.json │ │ └── nested_txt_files │ │ ├── config.txt │ │ └── level1 │ │ ├── config.txt │ │ └── level2 │ │ └── config.txt │ ├── test-hibernate.cfg.xml │ ├── testAppDataDir │ └── configuration │ │ ├── addresshierarchy │ │ ├── addressConfiguration.xml │ │ ├── addresshierarchy.csv │ │ ├── addresshierarchy_en.properties │ │ └── addresshierarchy_km_KH.properties │ │ ├── ampathforms │ │ └── test_form.json │ │ ├── ampathformstranslations │ │ └── test_form_translations_fr.json │ │ ├── appointmentservicedefinitions │ │ └── servicedefinitions.csv │ │ ├── appointmentservicetypes │ │ └── servicetypes.csv │ │ ├── appointmentspecialities │ │ └── specialities.csv │ │ ├── attributetypes │ │ └── attribute_types.csv │ │ ├── autogenerationoptions │ │ └── autogenerationoptions.csv │ │ ├── bahmniforms │ │ └── test_form1.json │ │ ├── cohortattributetypes │ │ └── cohortattributetypes.csv │ │ ├── cohorttypes │ │ └── cohorttypes.csv │ │ ├── conceptclasses │ │ └── conceptclasses.csv │ │ ├── concepts │ │ ├── concepts_base.csv │ │ ├── concepts_complex.csv │ │ ├── concepts_forsets.csv │ │ ├── concepts_mappings.csv │ │ ├── concepts_names.csv │ │ ├── concepts_nested.csv │ │ ├── concepts_numeric.csv │ │ ├── concepts_without_members_or_answers_column.csv │ │ └── fullyspecified_and_short_named_concepts.csv │ │ ├── conceptsets │ │ └── concept_sets.csv │ │ ├── conceptsources │ │ └── sources.csv │ │ ├── datafiltermappings │ │ └── mappings.csv │ │ ├── dispositions │ │ └── dispositionConfig.json │ │ ├── drugs │ │ └── drugs.csv │ │ ├── encounterroles │ │ └── encounterroles.csv │ │ ├── encountertypes │ │ └── encountertypes.csv │ │ ├── fhirconceptsources │ │ └── conceptsources.csv │ │ ├── fhirpatientidentifiersystems │ │ └── identifiersystems.csv │ │ ├── globalproperties │ │ ├── gp1.xml │ │ ├── gp2.xml │ │ └── gp3.xml │ │ ├── htmlforms │ │ ├── allAttributeForm.xml │ │ ├── secondLevelForm.xml │ │ └── thirdLevelForm.xml │ │ ├── idgen │ │ ├── idgen_pool.csv │ │ ├── idgen_remote.csv │ │ └── idgen_sequential.csv │ │ ├── jsonkeyvalues │ │ └── config.json │ │ ├── liquibase │ │ ├── concepts.xml │ │ └── liquibase.xml │ │ ├── locations │ │ └── locations.csv │ │ ├── locationtagmaps │ │ └── locationtagmaps.csv │ │ ├── locationtags │ │ └── locationtags.csv │ │ ├── messageproperties │ │ ├── metadata_additions_en.properties │ │ ├── metadata_en.properties │ │ ├── metadata_es.properties │ │ └── metadata_fr.properties │ │ ├── metadatasetmembers │ │ └── metadatasetmembers.csv │ │ ├── metadatasets │ │ └── metadatasets.csv │ │ ├── metadatasharing │ │ ├── PatientIdentifierType.zip │ │ ├── PersonAttributeType.zip │ │ ├── RelationshipType.zip │ │ └── _faulty_.zip │ │ ├── metadatatermmappings │ │ └── metadataterms.csv │ │ ├── ocl │ │ └── test.zip │ │ ├── orderfrequencies │ │ └── orderfrequencies.csv │ │ ├── ordertypes │ │ └── ordertypes.csv │ │ ├── patientidentifiertypes │ │ └── pit.csv │ │ ├── personattributetypes │ │ └── pat_base.csv │ │ ├── privileges │ │ └── privileges.csv │ │ ├── programs │ │ └── programs.csv │ │ ├── programworkflows │ │ └── workflows.csv │ │ ├── programworkflowstates │ │ └── states.csv │ │ ├── providerroles │ │ └── providerroles.csv │ │ ├── relationshiptypes │ │ └── relationshiptypes.csv │ │ ├── roles │ │ └── roles.csv │ │ └── visittypes │ │ └── visittypes.csv │ └── testdata │ ├── test-concepts-numeric.xml │ ├── test-concepts.xml │ ├── test-metadata.xml │ ├── test-metadatasets.xml │ ├── test-queues.xml │ ├── testAmpathforms │ ├── test_form_clob_changed.json │ └── test_form_new_version.json │ ├── testAmpathformstranslations │ ├── invalid_form_missing_formName_translations_fr.json │ ├── invalid_form_missing_language_translations_fr.json │ ├── invalid_form_missing_uuid_translations_fr.json │ └── test_form_updated_translations_fr.json │ └── testBahmniforms │ └── test_form1_updated.json ├── omod ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── web │ │ └── controller │ │ └── InitializerController.java │ └── resources │ ├── config.xml │ └── webModuleApplicationContext.xml ├── pom.xml ├── readme ├── addresshierarchy.md ├── ampathforms.md ├── ampathformstranslations.md ├── appointmentservices.md ├── appointmentspecialities.md ├── atttypes.md ├── autogenerationoptions.md ├── bahmniforms.md ├── billableservices.md ├── cashpoints.md ├── checksums.md ├── cohort.md ├── conceptclasses.md ├── conceptreferencerange.md ├── concepts.md ├── conceptsets.md ├── conceptsources.md ├── csv_conventions.md ├── datafiltermappings.md ├── dispositions.md ├── drugs.md ├── encounterroles.md ├── et.md ├── fhir.md ├── freqs.md ├── globalproperties.md ├── htmlforms.md ├── idgen.md ├── jsonkeyvalues.md ├── liquibase.md ├── loc.md ├── loctagmaps.md ├── loctags.md ├── mdm.md ├── mds.md ├── messageproperties.md ├── ocl.md ├── ordertypes.md ├── pat.md ├── paymentmodes.md ├── pit.md ├── priv.md ├── prog.md ├── providerroles.md ├── queues.md ├── relationshiptypes.md ├── roles.md ├── rtprops.md ├── validator.md └── visittypes.md ├── validator-first-dependency ├── pom.xml └── src │ └── main │ └── resources │ └── moduleApplicationContext.xml └── validator ├── .gitignore ├── pom.xml └── src ├── main ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── initializer │ │ └── validator │ │ ├── ConfigurationTester.java │ │ └── Validator.java └── resources │ └── moduleApplicationContext.xml └── test ├── java └── org │ └── openmrs │ └── module │ └── initializer │ └── validator │ └── ValidatorTest.java └── resources ├── ciel_excerpt.txt └── trimmed_ciel_excerpt.txt /.github/workflows/build-test-publish.yml: -------------------------------------------------------------------------------- 1 | name: Build and Publish 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Set up JDK 8 15 | uses: actions/setup-java@v2 16 | with: 17 | distribution: 'temurin' 18 | java-version: '8' 19 | 20 | - name: Build and Test 21 | run: mvn --batch-mode --update-snapshots clean package -P validator 22 | 23 | - name: Set settings.xml 24 | uses: s4u/maven-settings-action@v2.6.0 25 | with: 26 | servers: | 27 | [{ 28 | "id": "mks-repo", 29 | "username": "${{ secrets.NEXUS_USERNAME }}", 30 | "password": "${{ secrets.NEXUS_PASSWORD }}" 31 | }, 32 | { 33 | "id": "mks-repo-snapshots", 34 | "username": "${{ secrets.NEXUS_USERNAME }}", 35 | "password": "${{ secrets.NEXUS_PASSWORD }}" 36 | }] 37 | if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'mekomsolutions' }} 38 | 39 | - name: Publish 40 | run: mvn --batch-mode clean deploy -P validator 41 | if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'mekomsolutions' }} 42 | -------------------------------------------------------------------------------- /.github/workflows/build-test.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: 4 | pull_request: 5 | branches: [main] 6 | 7 | push: 8 | branches-ignore: [main] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | strategy: 14 | matrix: 15 | java: [ '8', '11'] 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | 20 | - name: Set up JDK ${{ matrix.java }} 21 | uses: actions/setup-java@v2 22 | with: 23 | distribution: 'temurin' 24 | java-version: ${{ matrix.java }} 25 | 26 | - name: Build and Test 27 | run: mvn --batch-mode --update-snapshots clean package -P validator 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.iml 3 | *.idea 4 | .settings 5 | .project 6 | *.sass-cache 7 | target 8 | .java-version 9 | *.releaseBackup 10 | release.properties 11 | README.html 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.ear 17 | *.iml 18 | 19 | .settings/* 20 | **/bin 21 | **/.classpath 22 | **/.project 23 | **/.settings/* 24 | **/target/* 25 | 26 | # OS X auto-generated files # 27 | .DS_Store 28 | 29 | *.css 30 | omod/src/main/compass/sass-external/* 31 | 32 | # Rubygems build directories # 33 | omod/.rubygems 34 | omod/.rubygems-provided 35 | 36 | # Bower resources # 37 | bower_components -------------------------------------------------------------------------------- /.ocd3.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | build: 3 | # Do skip OCD3 build. Initializer reference build is made through GitHub Actions. 4 | bash_commands: "exit 0" 5 | deploy: 6 | # Do not deploy via OCD3. Initializer publishing is done via GitHub Actions. 7 | bash_commands: "exit 0" -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Mekom Solutions 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /api-2.2/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /api-2.2/src/main/java/org/openmrs/module/initializer/attributes/types/AttributeTypeCsvLineHandlerImpl2_2.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.attributes.types; 2 | 3 | import static org.openmrs.module.initializer.api.attributes.types.AttributeTypeEntity.CONCEPT; 4 | import static org.openmrs.module.initializer.api.attributes.types.AttributeTypeEntity.PROGRAM; 5 | 6 | import org.openmrs.ConceptAttributeType; 7 | import org.openmrs.ProgramAttributeType; 8 | import org.openmrs.annotation.OpenmrsProfile; 9 | import org.openmrs.attribute.BaseAttributeType; 10 | import org.openmrs.module.initializer.api.attributes.types.AttributeTypeCsvLineHandlerImpl; 11 | import org.openmrs.module.initializer.api.attributes.types.AttributeTypeEntity; 12 | 13 | @OpenmrsProfile(openmrsPlatformVersion = "2.2.0") 14 | public class AttributeTypeCsvLineHandlerImpl2_2 extends AttributeTypeCsvLineHandlerImpl { 15 | 16 | @Override 17 | protected AttributeTypeEntity getType(String attributeDomain) { 18 | 19 | AttributeTypeEntity type = super.getType(attributeDomain); 20 | 21 | if (PROGRAM.toString().equalsIgnoreCase(attributeDomain)) { 22 | type = PROGRAM; 23 | } 24 | if (CONCEPT.toString().equalsIgnoreCase(attributeDomain)) { 25 | type = CONCEPT; 26 | } 27 | return type; 28 | } 29 | 30 | @Override 31 | protected BaseAttributeType newType(AttributeTypeEntity type) { 32 | 33 | BaseAttributeType attType = super.newType(type); 34 | 35 | switch (type) { 36 | case PROGRAM: 37 | return new ProgramAttributeType(); 38 | case CONCEPT: 39 | return new ConceptAttributeType(); 40 | default: 41 | return attType; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api-2.2/src/test/resources/testdata/test-metadata-2.2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /api-2.3/src/main/java/org/openmrs/module/initializer/api/datafilter/mappings/DataFilterMapping.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.datafilter.mappings; 2 | 3 | import org.openmrs.BaseOpenmrsMetadata; 4 | import org.openmrs.OpenmrsObject; 5 | 6 | public class DataFilterMapping extends BaseOpenmrsMetadata { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | private Integer id = 0; 11 | 12 | private OpenmrsObject entity; 13 | 14 | private OpenmrsObject basis; 15 | 16 | public DataFilterMapping(OpenmrsObject entity, OpenmrsObject basis) { 17 | super(); 18 | this.entity = entity; 19 | this.basis = basis; 20 | } 21 | 22 | @Override 23 | public Integer getId() { 24 | return id; 25 | } 26 | 27 | @Override 28 | public void setId(Integer id) { 29 | this.id = id; 30 | } 31 | 32 | public OpenmrsObject getEntity() { 33 | return entity; 34 | } 35 | 36 | public void setEntity(OpenmrsObject entity) { 37 | this.entity = entity; 38 | } 39 | 40 | public OpenmrsObject getBasis() { 41 | return basis; 42 | } 43 | 44 | public void setBasis(OpenmrsObject basis) { 45 | this.basis = basis; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /api-2.3/src/main/java/org/openmrs/module/initializer/api/datafilter/mappings/DataFilterMappingsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.datafilter.mappings; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | @OpenmrsProfile(modules = { "datafilter:*" }) 8 | public class DataFilterMappingsLoader extends BaseCsvLoader { 9 | 10 | @Autowired 11 | public void setParser(DataFilterMappingsCsvParser parser) { 12 | this.parser = parser; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /api-2.3/src/main/java/org/openmrs/module/initializer/api/queues/QueueCsvParser.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.queues; 2 | 3 | import org.apache.commons.lang3.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.queue.api.QueueService; 10 | import org.openmrs.module.queue.model.Queue; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.beans.factory.annotation.Qualifier; 13 | 14 | @OpenmrsProfile(modules = { "queue:*" }) 15 | public class QueueCsvParser extends CsvParser> { 16 | 17 | private final QueueService queueService; 18 | 19 | @Autowired 20 | public QueueCsvParser(@Qualifier("queue.QueueService") QueueService queueService, QueueLineProcessor processor) { 21 | super(processor); 22 | this.queueService = queueService; 23 | } 24 | 25 | @Override 26 | public Domain getDomain() { 27 | return Domain.QUEUES; 28 | } 29 | 30 | @Override 31 | public Queue bootstrap(CsvLine line) throws IllegalArgumentException { 32 | String uuid = line.getUuid(); 33 | Queue queue = queueService.getQueueByUuid(uuid).orElse(new Queue()); 34 | if (StringUtils.isNotBlank(uuid)) { 35 | queue.setUuid(uuid); 36 | } 37 | return queue; 38 | } 39 | 40 | @Override 41 | public Queue save(Queue instance) { 42 | return queueService.createQueue(instance); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api-2.3/src/main/java/org/openmrs/module/initializer/api/queues/QueueLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.queues; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 5 | import org.openmrs.module.queue.model.Queue; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "queue:*" }) 9 | public class QueueLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(QueueCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api-2.3/src/test/java/org/openmrs/module/initializer/DomainBaseModuleContextSensitive_2_3_Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This Source Code Form is subject to the terms of the Mozilla Public License, 3 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can 4 | * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under 5 | * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. 6 | * 7 | * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS 8 | * graphic logo is a trademark of OpenMRS Inc. 9 | */ 10 | package org.openmrs.module.initializer; 11 | 12 | import org.openmrs.module.Module; 13 | import org.openmrs.module.ModuleFactory; 14 | 15 | import java.io.File; 16 | 17 | /** 18 | * This allows to perform Spring context sensitive tests when Data Filter API is a dependency. In 19 | * that case it is necessary for each context sensitive test to update the search index. 20 | */ 21 | public abstract class DomainBaseModuleContextSensitive_2_3_Test extends DomainBaseModuleContextSensitiveTest { 22 | 23 | public DomainBaseModuleContextSensitive_2_3_Test() { 24 | super(); 25 | { 26 | Module mod = new Module("", "queue", "", "", "", "1.0.0"); 27 | mod.setFile(new File("")); 28 | ModuleFactory.getStartedModulesMap().put(mod.getModuleId(), mod); 29 | } 30 | } 31 | 32 | @Override 33 | public void updateSearchIndex() { 34 | // to prevent Data Filter's 'Illegal Record Access' 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /api-2.3/src/test/java/org/openmrs/module/initializer/api/loaders/ZeroOrderLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.loaders; 2 | 3 | import java.util.List; 4 | 5 | import org.openmrs.module.initializer.api.ConfigDirUtil; 6 | 7 | public class ZeroOrderLoader implements Loader { 8 | 9 | @Override 10 | public int compareTo(Loader that) { 11 | return this.getOrder().compareTo(that.getOrder()); 12 | } 13 | 14 | @Override 15 | public String getDomainName() { 16 | return "Test Domain"; 17 | } 18 | 19 | @Override 20 | public Integer getOrder() { 21 | return 0; 22 | } 23 | 24 | @Override 25 | public ConfigDirUtil getDirUtil() { 26 | return null; 27 | } 28 | 29 | @Override 30 | public void loadUnsafe(List wildcardExclusions, boolean doThrow) throws Exception { 31 | 32 | } 33 | 34 | @Override 35 | public void load(List wildcardExclusions) { 36 | 37 | } 38 | 39 | @Override 40 | public void load() { 41 | 42 | } 43 | 44 | @Override 45 | public boolean isPreLoader() { 46 | return false; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /api-2.3/src/test/resources/testAppDataDir/configuration/drugs/drugs.csv: -------------------------------------------------------------------------------- 1 | Uuid,Void/Retire,Name,Concept Drug,Concept Dosage Form,Strength,Mappings|SAME-AS|CS1|1,Mappings|SAME-AS|CS1|2,Mappings|broader-than,_version:1 2 | ,,Cetirizine 10mg Tablet,Cetirizine,Tablet,10mg,M1,,, 3 | ,,Erythromycine 500mg Tablet,Erythromycine,,500mg,"M2;M3",,, 4 | 2bcf7212-d218-4572-8893-25c4b5b71934,,Metronidazole 500mg Tablet,Metronidazole (new),Tablet,500mg,,,CS2:M4, 5 | ,,d4T 30,d4T,,30mg,,,"CS1:M5;CS2:M6", 6 | 6e764d43-ae8b-11eb-8168-0242ac110002,true,Metronidazole 250mg Tablet,Metronidazole (new),Tablet,250mg,,,, 7 | ,,Albendazole 200mg Tablet,Albendazole,Tablet,200mg,M7,M8,, -------------------------------------------------------------------------------- /api-2.3/src/test/resources/testAppDataDir/configuration/queues/queues.csv: -------------------------------------------------------------------------------- 1 | Uuid,Void/Retire,Name,Description,Service,Status Concept Set,Priority Concept Set,Location 2 | 2a0e0eee-6888-11ee-ab8d-0242ac120002,,Revised Queue,Revised Description,68b910bd-298c-4ecf-a632-661ae2f446op,,,Xanadu 3 | 288db1cc-688a-11ee-ab8d-0242ac120002,,New Queue,New Description,Triage,,,167ce20c-4785-4285-9119-d197268f7f4a 4 | 4856c1c1-c9b3-4a7e-8669-4220051ab640,,Triage Queue,Queue with custom statuses,67b910bd-298c-4ecf-a632-661ae2f446op,1d2a73ca-20aa-4218-b4d2-043024a9156e,24932838-60ca-44e8-840f-4184b368643c,Xanadu 5 | -------------------------------------------------------------------------------- /api-2.4/src/main/java/org/openmrs/module/initializer/api/billing/BillableServicesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.billing; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.billing.api.model.BillableService; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "billing:1.1.0 - 9.*" }) 9 | public class BillableServicesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(BillableServicesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api-2.4/src/main/java/org/openmrs/module/initializer/api/billing/CashPointsLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.billing; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.api.LocationService; 5 | import org.openmrs.module.billing.api.model.CashPoint; 6 | import org.openmrs.module.initializer.api.BaseLineProcessor; 7 | import org.openmrs.module.initializer.api.CsvLine; 8 | import org.openmrs.module.initializer.api.utils.Utils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | 12 | @OpenmrsProfile(modules = { "billing:1.1.0 - 9.*" }) 13 | public class CashPointsLineProcessor extends BaseLineProcessor { 14 | 15 | protected static final String HEADER_DESCRIPTION = "description"; 16 | 17 | protected static final String HEADER_LOCATION = "location"; 18 | 19 | private final LocationService locationService; 20 | 21 | @Autowired 22 | public CashPointsLineProcessor(@Qualifier("locationService") LocationService locationService) { 23 | super(); 24 | this.locationService = locationService; 25 | } 26 | 27 | @Override 28 | public CashPoint fill(CashPoint cashPoint, CsvLine line) throws IllegalArgumentException { 29 | cashPoint.setName(line.get(HEADER_NAME, true)); 30 | cashPoint.setDescription(line.getString(HEADER_DESCRIPTION)); 31 | String location = line.get(HEADER_LOCATION, true); 32 | cashPoint.setLocation(Utils.fetchLocation(location, locationService)); 33 | 34 | return cashPoint; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /api-2.4/src/main/java/org/openmrs/module/initializer/api/billing/CashPointsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.billing; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.billing.api.model.CashPoint; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "billing:1.1.0 - 9.*" }) 9 | public class CashPointsLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(CashPointsCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /api-2.4/src/main/java/org/openmrs/module/initializer/api/billing/PaymentModesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.billing; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.billing.api.model.PaymentMode; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "billing:1.1.0 - 9.*" }) 9 | public class PaymentModesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(PaymentModesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api-2.4/src/main/java/org/openmrs/module/initializer/api/logging/InitializerLogConfigurator2_4Test.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.logging; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | 5 | import org.apache.log4j.Level; 6 | import org.apache.logging.log4j.LogManager; 7 | import org.junit.jupiter.api.Test; 8 | import org.openmrs.module.initializer.InitializerActivator; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | 12 | class InitializerLogConfigurator2_4Test { 13 | 14 | @Test 15 | public void shouldSetupLoggerWithAppropriateNameAndLevel() throws ClassNotFoundException, InvocationTargetException, 16 | InstantiationException, IllegalAccessException, NoSuchMethodException { 17 | // setup 18 | Level level = Level.WARN; 19 | InitializerLogConfigurator2_4 logConfigurator24 = new InitializerLogConfigurator2_4(); 20 | 21 | // replay 22 | logConfigurator24.setupLogging(level, null); 23 | 24 | // verify 25 | assertEquals(org.apache.logging.log4j.Level.WARN, 26 | LogManager.getLogger(InitializerActivator.class.getPackage().getName()).getLevel()); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /api-2.4/src/test/java/org/openmrs/module/initializer/api/DomainBaseModuleContextSensitive_2_4_test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This Source Code Form is subject to the terms of the Mozilla Public License, 3 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can 4 | * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under 5 | * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. 6 | * 7 | * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS 8 | * graphic logo is a trademark of OpenMRS Inc. 9 | */ 10 | package org.openmrs.module.initializer.api; 11 | 12 | import org.openmrs.module.Module; 13 | import org.openmrs.module.ModuleFactory; 14 | import org.openmrs.module.initializer.DomainBaseModuleContextSensitiveTest; 15 | 16 | import java.io.File; 17 | 18 | /** 19 | * This allows to perform Spring context sensitive tests when Data Filter API is a dependency. In 20 | * that case it is necessary for each context sensitive test to update the search index. 21 | */ 22 | public abstract class DomainBaseModuleContextSensitive_2_4_test extends DomainBaseModuleContextSensitiveTest { 23 | 24 | public DomainBaseModuleContextSensitive_2_4_test() { 25 | super(); 26 | { 27 | Module mod = new Module("", "billing", "", "", "", "1.1.0"); 28 | mod.setFile(new File("")); 29 | ModuleFactory.getStartedModulesMap().put(mod.getModuleId(), mod); 30 | } 31 | } 32 | 33 | @Override 34 | public void updateSearchIndex() { 35 | // to prevent Data Filter's 'Illegal Record Access' 36 | } 37 | 38 | @Override 39 | public void revertContextMocks() { 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /api-2.4/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 18 | %p - %C{1}.%M(%L) |%d{ISO8601}| %m%n 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /api-2.4/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /api-2.4/src/test/resources/testAppDataDir/configuration/billableservices/billableServices.csv: -------------------------------------------------------------------------------- 1 | Uuid, Void/Retire, Service Name, Short Name, Concept, Service Type, Service Status 2 | 44ebd6cd-04ad-4eba-8ce1-0de4564bfd17,, Antenatal Care, ANTC, d4b4b6ef-6f3e-43a4-a3b9-9c56f3a1e2d8, Antenatal Services, Enabled 3 | a0f7d8a1-4fa2-418c-aa8a-9b358f43d605,, Orthopedic Modified, OTHS Modified, 3f6f6c92-8d5c-4a9e-bb1c-d3e00e4f8b71, Orthopedic Services, Disabled 4 | 16435ab4-27c3-4d91-b21e-52819bd654d8,true, Nutrition, NUC, 550e8400-e29b-41d4-a716-446655440000, Nutrition Services, Disabled -------------------------------------------------------------------------------- /api-2.4/src/test/resources/testAppDataDir/configuration/cashpoints/cashPoints.csv: -------------------------------------------------------------------------------- 1 | uuid,Void/Retire,name,description,location 2 | 54065383-b4d4-42d2-af4d-d250a1fd2590,, OPD Cash Point (Modified), Opd cash point for billing (Modified), ART Clinic 3 | c56a108f-e3c5-4881-a5e8-a796601883b9,, IPD Cash Point, IPD cash point for billing, Inpatient Ward 4 | 8e48e0be-1a31-4bd3-a54d-ace82653f8b8,true, MCH Cash Point, MCH cash point for billing, MCH Clinic -------------------------------------------------------------------------------- /api-2.4/src/test/resources/testAppDataDir/configuration/paymentmodes/paymentModes.csv: -------------------------------------------------------------------------------- 1 | uuid,Void/Retire,name,attributes 2 | 526bf278-ba81-4436-b867-c2f6641d060a,,Visa card edited, 3 | 2b1b9aae-5d35-43dd-9214-3fd370fd7737,true,Bank transfer, 4 | e168c141-f5fd-4eec-bd3e-633bed1c9606,,Paypal,Maximum::Numeric::::True;Minimum 5 | -------------------------------------------------------------------------------- /api-2.5/src/test/resources/liquibase-schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE LIQUIBASECHANGELOG 2 | ( 3 | ID varchar(255) NOT NULL, 4 | AUTHOR varchar(255) NOT NULL, 5 | FILENAME varchar(255) NOT NULL, 6 | DATEEXECUTED datetime NOT NULL, 7 | ORDEREXECUTED int(11) NOT NULL, 8 | EXECTYPE varchar(10) NOT NULL, 9 | MD5SUM varchar(35), 10 | DESCRIPTION varchar(255), 11 | COMMENTS varchar(255), 12 | TAG varchar(255), 13 | LIQUIBASE varchar(20), 14 | CONTEXTS varchar(255), 15 | LABELS varchar(255), 16 | DEPLOYMENT_ID varchar(10), 17 | PRIMARY KEY (ID, AUTHOR, FILENAME) 18 | ); 19 | 20 | CREATE TABLE LIQUIBASECHANGELOGLOCK 21 | ( 22 | ID int(11) NOT NULL, 23 | LOCKED tinyint(1) NOT NULL, 24 | LOCKGRANTED datetime, 25 | LOCKEDBY varchar(255), 26 | PRIMARY KEY (ID) 27 | ); -------------------------------------------------------------------------------- /api-2.5/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 18 | %p - %C{1}.%M(%L) |%d{ISO8601}| %m%n 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /api-2.5/src/test/resources/testAppDataDir/configuration/liquibase/liquibase.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /api-2.5/src/test/resources/testAppDataDir/configuration/liquibase/sql/test_changes_1.sql: -------------------------------------------------------------------------------- 1 | insert into global_property (uuid, property, property_value) values (uuid(), 'test_changes_1', 'true'); -------------------------------------------------------------------------------- /api-2.5/src/test/resources/testAppDataDir/configuration/liquibase/sql/test_changes_2.sql: -------------------------------------------------------------------------------- 1 | insert into global_property (uuid, property, property_value) values (uuid(), 'test_changes_2', 'true'); -------------------------------------------------------------------------------- /api-2.7/src/main/java/org/openmrs/module/initializer/api/conceptreferencerange/ConceptReferenceRangeLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.conceptreferencerange; 2 | 3 | import org.openmrs.ConceptReferenceRange; 4 | import org.openmrs.annotation.OpenmrsProfile; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | 9 | @OpenmrsProfile(openmrsPlatformVersion = "2.7.0 - 2.*") 10 | @Component 11 | public class ConceptReferenceRangeLoader extends BaseCsvLoader { 12 | 13 | @Autowired 14 | public void setParser(ConceptReferenceRangeParser parser) { 15 | this.parser = parser; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /api-2.7/src/test/resources/testAppDataDir/configuration/conceptreferencerange/conceptreferencerange.csv: -------------------------------------------------------------------------------- 1 | Uuid,Concept Numeric uuid,Absolute low,Critical low,Normal low,Normal high,Critical high,Absolute high,Criteria 2 | bc059100-4ace-4af5-afbf-2da7f3a34acf,a09ab2c5-878e-4905-b25d-5784167d0216,-100.5,-85.7,-50.3,45.1,78,98.8, $patient.getAge() > 3 3 | 930e1fb4-490d-45fe-a137-0cd941c76124,a09ab2c5-878e-4905-b25d-5784167d0216,-100.5,-85.7,-50.3,45.1,78,98.8, $patient.getAge() < 10 4 | b5a7b296-e500-4a2c-ab2e-eb012ed9ae1e,a09ab2c5-878e-4905-b25d-5784167d0216,60,70,80,120,130,150, $fn.getCurrentHour() > 2 -------------------------------------------------------------------------------- /api-2.7/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-2.7/src/test/resources/testAppDataDir/configuration/globalproperties/gp2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gp.gp21 5 | GP two one 6 | 7 | 8 | -------------------------------------------------------------------------------- /api-2.7/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-2.7/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-2.7/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-bahmni/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api-bahmni/.gitignore -------------------------------------------------------------------------------- /api-bahmni/src/main/java/org/openmrs/module/initializer/api/attributes/types/BahmniAttributeTypeCsvLineHandlerImpl.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.attributes.types; 2 | 3 | import static org.openmrs.module.initializer.api.attributes.types.AttributeTypeEntity.PROGRAM; 4 | 5 | import org.bahmni.module.bahmnicore.model.bahmniPatientProgram.ProgramAttributeType; 6 | import org.openmrs.annotation.OpenmrsProfile; 7 | import org.openmrs.attribute.BaseAttributeType; 8 | 9 | @OpenmrsProfile(openmrsPlatformVersion = "[2.1.1 - 2.1.*]", modules = { "bahmnicore:*.*" }) 10 | public class BahmniAttributeTypeCsvLineHandlerImpl extends AttributeTypeCsvLineHandlerImpl { 11 | 12 | @Override 13 | protected AttributeTypeEntity getType(String attributeDomain) { 14 | 15 | AttributeTypeEntity type = super.getType(attributeDomain); 16 | 17 | if (PROGRAM.toString().equalsIgnoreCase(attributeDomain)) { 18 | type = PROGRAM; 19 | } 20 | return type; 21 | } 22 | 23 | @Override 24 | protected BaseAttributeType newType(AttributeTypeEntity type) { 25 | 26 | BaseAttributeType attType = super.newType(type); 27 | 28 | switch (type) { 29 | case PROGRAM: 30 | return new ProgramAttributeType(); 31 | default: 32 | return attType; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /api-bahmni/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /api-bahmni/src/test/resources/testdata/bahmni-test-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mekomsolutions/openmrs-module-initializer/a32b6499af08f78123e772ff5c01d60c7e5e672f/api/.gitignore -------------------------------------------------------------------------------- /api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.openmrs.module 6 | initializer 7 | 2.10.0-SNAPSHOT 8 | 9 | 10 | initializer-api 11 | jar 12 | Initializer API 13 | API project for Initializer 14 | 15 | 16 | ${openmrsVersion2.1} 17 | 18 | 19 | 20 | 21 | commons-codec 22 | commons-codec 23 | 1.9 24 | 25 | 26 | com.opencsv 27 | opencsv 28 | 4.5 29 | 30 | 31 | com.github.freva 32 | ascii-table 33 | 1.1.0 34 | 35 | 36 | org.openmrs.module 37 | openconceptlab-api 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/Domain.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer; 2 | 3 | import org.apache.commons.lang.ArrayUtils; 4 | 5 | public enum Domain { 6 | LIQUIBASE, 7 | JSON_KEY_VALUES, 8 | CONCEPT_CLASSES, 9 | CONCEPT_SOURCES, 10 | METADATASHARING, 11 | VISIT_TYPES, 12 | PATIENT_IDENTIFIER_TYPES, 13 | RELATIONSHIP_TYPES, 14 | LOCATION_TAGS, 15 | PRIVILEGES, 16 | ENCOUNTER_TYPES, 17 | ENCOUNTER_ROLES, 18 | ROLES, 19 | GLOBAL_PROPERTIES, 20 | ATTRIBUTE_TYPES, 21 | PROVIDER_ROLES, 22 | LOCATIONS, 23 | LOCATION_TAG_MAPS, 24 | ADDRESS_HIERARCHY, 25 | BAHMNI_FORMS, 26 | OCL, 27 | CONCEPTS, 28 | CONCEPT_SETS, 29 | CONCEPT_REFERENCE_RANGE, 30 | BILLABLE_SERVICES, 31 | PAYMENT_MODES, 32 | CASH_POINTS, 33 | PROGRAMS, 34 | PROGRAM_WORKFLOWS, 35 | PROGRAM_WORKFLOW_STATES, 36 | PERSON_ATTRIBUTE_TYPES, 37 | IDGEN, 38 | AUTO_GENERATION_OPTIONS, 39 | DRUGS, 40 | ORDER_FREQUENCIES, 41 | ORDER_TYPES, 42 | APPOINTMENT_SPECIALITIES, 43 | APPOINTMENT_SERVICE_DEFINITIONS, 44 | APPOINTMENT_SERVICE_TYPES, 45 | QUEUES, 46 | DATAFILTER_MAPPINGS, 47 | METADATA_SETS, 48 | METADATA_SET_MEMBERS, 49 | METADATA_TERM_MAPPINGS, 50 | COHORT_TYPES, 51 | COHORT_ATTRIBUTE_TYPES, 52 | FHIR_CONCEPT_SOURCES, 53 | FHIR_PATIENT_IDENTIFIER_SYSTEMS, 54 | AMPATH_FORMS, 55 | AMPATH_FORMS_TRANSLATIONS, 56 | HTML_FORMS, 57 | DISPOSITIONS; 58 | 59 | public int getOrder() { 60 | return ArrayUtils.indexOf(values(), this) + 1; 61 | } 62 | 63 | /** 64 | * The name of the domain is also the name of its subfolder inside the configuration folder. 65 | */ 66 | public String getName() { 67 | return name().replace("_", "").toLowerCase(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/CsvFailingLines.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * This is the failed outcome of {@link CsvParser#process(List)}, an object containing the failing 8 | * CSV lines that could potentially be retried, as well as the error details for those lines. 9 | */ 10 | public class CsvFailingLines { 11 | 12 | /** 13 | * ErrorDetails encompasses a failing line and the exception that was caught when processing it. 14 | */ 15 | public class ErrorDetails { 16 | 17 | private CsvLine csvLine; 18 | 19 | private Exception e; 20 | 21 | public ErrorDetails(CsvLine line, Exception e) { 22 | this.csvLine = line; 23 | this.e = e; 24 | } 25 | 26 | public CsvLine getCsvLine() { 27 | return csvLine; 28 | } 29 | 30 | public Exception getException() { 31 | return e; 32 | } 33 | 34 | } 35 | 36 | // failing lines are in the error details but this provides a fast/direct access to them 37 | private List failingLines = new ArrayList(); 38 | 39 | private List errorDetails = new ArrayList(); 40 | 41 | public void addFailingLine(CsvLine line, Exception e) { 42 | failingLines.add(line.asLine()); 43 | errorDetails.add(new ErrorDetails(line, e)); 44 | } 45 | 46 | public List getFailingLines() { 47 | return failingLines; 48 | } 49 | 50 | public List getErrorDetails() { 51 | return errorDetails; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/InitializerDAO.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api; 2 | 3 | import java.util.List; 4 | 5 | import org.openmrs.Concept; 6 | 7 | /** 8 | * For database related functions 9 | * 10 | * @see InitializerService 11 | */ 12 | public interface InitializerDAO { 13 | 14 | /** 15 | * @see org.openmrs.module.initializer.api.InitializerService#getUnretiredConceptsByFullySpecifiedName(String) 16 | */ 17 | public List getUnretiredConceptsByFullySpecifiedName(String name); 18 | } 19 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/OrderedCsvFile.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api; 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 | * Reads the order of a CSV file as the RHS value of the _order metadata header. Eg. "_order:1000" → 12 | * order = 1000. 13 | */ 14 | public class OrderedCsvFile extends OrderedFile { 15 | 16 | public OrderedCsvFile(File file) { 17 | super(file.getAbsolutePath()); 18 | } 19 | 20 | @Override 21 | protected Integer fetchOrder(File file) throws Exception { 22 | String[] headerLine; 23 | try (InputStream is = new IgnoreBOMInputStream(new FileInputStream(file))) { 24 | headerLine = CsvParser.getHeaderLine(is); 25 | } 26 | return BaseLineProcessor.getOrder(headerLine); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/OrderedPropertiesFile.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api; 2 | 3 | import org.openmrs.util.OpenmrsUtil; 4 | 5 | import java.io.File; 6 | import java.util.Properties; 7 | 8 | /** 9 | * Reads the order of a properites file based on the value of a special code named "_order". For 10 | * example: _order = 100 11 | */ 12 | public class OrderedPropertiesFile extends OrderedFile { 13 | 14 | private Properties properties; 15 | 16 | public OrderedPropertiesFile(File file) { 17 | super(file.getAbsolutePath()); 18 | } 19 | 20 | @Override 21 | protected Integer fetchOrder(File file) throws Exception { 22 | properties = new Properties(); 23 | OpenmrsUtil.loadProperties(properties, file); 24 | String order = properties.getProperty("_order"); 25 | if (order != null) { 26 | try { 27 | return Integer.valueOf(order); 28 | } 29 | catch (Exception e) { 30 | log.warn("_order property of '" + order + "' cannot be parsed to an Integer"); 31 | } 32 | } 33 | return Integer.MAX_VALUE; 34 | } 35 | 36 | public Properties getProperties() { 37 | return properties; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/appt/servicedefinitions/AppointmentServiceDefinitionsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.appt.servicedefinitions; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.appointments.model.AppointmentServiceDefinition; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "appointments:*" }) 9 | public class AppointmentServiceDefinitionsLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(AppointmentServiceDefinitionsCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/appt/servicetypes/AppointmentServiceTypesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.appt.servicetypes; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.appointments.model.AppointmentServiceType; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "appointments:*" }) 9 | public class AppointmentServiceTypesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(AppointmentServiceTypesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/appt/specialities/SpecialitiesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.appt.specialities; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.appointments.model.Speciality; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "appointments:*" }) 9 | public class SpecialitiesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(SpecialitiesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/appt/specialities/SpecialityLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.appt.specialities; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.appointments.model.Speciality; 5 | import org.openmrs.module.initializer.api.BaseLineProcessor; 6 | import org.openmrs.module.initializer.api.CsvLine; 7 | 8 | /** 9 | * This is the first level line processor for specialities. It allows to parse and save specialities 10 | * with the minimal set of required fields. 11 | */ 12 | @OpenmrsProfile(modules = { "appointments:*" }) 13 | public class SpecialityLineProcessor extends BaseLineProcessor { 14 | 15 | public Speciality fill(Speciality speciality, CsvLine line) throws IllegalArgumentException { 16 | speciality.setName(line.getName(true)); 17 | return speciality; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/attributes/types/AttributeTypeCsvLineHandler.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.attributes.types; 2 | 3 | import org.openmrs.attribute.BaseAttributeType; 4 | import org.openmrs.module.initializer.api.CsvLine; 5 | 6 | public interface AttributeTypeCsvLineHandler { 7 | 8 | final static String HEADER_ENTITY_NAME = "entity name"; 9 | 10 | public AttributeTypeEntity getAttributeType(CsvLine line); 11 | 12 | public BaseAttributeType newAttributeType(CsvLine line); 13 | } 14 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/attributes/types/AttributeTypeEntity.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.attributes.types; 2 | 3 | public enum AttributeTypeEntity { 4 | LOCATION, 5 | VISIT, 6 | CONCEPT, 7 | PROVIDER, 8 | PROGRAM; 9 | } 10 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/attributes/types/AttributeTypesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.attributes.types; 2 | 3 | import org.openmrs.attribute.BaseAttributeType; 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 AttributeTypesLoader extends BaseCsvLoader, AttributeTypesCsvParser> { 10 | 11 | @Autowired 12 | public void setParser(AttributeTypesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/attributes/types/AttributeTypesProxyService.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.attributes.types; 2 | 3 | import java.util.Set; 4 | 5 | import org.openmrs.api.OpenmrsService; 6 | import org.openmrs.attribute.BaseAttributeType; 7 | 8 | /** 9 | * Proxy OpenMRS service to interface CRUD operations with attribute types. 10 | */ 11 | public interface AttributeTypesProxyService extends OpenmrsService { 12 | 13 | /** 14 | * Saves an AttributeType 15 | * 16 | * @param attributeType 17 | * @return attributeType 18 | */ 19 | BaseAttributeType saveAttributeType(BaseAttributeType attributeType); 20 | 21 | /** 22 | * Gets an AttributeType by uuid. 23 | * 24 | * @param uuid of AttributeType 25 | * @param attributeType the required {@link AttributeTypeEntity} 26 | * @return attributeType 27 | */ 28 | BaseAttributeType getAttributeTypeByUuid(String uuid, AttributeTypeEntity attributeType); 29 | 30 | /** 31 | * Gets an AttributeType by name. 32 | * 33 | * @param name of AttributeType 34 | * @param attributeType the required {@link AttributeTypeEntity} 35 | * @return attributeType 36 | */ 37 | BaseAttributeType getAttributeTypeByName(String name, AttributeTypeEntity attributeType); 38 | 39 | /** 40 | * @return The set of supported {@link AttributeTypeEntity}. 41 | */ 42 | Set getSupportedTypes(); 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/attributes/types/BaseAttributeTypeLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.attributes.types; 2 | 3 | import org.openmrs.attribute.BaseAttributeType; 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 BaseAttributeTypeLineProcessor extends BaseLineProcessor> { 10 | 11 | protected static String HEADER_MIN_OCCURS = "min occurs"; 12 | 13 | protected static String HEADER_MAX_OCCURS = "max occurs"; 14 | 15 | protected static String HEADER_DATATYPE_CLASSNAME = "datatype classname"; 16 | 17 | protected static String HEADER_DATATYPE_CONFIG = "datatype config"; 18 | 19 | protected static String HEADER_PREFERRED_HANDLER_CLASSNAME = "preferred handler classname"; 20 | 21 | protected static String HEADER_HANDLER_CONFIG = "handler config"; 22 | 23 | @Override 24 | public BaseAttributeType fill(BaseAttributeType instance, CsvLine line) throws IllegalArgumentException { 25 | 26 | instance.setName(line.getName(true)); 27 | instance.setDescription(line.get(HEADER_DESC)); 28 | instance.setDatatypeClassname(line.get(HEADER_DATATYPE_CLASSNAME, true)); 29 | instance.setDatatypeConfig(line.getString(HEADER_DATATYPE_CONFIG)); 30 | instance.setMinOccurs(line.getInt(HEADER_MIN_OCCURS)); 31 | instance.setMaxOccurs(line.getInt(HEADER_MAX_OCCURS)); 32 | instance.setPreferredHandlerClassname(line.getString(HEADER_PREFERRED_HANDLER_CLASSNAME)); 33 | instance.setHandlerConfig(line.getString(HEADER_HANDLER_CONFIG)); 34 | 35 | return instance; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptAttributeLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.openmrs.Concept; 5 | import org.openmrs.ConceptAttribute; 6 | import org.openmrs.ConceptAttributeType; 7 | import org.openmrs.api.ConceptService; 8 | import org.openmrs.module.initializer.api.BaseAttributeLineProcessor; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Component; 11 | 12 | @Component("initializer.conceptAttributeLineProcessor") 13 | public class ConceptAttributeLineProcessor extends BaseAttributeLineProcessor { 14 | 15 | private ConceptService conceptService; 16 | 17 | @Autowired 18 | public ConceptAttributeLineProcessor(ConceptService conceptService) { 19 | this.conceptService = conceptService; 20 | } 21 | 22 | @Override 23 | public ConceptAttributeType getAttributeType(String identifier) throws IllegalArgumentException { 24 | if (StringUtils.isBlank(identifier)) { 25 | throw new IllegalArgumentException("A blank attribute type identifier was provided."); 26 | } 27 | ConceptAttributeType ret = conceptService.getConceptAttributeTypeByUuid(identifier); 28 | if (ret == null) { 29 | ret = conceptService.getConceptAttributeTypeByName(identifier); 30 | } 31 | return ret; 32 | } 33 | 34 | @Override 35 | public ConceptAttribute newAttribute() { 36 | return new ConceptAttribute(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptClassLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.openmrs.ConceptClass; 4 | import org.openmrs.api.ConceptService; 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 12 | public class ConceptClassLineProcessor extends BaseLineProcessor { 13 | 14 | private ConceptService service; 15 | 16 | @Autowired 17 | public ConceptClassLineProcessor(@Qualifier("conceptService") ConceptService conceptService) { 18 | super(); 19 | this.service = conceptService; 20 | } 21 | 22 | public ConceptClass fill(ConceptClass conceptClass, CsvLine line) throws IllegalArgumentException { 23 | conceptClass.setName(line.get(HEADER_NAME, true)); 24 | conceptClass.setDescription(line.get(HEADER_DESC)); 25 | return conceptClass; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptClassesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.openmrs.ConceptClass; 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 ConceptClassesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(ConceptClassesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptComplexLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.ConceptComplex; 5 | import org.openmrs.api.ConceptService; 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.conceptComplexLineProcessor") 12 | public class ConceptComplexLineProcessor extends ConceptLineProcessor { 13 | 14 | protected static String DATATYPE_COMPLEX = "Complex"; 15 | 16 | protected static String HEADER_HANDLER = "complex data handler"; 17 | 18 | @Autowired 19 | public ConceptComplexLineProcessor(@Qualifier("conceptService") ConceptService conceptService) { 20 | super(conceptService); 21 | } 22 | 23 | public Concept fill(Concept instance, CsvLine line) throws IllegalArgumentException { 24 | 25 | if (!DATATYPE_COMPLEX.equals(line.get(ConceptLineProcessor.HEADER_DATATYPE))) { 26 | return instance; 27 | } 28 | 29 | ConceptComplex cc = new ConceptComplex(instance); 30 | if (instance.getId() != null) { // below overrides any other processors work, so this one should be called first 31 | cc = conceptService.getConceptComplex(instance.getId()); 32 | } 33 | cc.setDatatype(conceptService.getConceptDatatypeByName(DATATYPE_COMPLEX)); 34 | 35 | cc.setHandler(line.getString(HEADER_HANDLER)); 36 | 37 | return cc; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptSetsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.openmrs.Concept; 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 ConceptSetsLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(ConceptSetsCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptSourceLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.openmrs.ConceptSource; 4 | import org.openmrs.api.ConceptService; 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 12 | public class ConceptSourceLineProcessor extends BaseLineProcessor { 13 | 14 | final public static String HEADER_HL7_CODE = "HL7 Code"; 15 | 16 | final public static String HEADER_UNIQUE_ID = "Unique ID"; 17 | 18 | private ConceptService service; 19 | 20 | @Autowired 21 | public ConceptSourceLineProcessor(@Qualifier("conceptService") ConceptService conceptService) { 22 | super(); 23 | this.service = conceptService; 24 | } 25 | 26 | public ConceptSource fill(ConceptSource conceptSource, CsvLine line) throws IllegalArgumentException { 27 | conceptSource.setName(line.get(HEADER_NAME, true)); 28 | conceptSource.setDescription(line.get(HEADER_DESC, true)); 29 | conceptSource.setHl7Code(line.get(HEADER_HL7_CODE)); 30 | conceptSource.setUniqueId(line.get(HEADER_UNIQUE_ID)); 31 | return conceptSource; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptSourcesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import org.openmrs.ConceptSource; 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 ConceptSourcesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(ConceptSourcesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/c/ConceptsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.c; 2 | 3 | import java.io.File; 4 | 5 | import org.openmrs.Concept; 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 ConceptsLoader extends BaseCsvLoader { 12 | 13 | @Autowired 14 | public void setParser(ConceptsCsvParser 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/cohort/cat/CohortAttributeTypeLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.cohort.cat; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.openmrs.annotation.OpenmrsProfile; 5 | import org.openmrs.module.cohort.CohortAttributeType; 6 | import org.openmrs.module.initializer.api.BaseLineProcessor; 7 | import org.openmrs.module.initializer.api.CsvLine; 8 | 9 | @OpenmrsProfile(modules = { "cohort:3.5.* - 9.*" }) 10 | public class CohortAttributeTypeLineProcessor extends BaseLineProcessor { 11 | 12 | @Override 13 | public CohortAttributeType fill(CohortAttributeType instance, CsvLine line) throws IllegalArgumentException { 14 | String uuid = line.getUuid(); 15 | if (StringUtils.isNotBlank(uuid)) { 16 | instance.setUuid(line.getUuid()); 17 | } 18 | 19 | instance.setName(line.getName(true)); 20 | instance.setDescription(line.get("Description")); 21 | instance.setDatatypeClassname(line.get("Datatype classname", true)); 22 | instance.setPreferredHandlerClassname(line.get("Preferred handler classname")); 23 | instance.setHandlerConfig(line.get("Handler config")); 24 | instance.setMinOccurs(line.getInt("Min occurs")); 25 | instance.setMaxOccurs(line.getInt("Max occurs")); 26 | 27 | return instance; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/cohort/cat/CohortAttributeTypeLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.cohort.cat; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.cohort.CohortAttributeType; 5 | import org.openmrs.module.initializer.Domain; 6 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | @OpenmrsProfile(modules = { "cohort:3.5.* - 9.*" }) 10 | public class CohortAttributeTypeLoader extends BaseCsvLoader { 11 | 12 | @Override 13 | public Domain getDomain() { 14 | return Domain.COHORT_ATTRIBUTE_TYPES; 15 | } 16 | 17 | @Autowired 18 | public void setParser(CohortAttributeTypeCsvParser parser) { 19 | this.parser = parser; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/cohort/ct/CohortTypeLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.cohort.ct; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.openmrs.annotation.OpenmrsProfile; 5 | import org.openmrs.module.cohort.CohortType; 6 | import org.openmrs.module.initializer.api.BaseLineProcessor; 7 | import org.openmrs.module.initializer.api.CsvLine; 8 | 9 | @OpenmrsProfile(modules = { "cohort:3.5.* - 9.*" }) 10 | public class CohortTypeLineProcessor extends BaseLineProcessor { 11 | 12 | @Override 13 | public CohortType fill(CohortType instance, CsvLine line) throws IllegalArgumentException { 14 | String uuid = line.getUuid(); 15 | if (StringUtils.isNotBlank(uuid)) { 16 | instance.setUuid(line.getUuid()); 17 | } 18 | 19 | instance.setName(line.getName(true)); 20 | instance.setDescription(line.get("Description")); 21 | 22 | return instance; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/cohort/ct/CohortTypeLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.cohort.ct; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.cohort.CohortType; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "cohort:3.5.* - 9.*" }) 9 | public class CohortTypeLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(CohortTypeCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/display/DisplaysCsvParser.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.display; 2 | 3 | import org.openmrs.OpenmrsObject; 4 | import org.openmrs.api.context.Context; 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.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Component; 11 | 12 | @Component 13 | public class DisplaysCsvParser extends CsvParser> { 14 | 15 | private CsvParser> bootstrapParser; 16 | 17 | public void setBootstrapParser( 18 | CsvParser> parser) { 19 | this.bootstrapParser = parser; 20 | } 21 | 22 | @Autowired 23 | public DisplaysCsvParser(DisplayLineProcessor baseProcessor) { 24 | super(baseProcessor); 25 | } 26 | 27 | @Override 28 | public Domain getDomain() { 29 | return null; 30 | } 31 | 32 | @Override 33 | public OpenmrsObject bootstrap(CsvLine line) throws IllegalArgumentException { 34 | return bootstrapParser.bootstrap(line); 35 | } 36 | 37 | @Override 38 | public OpenmrsObject save(OpenmrsObject instance) { 39 | // Clearing object from session to prevent possibly saving it later on. 40 | // See CsvParser#process(List) 41 | Context.clearSession(); 42 | return instance; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/display/DisplaysPreLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.display; 2 | 3 | import org.openmrs.OpenmrsObject; 4 | import org.openmrs.module.initializer.api.BaseLineProcessor; 5 | import org.openmrs.module.initializer.api.CsvParser; 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 DisplaysPreLoader extends BaseCsvLoader { 12 | 13 | @Override 14 | public boolean isPreLoader() { 15 | return true; 16 | } 17 | 18 | @Override 19 | public String getDomainName() { 20 | return "displays"; 21 | } 22 | 23 | @Override 24 | public Integer getOrder() { 25 | return 0; 26 | } 27 | 28 | @Autowired 29 | public void setParser(DisplaysCsvParser parser) { 30 | this.parser = parser; 31 | } 32 | 33 | @Override 34 | public void setDisplaysPreLoader(DisplaysPreLoader displaysLoader) { 35 | // this override prevents the parent's method Spring autowiring that would result in a cyclic bean creation error. 36 | } 37 | 38 | public void setBootstrapParser( 39 | CsvParser> parser) { 40 | this.parser.setBootstrapParser(parser); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/drugs/DrugsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.drugs; 2 | 3 | import org.openmrs.Drug; 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 DrugsLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(DrugsCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/er/EncounterRoleLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.er; 2 | 3 | import org.openmrs.EncounterRole; 4 | import org.openmrs.api.EncounterService; 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 12 | public class EncounterRoleLineProcessor extends BaseLineProcessor { 13 | 14 | private EncounterService service; 15 | 16 | @Autowired 17 | public EncounterRoleLineProcessor(@Qualifier("encounterService") EncounterService encounterService) { 18 | super(); 19 | this.service = encounterService; 20 | } 21 | 22 | @Override 23 | public EncounterRole fill(EncounterRole type, CsvLine line) throws IllegalArgumentException { 24 | 25 | type.setName(line.getName(true)); 26 | type.setDescription(line.get(HEADER_DESC)); 27 | 28 | return type; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/er/EncounterRolesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.er; 2 | 3 | import org.openmrs.EncounterRole; 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 EncounterRolesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(EncounterRolesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/et/EncounterTypesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.et; 2 | 3 | import org.openmrs.EncounterType; 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 EncounterTypesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(EncounterTypesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/fhir/cs/FhirConceptSourcesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.fhir.cs; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.fhir2.model.FhirConceptSource; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "fhir2:1.6.* - 9.*" }) 9 | public class FhirConceptSourcesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(FhirConceptSourceCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/fhir/pis/FhirPatientIdentifierSystemLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.fhir.pis; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.fhir2.model.FhirPatientIdentifierSystem; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "fhir2:1.6.* - 9.*" }) 9 | public class FhirPatientIdentifierSystemLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(FhirPatientIdentifierSystemCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/freq/OrderFrequenciesCsvParser.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.freq; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.openmrs.OrderFrequency; 5 | import org.openmrs.api.OrderService; 6 | import org.openmrs.module.initializer.Domain; 7 | import org.openmrs.module.initializer.api.BaseLineProcessor; 8 | import org.openmrs.module.initializer.api.CsvLine; 9 | import org.openmrs.module.initializer.api.CsvParser; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.beans.factory.annotation.Qualifier; 12 | import org.springframework.stereotype.Component; 13 | 14 | @Component 15 | public class OrderFrequenciesCsvParser extends CsvParser> { 16 | 17 | private OrderService orderService; 18 | 19 | @Autowired 20 | public OrderFrequenciesCsvParser(@Qualifier("orderService") OrderService orderService, 21 | OrderFrequencyLineProcessor processor) { 22 | super(processor); 23 | this.orderService = orderService; 24 | } 25 | 26 | @Override 27 | public Domain getDomain() { 28 | return Domain.ORDER_FREQUENCIES; 29 | } 30 | 31 | @Override 32 | public OrderFrequency bootstrap(CsvLine line) throws IllegalArgumentException { 33 | 34 | String uuid = line.getUuid(); 35 | 36 | OrderFrequency freq = orderService.getOrderFrequencyByUuid(uuid); 37 | if (freq == null) { 38 | freq = new OrderFrequency(); 39 | if (!StringUtils.isEmpty(uuid)) { 40 | freq.setUuid(uuid); 41 | } 42 | } 43 | 44 | return freq; 45 | } 46 | 47 | @Override 48 | public OrderFrequency save(OrderFrequency instance) { 49 | return orderService.saveOrderFrequency(instance); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/freq/OrderFrequenciesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.freq; 2 | 3 | import org.openmrs.OrderFrequency; 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 OrderFrequenciesLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(OrderFrequenciesCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/freq/OrderFrequencyLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.freq; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.OrderFrequency; 5 | import org.openmrs.api.ConceptService; 6 | import org.openmrs.module.initializer.api.BaseLineProcessor; 7 | import org.openmrs.module.initializer.api.CsvLine; 8 | import org.openmrs.module.initializer.api.utils.Utils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Component; 12 | 13 | /** 14 | * This is the first level line processor for concepts. It allows to parse and save concepts with 15 | * the minimal set of required fields. 16 | */ 17 | @Component 18 | public class OrderFrequencyLineProcessor extends BaseLineProcessor { 19 | 20 | protected static String HEADER_FREQ_PER_DAY = "frequency per day"; 21 | 22 | protected static String HEADER_CONCEPT_FREQ = "concept frequency"; 23 | 24 | private ConceptService conceptService; 25 | 26 | @Autowired 27 | public OrderFrequencyLineProcessor(@Qualifier("conceptService") ConceptService conceptService) { 28 | super(); 29 | this.conceptService = conceptService; 30 | } 31 | 32 | @Override 33 | public OrderFrequency fill(OrderFrequency freq, CsvLine line) throws IllegalArgumentException { 34 | 35 | Concept conceptFreq = Utils.fetchConcept(line.get(HEADER_CONCEPT_FREQ), conceptService); 36 | 37 | freq.setConcept(conceptFreq); 38 | freq.setFrequencyPerDay(line.getDouble(HEADER_FREQ_PER_DAY)); 39 | 40 | return freq; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/gp/GlobalPropertiesConfig.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.gp; 2 | 3 | import java.util.Collections; 4 | import java.util.List; 5 | 6 | import org.openmrs.GlobalProperty; 7 | 8 | public class GlobalPropertiesConfig { 9 | 10 | protected List globalProperties = Collections.emptyList(); 11 | 12 | public List getGlobalProperties() { 13 | return globalProperties; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/gp/GlobalPropertiesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.gp; 2 | 3 | import java.io.InputStream; 4 | 5 | import org.openmrs.api.AdministrationService; 6 | import org.openmrs.module.initializer.Domain; 7 | import org.openmrs.module.initializer.api.InitializerSerializer; 8 | import org.openmrs.module.initializer.api.loaders.BaseInputStreamLoader; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Component; 11 | 12 | @Component 13 | public class GlobalPropertiesLoader extends BaseInputStreamLoader { 14 | 15 | @Autowired 16 | private AdministrationService adminService; 17 | 18 | @Override 19 | protected Domain getDomain() { 20 | return Domain.GLOBAL_PROPERTIES; 21 | } 22 | 23 | @Override 24 | protected String getFileExtension() { 25 | return "xml"; 26 | } 27 | 28 | @Override 29 | protected void load(InputStream is) throws Exception { 30 | GlobalPropertiesConfig config = InitializerSerializer.getGlobalPropertiesConfig(is); 31 | adminService.saveGlobalProperties(config.getGlobalProperties()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/idgen/CommonIdentifierSourceLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.idgen; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.idgen.service.IdentifierSourceService; 5 | import org.openmrs.module.initializer.api.CsvLine; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | /** 9 | * This is the first level line processor for identifier sources. It allows to parse and save 10 | * identifier sources with the minimal/common set of required fields. 11 | */ 12 | @OpenmrsProfile(modules = { "idgen:*" }) 13 | public class CommonIdentifierSourceLineProcessor extends IdentifierSourceLineProcessor { 14 | 15 | @Autowired 16 | public CommonIdentifierSourceLineProcessor(IdentifierSourceService idgenService) { 17 | super(idgenService); 18 | } 19 | 20 | @Override 21 | public IdgenSourceWrapper fill(IdgenSourceWrapper instance, CsvLine line) throws IllegalArgumentException { 22 | 23 | instance.getIdentifierSource().setIdentifierType(getPatientIdentifierType(line.getString(HEADER_IDTYPE))); 24 | instance.getIdentifierSource().setName(line.getString(HEADER_NAME)); 25 | instance.getIdentifierSource().setDescription(line.getString(HEADER_DESC)); 26 | 27 | return instance; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/idgen/IdentifierSourceType.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.idgen; 2 | 3 | public enum IdentifierSourceType { 4 | POOL, 5 | REMOTE, 6 | SEQUENTIAL 7 | } 8 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/idgen/IdentifierSourcesLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.idgen; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | @OpenmrsProfile(modules = { "idgen:*" }) 8 | public class IdentifierSourcesLoader extends BaseCsvLoader { 9 | 10 | @Autowired 11 | public void setParser(IdentifierSourcesCsvParser parser) { 12 | this.parser = parser; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/idgen/IdgenSourceWrapper.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.idgen; 2 | 3 | import org.openmrs.BaseOpenmrsMetadata; 4 | import org.openmrs.module.idgen.IdentifierSource; 5 | 6 | /** 7 | * This wrapper class is necessary because {@link IdentifierSource} does not extend 8 | * {@link BaseOpenmrsMetadata}. 9 | */ 10 | public class IdgenSourceWrapper extends BaseOpenmrsMetadata { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | protected IdentifierSource source; 15 | 16 | public IdgenSourceWrapper(IdentifierSource source) { 17 | super(); 18 | this.source = source; 19 | } 20 | 21 | public IdentifierSourceType getType() { 22 | return IdentifierSourceLineProcessor.getIdentifierSourceType(source); 23 | } 24 | 25 | public IdentifierSource getIdentifierSource() { 26 | return source; 27 | } 28 | 29 | public void setIdentifierSource(IdentifierSource identifierSource) { 30 | this.source = identifierSource; 31 | } 32 | 33 | @Override 34 | public Integer getId() { 35 | return source.getId(); 36 | } 37 | 38 | @Override 39 | public void setId(Integer id) { 40 | source.setId(id); 41 | } 42 | 43 | @Override 44 | public void setRetired(Boolean retired) { 45 | source.setRetired(retired); 46 | } 47 | 48 | @Override 49 | public Boolean getRetired() { 50 | return source.isRetired(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/idgen/SequentialIdentifierGeneratorLineProcessor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.idgen; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.idgen.SequentialIdentifierGenerator; 5 | import org.openmrs.module.idgen.service.IdentifierSourceService; 6 | import org.openmrs.module.initializer.api.CsvLine; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | /** 10 | * Columns specific to {@link SequentialIdentifierGenerator}. 11 | */ 12 | @OpenmrsProfile(modules = { "idgen:*" }) 13 | public class SequentialIdentifierGeneratorLineProcessor extends IdentifierSourceLineProcessor { 14 | 15 | @Autowired 16 | public SequentialIdentifierGeneratorLineProcessor(IdentifierSourceService idgenService) { 17 | super(idgenService); 18 | } 19 | 20 | @Override 21 | public IdgenSourceWrapper fill(IdgenSourceWrapper instance, CsvLine line) throws IllegalArgumentException { 22 | 23 | if (!IdentifierSourceType.SEQUENTIAL.equals(instance.getType())) { 24 | return instance; 25 | } 26 | 27 | SequentialIdentifierGenerator source = (SequentialIdentifierGenerator) instance.getIdentifierSource(); 28 | 29 | source.setBaseCharacterSet(line.get(HEADER_BASE_CHAR_SET, true)); 30 | source.setFirstIdentifierBase(line.get(HEADER_FIRST_ID_BASE, true)); 31 | source.setPrefix(line.getString(HEADER_PREFIX, "")); 32 | source.setSuffix(line.getString(HEADER_SUFFIX, "")); 33 | source.setMinLength(line.getInt(HEADER_MIN_LENGTH)); 34 | source.setMaxLength(line.getInt(HEADER_MAX_LENGTH)); 35 | 36 | instance.setIdentifierSource(source); 37 | 38 | return instance; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/idgen/autogen/AutoGenerationOptionsLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.idgen.autogen; 2 | 3 | import org.openmrs.annotation.OpenmrsProfile; 4 | import org.openmrs.module.idgen.AutoGenerationOption; 5 | import org.openmrs.module.initializer.api.loaders.BaseCsvLoader; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | @OpenmrsProfile(modules = { "idgen:4.6.0" }) 9 | public class AutoGenerationOptionsLoader extends BaseCsvLoader { 10 | 11 | @Autowired 12 | public void setParser(AutoGenerationOptionsCsvParser parser) { 13 | this.parser = parser; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/src/main/java/org/openmrs/module/initializer/api/loaders/AddressHierarchyLoader.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.initializer.api.loaders; 2 | 3 | import java.nio.file.Paths; 4 | import java.util.List; 5 | 6 | import org.openmrs.annotation.OpenmrsProfile; 7 | import org.openmrs.module.addresshierarchy.config.AddressConfigurationLoader; 8 | import org.openmrs.module.initializer.Domain; 9 | import org.openmrs.module.initializer.api.ConfigDirUtil; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | @OpenmrsProfile(modules = { "addresshierarchy:2.17.* - 9.*" }) 14 | public class AddressHierarchyLoader extends BaseLoader { 15 | 16 | protected final Logger log = LoggerFactory.getLogger(getClass()); 17 | 18 | @Override 19 | protected Domain getDomain() { 20 | return Domain.ADDRESS_HIERARCHY; 21 | } 22 | 23 | @Override 24 | public ConfigDirUtil getDirUtil() { 25 | return new ConfigDirUtil(iniz.getConfigDirPath(), iniz.getChecksumsDirPath(), getDomainName(), true); 26 | } 27 | 28 | @Override 29 | public void loadUnsafe(List 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 --------------------------------------------------------------------------------