├── bahmnicore-omod ├── scripts │ └── run-compass.sh └── src │ ├── main │ ├── resources │ │ ├── dispositionConfig.json │ │ ├── messages.properties │ │ ├── V1_42__RemovingNotNullContraintOnOrderTypeId.sql │ │ ├── V1_24__AddUniqueConstraintToPatientidentifier.sql │ │ ├── V1_41__AddingIndexToCityVillage-JssSpecific.sql │ │ ├── migrations │ │ │ └── dependent-modules │ │ │ │ └── V1_73__RemoveNotNullConstraintOnAddressEntryName.sql │ │ ├── V1_68__EncounterTypeForAdmission.sql │ │ ├── V1_70__EncounterTypeForDischarge.sql │ │ ├── V1_78__EncounterTypeForTransfer.sql │ │ ├── V1_10__SetupRegistrationEncounterType.sql │ │ ├── V1_43__AddOPDConsultationEncounterType.sql │ │ ├── V1_61__CreatingGlobalPropertyForPatientIdentifierType.sql │ │ ├── V1_67__AddConceptSetForAdmission.sql │ │ ├── V1_69__AddConceptSetForDischarge.sql │ │ ├── V1_23__DeleteOpenMRSCorePersonAttributes.sql │ │ ├── V1_10__CreatingPatientIdentifierForBahmni.sql │ │ ├── V1_56__AddConceptDescriptionProc.sql │ │ ├── V1_25__RegistrationConceptSetFix.sql │ │ ├── V1_80__AddConceptNumericProc.sql │ │ ├── V1_66__addConceptConsultationNote.sql │ │ ├── V1_59__AddConceptSetMembersProc.sql │ │ ├── V1_30__AddConceptAnswerProc.sql │ │ ├── V1_39__CreateLaboratoryPanelConcept.sql │ │ ├── V1_55__addLabAndRadiologyOrderTypes.sql │ │ ├── V1_11__CreateConceptSetForRegistrationConcepts.sql │ │ ├── V1_81__DeleteConcept.sql │ │ └── V1_58__AddConceptReferenceMapProc.sql │ ├── compass │ │ ├── sass │ │ │ └── bahmnicore.scss │ │ └── config.rb │ └── java │ │ └── org │ │ └── bahmni │ │ └── module │ │ └── bahmnicore │ │ └── web │ │ └── v1_0 │ │ ├── MvcConfiguration.java │ │ ├── contract │ │ ├── BahmniMailContent.java │ │ └── BahmniConceptAnswer.java │ │ ├── VisitClosedException.java │ │ ├── mapper │ │ └── CustomObjectMapper.java │ │ └── LocaleResolver.java │ └── test │ ├── resources │ ├── patientContextDataSet.xml │ ├── search │ │ └── bacteriologySpecimen │ │ │ └── programEpisodeMapping.xml │ ├── addressHierarchy.xml │ ├── updatePatient.json │ └── test-hibernate.cfg.xml │ └── java │ └── org │ ├── bahmni │ └── module │ │ └── bahmnicore │ │ └── web │ │ └── v1_0 │ │ ├── BaseIntegrationTest.java │ │ └── controller │ │ └── WhoamiControllerIT.java │ └── openmrs │ └── module │ └── bahmnicore │ └── web │ └── v1_0 │ └── resource │ └── RestConstants.java ├── bahmnicore-api └── src │ ├── main │ ├── resources │ │ └── atomfeed.properties │ └── java │ │ └── org │ │ └── bahmni │ │ └── module │ │ └── bahmnicore │ │ ├── dao │ │ ├── EntityDao.java │ │ ├── PersonNameDao.java │ │ ├── PersonAttributeDao.java │ │ ├── BahmniOrderSetDao.java │ │ ├── ApplicationDataDirectory.java │ │ ├── BahmniAddressHierarchyDao.java │ │ ├── VisitDao.java │ │ ├── BahmniConceptDao.java │ │ ├── NoteDao.java │ │ └── impl │ │ │ ├── ApplicationDataDirectoryImpl.java │ │ │ ├── EntityDaoImpl.java │ │ │ └── PersonNameDaoImpl.java │ │ ├── encounterModifier │ │ ├── exception │ │ │ └── CannotModifyEncounterException.java │ │ └── EncounterModifier.java │ │ ├── security │ │ └── PrivilegeConstants.java │ │ ├── CIELDictionary.java │ │ ├── service │ │ ├── BahmniOrderSetService.java │ │ ├── BahmniProgramServiceValidator.java │ │ ├── SqlSearchParamStore.java │ │ ├── ThumbnailGenerator.java │ │ ├── BahmniAddressHierarchyService.java │ │ ├── SqlSearchService.java │ │ ├── BahmniVisitService.java │ │ ├── TsConceptSearchService.java │ │ ├── impl │ │ │ ├── BahmniProgramServiceValidatorImpl.java │ │ │ └── BahmniOrderSetServiceImpl.java │ │ ├── DiseaseTemplateService.java │ │ ├── BahmniEncounterModifierService.java │ │ ├── BahmniProgramWorkflowService.java │ │ ├── PatientDocumentService.java │ │ ├── BahmniConceptService.java │ │ ├── BahmniOrderService.java │ │ ├── BahmniDiagnosisService.java │ │ ├── OrderService.java │ │ └── RowMapper.java │ │ ├── model │ │ ├── error │ │ │ ├── ErrorMessage.java │ │ │ └── ErrorCode.java │ │ ├── ResultList.java │ │ ├── VideoFormatsForThumbnailGeneration.java │ │ ├── VideoFormats.java │ │ ├── BahmniName.java │ │ ├── searchParams │ │ │ └── AdditionalSearchParam.java │ │ ├── Provider.java │ │ ├── NoteType.java │ │ └── BahmniPersonAttribute.java │ │ ├── bahmniexceptions │ │ ├── FileTypeNotSupportedException.java │ │ └── VideoFormatNotSupportedException.java │ │ ├── BahmniCoreException.java │ │ ├── contract │ │ ├── visit │ │ │ └── EncounterType.java │ │ ├── encounter │ │ │ └── data │ │ │ │ ├── ConceptData.java │ │ │ │ └── ObservationData.java │ │ ├── entityMapping │ │ │ └── Entity.java │ │ ├── diseasetemplate │ │ │ └── DiseaseTemplateConfig.java │ │ ├── monitoring │ │ │ └── response │ │ │ │ └── TasksMonitoringResponse.java │ │ └── drugorder │ │ │ ├── OrderFrequencyData.java │ │ │ └── ConceptData.java │ │ ├── obs │ │ └── ObservationsAdder.java │ │ ├── BillingSystemException.java │ │ ├── events │ │ ├── BahmniEventType.java │ │ ├── EncounterEvent.java │ │ ├── PatientEvent.java │ │ ├── BahmniEvent.java │ │ └── eventPublisher │ │ │ └── BahmniEventPublisher.java │ │ ├── extensions │ │ └── MonthCalculationExtension.java │ │ ├── ApplicationError.java │ │ ├── forms2 │ │ ├── service │ │ │ └── BahmniFormDetailsService.java │ │ └── contract │ │ │ └── FormType.java │ │ ├── util │ │ └── WebUtils.java │ │ └── Activator.java │ └── test │ ├── resources │ ├── SampleVideo.mkv │ ├── SampleVideo.mov │ ├── visitAttributeDataSet.xml │ ├── programAttributesDataSet.xml │ ├── notesData.xml │ └── test-hibernate.cfg.xml │ └── java │ └── org │ └── bahmni │ └── module │ └── bahmnicore │ ├── extensions │ └── MonthCalculationExtensionTest.java │ ├── BaseIntegrationTest.java │ ├── service │ └── impl │ │ └── BahmniFeedDrugOrderServiceImplTest.java │ ├── model │ ├── SimpleObjectExtractorTest.java │ ├── BahmniNameTest.java │ └── BahmniPersonAttributeTest.java │ ├── mapper │ └── BirthDateMapperTest.java │ └── util │ ├── AddressMother.java │ └── NameMother.java ├── vagrant-deploy └── scripts │ └── vagrant │ ├── openmrs_start.sh │ ├── openmrs_stop.sh │ ├── setup_environment.sh │ ├── deploy_omods.sh │ └── vagrant_functions.sh ├── admin └── src │ ├── test │ ├── resources │ │ ├── reference-term-source.csv │ │ ├── concept_import.csv │ │ ├── concept_set_import.csv │ │ ├── programSample.csv │ │ ├── visitAttributeDataSet.xml │ │ ├── baseMetaData.xml │ │ ├── patientMatchingAlgorithm │ │ │ ├── NoMatch.groovy │ │ │ ├── MultipleMatchPatient.groovy │ │ │ ├── GANIdentifier.groovy │ │ │ └── IdAndNameMatch.groovy │ │ ├── sample.csv │ │ ├── relationshipDataSetup.xml │ │ ├── test-hibernate.cfg.xml │ │ ├── conceptReferenceTerm.xml │ │ ├── trial.csv │ │ └── TestingApplicationContext.xml │ └── java │ │ └── org │ │ └── bahmni │ │ └── module │ │ └── admin │ │ ├── BaseIntegrationTest.java │ │ └── csv │ │ └── models │ │ └── MultipleEncounterRowTest.java │ └── main │ ├── java │ └── org │ │ └── bahmni │ │ └── module │ │ └── admin │ │ ├── csv │ │ ├── patientmatchingalgorithm │ │ │ ├── BahmniPatientMatchingAlgorithm.java │ │ │ └── PatientMatchingAlgorithm.java │ │ └── models │ │ │ ├── LabResultRow.java │ │ │ └── PatientProgramRow.java │ │ ├── config │ │ ├── service │ │ │ └── BahmniConfigService.java │ │ ├── dao │ │ │ └── BahmniConfigDao.java │ │ └── BahmniCoreModuleConfig.java │ │ ├── observation │ │ └── handler │ │ │ └── CSVObsHandler.java │ │ ├── concepts │ │ └── mapper │ │ │ └── DrugMapper.java │ │ └── retrospectiveEncounter │ │ └── domain │ │ └── BahmniVisit.java │ └── resources │ └── moduleApplicationContext.xml ├── openmrs-elis-atomfeed-client-omod └── src │ ├── main │ ├── resources │ │ ├── messages.properties │ │ ├── V1_52__StartOpenElisAtomFeedSchedulerTaskToStartAutomatically.sql │ │ ├── V1_50__UpdatingOpenElisAtomFeedSchedulerTaskToRunEvery15Seconds.sql │ │ ├── V1_45__UpdatingOpenElisAtomFeedSchedulerTaskToNotStartUpAutomatically.sql │ │ ├── V1_44__AddingSchedulerTaskToProcessOpenElisPatientFeed.sql │ │ └── V1_64__AddLabResultFeedScheduler.sql │ └── java │ │ └── org │ │ └── bahmni │ │ └── module │ │ └── elisatomfeedclient │ │ ├── api │ │ ├── client │ │ │ ├── FeedClient.java │ │ │ ├── OpenElisPatientFeedClient.java │ │ │ ├── FailedEventsFeedClient.java │ │ │ └── OpenElisPatientFailedEventsFeedClient.java │ │ ├── elisFeedInterceptor │ │ │ ├── ElisFeedEncounterInterceptor.java │ │ │ └── ElisFeedAccessionInterceptor.java │ │ ├── exception │ │ │ └── OpenElisFeedException.java │ │ ├── task │ │ │ ├── OpenElisPatientFeedTask.java │ │ │ └── OpenElisPatientFeedFailedEventsTask.java │ │ ├── Constants.java │ │ ├── domain │ │ │ └── OpenElisPatientAttribute.java │ │ └── worker │ │ │ ├── IgnoreEventWorker.java │ │ │ └── ProviderHelper.java │ │ └── Activator.java │ └── test │ ├── resources │ ├── test-bahmnicore.properties │ ├── TestingApplicationContext.xml │ └── visitAttributeDataSet.xml │ └── java │ └── org │ └── bahmni │ └── module │ └── elisatomfeedclient │ └── api │ └── domain │ └── OpenElisPatientTest.java ├── bahmni-emr-api └── src │ ├── test │ ├── resources │ │ ├── labOrderAssociatedWithTestOrderData.xml │ │ ├── obscalculator │ │ │ └── BahmniObsValueCalculator.groovy │ │ ├── concepts.xml │ │ └── test-hibernate.cfg.xml │ └── java │ │ └── org │ │ └── openmrs │ │ └── module │ │ └── bahmniemrapi │ │ ├── BaseIntegrationTest.java │ │ ├── encountertransaction │ │ └── impl │ │ │ ├── DummyEncounterSessionMatcher.java │ │ │ └── MockEncounterTransactionHandler.java │ │ ├── drugogram │ │ └── contract │ │ │ └── RegimenRowTest.java │ │ ├── builder │ │ ├── LocationBuilder.java │ │ ├── PersonBuilder.java │ │ └── ETConceptBuilder.java │ │ └── drugorder │ │ └── mapper │ │ └── BahmniProviderMapperTest.java │ └── main │ ├── java │ └── org │ │ └── openmrs │ │ └── module │ │ └── bahmniemrapi │ │ ├── drugogram │ │ └── contract │ │ │ ├── TableExtension.java │ │ │ └── BaseTableExtension.java │ │ ├── obscalculator │ │ └── ObsValueCalculator.java │ │ ├── document │ │ ├── service │ │ │ └── VisitDocumentService.java │ │ └── contract │ │ │ └── VisitDocumentResponse.java │ │ ├── BahmniEmrAPIException.java │ │ ├── encountertransaction │ │ ├── command │ │ │ ├── EncounterDataPreSaveCommand.java │ │ │ └── EncounterDataPostSaveCommand.java │ │ ├── mapper │ │ │ ├── BahmniComplexDataMapper.java │ │ │ └── EncounterTransactionDiagnosisMapper.java │ │ ├── service │ │ │ ├── VisitMatcher.java │ │ │ └── BahmniEncounterTransactionService.java │ │ └── advisor │ │ │ └── BahmniEncounterServiceAdvisor.java │ │ ├── drugorder │ │ └── mapper │ │ │ └── BahmniProviderMapper.java │ │ ├── disposition │ │ └── service │ │ │ └── BahmniDispositionService.java │ │ ├── laborder │ │ └── service │ │ │ └── LabOrderResultsService.java │ │ ├── visit │ │ └── contract │ │ │ └── VisitData.java │ │ ├── pivottable │ │ └── contract │ │ │ ├── PivotRow.java │ │ │ └── PivotTable.java │ │ └── diagnosis │ │ └── contract │ │ └── BahmniDiagnosisRequest.java │ └── resources │ └── moduleApplicationContext.xml ├── bahmni-test-commons └── src │ └── test │ ├── java │ └── org │ │ └── bahmni │ │ └── test │ │ ├── properties │ │ ├── PropertiesReader.java │ │ └── SystemPropertiesReader.java │ │ └── builder │ │ └── PersonBuilder.java │ └── resources │ └── TestingApplicationContext.xml ├── scripts ├── vagrant-deploy.sh ├── vagrant-database.sh └── docker-link.sh ├── jss-old-data └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── bahmni │ │ │ ├── datamigration │ │ │ ├── LookupValueProvider.java │ │ │ ├── DataScrub.java │ │ │ └── request │ │ │ │ ├── referencedata │ │ │ │ ├── PersonAttributeRequest.java │ │ │ │ └── PersonAttribute.java │ │ │ │ └── patient │ │ │ │ ├── CenterId.java │ │ │ │ ├── Name.java │ │ │ │ └── PatientAttribute.java │ │ │ └── jss │ │ │ └── registration │ │ │ ├── RegistrationNumber.java │ │ │ └── AllStates.java │ └── resources │ │ ├── jssApplicationContext.xml │ │ └── log4j2.xml │ └── test │ └── resources │ └── RegistrationMaster_Sample.csv ├── .gitignore ├── reference-data ├── api │ └── src │ │ └── main │ │ └── java │ │ ├── org │ │ └── bahmni │ │ │ └── module │ │ │ └── referencedata │ │ │ └── labconcepts │ │ │ ├── service │ │ │ ├── ReferenceDataDrugService.java │ │ │ ├── DrugMetaDataService.java │ │ │ ├── ConceptMetaDataService.java │ │ │ ├── ReferenceDataConceptService.java │ │ │ └── ReferenceDataConceptReferenceTermService.java │ │ │ ├── contract │ │ │ ├── RadiologyTest.java │ │ │ ├── Concepts.java │ │ │ ├── CodedTestAnswer.java │ │ │ ├── ResourceReference.java │ │ │ ├── AllTestsAndPanels.java │ │ │ ├── AllSamples.java │ │ │ ├── Department.java │ │ │ ├── ConceptSet.java │ │ │ ├── Panel.java │ │ │ └── TestsAndPanels.java │ │ │ ├── mapper │ │ │ ├── ResourceReferenceMapper.java │ │ │ ├── RadiologyTestMapper.java │ │ │ ├── DrugMetaDataMapper.java │ │ │ ├── AllTestsAndPanelsMapper.java │ │ │ ├── PanelMapper.java │ │ │ ├── LabTestMapper.java │ │ │ ├── AttributableResourceMapper.java │ │ │ └── DepartmentMapper.java │ │ │ └── validator │ │ │ └── Validator.java │ │ └── feed │ │ └── FeedActivator.java └── omod │ └── src │ ├── test │ ├── java │ │ └── org │ │ │ └── bahmni │ │ │ └── module │ │ │ └── referencedata │ │ │ └── BaseIntegrationTest.java │ └── resources │ │ └── referenceTermSetup.xml │ └── main │ ├── java │ └── org │ │ └── bahmni │ │ └── module │ │ └── referencedata │ │ └── labconcepts │ │ └── model │ │ └── event │ │ ├── ConceptServiceOperationEvent.java │ │ ├── PanelEvent.java │ │ ├── DepartmentEvent.java │ │ ├── SampleEvent.java │ │ ├── RadiologyTestEvent.java │ │ ├── AllLabSamplesEvent.java │ │ └── AllTestsPanelsConceptSetEvent.java │ └── resources │ └── webModuleApplicationContext.xml ├── bahmnicore-ui └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── bahmni │ │ │ └── module │ │ │ └── bahmnicoreui │ │ │ ├── contract │ │ │ ├── Privilege.java │ │ │ └── ConceptValue.java │ │ │ ├── service │ │ │ └── BahmniDiseaseSummaryService.java │ │ │ └── constant │ │ │ └── DiseaseSummaryConstants.java │ └── resources │ │ └── moduleApplicationContext.xml │ └── test │ └── resources │ └── TestingApplicationContext.xml ├── NOTICE ├── .codeclimate.yml ├── bahmnicore.properties ├── obs-relation └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── bahmni │ │ │ └── module │ │ │ └── obsrelationship │ │ │ ├── model │ │ │ └── ObsRelationshipType.java │ │ │ ├── dao │ │ │ └── ObsRelationshipDao.java │ │ │ └── api │ │ │ └── ObsRelationService.java │ └── resources │ │ └── obsrelation-hibernate.cfg.xml │ └── test │ └── resources │ └── test-hibernate.cfg.xml ├── bahmni-mapping └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── openmrs │ │ │ └── module │ │ │ └── bahmnimapping │ │ │ ├── dao │ │ │ ├── EntityMappingDao.java │ │ │ └── LocationEncounterTypeMapDao.java │ │ │ └── services │ │ │ └── BahmniLocationService.java │ └── resources │ │ ├── moduleApplicationContext.xml │ │ ├── EntityMappingType.hbm.xml │ │ └── EntityMapping.hbm.xml │ └── test │ └── resources │ ├── entityMappingData.xml │ └── test-hibernate.cfg.xml ├── README.md ├── .github └── workflows │ └── validate_pr.yml └── .mvn └── wrapper └── maven-wrapper.properties /bahmnicore-omod/scripts/run-compass.sh: -------------------------------------------------------------------------------- 1 | compass compile $1 2 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/dispositionConfig.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /bahmnicore-api/src/main/resources/atomfeed.properties: -------------------------------------------------------------------------------- 1 | atomdb.default_schema= -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | @MODULE_ID@.title=Bahmni Core -------------------------------------------------------------------------------- /vagrant-deploy/scripts/vagrant/openmrs_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | sudo service openmrs debug 3 | -------------------------------------------------------------------------------- /admin/src/test/resources/reference-term-source.csv: -------------------------------------------------------------------------------- 1 | Reference-term-code,Reference-term-name,Reference-term-source 2 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | @MODULE_ID@.title=Open-Elis Atom Feed Client -------------------------------------------------------------------------------- /vagrant-deploy/scripts/vagrant/openmrs_stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | set +e 3 | sudo service openmrs stop 4 | set -e 5 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_42__RemovingNotNullContraintOnOrderTypeId.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE orders MODIFY COLUMN order_type_id int NULL; -------------------------------------------------------------------------------- /bahmnicore-api/src/test/resources/SampleVideo.mkv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bahmni/bahmni-core/HEAD/bahmnicore-api/src/test/resources/SampleVideo.mkv -------------------------------------------------------------------------------- /bahmnicore-api/src/test/resources/SampleVideo.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bahmni/bahmni-core/HEAD/bahmnicore-api/src/test/resources/SampleVideo.mov -------------------------------------------------------------------------------- /admin/src/test/resources/concept_import.csv: -------------------------------------------------------------------------------- 1 | name,shortname,Synonym.1,description,class,datatype,reference-term-source,reference-term-code,reference-term-relationship -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/compass/sass/bahmnicore.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "variables"; 3 | $fontPath: "../../uicommons/fonts"; 4 | @import "reference"; 5 | -------------------------------------------------------------------------------- /admin/src/test/resources/concept_set_import.csv: -------------------------------------------------------------------------------- 1 | name,shortname,description,class,Reference-term-source,Reference-term-code,Reference-term-relationship,Child.1,Child.2 2 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/resources/labOrderAssociatedWithTestOrderData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_24__AddUniqueConstraintToPatientidentifier.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE patient_identifier ADD CONSTRAINT unique_patient_identifier UNIQUE (identifier); -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_41__AddingIndexToCityVillage-JssSpecific.sql: -------------------------------------------------------------------------------- 1 | -- JSS specific 2 | CREATE INDEX person_address_city_village ON person_address (city_village); -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/migrations/dependent-modules/V1_73__RemoveNotNullConstraintOnAddressEntryName.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE address_hierarchy_entry MODIFY name varchar(160) NULL; -------------------------------------------------------------------------------- /bahmni-test-commons/src/test/java/org/bahmni/test/properties/PropertiesReader.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.test.properties; 2 | 3 | public interface PropertiesReader { 4 | String getProperty(String key); 5 | } 6 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_68__EncounterTypeForAdmission.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO encounter_type (name, description, creator, date_created, uuid) VALUES ('ADMISSION', 'ADMISSION encounter', 1, curdate(), uuid()); -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_70__EncounterTypeForDischarge.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO encounter_type (name, description, creator, date_created, uuid) VALUES ('DISCHARGE', 'DISCHARGE encounter', 1, curdate(), uuid()); -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_78__EncounterTypeForTransfer.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO encounter_type (name, description, creator, date_created, uuid) VALUES ('TRANSFER', 'TRANSFER encounter', 1, curdate(), uuid()); -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/resources/V1_52__StartOpenElisAtomFeedSchedulerTaskToStartAutomatically.sql: -------------------------------------------------------------------------------- 1 | UPDATE scheduler_task_config SET start_on_startup = 1 WHERE name = 'OpenElis Atom Feed Client'; -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_10__SetupRegistrationEncounterType.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO encounter_type (name, description, creator, date_created, uuid) VALUES ('REG', 'Registration encounter', 1, curdate(), uuid()); -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/resources/V1_50__UpdatingOpenElisAtomFeedSchedulerTaskToRunEvery15Seconds.sql: -------------------------------------------------------------------------------- 1 | UPDATE scheduler_task_config SET repeat_interval = 15 WHERE name = 'OpenElis Atom Feed Client'; -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/resources/V1_45__UpdatingOpenElisAtomFeedSchedulerTaskToNotStartUpAutomatically.sql: -------------------------------------------------------------------------------- 1 | UPDATE scheduler_task_config SET start_on_startup = 0 WHERE name = 'OpenElis Atom Feed Client'; -------------------------------------------------------------------------------- /vagrant-deploy/scripts/vagrant/setup_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | 3 | TEMP_LOCATION=/tmp/deploy_bahmni_core 4 | 5 | if [[ ! -d $TEMP_LOCATION ]]; then 6 | mkdir $TEMP_LOCATION 7 | fi 8 | 9 | rm -rf $TEMP_LOCATION/* -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_43__AddOPDConsultationEncounterType.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO encounter_type (name, description, creator, date_created, uuid) VALUES ('OPD', 'OPD consultation encounter', 1, curdate(), uuid()); 2 | -------------------------------------------------------------------------------- /scripts/vagrant-deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | 3 | PATH_OF_CURRENT_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | cd $PATH_OF_CURRENT_SCRIPT/../ 6 | 7 | mvn clean install -nsu -DskipTests -Pvagrant-deploy 8 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/EntityDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | public interface EntityDao { 4 | 5 | public T getByUuid(String uuid, Class className); 6 | } 7 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/client/FeedClient.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.client; 2 | 3 | public interface FeedClient { 4 | void processFeed(); 5 | } 6 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/resources/patientContextDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/client/OpenElisPatientFeedClient.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.client; 2 | 3 | public interface OpenElisPatientFeedClient extends FeedClient{ 4 | } 5 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/encounterModifier/exception/CannotModifyEncounterException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.encounterModifier.exception; 2 | 3 | public class CannotModifyEncounterException extends Exception { 4 | } 5 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_61__CreatingGlobalPropertyForPatientIdentifierType.sql: -------------------------------------------------------------------------------- 1 | select uuid from patient_identifier_type where name = 'Bahmni Id' into @uuid; 2 | UPDATE global_property SET property_value = @uuid WHERE property='emr.primaryIdentifierType'; 3 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/LookupValueProvider.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration; 2 | 3 | public interface LookupValueProvider { 4 | String getLookUpValue(String key); 5 | String getLookUpValue(String key, int valueIndex); 6 | } 7 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/client/FailedEventsFeedClient.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.client; 2 | 3 | public interface FailedEventsFeedClient { 4 | void processFailedEvents(); 5 | } 6 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/security/PrivilegeConstants.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.security; 2 | 3 | public class PrivilegeConstants { 4 | public static final String DELETE_PATIENT_DOCUMENT_PRIVILEGE = "Delete Patient Document"; 5 | } 6 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/PersonNameDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | import org.bahmni.module.bahmnicore.model.ResultList; 4 | 5 | public interface PersonNameDao { 6 | 7 | public ResultList getUnique(String key, String query); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_67__AddConceptSetForAdmission.sql: -------------------------------------------------------------------------------- 1 | set @concept_id = 0; 2 | set @concept_name_short_id = 0; 3 | set @concept_name_full_id = 0; 4 | 5 | call add_concept(@concept_id, @concept_name_short_id, @concept_name_full_id, 'Admission', 'Admission', 'N/A', 'Misc', true); 6 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_69__AddConceptSetForDischarge.sql: -------------------------------------------------------------------------------- 1 | set @concept_id = 0; 2 | set @concept_name_short_id = 0; 3 | set @concept_name_full_id = 0; 4 | 5 | call add_concept(@concept_id, @concept_name_short_id, @concept_name_full_id, 'DISCHARGE', 'DISCHARGE', 'N/A', 'Misc', true); 6 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/client/OpenElisPatientFailedEventsFeedClient.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.client; 2 | 3 | public interface OpenElisPatientFailedEventsFeedClient extends FailedEventsFeedClient { 4 | } 5 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/test/resources/test-bahmnicore.properties: -------------------------------------------------------------------------------- 1 | openelis.uri=http://localhost:8080/ 2 | patient.feed.uri=http://localhost:8080/openelis/ws/feed/patient/recent 3 | feed.maxFailedEvents=10000 4 | feed.connectionTimeoutInMilliseconds=10000 5 | feed.replyTimeoutInMilliseconds=20000 6 | 7 | -------------------------------------------------------------------------------- /admin/src/test/resources/programSample.csv: -------------------------------------------------------------------------------- 1 | Sr. No.,Registration Number,Patient.Name,Patient.Husbands / Fathers name in full,Patient.AGE,Patient.Gender,Patient.Caste,Patient.Category,Patient.Occupation,Patient.Village,Program,EnrollmentDate 2 | 1,GAN200000,Dummy,Gayaram,50,M,Mehar,SC,,Achanakmar,"DIABETES PROGRAM",15-10-2012 -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/PersonAttributeDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | import org.bahmni.module.bahmnicore.model.ResultList; 4 | 5 | public interface PersonAttributeDao { 6 | 7 | public ResultList getUnique(String personAttribute, String query); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/BahmniOrderSetDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | 4 | import org.openmrs.OrderSet; 5 | 6 | import java.util.List; 7 | 8 | public interface BahmniOrderSetDao { 9 | List getOrderSetByQuery(String searchTerm); 10 | } 11 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_23__DeleteOpenMRSCorePersonAttributes.sql: -------------------------------------------------------------------------------- 1 | -- In OpenMRS Core liquibase-core-data.xml the ids are hard coded ( 1 to 7) 2 | SET foreign_key_checks = 0; 3 | delete from person_attribute_type where person_attribute_type_id >= 1 and person_attribute_type_id <= 7; 4 | SET foreign_key_checks = 1; 5 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/CIELDictionary.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore; 2 | 3 | public class CIELDictionary { 4 | public final static String WEIGHT_UUID = "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAA"; 5 | public final static String HEIGHT_UUID = "5090AAAAAAAAAAAAAAAAAAAAAAAAAAAA"; 6 | } 7 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/ApplicationDataDirectory.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | import java.io.File; 4 | 5 | public interface ApplicationDataDirectory { 6 | File getFile(String relativePath); 7 | 8 | File getFileFromConfig(String relativePath); 9 | } 10 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_10__CreatingPatientIdentifierForBahmni.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO patient_identifier_type (name, description, creator, date_created, required, uuid, location_behavior) 2 | VALUES ('JSS', 'New patient identifier type created for use by the Bahmni Registration System', 1, curdate(), 1, uuid(), 'NOT_USED'); 3 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/DataScrub.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration; 2 | 3 | public class DataScrub { 4 | 5 | public static String scrubData(String value) { 6 | if(value == null) 7 | return ""; 8 | return value.replace("\\", "").trim(); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /bahmni-test-commons/src/test/java/org/bahmni/test/properties/SystemPropertiesReader.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.test.properties; 2 | 3 | public class SystemPropertiesReader implements PropertiesReader { 4 | @Override 5 | public String getProperty(String key) { 6 | return System.getProperty(key); 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniOrderSetService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | 4 | import org.openmrs.OrderSet; 5 | 6 | import java.util.List; 7 | 8 | public interface BahmniOrderSetService { 9 | List getOrderSetByQuery(String searchTerm); 10 | } 11 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/extensions/MonthCalculationExtensionTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.extensions; 2 | 3 | import org.junit.Test; 4 | 5 | public class MonthCalculationExtensionTest { 6 | 7 | @Test 8 | public void testName() throws Exception { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_56__AddConceptDescriptionProc.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE add_concept_description (concept_id INT, 2 | description VARCHAR(250)) 3 | BEGIN 4 | INSERT INTO concept_description(uuid, concept_id, description, locale, creator, date_created) values(uuid(), concept_id, description, 'en', 1, now()); 5 | END; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .DS_Store 3 | .idea 4 | *.iml 5 | */logs/* 6 | logs/* 7 | classes/ 8 | .sass-cache 9 | .rubygems-provided 10 | .rubygems 11 | sass-external 12 | bahmnicore-omod/src/main/webapp/resources/styles/bahmnicore.css 13 | .mvn/wrapper/*.jar 14 | .vscode 15 | 16 | 17 | # Eclipse project files 18 | .settings 19 | .classpath 20 | .project 21 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/drugogram/contract/TableExtension.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.drugogram.contract; 2 | 3 | public interface TableExtension { 4 | 5 | void update(T table); 6 | void update(T table, String patientUuid); 7 | void update(T table, String patientUuid, String patientProgramUuid); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_25__RegistrationConceptSetFix.sql: -------------------------------------------------------------------------------- 1 | select concept.concept_id from concept, concept_name where concept_name.concept_id = concept.concept_id and concept_name.name = 'REGISTRATION_CONCEPTS' into @concept_id; 2 | update concept set is_set = 1 where concept_id = @concept_id; 3 | delete from concept_set where concept_id = concept_set; -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniProgramServiceValidator.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.PatientProgram; 4 | import org.openmrs.api.APIException; 5 | 6 | public interface BahmniProgramServiceValidator { 7 | void validate(PatientProgram patientProgram) throws APIException; 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/SqlSearchParamStore.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import java.util.Map; 4 | 5 | public interface SqlSearchParamStore { 6 | void initQueryParamStore(); 7 | 8 | boolean isInitialized(); 9 | 10 | Map getSearchableParameters(); 11 | } 12 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_80__AddConceptNumericProc.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE add_concept_numeric (concept_id INT, 2 | low_normal DOUBLE, 3 | hi_normal DOUBLE, 4 | units VARCHAR(50)) 5 | BEGIN 6 | INSERT INTO concept_numeric (concept_id, low_normal, hi_normal, units) values (concept_id, low_normal, hi_normal, units); 7 | END; 8 | 9 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/request/referencedata/PersonAttributeRequest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration.request.referencedata; 2 | 3 | public class PersonAttributeRequest { 4 | private String display; 5 | private String uuid; 6 | private String value; 7 | private String attributeType; 8 | private String voided; 9 | } -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/service/ReferenceDataDrugService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.service; 2 | 3 | 4 | import org.bahmni.module.referencedata.labconcepts.contract.Drug; 5 | 6 | public interface ReferenceDataDrugService { 7 | public org.openmrs.Drug saveDrug(Drug drug); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-ui/src/main/java/org/bahmni/module/bahmnicoreui/contract/Privilege.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicoreui.contract; 2 | 3 | public class Privilege { 4 | private String name; 5 | 6 | public Privilege(String name) { 7 | this.name = name; 8 | } 9 | 10 | public String getName() { 11 | return name; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/error/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model.error; 2 | 3 | public class ErrorMessage { 4 | public static String ExistingPatientMessagePart = "already in use by another patient"; 5 | public static String ExistingCustomerMessagePart = "Customer with id, name already exists"; 6 | } 7 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_66__addConceptConsultationNote.sql: -------------------------------------------------------------------------------- 1 | set @concept_id = 0; 2 | set @concept_name_short_id = 0; 3 | set @concept_name_full_id = 0; 4 | 5 | call add_concept(@concept_id, @concept_name_short_id, @concept_name_full_id, 'Consultation Note', 'consultation note', 'Text', 'Misc', false); 6 | call add_concept_description(@concept_id, 'Consultation Note'); -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/java/org/bahmni/module/bahmnicore/web/v1_0/MvcConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0; 2 | 3 | import org.springframework.web.bind.annotation.ControllerAdvice; 4 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 5 | 6 | @EnableWebMvc 7 | @ControllerAdvice 8 | public class MvcConfiguration { 9 | } 10 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/obscalculator/ObsValueCalculator.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.obscalculator; 2 | 3 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniEncounterTransaction; 4 | 5 | public interface ObsValueCalculator { 6 | void run(BahmniEncounterTransaction bahmniEncounterTransaction); 7 | } 8 | -------------------------------------------------------------------------------- /admin/src/test/resources/visitAttributeDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2018 OpenMRS, Inc 2 | 3 | This product includes software developed under the stewardship of the Bahmni Coalition, under fiscal sponsorship of OpenMRS, Inc. (http://www.openmrs.org/) 4 | 5 | This product includes software developed at ThoughtWorks, Inc (http://www.thoughtworks.com/) 6 | 7 | This software contains code derived from the RAXA-Core (https://github.com/Raxa/raxacore) -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/bahmniexceptions/FileTypeNotSupportedException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.bahmniexceptions; 2 | 3 | import org.openmrs.api.APIException; 4 | 5 | public class FileTypeNotSupportedException extends APIException { 6 | public FileTypeNotSupportedException(String message) { 7 | super(message); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/resources/visitAttributeDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/resources/search/bacteriologySpecimen/programEpisodeMapping.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/elisFeedInterceptor/ElisFeedEncounterInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.elisFeedInterceptor; 2 | 3 | import org.openmrs.Encounter; 4 | 5 | import java.util.Set; 6 | 7 | public interface ElisFeedEncounterInterceptor { 8 | void run(Set encounters); 9 | } 10 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/document/service/VisitDocumentService.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.document.service; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.module.bahmniemrapi.document.contract.VisitDocumentRequest; 5 | 6 | public interface VisitDocumentService { 7 | Encounter upload(VisitDocumentRequest visitDocumentRequest); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_59__AddConceptSetMembersProc.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE add_concept_set_members (set_concept_id INT, 2 | member_concept_id INT,weight INT) 3 | BEGIN 4 | INSERT INTO concept_set (concept_id, concept_set,sort_weight,creator,date_created,uuid) 5 | values (member_concept_id, set_concept_id,weight,1, now(),uuid()); 6 | END; 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /admin/src/test/resources/baseMetaData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/bahmniexceptions/VideoFormatNotSupportedException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.bahmniexceptions; 2 | 3 | import org.openmrs.api.APIException; 4 | 5 | public class VideoFormatNotSupportedException extends APIException{ 6 | public VideoFormatNotSupportedException(String message) { 7 | super(message); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/BahmniAddressHierarchyDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | import org.bahmni.module.bahmnicore.model.BahmniAddressHierarchyEntry; 4 | 5 | import java.util.List; 6 | 7 | public interface BahmniAddressHierarchyDao { 8 | List getAddressHierarchyEntriesByUuid(List uuids); 9 | } 10 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/elisFeedInterceptor/ElisFeedAccessionInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.elisFeedInterceptor; 2 | 3 | import org.bahmni.module.elisatomfeedclient.api.domain.OpenElisAccession; 4 | 5 | public interface ElisFeedAccessionInterceptor { 6 | void run(OpenElisAccession openElisAccession); 7 | } 8 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/service/DrugMetaDataService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.service; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.model.DrugMetaData; 4 | 5 | public interface DrugMetaDataService { 6 | public DrugMetaData getDrugMetaData(org.bahmni.module.referencedata.labconcepts.contract.Drug drug); 7 | } 8 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/BahmniCoreException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore; 2 | 3 | 4 | public class BahmniCoreException extends ApplicationError { 5 | public BahmniCoreException(String message, Throwable cause) { 6 | super(message, cause); 7 | } 8 | 9 | public BahmniCoreException(String message) { 10 | super(message); 11 | } 12 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/ThumbnailGenerator.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import java.awt.image.BufferedImage; 4 | import java.io.File; 5 | import java.io.IOException; 6 | 7 | public interface ThumbnailGenerator { 8 | boolean isFormatSupported(String format); 9 | BufferedImage generateThumbnail(File video) throws IOException; 10 | } 11 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/test/resources/TestingApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/test/resources/visitAttributeDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /reference-data/omod/src/test/java/org/bahmni/module/referencedata/BaseIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata; 2 | 3 | import org.bahmni.test.web.controller.BaseWebControllerTest; 4 | 5 | @org.springframework.test.context.ContextConfiguration(locations = {"classpath:TestingApplicationContext.xml"}, inheritLocations = true) 6 | public class BaseIntegrationTest extends BaseWebControllerTest { 7 | } 8 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniAddressHierarchyService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.bahmni.module.bahmnicore.model.BahmniAddressHierarchyEntry; 4 | 5 | import java.util.List; 6 | 7 | public interface BahmniAddressHierarchyService { 8 | List getAddressHierarchyEntriesByUuid(List uuids); 9 | } 10 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/BahmniEmrAPIException.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi; 2 | 3 | 4 | public class BahmniEmrAPIException extends RuntimeException { 5 | public BahmniEmrAPIException(String message, Throwable cause) { 6 | super(message, cause); 7 | } 8 | 9 | public BahmniEmrAPIException(String message) { 10 | super(message); 11 | } 12 | } -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/java/org/bahmni/module/bahmnicore/web/v1_0/BaseIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0; 2 | 3 | import org.bahmni.test.web.controller.BaseWebControllerTest; 4 | 5 | @org.springframework.test.context.ContextConfiguration(locations = {"classpath:TestingApplicationContext.xml"}, inheritLocations = true) 6 | public class BaseIntegrationTest extends BaseWebControllerTest { 7 | } 8 | -------------------------------------------------------------------------------- /vagrant-deploy/scripts/vagrant/deploy_omods.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | 3 | TEMP_LOCATION=/tmp/deploy_bahmni_core 4 | USER=bahmni_support 5 | #USER=jss 6 | OMOD_LOCATION=/opt/openmrs/modules 7 | 8 | sudo rm -f $OMOD_LOCATION/bahmnicore*.omod 9 | sudo rm -f $OMOD_LOCATION/openelis-atomfeed-client*.omod 10 | sudo rm -f $OMOD_LOCATION/reference-data*.omod 11 | 12 | sudo su - $USER -c "sudo cp -f $TEMP_LOCATION/* $OMOD_LOCATION" 13 | -------------------------------------------------------------------------------- /admin/src/test/java/org/bahmni/module/admin/BaseIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin; 2 | 3 | import org.openmrs.web.test.BaseModuleWebContextSensitiveTest; 4 | import org.springframework.test.context.ContextConfiguration; 5 | 6 | @ContextConfiguration(locations = {"classpath:TestingApplicationContext.xml"}, inheritLocations = true) 7 | public class BaseIntegrationTest extends BaseModuleWebContextSensitiveTest { 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_30__AddConceptAnswerProc.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE add_concept_answer (concept_id INT, 2 | answer_concept_id INT, 3 | sort_weight DOUBLE) 4 | BEGIN 5 | INSERT INTO concept_answer (concept_id, answer_concept, answer_drug, date_created, creator, uuid, sort_weight) values (concept_id, answer_concept_id, null, now(), 1, uuid(), sort_weight); 6 | END; -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/java/org/bahmni/module/bahmnicore/web/v1_0/contract/BahmniMailContent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0.contract; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | import org.bahmni.module.communication.model.MailContent; 7 | 8 | @Getter 9 | @Setter 10 | @AllArgsConstructor 11 | public class BahmniMailContent extends MailContent { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/resources/V1_44__AddingSchedulerTaskToProcessOpenElisPatientFeed.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO scheduler_task_config(name, schedulable_class, start_time, start_time_pattern, repeat_interval, start_on_startup, started, created_by, date_created, uuid) 2 | VALUES ('OpenElis Atom Feed Client', 'org.bahmni.module.elisatomfeedclient.api.task.OpenElisAtomFeedTask', now(), 'MM/dd/yyyy HH:mm:ss', 60, 1, 1, 1, curdate(), uuid()); -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | engines: 3 | duplication: 4 | enabled: true 5 | config: 6 | languages: 7 | - ruby 8 | - javascript 9 | - python 10 | - php 11 | fixme: 12 | enabled: true 13 | rubocop: 14 | enabled: true 15 | ratings: 16 | paths: 17 | - "**.inc" 18 | - "**.js" 19 | - "**.jsx" 20 | - "**.module" 21 | - "**.php" 22 | - "**.py" 23 | - "**.rb" 24 | exclude_paths: [] 25 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/BaseIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi; 2 | 3 | import org.openmrs.test.BaseModuleContextSensitiveTest; 4 | import org.springframework.test.context.ContextConfiguration; 5 | 6 | @ContextConfiguration(locations = {"classpath:TestingApplicationContext.xml"}, inheritLocations = true) 7 | public class BaseIntegrationTest extends BaseModuleContextSensitiveTest { 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/BaseIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore; 2 | 3 | import org.springframework.test.context.ContextConfiguration; 4 | import org.openmrs.web.test.BaseModuleWebContextSensitiveTest; 5 | 6 | @ContextConfiguration(locations = {"classpath:TestingApplicationContext.xml"}, inheritLocations = true) 7 | public class BaseIntegrationTest extends BaseModuleWebContextSensitiveTest { 8 | } 9 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/command/EncounterDataPreSaveCommand.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.command; 2 | 3 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniEncounterTransaction; 4 | 5 | public interface EncounterDataPreSaveCommand { 6 | 7 | BahmniEncounterTransaction update(BahmniEncounterTransaction bahmniEncounterTransaction); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/visit/EncounterType.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.visit; 2 | 3 | public enum EncounterType { 4 | ADMISSION ("ADMISSION"), 5 | DISHCARGE ("DISCHARGE"); 6 | 7 | private final String name; 8 | 9 | EncounterType(String name) { 10 | this.name = name; 11 | } 12 | 13 | public String getName() { 14 | return name; 15 | } 16 | } -------------------------------------------------------------------------------- /admin/src/test/resources/patientMatchingAlgorithm/NoMatch.groovy: -------------------------------------------------------------------------------- 1 | package patientMatchingAlgorithm; 2 | 3 | import org.bahmni.module.admin.csv.patientmatchingalgorithm.PatientMatchingAlgorithm 4 | import org.openmrs.Patient; 5 | 6 | 7 | public class NoMatch extends PatientMatchingAlgorithm{ 8 | 9 | 10 | @Override 11 | Patient run(List patientList, List patientAttributes) { 12 | return null 13 | } 14 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/test/resources/programAttributesDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/service/ConceptMetaDataService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.service; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.ConceptCommon; 4 | import org.bahmni.module.referencedata.labconcepts.model.ConceptMetaData; 5 | 6 | public interface ConceptMetaDataService { 7 | public ConceptMetaData getConceptMetaData(ConceptCommon conceptCommon); 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-ui/src/main/java/org/bahmni/module/bahmnicoreui/service/BahmniDiseaseSummaryService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicoreui.service; 2 | 3 | import org.bahmni.module.bahmnicoreui.contract.DiseaseDataParams; 4 | import org.bahmni.module.bahmnicoreui.contract.DiseaseSummaryData; 5 | 6 | public interface BahmniDiseaseSummaryService { 7 | 8 | DiseaseSummaryData getDiseaseSummary(String patientUuid, DiseaseDataParams queryParams); 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/exception/OpenElisFeedException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.exception; 2 | 3 | public class OpenElisFeedException extends RuntimeException { 4 | public OpenElisFeedException(String message, Exception e) { 5 | super(message, e); 6 | } 7 | 8 | public OpenElisFeedException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/SqlSearchService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.annotation.Authorized; 4 | import org.openmrs.module.webservices.rest.SimpleObject; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | public interface SqlSearchService { 10 | 11 | @Authorized 12 | public List search(String sqlQuery, Map params); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/service/impl/BahmniFeedDrugOrderServiceImplTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service.impl; 2 | 3 | import org.junit.Rule; 4 | import org.junit.rules.ExpectedException; 5 | 6 | public class BahmniFeedDrugOrderServiceImplTest { 7 | public static final String TEST_VISIT_TYPE = "TEST VISIT TYPE"; 8 | 9 | @Rule 10 | public ExpectedException expectedException = ExpectedException.none(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /bahmnicore-ui/src/test/resources/TestingApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/request/patient/CenterId.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration.request.patient; 2 | 3 | public class CenterId { 4 | private String name; 5 | 6 | public CenterId(String name) { 7 | this.name = name; 8 | } 9 | 10 | public String getName() { 11 | return name == null ? null : name.toUpperCase(); 12 | } 13 | 14 | public void setName(String name) { 15 | this.name = name; 16 | } 17 | } -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/mapper/BahmniComplexDataMapper.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.mapper; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.obs.ComplexData; 5 | 6 | import java.io.Serializable; 7 | 8 | public interface BahmniComplexDataMapper { 9 | Serializable map(ComplexData complexData); 10 | boolean canHandle(final Concept concept, ComplexData complexData); 11 | } 12 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/resources/notesData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniVisitService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.Visit; 5 | 6 | import java.util.List; 7 | 8 | public interface BahmniVisitService { 9 | public Visit getLatestVisit(String patientUuid, String conceptName); 10 | 11 | Visit getVisitSummary(String visitUuid); 12 | 13 | List getAdmitAndDischargeEncounters(Integer visitId); 14 | } 15 | -------------------------------------------------------------------------------- /jss-old-data/src/main/resources/jssApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/obs/ObservationsAdder.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.obs; 2 | 3 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniObservation; 4 | 5 | import java.text.ParseException; 6 | import java.util.Collection; 7 | import java.util.List; 8 | 9 | public interface ObservationsAdder { 10 | 11 | void addObservations(Collection observations, List conceptNames) throws ParseException; 12 | } 13 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/RadiologyTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class RadiologyTest extends Resource { 7 | public static final List RADIOLOGY_TEST_CONCEPT_CLASSES = Arrays.asList("Radiology", "Radiology/Imaging Procedure"); 8 | public static final String RADIOLOGY_TEST_PARENT_CONCEPT_NAME = "Radiology"; 9 | } 10 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/ConceptServiceOperationEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.ict4h.atomfeed.server.service.Event; 4 | 5 | import java.net.URISyntaxException; 6 | 7 | public interface ConceptServiceOperationEvent { 8 | public Event asAtomFeedEvent(Object[] arguments) throws URISyntaxException; 9 | public Boolean isApplicable(String operation, Object[] arguments); 10 | } 11 | -------------------------------------------------------------------------------- /bahmnicore.properties: -------------------------------------------------------------------------------- 1 | openerp.port=8069 2 | openerp.host=localhost 3 | openerp.database=openerp 4 | openerp.user=admin 5 | openerp.password=password 6 | openerp.connectionTimeoutInMilliseconds=10000 7 | openerp.replyTimeoutInMilliseconds=20000 8 | 9 | bahmnicore.datamigration.mode=false 10 | 11 | #Make sure this directory exists 12 | bahmnicore.images.directory=/tmp/patient_images 13 | bahmnicore.urls.patientimages=http://localhost:8080/patient_images 14 | 15 | bahmnicore.documents.baseDirectory=/home/jss/document_images -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/encounterModifier/EncounterModifier.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.encounterModifier; 2 | 3 | import org.bahmni.module.bahmnicore.contract.encounter.data.EncounterModifierData; 4 | import org.bahmni.module.bahmnicore.encounterModifier.exception.CannotModifyEncounterException; 5 | 6 | public abstract class EncounterModifier { 7 | public abstract EncounterModifierData run(EncounterModifierData encounterModifierData) throws CannotModifyEncounterException; 8 | } 9 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/error/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model.error; 2 | 3 | public class ErrorCode { 4 | public static int DuplicatePatient = 1; 5 | public static int DuplicateCustomer = 2; 6 | public static int OpenERPError = 3; 7 | public static int OpenMRSError = 4; 8 | 9 | public static boolean duplicationError(int errorCode) { 10 | return errorCode == DuplicateCustomer || errorCode == DuplicatePatient; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /obs-relation/src/main/java/org/bahmni/module/obsrelationship/model/ObsRelationshipType.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.obsrelationship.model; 2 | 3 | import org.openmrs.BaseOpenmrsMetadata; 4 | 5 | 6 | public class ObsRelationshipType extends BaseOpenmrsMetadata implements java.io.Serializable{ 7 | private int id; 8 | 9 | @Override 10 | public Integer getId() { 11 | return this.id; 12 | } 13 | 14 | @Override 15 | public void setId(Integer id) { 16 | this.id = id; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /admin/src/test/resources/sample.csv: -------------------------------------------------------------------------------- 1 | Sr. No.,Registration Number,encounterType,visitType,Patient.Name,Patient.Husbands / Fathers name in full,Patient.AGE,Patient.Gender,Patient.Caste,Patient.Category,Patient.Occupation,Patient.Village,Patient.Cluster,Patient.Block,Repeat.1.EncounterDate,Repeat.1.Diagnosis.diagnosis1,Repeat.1.Obs.Weight,Repeat.1.Obs.Height,Repeat.2.EncounterDate,Repeat.2.Obs.Weight,Repeat.2.Obs.Height 1,6424,Consultation,OPD,Ganesh ram Mehar,Gayaram,50,M,Mehar,SC,,Achanakmar,4,,26-10-2012,"Diabetes, Type 1",51.75,,19-6-2013,48.7, -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/jss/registration/RegistrationNumber.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.jss.registration; 2 | 3 | public class RegistrationNumber { 4 | private String centerCode; 5 | private String id; 6 | 7 | public RegistrationNumber(String centerCode, String id) { 8 | this.centerCode = centerCode; 9 | this.id = id; 10 | } 11 | 12 | public String getCenterCode() { 13 | return centerCode; 14 | } 15 | 16 | public String getId() { 17 | return id; 18 | } 19 | } -------------------------------------------------------------------------------- /bahmni-test-commons/src/test/java/org/bahmni/test/builder/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.test.builder; 2 | 3 | import org.openmrs.Person; 4 | 5 | public class PersonBuilder { 6 | 7 | private final Person person; 8 | 9 | public PersonBuilder() { 10 | person = new Person(); 11 | } 12 | 13 | public PersonBuilder withUUID(String patientUuid) { 14 | person.setUuid(patientUuid); 15 | return this; 16 | } 17 | 18 | public Person build() { 19 | return person; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/BillingSystemException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore; 2 | 3 | import org.openmrs.Patient; 4 | 5 | public class BillingSystemException extends ApplicationError { 6 | private Patient patient; 7 | 8 | public BillingSystemException(String message, Throwable throwable, Patient patient) { 9 | super(message, throwable); 10 | this.patient = patient; 11 | } 12 | 13 | public Patient getPatient() { 14 | return patient; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/TsConceptSearchService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.annotation.Authorized; 4 | import org.openmrs.api.OpenmrsService; 5 | import org.openmrs.module.webservices.rest.SimpleObject; 6 | 7 | import java.util.List; 8 | 9 | public interface TsConceptSearchService extends OpenmrsService { 10 | @Authorized(value = {"Get Concepts"}) 11 | List getConcepts(String query, Integer limit, String locale); 12 | } 13 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/ResultList.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class ResultList { 7 | 8 | private List results; 9 | 10 | public ResultList(List results) { 11 | this.results = results == null ? new ArrayList() : results; 12 | } 13 | 14 | public List getResults() { 15 | return results; 16 | } 17 | 18 | public int size() { 19 | return results.size(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_39__CreateLaboratoryPanelConcept.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO concept (datatype_id,class_id,is_set,creator,date_created,changed_by,date_changed,uuid) VALUES (4,8,true,1,{ts '2013-07-23 11:26:35'},1,{ts '2013-07-23 11:26:35'},uuid()); 2 | 3 | select max(concept_id) from concept into @laboratory_concept_id; 4 | 5 | insert into concept_name(concept_id, name, locale, locale_preferred,creator, date_created, concept_name_type, uuid) values (@laboratory_concept_id, 'Laboratory', 'en', true, 1, {ts '2013-07-23 11:26:35'}, 'FULLY_SPECIFIED', uuid()); -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/csv/patientmatchingalgorithm/BahmniPatientMatchingAlgorithm.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.csv.patientmatchingalgorithm; 2 | 3 | import org.bahmni.csv.KeyValue; 4 | import org.openmrs.Patient; 5 | 6 | import java.util.List; 7 | 8 | public class BahmniPatientMatchingAlgorithm extends PatientMatchingAlgorithm { 9 | @Override 10 | public Patient run(List patientList, List patientAttributes) { 11 | return patientList.size() > 0 ? patientList.get(0) : null; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /admin/src/test/resources/patientMatchingAlgorithm/MultipleMatchPatient.groovy: -------------------------------------------------------------------------------- 1 | import org.bahmni.module.admin.csv.patientmatchingalgorithm.PatientMatchingAlgorithm 2 | import org.bahmni.module.admin.csv.patientmatchingalgorithm.exception.CannotMatchPatientException 3 | import org.openmrs.Patient 4 | 5 | public class MultipleMatchPatient extends PatientMatchingAlgorithm { 6 | @Override 7 | Patient run(List patientList, List patientAttributes) { 8 | throw new CannotMatchPatientException(patientList); 9 | } 10 | } -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/drugogram/contract/BaseTableExtension.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.drugogram.contract; 2 | 3 | public class BaseTableExtension implements TableExtension { 4 | 5 | @Override 6 | public void update(T table) { 7 | //Do nothing 8 | } 9 | 10 | @Override 11 | public void update(T table, String patientUuid) { 12 | //Do nothing 13 | } 14 | 15 | @Override 16 | public void update(T table, String patientUuid, String patientProgramUuid) { 17 | //Do nothing 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/config/service/BahmniConfigService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.config.service; 2 | 3 | import org.bahmni.module.admin.config.model.BahmniConfig; 4 | 5 | import java.util.List; 6 | 7 | public interface BahmniConfigService { 8 | BahmniConfig get(String appName, String configName); 9 | 10 | List getAllFor(String appName); 11 | 12 | BahmniConfig save(BahmniConfig bahmniConfig); 13 | 14 | BahmniConfig update(BahmniConfig bahmniConfig); 15 | 16 | List getAll(); 17 | } 18 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/ResourceReferenceMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.ResourceReference; 4 | import org.openmrs.Concept; 5 | import org.openmrs.api.context.Context; 6 | 7 | public class ResourceReferenceMapper { 8 | public ResourceReference map(Concept concept) { 9 | return new ResourceReference(concept.getUuid(), concept.getName(Context.getLocale()).getName()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/events/BahmniEventType.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.events; 2 | 3 | public enum BahmniEventType { 4 | BAHMNI_PATIENT_CREATED("bahmni-patient"), 5 | BAHMNI_PATIENT_UPDATED("bahmni-patient"), 6 | BAHMNI_ENCOUNTER_CREATED("bahmni-encounter"), 7 | BAHMNI_ENCOUNTER_UPDATED("bahmni-encounter"); 8 | 9 | private final String topic; 10 | BahmniEventType(String topic) { 11 | this.topic = topic; 12 | } 13 | public String topic() { 14 | return topic; 15 | } 16 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/impl/BahmniProgramServiceValidatorImpl.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service.impl; 2 | 3 | import org.bahmni.module.bahmnicore.service.BahmniProgramServiceValidator; 4 | import org.openmrs.PatientProgram; 5 | import org.openmrs.api.APIException; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class BahmniProgramServiceValidatorImpl implements BahmniProgramServiceValidator { 10 | public void validate(PatientProgram patientProgram) throws APIException {} 11 | } 12 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/extensions/MonthCalculationExtension.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.extensions; 2 | 3 | import org.openmrs.module.bahmniemrapi.drugogram.contract.BaseTableExtension; 4 | import org.openmrs.module.bahmniemrapi.drugogram.contract.TreatmentRegimen; 5 | 6 | public class MonthCalculationExtension extends BaseTableExtension { 7 | 8 | @Override 9 | public void update(TreatmentRegimen treatmentRegimen, String patientUuid, String patientProgramUuid) { 10 | // Do nothing 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/validator/Validator.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.validator; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.openmrs.api.APIException; 5 | 6 | import java.util.List; 7 | 8 | public class Validator { 9 | public void throwExceptionIfExists(List errors) { 10 | String message = StringUtils.join(errors, "\n"); 11 | if (!StringUtils.isBlank(message)) { 12 | throw new APIException(message); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /bahmni-mapping/src/main/java/org/openmrs/module/bahmnimapping/dao/EntityMappingDao.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmnimapping.dao; 2 | 3 | import org.openmrs.module.bahmnimapping.model.EntityMapping; 4 | import org.openmrs.module.bahmnimapping.model.EntityMappingType; 5 | 6 | import java.util.List; 7 | 8 | public interface EntityMappingDao { 9 | List getMappingsOfEntity(String entity1Uuid, String mappingTypeName); 10 | List getAllEntityMappings(String mappingTypeName); 11 | EntityMappingType getEntityMappingTypeByName(String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_55__addLabAndRadiologyOrderTypes.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO order_type (`name`,`description`,`creator`,`date_created`,`retired`,`retired_by`,`date_retired`,`retire_reason`,`uuid`,`java_class_name`) 2 | VALUES ('Lab Order','An order for laboratory tests',1,NOW(),0,NULL,NULL,NULL,UUID(),'org.openmrs.Order'); 3 | 4 | INSERT INTO order_type (`name`,`description`,`creator`,`date_created`,`retired`,`retired_by`,`date_retired`,`retire_reason`,`uuid`,`java_class_name`) 5 | VALUES ('Radiology Order','An order for radiology tests',1,NOW(),0,NULL,NULL,NULL,UUID(),'org.openmrs.Order'); 6 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/config/dao/BahmniConfigDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.config.dao; 2 | 3 | import org.bahmni.module.admin.config.model.BahmniConfig; 4 | 5 | import java.util.List; 6 | 7 | public interface BahmniConfigDao { 8 | BahmniConfig get(String appName, String configName); 9 | 10 | BahmniConfig get(String uuid); 11 | 12 | List getAllFor(String appName); 13 | 14 | BahmniConfig save(BahmniConfig bahmniConfig); 15 | 16 | BahmniConfig update(BahmniConfig existingConfig); 17 | 18 | List getAll(); 19 | } 20 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/events/EncounterEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.events; 2 | 3 | import org.openmrs.Encounter; 4 | 5 | public class EncounterEvent extends BahmniEvent { 6 | 7 | private Encounter encounter; 8 | 9 | public EncounterEvent(BahmniEventType bahmniEventType, Encounter encounter) { 10 | super(bahmniEventType); 11 | this.encounter = encounter; 12 | this.payloadId=encounter.getUuid(); 13 | } 14 | 15 | public Encounter getEncounter() { 16 | return encounter; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_11__CreateConceptSetForRegistrationConcepts.sql: -------------------------------------------------------------------------------- 1 | -- This is a concept for concept-set 2 | insert into concept (datatype_id, class_id, is_set, creator, date_created, changed_by, date_changed, uuid) 3 | values (1, 10, 0, 1, now(), 1, now(), uuid()); 4 | select max(concept_id) from concept into @registration_concepts_concept_id; 5 | insert into concept_name (concept_id, name, locale, locale_preferred, creator, date_created, concept_name_type, uuid) 6 | values (@registration_concepts_concept_id, 'REGISTRATION_CONCEPTS', 'en', 1, 1, now(), 'FULLY_SPECIFIED', uuid()); 7 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_81__DeleteConcept.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE delete_concept (name_concept VARCHAR(255)) 2 | BEGIN 3 | DECLARE conceptId INT default 0; 4 | 5 | select concept_id INTO conceptId from concept_name where name = name_concept and locale_preferred = 1; 6 | delete from concept_set where concept_set = conceptId; 7 | delete from concept_name where concept_id = conceptId; 8 | delete from concept_numeric where concept_id = conceptId; 9 | delete from concept_answer where concept_id = conceptId; 10 | delete from concept where concept_id = conceptId; 11 | END; -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/DiseaseTemplateService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.bahmni.module.bahmnicore.contract.diseasetemplate.DiseaseTemplate; 4 | import org.bahmni.module.bahmnicore.contract.diseasetemplate.DiseaseTemplatesConfig; 5 | 6 | import java.util.List; 7 | 8 | public interface DiseaseTemplateService { 9 | 10 | List allDiseaseTemplatesFor(DiseaseTemplatesConfig diseaseTemplatesConfig); 11 | 12 | DiseaseTemplate diseaseTemplateFor(DiseaseTemplatesConfig diseaseTemplatesConfig); 13 | } 14 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/java/org/bahmni/module/bahmnicore/web/v1_0/VisitClosedException.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0; 2 | 3 | import org.openmrs.api.APIException; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.web.bind.annotation.ResponseStatus; 6 | 7 | @ResponseStatus(value = HttpStatus.FORBIDDEN, reason = "Visit for this patient is closed. You cannot do an 'Undo Discharge' for the patient.") 8 | public class VisitClosedException extends APIException { 9 | public VisitClosedException(String message){ 10 | super(message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/drugorder/mapper/BahmniProviderMapper.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.drugorder.mapper; 2 | 3 | import org.openmrs.Provider; 4 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 5 | 6 | public class BahmniProviderMapper { 7 | public EncounterTransaction.Provider map(Provider provider) { 8 | EncounterTransaction.Provider result = new EncounterTransaction.Provider(); 9 | result.setUuid(provider.getUuid()); 10 | result.setName(provider.getName()); 11 | return result; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bahmnicore-ui/src/main/java/org/bahmni/module/bahmnicoreui/contract/ConceptValue.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicoreui.contract; 2 | 3 | public class ConceptValue { 4 | private String value; 5 | 6 | private Boolean abnormal; 7 | 8 | public Boolean getAbnormal() { 9 | return abnormal; 10 | } 11 | 12 | public void setAbnormal(Boolean abnormal) { 13 | this.abnormal = abnormal; 14 | } 15 | 16 | public String getValue() { 17 | return value; 18 | } 19 | 20 | public void setValue(String value) { 21 | this.value = value; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/resources/obscalculator/BahmniObsValueCalculator.groovy: -------------------------------------------------------------------------------- 1 | package obscalculator 2 | 3 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniEncounterTransaction 4 | import org.openmrs.module.bahmniemrapi.obscalculator.ObsValueCalculator 5 | 6 | public class TestObsValueCalculator implements ObsValueCalculator { 7 | 8 | public static String DEFAULT_ENCOUNTER_UUID = "defaultEncounterUuid" 9 | 10 | @Override 11 | void run(BahmniEncounterTransaction bahmniEncounterTransaction) { 12 | bahmniEncounterTransaction.setEncounterUuid(DEFAULT_ENCOUNTER_UUID) 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /bahmni-test-commons/src/test/resources/TestingApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/ApplicationError.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore; 2 | 3 | public class ApplicationError extends RuntimeException { 4 | private int errorCode; 5 | 6 | public ApplicationError(String message, Throwable throwable) { 7 | super(message, throwable); 8 | } 9 | 10 | public ApplicationError(String message) { 11 | super(message); 12 | } 13 | 14 | public int getErrorCode() { 15 | return errorCode; 16 | } 17 | 18 | public void setErrorCode(int errorCode) { 19 | this.errorCode = errorCode; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/forms2/service/BahmniFormDetailsService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.forms2.service; 2 | 3 | import org.bahmni.module.bahmnicore.forms2.contract.FormDetails; 4 | import org.bahmni.module.bahmnicore.forms2.contract.FormType; 5 | 6 | import java.util.Collection; 7 | 8 | public interface BahmniFormDetailsService { 9 | Collection getFormDetails(String patientUuid, FormType formType, int numberOfVisits); 10 | 11 | Collection getFormDetails(String patientUuid, FormType formType, String visitUuid, String patientProgramUuid); 12 | } 13 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/command/EncounterDataPostSaveCommand.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.command; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniEncounterTransaction; 5 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 6 | 7 | public interface EncounterDataPostSaveCommand { 8 | 9 | EncounterTransaction save(BahmniEncounterTransaction bahmniEncounterTransaction, Encounter currentEncounter, EncounterTransaction updatedEncounterTransaction); 10 | } 11 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniEncounterModifierService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.bahmni.module.bahmnicore.contract.encounter.data.EncounterModifierData; 4 | import org.bahmni.module.bahmnicore.encounterModifier.exception.CannotModifyEncounterException; 5 | 6 | import java.io.IOException; 7 | 8 | public interface BahmniEncounterModifierService { 9 | public EncounterModifierData getModifiedEncounter(EncounterModifierData encounterModifierData) throws IllegalAccessException, IOException, InstantiationException, CannotModifyEncounterException; 10 | } 11 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/RadiologyTestMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.RadiologyTest; 4 | import org.openmrs.Concept; 5 | 6 | public class RadiologyTestMapper extends ResourceMapper { 7 | public RadiologyTestMapper() { 8 | super(RadiologyTest.RADIOLOGY_TEST_PARENT_CONCEPT_NAME); 9 | } 10 | 11 | @Override 12 | public RadiologyTest map(Concept testConcept) { 13 | return mapResource(new RadiologyTest(), testConcept); 14 | } 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jss-old-data/src/test/resources/RegistrationMaster_Sample.csv: -------------------------------------------------------------------------------- 1 | REG_NO,REG_DATE,FNAME,LNAME,FHNAME,P_SEX,P_DOB,P_AGE,P_HEIGHT,P_WEIGHT,VILLAGE,CITY,P_POST,EDUCATION,OCCUPATION,P_MEMBER,P_TB,BALANCE_AMT,Remark,FNameID,CasteID,FHNameID,EducationID,OccupationID,VillageID,TahsilID,DistrictID,TahsilID2,VillageID2,Neighborhood,GramPanchID,LNameID,ClassID,memberVillageID,GramPanch,Tahsil 52174/GAN,29/07/2005 00:00:00,UMASHANKAR,,VISHAL,M,05/08/79 0:00,26,,34.6,DEVARI,,BHARANI,,,,0,0,,20937,1,21393,0,0,3084,1,0,0,0,,0,2,0,0,, 8370/GAN,27/06/2003 00:00:00,Binda Bai Goswami,,Kunj Bharati,F,,y/70,,52,Patharra,,Peepertarai,,,,0,0,,2931,1,28226,0,0,8846,1,0,0,0,,0,2,0,0,, -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/service/ReferenceDataConceptService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.service; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.Concept; 4 | import org.bahmni.module.referencedata.labconcepts.contract.ConceptSet; 5 | 6 | public interface ReferenceDataConceptService { 7 | public org.openmrs.Concept saveConcept(Concept concept); 8 | 9 | public org.openmrs.Concept saveConcept(ConceptSet conceptSet); 10 | 11 | public org.bahmni.module.referencedata.labconcepts.contract.Concepts getConcept(String conceptName); 12 | } 13 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/model/SimpleObjectExtractorTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import org.junit.Test; 4 | import org.openmrs.module.webservices.rest.SimpleObject; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | public class SimpleObjectExtractorTest { 9 | @Test 10 | public void shouldReturnDefaultValueWhenKeyDoesNotExist() { 11 | SimpleObjectExtractor simpleObjectExtractor = new SimpleObjectExtractor(new SimpleObject().add("foo", 4)); 12 | 13 | assertEquals(0, (int)simpleObjectExtractor.getValueOrDefault("bar", int.class)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/feed/FeedActivator.java: -------------------------------------------------------------------------------- 1 | package feed; 2 | 3 | import org.openmrs.module.ModuleActivator; 4 | 5 | public class FeedActivator implements ModuleActivator { 6 | @Override 7 | public void willRefreshContext() { 8 | 9 | } 10 | 11 | @Override 12 | public void contextRefreshed() { 13 | 14 | } 15 | 16 | @Override 17 | public void willStart() { 18 | 19 | } 20 | 21 | @Override 22 | public void started() { 23 | 24 | } 25 | 26 | @Override 27 | public void willStop() { 28 | 29 | } 30 | 31 | @Override 32 | public void stopped() { 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /admin/src/test/resources/patientMatchingAlgorithm/GANIdentifier.groovy: -------------------------------------------------------------------------------- 1 | package patientMatchingAlgorithm; 2 | 3 | import org.bahmni.module.admin.csv.patientmatchingalgorithm.PatientMatchingAlgorithm 4 | import org.openmrs.Patient; 5 | 6 | 7 | public class GANIdentifier extends PatientMatchingAlgorithm { 8 | @Override 9 | Patient run(List patientList, List patientAttributes) { 10 | for (Patient patient : patientList) { 11 | if (patient.getPatientIdentifier().getIdentifier().contains("GAN")) { 12 | return patient; 13 | } 14 | } 15 | return null; 16 | } 17 | } -------------------------------------------------------------------------------- /scripts/vagrant-database.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | PATH_OF_CURRENT_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 3 | source $PATH_OF_CURRENT_SCRIPT/../vagrant-deploy/scripts/vagrant/vagrant_functions.sh 4 | 5 | set -e 6 | $PATH_OF_CURRENT_SCRIPT/vagrant-deploy.sh 7 | 8 | #invoke migration of openmrs core 9 | run_in_vagrant -c "sudo su - bahmni -c 'cd /bahmni_temp/ && ./run-liquibase-openmrs.sh'" 10 | #invoke migrations of bahmni core omods 11 | run_in_vagrant -c "sudo su - bahmni -c 'cd /bahmni_temp/ && ./run-core-bahmni-modules-liquibase.sh'" 12 | run_in_vagrant -c "sudo su - bahmni -c 'cd /bahmni_temp/ && ./run-openelis-atomfeed-client-liquibase.sh'" 13 | -------------------------------------------------------------------------------- /bahmni-mapping/src/main/resources/moduleApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniProgramWorkflowService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.annotation.Authorized; 5 | import org.openmrs.api.ProgramWorkflowService; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import java.util.Collection; 9 | 10 | public interface BahmniProgramWorkflowService extends ProgramWorkflowService { 11 | 12 | @Transactional(readOnly = true) 13 | @Authorized({"View Patient Programs"}) 14 | Collection getEncountersByPatientProgramUuid(String patientProgramUuid); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/PatientDocumentService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.springframework.http.ResponseEntity; 4 | 5 | public interface PatientDocumentService { 6 | public void saveImage(String patientIdentifier, String image); 7 | public String saveDocument(Integer patientId, String encounterTypeName, String content, String format, String fileType, String fileName); 8 | public ResponseEntity retriveImage(String patientUuid); 9 | public ResponseEntity retriveImageWithoutDefault(String patientUuid); 10 | 11 | void delete(String fileName); 12 | } 13 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/resources/moduleApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /bahmni-mapping/src/test/resources/entityMappingData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /bahmnicore-ui/src/main/java/org/bahmni/module/bahmnicoreui/constant/DiseaseSummaryConstants.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicoreui.constant; 2 | 3 | public class DiseaseSummaryConstants { 4 | 5 | public static final String DATE_FORMAT = "yyyy-MM-dd"; 6 | public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm"; 7 | public static final String RESULT_TABLE_GROUP_BY_ENCOUNTER = "encounters"; 8 | public static final String RESULT_TABLE_GROUP_BY_VISITS = "visits"; 9 | public static final String RESULT_TABLE_GROUP_BY_OBS_DATETIME = "time"; 10 | public static final String RESULT_TABLE_GROUP_BY_OBS_DATETIME_AND_CONCEPT = "obstime"; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /bahmnicore-ui/src/main/resources/moduleApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/VisitDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.Patient; 5 | import org.openmrs.Visit; 6 | 7 | import java.util.List; 8 | 9 | public interface VisitDao { 10 | public Visit getLatestVisit(String patientUuid, String conceptName); 11 | 12 | Visit getVisitSummary(String visitUuid); 13 | 14 | List getAdmitAndDischargeEncounters(Integer visitId); 15 | 16 | List getVisitsByPatient(Patient patient, int numberOfVisits); 17 | 18 | List getVisitIdsFor(String patientUuid, Integer numberOfVisits); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/forms2/contract/FormType.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.forms2.contract; 2 | 3 | public enum FormType { 4 | 5 | FORMS1("v1"), FORMS2("v2"); 6 | 7 | private final String type; 8 | 9 | FormType(String type) { 10 | this.type = type; 11 | } 12 | 13 | 14 | public static FormType valueOfType(String value) { 15 | for(FormType v : values()) { 16 | if (v.type.equalsIgnoreCase(value)) return v; 17 | } 18 | throw new IllegalArgumentException(); 19 | } 20 | 21 | public String getType() { 22 | return this.type; 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /scripts/docker-link.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | 3 | USER=bahmni 4 | 5 | rm -f /opt/openmrs/modules/* 6 | ln -s /bahmni-code/openmrs-distro-bahmni/distro/target/distro/*.omod /opt/openmrs/modules 7 | 8 | rm /opt/openmrs/modules/bahmnicore* 9 | ln -s /bahmni-code/bahmni-core/bahmnicore-omod/target/*.omod /opt/openmrs/modules 10 | 11 | rm /opt/openmrs/modules/openelis-atomfeed-client* 12 | ln -s /bahmni-code/bahmni-core/openmrs-elis-atomfeed-client-omod/target/*.omod /opt/openmrs/modules 13 | 14 | rm /opt/openmrs/modules/reference-data*.omod 15 | ln -s /bahmni-code/bahmni-core/reference-data/omod/target/*.omod /opt/openmrs/modules 16 | 17 | chown -h ${USER}:${USER} /opt/openmrs/modules/* -------------------------------------------------------------------------------- /admin/src/test/java/org/bahmni/module/admin/csv/models/MultipleEncounterRowTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.csv.models; 2 | 3 | import org.junit.Test; 4 | import org.springframework.util.Assert; 5 | 6 | public class MultipleEncounterRowTest { 7 | @Test 8 | public void isEmptyReturnsTrueForEmptyRow() { 9 | Assert.isTrue(new MultipleEncounterRow().getNonEmptyEncounterRows().isEmpty(), "No data in encounter"); 10 | 11 | MultipleEncounterRow emptyEncounterRow = new MultipleEncounterRowBuilder().getEmptyMultipleEncounterRow("GAN12345"); 12 | Assert.isTrue(emptyEncounterRow.getNonEmptyEncounterRows().isEmpty(), "No data in encounter"); 13 | } 14 | } -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/mapper/EncounterTransactionDiagnosisMapper.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.mapper; 2 | 3 | public class EncounterTransactionDiagnosisMapper { 4 | // public void populateDiagnosis(BahmniEncounterTransaction bahmniEncounterTransaction) { 5 | // List diagnoses = new ArrayList<>(); 6 | // for (BahmniDiagnosis bahmniDiagnosis : bahmniEncounterTransaction.getBahmniDiagnoses()) { 7 | // diagnoses.add(bahmniDiagnosis); 8 | // } 9 | // bahmniEncounterTransaction.setDiagnoses(diagnoses); 10 | // } 11 | } 12 | -------------------------------------------------------------------------------- /admin/src/test/resources/relationshipDataSetup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/resources/concepts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/task/OpenElisPatientFeedTask.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.task; 2 | 3 | import org.bahmni.module.elisatomfeedclient.api.client.FeedClient; 4 | import org.bahmni.module.elisatomfeedclient.api.client.OpenElisPatientFeedClient; 5 | import org.openmrs.api.context.Context; 6 | import org.openmrs.scheduler.tasks.AbstractTask; 7 | 8 | public class OpenElisPatientFeedTask extends AbstractTask { 9 | 10 | @Override 11 | public void execute() { 12 | FeedClient feedClient = Context.getService(OpenElisPatientFeedClient.class); 13 | feedClient.processFeed(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/encountertransaction/impl/DummyEncounterSessionMatcher.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.impl; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.Visit; 5 | import org.openmrs.module.emrapi.encounter.EncounterParameters; 6 | import org.openmrs.module.emrapi.encounter.matcher.BaseEncounterMatcher; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class DummyEncounterSessionMatcher implements BaseEncounterMatcher{ 11 | @Override 12 | public Encounter findEncounter(Visit visit, EncounterParameters encounterParameters) { 13 | return null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/util/WebUtils.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.util; 2 | 3 | import org.openmrs.module.webservices.rest.SimpleObject; 4 | 5 | import java.util.LinkedHashMap; 6 | 7 | public class WebUtils { 8 | 9 | public static SimpleObject wrapErrorResponse(String code, String reason) { 10 | LinkedHashMap map = new LinkedHashMap(); 11 | if (reason != null && !"".equals(reason)) { 12 | map.put("message", reason); 13 | } 14 | if (code != null && !"".equals(code)) { 15 | map.put("code", code); 16 | } 17 | return (new SimpleObject()).add("error", map); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/Constants.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api; 2 | 3 | public class Constants { 4 | public static final String DEFAULT_INVESTIGATION_ENCOUNTER_TYPE = "INVESTIGATION"; 5 | public static final String DEFAULT_LAB_SYSTEM_USERNAME = "Lab System"; 6 | public static final String DEFAULT_LAB_ORDER_TYPE = "Order"; 7 | public static final String DEFAULT_LAB_SYSTEM_IDENTIFIER = "LABSYSTEM"; 8 | public static final String DEFAULT_LAB_RESULT_ENCOUNTER_TYPE = "LAB_RESULT"; 9 | public static final String GP_ALLOW_DISCONTINUE_ORDERS = "elisatomfeedclient.discontinueCancelledOrders"; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/resources/V1_64__AddLabResultFeedScheduler.sql: -------------------------------------------------------------------------------- 1 | UPDATE scheduler_task_config SET 2 | schedulable_class="org.bahmni.module.elisatomfeedclient.api.task.OpenElisPatientFeedTask", 3 | name = "OpenElis Patient Atom Feed Task" 4 | where schedulable_class = "org.bahmni.module.elisatomfeedclient.api.task.OpenElisAtomFeedTask"; 5 | 6 | INSERT INTO scheduler_task_config(name, schedulable_class, start_time, start_time_pattern, repeat_interval, start_on_startup, started, created_by, date_created, uuid) 7 | VALUES ('OpenElis Lab Result Atom Feed Task', 'org.bahmni.module.elisatomfeedclient.api.task.OpenElisLabResultFeedTask', now(), 'MM/dd/yyyy HH:mm:ss', 15, 1, 1, 1, curdate(), uuid()); -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/request/patient/Name.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration.request.patient; 2 | 3 | import static org.bahmni.datamigration.DataScrub.scrubData; 4 | 5 | 6 | public class Name { 7 | private String familyName; 8 | private String givenName; 9 | 10 | public String getFamilyName() { 11 | return familyName; 12 | } 13 | 14 | public void setFamilyName(String familyName) { 15 | this.familyName = scrubData(familyName); 16 | } 17 | 18 | public String getGivenName() { 19 | return givenName; 20 | } 21 | 22 | public void setGivenName(String givenName) { 23 | this.givenName = scrubData(givenName); 24 | } 25 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/events/PatientEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.events; 2 | 3 | import org.openmrs.Patient; 4 | import org.openmrs.api.context.Context; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.time.LocalDateTime; 8 | import java.util.UUID; 9 | 10 | public class PatientEvent extends BahmniEvent { 11 | 12 | private Patient patient; 13 | 14 | public PatientEvent(BahmniEventType bahmniEventType, Patient patient) { 15 | super(bahmniEventType); 16 | this.patient = patient; 17 | this.payloadId=patient.getUuid(); 18 | } 19 | 20 | public Patient getPatient() { 21 | return patient; 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /jss-old-data/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/PanelEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.ConceptClass; 5 | 6 | import static org.bahmni.module.referencedata.labconcepts.mapper.ConceptExtension.isOfConceptClassByUUID; 7 | 8 | public class PanelEvent extends ConceptOperationEvent { 9 | 10 | public PanelEvent(String url, String category, String title) { 11 | super(url, category, title); 12 | } 13 | 14 | @Override 15 | public boolean isResourceConcept(Concept concept) { 16 | return isOfConceptClassByUUID(concept, ConceptClass.LABSET_UUID); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/test/java/org/bahmni/module/elisatomfeedclient/api/domain/OpenElisPatientTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.domain; 2 | 3 | import org.joda.time.LocalDate; 4 | import org.junit.Test; 5 | 6 | import static junit.framework.Assert.assertEquals; 7 | 8 | public class OpenElisPatientTest { 9 | 10 | @Test 11 | public void shouldReturnBirthDateAsDate() throws Exception { 12 | OpenElisPatient openElisPatient = new OpenElisPatient(); 13 | LocalDate today = LocalDate.now(); 14 | openElisPatient.setDateOfBirth(today.toString("yyyy-MM-dd")); 15 | 16 | assertEquals(today.toDate(), openElisPatient.getDateOfBirthAsDate()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/java/org/openmrs/module/bahmnicore/web/v1_0/resource/RestConstants.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmnicore.web.v1_0.resource; 2 | public class RestConstants { 3 | public final static String PATIENT_PROGRAM_ATTRIBUTE_UUID = "3a2bdb18-6faa-11e0-8414-001e378eb67e"; 4 | public final static String PROGRAM_ATTRIBUTE_TYPE_UUID = "d7477c21-bfc3-4922-9591-e89d8b9c8efb"; 5 | public final static String PATIENT_PROGRAM_UUID = "9119b9f8-af3d-4ad8-9e2e-2317c3de91c6"; 6 | 7 | public final static String TEST_DATA_SET = "customTestDataset1_12.xml"; 8 | 9 | public final static String ORDER_SET_UUID = "order_set_uuid1"; 10 | 11 | public final static String ORDER_SET_MEMBER_UUID = "order_set_member_uuid1"; 12 | } -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/resources/addressHierarchy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/service/VisitMatcher.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.service; 2 | 3 | import org.openmrs.Patient; 4 | import org.openmrs.Visit; 5 | import org.openmrs.VisitType; 6 | 7 | import java.util.Date; 8 | 9 | public interface VisitMatcher { 10 | Visit getVisitFor(Patient patient, String visitTypeForNewVisit, Date orderDate, Date visitStartDate, Date visitEndDate, String locationUuid); 11 | boolean hasActiveVisit(Patient patient); 12 | Visit createNewVisit(Patient patient, Date date, String visitTypeForNewVisit, Date visitStartDate, Date visitEndDate, String locationUuid); 13 | VisitType getVisitTypeByName(String visitTypeName); 14 | } 15 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/observation/handler/CSVObsHandler.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.observation.handler; 2 | 3 | 4 | import org.bahmni.csv.KeyValue; 5 | import org.bahmni.module.admin.csv.models.EncounterRow; 6 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 7 | 8 | import java.text.ParseException; 9 | import java.util.List; 10 | 11 | public interface CSVObsHandler { 12 | 13 | List getRelatedCSVObs(EncounterRow encounterRow); 14 | 15 | List handle(EncounterRow encounterRow) throws ParseException; 16 | 17 | List handle(EncounterRow encounterRow, boolean shouldPerformForm2Validations) throws ParseException; 18 | } 19 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/disposition/service/BahmniDispositionService.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.disposition.service; 2 | 3 | import org.openmrs.Visit; 4 | import org.openmrs.module.bahmniemrapi.disposition.contract.BahmniDisposition; 5 | 6 | import java.util.List; 7 | import java.util.Locale; 8 | 9 | public interface BahmniDispositionService { 10 | 11 | List getDispositionByVisitUuid(String visitUuid); 12 | List getDispositionByVisits(List visits); 13 | 14 | List getDispositionByVisitUuid(String visitUuid , Locale locale); 15 | List getDispositionByVisits(List visits , Locale locale); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/Activator.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore; 2 | 3 | import org.apache.commons.logging.Log; 4 | import org.apache.commons.logging.LogFactory; 5 | import org.bahmni.module.bahmnicore.properties.BahmniCoreProperties; 6 | import org.openmrs.api.context.Context; 7 | import org.openmrs.module.BaseModuleActivator; 8 | 9 | public class Activator extends BaseModuleActivator { 10 | 11 | private Log log = LogFactory.getLog(this.getClass()); 12 | 13 | @Override 14 | public void started() { 15 | log.info("Started the Bahmni Core module"); 16 | BahmniCoreProperties.load(); 17 | } 18 | 19 | @Override 20 | public void stopped() { 21 | log.info("Stopped the Bahmni Core module"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenMRS module bahmnicore 2 | 3 | This module provides necessary services for running Bahmni 4 | 5 | ## Build 6 | 7 | [![BahmniCore-master Actions Status](https://github.com/Bahmni/bahmni-core/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/Bahmni/bahmni-core/actions) 8 | 9 | ### Prerequisite 10 | JDK 1.8 11 | ruby 2.2+ 12 | RubyGems 13 | Compass 1.0.3 (gem install compass) 14 | 15 | ### Clone the repository and build the omod 16 | 17 | git clone https://github.com/bahmni/bahmni-core 18 | cd bahmni-core 19 | ./mvnw clean install 20 | 21 | ## Deploy 22 | 23 | Copy ```bahmni-core/bahmnicore-omod/target/bahmnicore-omod-VERSION-SNAPSHOT.omod``` into OpenMRS modules directory and restart OpenMRS 24 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/encounter/data/ConceptData.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.encounter.data; 2 | 3 | public class ConceptData { 4 | private String uuid; 5 | private String name; 6 | 7 | public ConceptData(String uuid, String name) { 8 | this.uuid = uuid; 9 | this.name = name; 10 | } 11 | 12 | public ConceptData() { 13 | } 14 | 15 | public String getUuid() { 16 | return uuid; 17 | } 18 | 19 | public void setUuid(String uuid) { 20 | this.uuid = uuid; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/BahmniConceptDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | 4 | import org.openmrs.Concept; 5 | import org.openmrs.ConceptAnswer; 6 | import org.openmrs.Drug; 7 | 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | public interface BahmniConceptDao { 12 | Collection searchByQuestion(Concept questionConcept, String searchQuery); 13 | Concept getConceptByFullySpecifiedName(String fullySpecifiedConceptName); 14 | Collection getDrugByListOfConcepts(Collection conceptSet); 15 | List searchDrugsByDrugName(Integer conceptSetId, String searchTerm); 16 | 17 | List getConceptsByFullySpecifiedName(List conceptNames); 18 | } 19 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/service/ReferenceDataConceptReferenceTermService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.service; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.ConceptReferenceTerm; 4 | import org.openmrs.ConceptMap; 5 | 6 | public interface ReferenceDataConceptReferenceTermService { 7 | public org.openmrs.ConceptReferenceTerm getConceptReferenceTerm(String referenceTermCode, String referenceTermSource); 8 | 9 | public ConceptMap getConceptMap(org.bahmni.module.referencedata.labconcepts.contract.ConceptReferenceTerm conceptReferenceTermData); 10 | 11 | public org.openmrs.ConceptReferenceTerm saveOrUpdate(ConceptReferenceTerm conceptReferenceTerm); 12 | } 13 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/laborder/service/LabOrderResultsService.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.laborder.service; 2 | 3 | import org.openmrs.Patient; 4 | import org.openmrs.Visit; 5 | import org.openmrs.module.bahmniemrapi.laborder.contract.LabOrderResult; 6 | import org.openmrs.module.bahmniemrapi.laborder.contract.LabOrderResults; 7 | 8 | import java.util.Collection; 9 | import java.util.Date; 10 | import java.util.List; 11 | 12 | public interface LabOrderResultsService { 13 | LabOrderResults getAll(Patient patient, List visits, int numberOfAccessions); 14 | 15 | List getAllForConcepts(Patient patient, Collection concepts, List visits, Date startDate, Date endDate); 16 | } 17 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/VideoFormatsForThumbnailGeneration.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | public enum VideoFormatsForThumbnailGeneration { 4 | _3GP("3GPP"), MP4("MP4"), MOV("MOV"); 5 | 6 | private final String value; 7 | 8 | VideoFormatsForThumbnailGeneration(String value) { 9 | this.value = value; 10 | } 11 | 12 | public static boolean isFormatSupported(String givenFormat) { 13 | for (VideoFormatsForThumbnailGeneration format : VideoFormatsForThumbnailGeneration.values()) { 14 | if (givenFormat.toUpperCase().contains(format.value)) 15 | return true; 16 | } 17 | return false; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return value.toLowerCase(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/java/org/bahmni/module/bahmnicore/web/v1_0/mapper/CustomObjectMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0.mapper; 2 | 3 | import org.codehaus.jackson.map.ObjectMapper; 4 | import org.codehaus.jackson.map.SerializationConfig; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.text.SimpleDateFormat; 8 | 9 | @Component 10 | public class CustomObjectMapper extends ObjectMapper { 11 | public CustomObjectMapper() { 12 | super(); 13 | configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false); 14 | configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false); 15 | _serializationConfig.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /obs-relation/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/task/OpenElisPatientFeedFailedEventsTask.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.task; 2 | 3 | import org.bahmni.module.elisatomfeedclient.api.client.FailedEventsFeedClient; 4 | import org.bahmni.module.elisatomfeedclient.api.client.OpenElisPatientFailedEventsFeedClient; 5 | import org.openmrs.api.context.Context; 6 | import org.openmrs.scheduler.tasks.AbstractTask; 7 | 8 | public class OpenElisPatientFeedFailedEventsTask extends AbstractTask { 9 | 10 | @Override 11 | public void execute() { 12 | FailedEventsFeedClient feedClient = Context.getService(OpenElisPatientFailedEventsFeedClient.class); 13 | feedClient.processFailedEvents(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/DrugMetaDataMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.model.DrugMetaData; 4 | import org.openmrs.Drug; 5 | 6 | public class DrugMetaDataMapper { 7 | 8 | public org.openmrs.Drug map(DrugMetaData drugMetaData) { 9 | Drug drug = null; 10 | 11 | if (drugMetaData.getExistingDrug() != null) { 12 | drug = drugMetaData.getExistingDrug(); 13 | } else { 14 | drug = new Drug(); 15 | } 16 | 17 | drug.setDosageForm(drugMetaData.getDosageForm()); 18 | drug.setConcept(drugMetaData.getDrugConcept()); 19 | return drug; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/Activator.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient; 2 | 3 | import org.apache.commons.logging.Log; 4 | import org.apache.commons.logging.LogFactory; 5 | import org.bahmni.module.bahmnicore.properties.BahmniCoreProperties; 6 | import org.openmrs.module.BaseModuleActivator; 7 | 8 | public class Activator extends BaseModuleActivator { 9 | 10 | private Log log = LogFactory.getLog(this.getClass()); 11 | 12 | @Override 13 | public void started() { 14 | log.info("Started the Open-Elis Atom Feed Client module"); 15 | BahmniCoreProperties.load(); 16 | } 17 | 18 | @Override 19 | public void stopped() { 20 | log.info("Stopped the Open-Elis Atom Feed Client module"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bahmni-mapping/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /obs-relation/src/main/resources/obsrelation-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/Concepts.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.List; 4 | 5 | public class Concepts { 6 | private List conceptList; 7 | private List conceptSetList; 8 | 9 | public List getConceptList() { 10 | return conceptList; 11 | } 12 | 13 | public void setConceptList(List conceptList) { 14 | this.conceptList = conceptList; 15 | } 16 | 17 | public List getConceptSetList() { 18 | return conceptSetList; 19 | } 20 | 21 | public void setConceptSetList(List conceptSetList) { 22 | this.conceptSetList = conceptSetList; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/drugogram/contract/RegimenRowTest.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.drugogram.contract; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | 8 | public class RegimenRowTest { 9 | 10 | @Test 11 | public void shouldReturnEmptyStringWhenDrugValueIsAbsent() { 12 | RegimenRow regimenRow = new RegimenRow(); 13 | assertEquals("", regimenRow.getDrugValue("Paracetamol")); 14 | } 15 | 16 | @Test 17 | public void shouldGetDrugValueForDrugConceptName() { 18 | RegimenRow regimenRow = new RegimenRow(); 19 | regimenRow.addDrugs("Paracetamol", "300.0"); 20 | assertEquals("300.0", regimenRow.getDrugValue("Paracetamol")); 21 | } 22 | } -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/java/org/bahmni/module/bahmnicore/web/v1_0/LocaleResolver.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0; 2 | 3 | import org.openmrs.api.APIException; 4 | import org.openmrs.util.LocaleUtility; 5 | 6 | import java.util.Locale; 7 | 8 | public class LocaleResolver { 9 | 10 | public static Locale identifyLocale(String locale) { 11 | if (locale != null && !locale.isEmpty()) { 12 | Locale searchLocale = LocaleUtility.fromSpecification(locale); 13 | if (searchLocale.getLanguage().isEmpty()) { 14 | throw new APIException("Invalid locale: " + locale); 15 | } 16 | return searchLocale; 17 | } else { 18 | return LocaleUtility.getDefaultLocale(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/CodedTestAnswer.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | 4 | public class CodedTestAnswer { 5 | private String name; 6 | private String uuid; 7 | 8 | public CodedTestAnswer() { 9 | } 10 | 11 | public CodedTestAnswer(String name, String uuid) { 12 | this.name = name; 13 | this.uuid = uuid; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public String getUuid() { 25 | return uuid; 26 | } 27 | 28 | public void setUuid(String uuid) { 29 | this.uuid = uuid; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/ResourceReference.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | public class ResourceReference { 4 | private String name; 5 | private String uuid; 6 | 7 | public ResourceReference() { 8 | } 9 | 10 | public ResourceReference(String uuid, String name) { 11 | this.uuid = uuid; 12 | this.name = name; 13 | } 14 | 15 | public String getUuid() { 16 | return uuid; 17 | } 18 | 19 | public void setUuid(String uuid) { 20 | this.uuid = uuid; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /admin/src/main/resources/moduleApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/DepartmentEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.openmrs.Concept; 4 | 5 | import static org.bahmni.module.referencedata.labconcepts.contract.Department.DEPARTMENT_CONCEPT_CLASS; 6 | import static org.bahmni.module.referencedata.labconcepts.mapper.ConceptExtension.isOfConceptClass; 7 | 8 | public class DepartmentEvent extends ConceptOperationEvent { 9 | 10 | public DepartmentEvent(String url, String category, String title) { 11 | super(url, category, title); 12 | } 13 | 14 | @Override 15 | public boolean isResourceConcept(Concept concept) { 16 | return isOfConceptClass(concept, DEPARTMENT_CONCEPT_CLASS); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/SampleEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.openmrs.Concept; 4 | 5 | import static org.bahmni.module.referencedata.labconcepts.contract.Sample.SAMPLE_CONCEPT_CLASSES; 6 | import static org.bahmni.module.referencedata.labconcepts.mapper.ConceptExtension.isOfAnyConceptClass; 7 | 8 | public class SampleEvent extends ConceptOperationEvent { 9 | 10 | public SampleEvent(String url, String category, String title) { 11 | super(url, category, title); 12 | } 13 | 14 | 15 | @Override 16 | public boolean isResourceConcept(Concept concept) { 17 | return isOfAnyConceptClass(concept, SAMPLE_CONCEPT_CLASSES); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /bahmni-mapping/src/main/resources/EntityMappingType.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/resources/V1_58__AddConceptReferenceMapProc.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE add_concept_reference_map (concept_id INT, 2 | concept_source_id INT, 3 | reference_term VARCHAR(255), 4 | reference_type_id INT) 5 | BEGIN 6 | DECLARE reference_term_id INT; 7 | 8 | INSERT INTO concept_reference_term (concept_source_id,code,creator,date_created,uuid) 9 | VALUES (concept_source_id,reference_term,1,now(),uuid()); 10 | SELECT MAX(concept_reference_term_id) INTO reference_term_id FROM concept_reference_term; 11 | 12 | INSERT INTO concept_reference_map(concept_reference_term_id,concept_map_type_id,creator,date_created,concept_id,uuid) 13 | VALUES(reference_term_id, reference_type_id, 1, now(), concept_id, uuid()); 14 | 15 | END; 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /admin/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/document/contract/VisitDocumentResponse.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.document.contract; 2 | 3 | public class VisitDocumentResponse { 4 | private String visitUuid; 5 | private String encounterUuid; 6 | 7 | public VisitDocumentResponse(String visitUuid, String encounterUuid) { 8 | this.visitUuid = visitUuid; 9 | this.encounterUuid = encounterUuid; 10 | } 11 | 12 | public VisitDocumentResponse() { 13 | } 14 | 15 | public String getVisitUuid() { 16 | return visitUuid; 17 | } 18 | 19 | public void setVisitUuid(String visitUuid) { 20 | this.visitUuid = visitUuid; 21 | } 22 | 23 | public String getEncounterUuid() { 24 | return encounterUuid; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/NoteDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.bahmni.module.bahmnicore.model.Note; 7 | import org.bahmni.module.bahmnicore.model.NoteType; 8 | import org.openmrs.api.db.DAOException; 9 | 10 | public interface NoteDao { 11 | 12 | Note createNote(Note note); 13 | 14 | Note getNoteById(Integer noteId); 15 | 16 | Note updateNote(Note note); 17 | 18 | void deleteNote(Note note); 19 | 20 | Note voidNote(Note note); 21 | 22 | Note getNote(Date noteDate, String noteType); 23 | 24 | NoteType getNoteType(String name); 25 | 26 | List getNotes(Date startDate, Date endDate, String noteType); 27 | 28 | Note getNoteByUuid(String uuid); 29 | } 30 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/VideoFormats.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | public enum VideoFormats { 4 | 5 | OGG("OGG"), _3GP("3GPP"), MP4("MP4"), MPEG("MPEG"), WMV("WMV"), AVI("AVI"), MOV("MOV"), FLV("FLV"), WEBM("WEBM"), MKV("MKV"); 6 | 7 | private final String value; 8 | 9 | VideoFormats(String value) { 10 | this.value = value; 11 | } 12 | 13 | public static boolean isFormatSupported(String givenFormat) { 14 | for (VideoFormats format : VideoFormats.values()) { 15 | if (givenFormat.toUpperCase().contains(format.value)) 16 | return true; 17 | } 18 | return false; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return value.toLowerCase(); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/domain/OpenElisPatientAttribute.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.domain; 2 | 3 | public class OpenElisPatientAttribute { 4 | private String name; 5 | private String value; 6 | 7 | public OpenElisPatientAttribute() { 8 | } 9 | 10 | public OpenElisPatientAttribute(String name, String value) { 11 | this.name = name; 12 | this.value = value; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public String getValue() { 24 | return value; 25 | } 26 | 27 | public void setValue(String value) { 28 | this.value = value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/concepts/mapper/DrugMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.concepts.mapper; 2 | 3 | import org.bahmni.module.admin.csv.models.DrugRow; 4 | import org.bahmni.module.referencedata.labconcepts.contract.Drug; 5 | 6 | public class DrugMapper { 7 | public Drug map(DrugRow drugRow) { 8 | Drug drug = new Drug(); 9 | drug.setUuid(drugRow.getUuid()); 10 | drug.setName(drugRow.getName()); 11 | drug.setGenericName(drugRow.getGenericName()); 12 | drug.setDosageForm(drugRow.getDosageForm()); 13 | drug.setStrength(drugRow.getStrength()); 14 | drug.setMinimumDose(drugRow.getMinimumDose()); 15 | drug.setMaximumDose(drugRow.getMaximumDose()); 16 | drug.setCombination(drugRow.getCombination()); 17 | return drug; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/jss/registration/AllStates.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.jss.registration; 2 | 3 | import org.bahmni.datamigration.AllLookupValues; 4 | 5 | import java.io.IOException; 6 | 7 | public class AllStates extends AllLookupValues { 8 | private AllLookupValues allDistricts; 9 | 10 | public AllStates(String csvLocation, String fileName, AllLookupValues allDistricts) throws IOException { 11 | super(csvLocation, fileName); 12 | this.allDistricts = allDistricts; 13 | } 14 | 15 | @Override 16 | public String getLookUpValue(String key) { 17 | String stateId = allDistricts.getLookUpValue(key); 18 | String lookUpValue = allDistricts.getLookUpValue(stateId); 19 | "Madya Pradesh".equals(lookUpValue) return "Madhya Pradesh"; 20 | return lookUpValue; 21 | } 22 | } -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/RadiologyTestEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.openmrs.Concept; 4 | 5 | import static org.bahmni.module.referencedata.labconcepts.contract.RadiologyTest.RADIOLOGY_TEST_CONCEPT_CLASSES; 6 | import static org.bahmni.module.referencedata.labconcepts.mapper.ConceptExtension.isOfAnyConceptClass; 7 | 8 | public class RadiologyTestEvent extends ConceptOperationEvent { 9 | 10 | public RadiologyTestEvent(String url, String category, String title) { 11 | super(url, category, title); 12 | } 13 | 14 | 15 | @Override 16 | public boolean isResourceConcept(Concept concept) { 17 | return isOfAnyConceptClass(concept, RADIOLOGY_TEST_CONCEPT_CLASSES); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniConceptService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.ConceptAnswer; 5 | import org.openmrs.Drug; 6 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 7 | 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | public interface BahmniConceptService { 12 | EncounterTransaction.Concept getConceptByName(String conceptName); 13 | 14 | Collection searchByQuestion(String questionConcept, String query); 15 | Collection getDrugsByConceptSetName(String conceptSetName, String searchTerm); 16 | 17 | Concept getConceptByFullySpecifiedName(String drug); 18 | 19 | List getConceptsByFullySpecifiedName(List conceptNames); 20 | } 21 | -------------------------------------------------------------------------------- /reference-data/omod/src/test/resources/referenceTermSetup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/AllTestsAndPanels.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | public class AllTestsAndPanels extends Resource { 4 | public static final String ALL_TESTS_AND_PANELS = "All_Tests_and_Panels"; 5 | 6 | private String description; 7 | 8 | private TestsAndPanels testsAndPanels; 9 | 10 | public TestsAndPanels getTestsAndPanels() { 11 | return testsAndPanels; 12 | } 13 | 14 | public void setTestsAndPanels(TestsAndPanels testsAndPanels) { 15 | this.testsAndPanels = testsAndPanels; 16 | } 17 | 18 | public String getDescription() { 19 | return description; 20 | } 21 | 22 | public void setDescription(String description) { 23 | this.description = description; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/model/BahmniNameTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import org.junit.Test; 4 | import org.openmrs.module.webservices.rest.SimpleObject; 5 | 6 | import static junit.framework.Assert.assertEquals; 7 | 8 | public class BahmniNameTest { 9 | 10 | @Test 11 | public void shouldCreateNameFromSimpleObject() { 12 | String givenName = "SomeGivenName"; 13 | String middleName = "SomeMiddleName"; 14 | String familyName = "SomeFamilyName"; 15 | SimpleObject nameObject = new SimpleObject().add("givenName", givenName).add("middleName", middleName).add( 16 | "familyName", familyName); 17 | 18 | BahmniName name = new BahmniName(nameObject); 19 | 20 | assertEquals(givenName, name.getGivenName()); 21 | assertEquals(familyName, name.getFamilyName()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/visit/contract/VisitData.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.visit.contract; 2 | 3 | 4 | import org.openmrs.Visit; 5 | 6 | import java.util.Date; 7 | 8 | public class VisitData { 9 | private String uuid; 10 | private Date startDateTime; 11 | 12 | public VisitData(Visit visit) { 13 | this.uuid = visit.getUuid(); 14 | this.startDateTime = visit.getStartDatetime(); 15 | } 16 | 17 | public String getUuid() { 18 | return uuid; 19 | } 20 | 21 | public void setUuid(String uuid) { 22 | this.uuid = uuid; 23 | } 24 | 25 | public Date getStartDateTime() { 26 | return startDateTime; 27 | } 28 | 29 | public void setStartDateTime(Date startDateTime) { 30 | this.startDateTime = startDateTime; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /admin/src/test/resources/conceptReferenceTerm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 9 | 10 | 13 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/model/BahmniPersonAttributeTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import org.junit.Test; 4 | import org.openmrs.module.webservices.rest.SimpleObject; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | public class BahmniPersonAttributeTest { 9 | 10 | @Test 11 | public void shouldCreatePersonAttributeFromSimpleObject() { 12 | String value = "someCaste"; 13 | String attributeUUId = "casteAttributeUUId"; 14 | SimpleObject personAttributeObject = new SimpleObject().add("attributeType", attributeUUId).add("value", value); 15 | 16 | BahmniPersonAttribute personAttribute = new BahmniPersonAttribute(personAttributeObject); 17 | 18 | assertEquals(attributeUUId, personAttribute.getPersonAttributeUuid()); 19 | assertEquals(value, personAttribute.getValue()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/worker/IgnoreEventWorker.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.worker; 2 | 3 | import org.apache.logging.log4j.LogManager; 4 | import org.apache.logging.log4j.Logger; 5 | import org.ict4h.atomfeed.client.domain.Event; 6 | import org.ict4h.atomfeed.client.service.EventWorker; 7 | 8 | public class IgnoreEventWorker implements EventWorker { 9 | 10 | private static Logger logger = LogManager.getLogger(IgnoreEventWorker.class); 11 | private String message; 12 | 13 | public IgnoreEventWorker(String message) { 14 | this.message = message; 15 | } 16 | 17 | @Override 18 | public void process(Event event) { 19 | logger.warn(message); 20 | } 21 | 22 | @Override 23 | public void cleanUp(Event event) { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/resources/webModuleApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/builder/LocationBuilder.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.builder; 2 | 3 | import org.openmrs.Location; 4 | import org.openmrs.LocationTag; 5 | import org.openmrs.module.emrapi.EmrApiConstants; 6 | 7 | public class LocationBuilder { 8 | private Location location; 9 | 10 | public LocationBuilder() { 11 | this.location = new Location(); 12 | } 13 | 14 | public LocationBuilder withVisitLocationTag() { 15 | location.addTag(new LocationTag(EmrApiConstants.LOCATION_TAG_SUPPORTS_VISITS, "Visit Location")); 16 | return this; 17 | } 18 | 19 | public LocationBuilder withParent(Location parentLocation) { 20 | location.setParentLocation(parentLocation); 21 | return this; 22 | } 23 | 24 | public Location build() { 25 | return location; 26 | } 27 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniOrderService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.Order; 5 | import org.openmrs.module.bahmniemrapi.order.contract.BahmniOrder; 6 | 7 | import java.util.List; 8 | 9 | public interface BahmniOrderService{ 10 | List ordersForOrderType(String patientUuid, List concepts, Integer numberOfVisits, List obsIgnoreList, String orderTypeUuid, Boolean includeObs, List locationUuids); 11 | 12 | List ordersForOrderUuid(String patientUuid, List concepts, List obsIgnoreList, String orderUuid); 13 | 14 | List ordersForVisit(String visitUuid, String orderTypeUuid, List conceptNames, List obsIgnoreList); 15 | 16 | Order getChildOrder(Order order); 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/validate_pr.yml: -------------------------------------------------------------------------------- 1 | name: Validate PR 2 | on: 3 | pull_request: 4 | branches: [ master ] 5 | 6 | jobs: 7 | build: 8 | name: Build 9 | runs-on: macos-14 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Set up JDK 1.8 13 | uses: actions/setup-java@v1 14 | with: 15 | java-version: 1.8 16 | - name: Cache Maven packages 17 | uses: actions/cache@v3 18 | with: 19 | path: ~/.m2 20 | key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} 21 | restore-keys: ${{ runner.os }}-m2 22 | - name: Build with Maven 23 | run: | 24 | ./mvnw install -U -Dmaven.javadoc.skip=true -V -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn 25 | ./mvnw verify -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn 26 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/AllSamples.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class AllSamples extends Resource { 7 | private String description; 8 | private List samples = new ArrayList<>(); 9 | public static final String ALL_SAMPLES = "Lab Samples"; 10 | 11 | public String getDescription() { 12 | return description; 13 | } 14 | 15 | public void setDescription(String description) { 16 | this.description = description; 17 | } 18 | 19 | public List getSamples() { 20 | return samples; 21 | } 22 | 23 | public void addSample(Sample sample) { 24 | if (sample != null) { 25 | this.samples.add(sample); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/encountertransaction/impl/MockEncounterTransactionHandler.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.impl; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 5 | import org.openmrs.module.emrapi.encounter.postprocessor.EncounterTransactionHandler; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class MockEncounterTransactionHandler implements EncounterTransactionHandler { 10 | public int numberOfTimesSaveWasCalled = 0; 11 | 12 | @Override 13 | public void forRead(Encounter encounter, EncounterTransaction encounterTransaction) { 14 | 15 | } 16 | 17 | @Override 18 | public void forSave(Encounter encounter, EncounterTransaction encounterTransaction) { 19 | numberOfTimesSaveWasCalled++; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/events/BahmniEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.events; 2 | 3 | import org.openmrs.api.context.Context; 4 | import org.openmrs.api.context.UserContext; 5 | 6 | import java.time.LocalDateTime; 7 | import java.util.UUID; 8 | 9 | public class BahmniEvent { 10 | 11 | private static final long version = 1L; 12 | public UserContext userContext; 13 | public String eventId; 14 | public BahmniEventType eventType; 15 | public String payloadId; 16 | public LocalDateTime publishedDateTime; 17 | 18 | public BahmniEvent(BahmniEventType bahmniEventType) { 19 | this.eventType = bahmniEventType; 20 | this.eventId = UUID.randomUUID().toString(); 21 | this.publishedDateTime = LocalDateTime.now(); 22 | this.userContext= Context.getUserContext(); 23 | this.payloadId=""; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/resources/updatePatient.json: -------------------------------------------------------------------------------- 1 | { 2 | "patient": { 3 | "person": { 4 | "names": [ 5 | { 6 | "uuid": "4e89ec9e-6bd7-43e5-b5b9-9671c1c3eb9b", 7 | "givenName": "abishek", 8 | "middleName": "kumar", 9 | "familyName": "Anand", 10 | "preferred": true 11 | } 12 | ], 13 | "birthdate": "1984-03-07", 14 | "birthdateEstimated": false, 15 | "birthtime": null, 16 | "gender": "M", 17 | "dead": false, 18 | "deathDate": null, 19 | "causeOfDeath": "" 20 | }, 21 | "identifiers": [ 22 | { 23 | "display": "Patient Identifier = BDH202039", 24 | "uuid": "12f43236-d986-4cd9-a8e2-733400649b3a", 25 | "identifierType": "81433852-3f10-11e4-adec-0800271c1b76", 26 | "identifier": "ABC123DEF" 27 | } 28 | ] 29 | }, 30 | "relationships": [] 31 | } -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/Department.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.List; 4 | 5 | public class Department extends Resource { 6 | private String description; 7 | private List tests; 8 | 9 | public static final String DEPARTMENT_PARENT_CONCEPT_NAME = "Lab Departments"; 10 | public static final String DEPARTMENT_CONCEPT_CLASS = "Department"; 11 | 12 | public List getTests() { 13 | return tests; 14 | } 15 | 16 | public void setTests(List tests) { 17 | this.tests = tests; 18 | } 19 | 20 | public String getDescription() { 21 | return description; 22 | } 23 | 24 | public void setDescription(String description) { 25 | this.description = description; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/request/patient/PatientAttribute.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration.request.patient; 2 | 3 | import static org.bahmni.datamigration.DataScrub.scrubData; 4 | 5 | public class PatientAttribute { 6 | private String attributeType; 7 | private String name; 8 | private String value; 9 | 10 | public String getAttributeType() { 11 | return attributeType; 12 | } 13 | 14 | public void setAttributeType(String attributeType) { 15 | this.attributeType = attributeType; 16 | } 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = scrubData(name); 24 | } 25 | 26 | public String getValue() { 27 | return value; 28 | } 29 | 30 | public void setValue(String value) { 31 | this.value = scrubData(value); 32 | } 33 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/mapper/BirthDateMapperTest.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.mapper; 2 | 3 | import org.bahmni.module.bahmnicore.model.Age; 4 | import org.bahmni.module.bahmnicore.model.BahmniPatient; 5 | import org.junit.Test; 6 | import org.openmrs.Patient; 7 | 8 | import java.util.Date; 9 | 10 | import static junit.framework.Assert.assertEquals; 11 | 12 | public class BirthDateMapperTest { 13 | 14 | @Test 15 | public void shouldMapFromPatientToBahmniPatient() { 16 | Patient patient = new Patient(); 17 | patient.setBirthdate(new Date()); 18 | 19 | BirthDateMapper mapper = new BirthDateMapper(); 20 | BahmniPatient bahmniPatient = mapper.mapFromPatient(null, patient); 21 | 22 | assertEquals(patient.getBirthdate(),bahmniPatient.getBirthdate()); 23 | assertEquals(new Age(0,0,0), bahmniPatient.getAge()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/BahmniDiagnosisService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.ConceptSource; 5 | import org.openmrs.module.bahmniemrapi.diagnosis.contract.BahmniDiagnosisRequest; 6 | 7 | import java.text.ParseException; 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | public interface BahmniDiagnosisService { 12 | void delete(String diagnosisObservationUuid); 13 | List getBahmniDiagnosisByPatientAndVisit(String patientUuid,String visitUuid); 14 | List getBahmniDiagnosisByPatientAndDate(String patientUuid, String date) throws ParseException; 15 | 16 | boolean isExternalTerminologyServerLookupNeeded(); 17 | 18 | Collection getDiagnosisSets(); 19 | 20 | List getConceptSourcesForDiagnosisSearch(); 21 | } 22 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/AllLabSamplesEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.AllSamples; 4 | import org.openmrs.Concept; 5 | import org.openmrs.api.context.Context; 6 | 7 | public class AllLabSamplesEvent extends ConceptOperationEvent { 8 | 9 | public AllLabSamplesEvent(String conceptUrl, String labCategory, String title) { 10 | super(conceptUrl, labCategory, title); 11 | } 12 | 13 | @Override 14 | public boolean isResourceConcept(Concept concept) { 15 | return isLabSamplesConcept(concept); 16 | } 17 | 18 | 19 | private boolean isLabSamplesConcept(Concept concept) { 20 | return concept.getName(Context.getLocale()) != null && concept.getName(Context.getLocale()).getName().equals(AllSamples.ALL_SAMPLES); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/csv/patientmatchingalgorithm/PatientMatchingAlgorithm.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.csv.patientmatchingalgorithm; 2 | 3 | import org.bahmni.csv.KeyValue; 4 | import org.bahmni.module.admin.csv.patientmatchingalgorithm.exception.CannotMatchPatientException; 5 | import org.openmrs.Patient; 6 | 7 | import java.util.List; 8 | 9 | public abstract class PatientMatchingAlgorithm { 10 | public String valueFor(String keyToSearch, List patientAttributes) { 11 | for (KeyValue patientAttributeKeyValue : patientAttributes) { 12 | if (patientAttributeKeyValue.getKey().equalsIgnoreCase(keyToSearch)) { 13 | return patientAttributeKeyValue.getValue(); 14 | } 15 | } 16 | return null; 17 | } 18 | 19 | public abstract Patient run(List patientList, List patientAttributes) throws CannotMatchPatientException; 20 | } 21 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/BahmniName.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import java.util.LinkedHashMap; 4 | 5 | public class BahmniName { 6 | private String givenName; 7 | 8 | private String familyName; 9 | 10 | public BahmniName(LinkedHashMap post) { 11 | SimpleObjectExtractor extractor = new SimpleObjectExtractor(post); 12 | givenName = extractor.extract("givenName"); 13 | familyName = extractor.extract("familyName"); 14 | } 15 | 16 | public BahmniName(String givenName, String familyName) { 17 | this.givenName = givenName; 18 | this.familyName = familyName; 19 | } 20 | 21 | public String getGivenName() { 22 | return givenName; 23 | } 24 | 25 | public String getFamilyName() { 26 | return familyName; 27 | } 28 | 29 | public String getFullName() { 30 | return String.format("%s %s", givenName, familyName); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/AllTestsAndPanelsMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.AllTestsAndPanels; 4 | import org.openmrs.Concept; 5 | 6 | public class AllTestsAndPanelsMapper extends ResourceMapper { 7 | public AllTestsAndPanelsMapper() { 8 | super(null); 9 | } 10 | 11 | @Override 12 | public AllTestsAndPanels map(Concept testsAndPanelsConcept) { 13 | AllTestsAndPanels allTestsAndPanels = new AllTestsAndPanels(); 14 | allTestsAndPanels = mapResource(allTestsAndPanels, testsAndPanelsConcept); 15 | allTestsAndPanels.setDescription(ConceptExtension.getDescription(testsAndPanelsConcept)); 16 | allTestsAndPanels.setTestsAndPanels(new TestAndPanelMapper().map(testsAndPanelsConcept)); 17 | return allTestsAndPanels; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/retrospectiveEncounter/domain/BahmniVisit.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.retrospectiveEncounter.domain; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.Obs; 5 | import org.openmrs.Visit; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Set; 10 | 11 | public class BahmniVisit { 12 | private Visit visit; 13 | 14 | public BahmniVisit(Visit visit) { 15 | this.visit = visit; 16 | } 17 | 18 | public List obsFor(String requestedEncounterType) { 19 | List allObs = new ArrayList<>(); 20 | for (Encounter anEncounter : visit.getEncounters()) { 21 | if (anEncounter.getEncounterType().getName().equals(requestedEncounterType)) { 22 | Set obs = anEncounter.getObs(); 23 | allObs.addAll(obs); 24 | } 25 | } 26 | return allObs; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bahmni-mapping/src/main/java/org/openmrs/module/bahmnimapping/dao/LocationEncounterTypeMapDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The contents of this file are subject to the OpenMRS Public License 3 | * Version 1.0 (the "License"); you may not use this file except in 4 | * compliance with the License. You may obtain a copy of the License at 5 | * http://license.openmrs.org 6 | * 7 | * Software distributed under the License is distributed on an "AS IS" 8 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 9 | * License for the specific language governing rights and limitations 10 | * under the License. 11 | * 12 | * Copyright (C) OpenMRS, LLC. All Rights Reserved. 13 | */ 14 | package org.openmrs.module.bahmnimapping.dao; 15 | 16 | 17 | import org.openmrs.EncounterType; 18 | 19 | import java.util.List; 20 | 21 | public interface LocationEncounterTypeMapDao { 22 | List getEncounterTypes(String locationUuid); 23 | } 24 | -------------------------------------------------------------------------------- /bahmni-mapping/src/main/resources/EntityMapping.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/events/eventPublisher/BahmniEventPublisher.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.events.eventPublisher; 2 | 3 | import org.bahmni.module.bahmnicore.events.BahmniEvent; 4 | import org.springframework.context.ApplicationEventPublisher; 5 | import org.springframework.context.ApplicationEventPublisherAware; 6 | import org.springframework.lang.NonNull; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class BahmniEventPublisher implements ApplicationEventPublisherAware { 11 | 12 | private ApplicationEventPublisher eventPublisher; 13 | 14 | @Override 15 | public void setApplicationEventPublisher(@NonNull ApplicationEventPublisher applicationEventPublisher) { 16 | this.eventPublisher = applicationEventPublisher; 17 | } 18 | public void publishEvent(BahmniEvent event) { 19 | this.eventPublisher.publishEvent(event); 20 | } 21 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.Order; 4 | import org.openmrs.Patient; 5 | import org.openmrs.Visit; 6 | 7 | import java.util.List; 8 | 9 | public interface OrderService { 10 | List getPendingOrders(String patientUuid, String orderTypeUuid); 11 | 12 | List getAllOrders(String patientUuid, String orderTypeUuid, Integer offset, Integer limit, List locationUuids); 13 | 14 | List getVisitsWithOrders(Patient patient, String orderType, Boolean includeActiveVisit, Integer numberOfVisits); 15 | 16 | List getAllOrdersForVisits(String patientUuid, String orderType, Integer numberOfVisits); 17 | 18 | Order getOrderByUuid(String orderUuid); 19 | 20 | List getAllOrdersForVisitUuid(String visitUuid, String orderTypeUuid); 21 | 22 | Order getChildOrder(Order order); 23 | } 24 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/entityMapping/Entity.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.entityMapping; 2 | 3 | import java.util.List; 4 | 5 | public class Entity { 6 | public T1 entity; 7 | 8 | public List mappings; 9 | 10 | public Entity () { 11 | } 12 | 13 | public Entity(T1 entity, List mappings) { 14 | this.entity = entity; 15 | this.mappings = mappings; 16 | } 17 | 18 | public T1 getEntity() { 19 | return entity; 20 | } 21 | 22 | public void setEntity(T1 entity) { 23 | this.entity = entity; 24 | } 25 | 26 | public List getMappings() { 27 | return mappings; 28 | } 29 | 30 | public void setMappings(List mappings) { 31 | this.mappings = mappings; 32 | } 33 | 34 | public void addMapping(Object mappedEntity) { 35 | mappings.add((T2) mappedEntity); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/advisor/BahmniEncounterServiceAdvisor.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.advisor; 2 | 3 | import org.aopalliance.aop.Advice; 4 | import org.openmrs.module.bahmniemrapi.encountertransaction.advice.BahmniEncounterTransactionUpdateAdvice; 5 | import org.springframework.aop.Advisor; 6 | import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor; 7 | 8 | import java.lang.reflect.Method; 9 | 10 | public class BahmniEncounterServiceAdvisor extends StaticMethodMatcherPointcutAdvisor implements Advisor { 11 | private static final String SAVE_METHOD = "save"; 12 | 13 | @Override 14 | public boolean matches(Method method, Class aClass) { 15 | return SAVE_METHOD.equals(method.getName()); 16 | } 17 | 18 | @Override 19 | public Advice getAdvice() { 20 | return new BahmniEncounterTransactionUpdateAdvice(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/ConceptSet.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class ConceptSet extends ConceptCommon { 7 | private List children; 8 | 9 | public ConceptSet() { 10 | super(); 11 | } 12 | 13 | public ConceptSet(String uuid, String name, String conceptDescription, String conceptClass, String conceptShortname, List referenceTerms, List children) { 14 | super(uuid, name, conceptDescription, conceptClass, conceptShortname, referenceTerms, "N/A"); 15 | this.children = children; 16 | } 17 | 18 | public List getChildren() { 19 | return children == null ? new ArrayList() : children; 20 | } 21 | 22 | public void setChildren(List children) { 23 | this.children = children; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/csv/models/LabResultRow.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.csv.models; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | 5 | public class LabResultRow { 6 | private String test; 7 | private String result; 8 | 9 | public LabResultRow() { 10 | } 11 | 12 | public LabResultRow(String test, String result) { 13 | this.test = test; 14 | this.result = result; 15 | } 16 | 17 | public String getTest() { 18 | return test; 19 | } 20 | 21 | public LabResultRow setTest(String test) { 22 | this.test = test; 23 | return this; 24 | } 25 | 26 | public String getResult() { 27 | return result; 28 | } 29 | 30 | public LabResultRow setResult(String result) { 31 | this.result = result; 32 | return this; 33 | } 34 | 35 | public boolean isEmpty() { 36 | return StringUtils.isBlank(test) && StringUtils.isBlank(result); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /bahmni-mapping/src/main/java/org/openmrs/module/bahmnimapping/services/BahmniLocationService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The contents of this file are subject to the OpenMRS Public License 3 | * Version 1.0 (the "License"); you may not use this file except in 4 | * compliance with the License. You may obtain a copy of the License at 5 | * http://license.openmrs.org 6 | * 7 | * Software distributed under the License is distributed on an "AS IS" 8 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 9 | * License for the specific language governing rights and limitations 10 | * under the License. 11 | * 12 | * Copyright (C) OpenMRS, LLC. All Rights Reserved. 13 | */ 14 | package org.openmrs.module.bahmnimapping.services; 15 | 16 | import org.openmrs.EncounterType; 17 | 18 | import java.util.List; 19 | 20 | public interface BahmniLocationService { 21 | List getEncounterTypes(String locationUuid); 22 | EncounterType getEncounterType(String locationUuid); 23 | } 24 | -------------------------------------------------------------------------------- /obs-relation/src/main/java/org/bahmni/module/obsrelationship/dao/ObsRelationshipDao.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.obsrelationship.dao; 2 | 3 | import org.bahmni.module.obsrelationship.model.ObsRelationship; 4 | import org.bahmni.module.obsrelationship.model.ObsRelationshipType; 5 | import org.openmrs.Obs; 6 | 7 | import java.util.List; 8 | 9 | public interface ObsRelationshipDao { 10 | ObsRelationship saveOrUpdate(ObsRelationship obsRelationship); 11 | ObsRelationshipType saveOrUpdateRelationshipType(ObsRelationshipType obsRelationshipType); 12 | ObsRelationship getRelationByUuid(String uuid); 13 | List getRelationsBy(Obs sourceObs, Obs targetObs); 14 | List getAllRelationshipTypes(); 15 | ObsRelationshipType getRelationshipTypeByName(String name); 16 | 17 | List getRelationsWhereSourceObsInEncounter(String encounterUuid); 18 | 19 | List getObsRelationshipsByTargetObsUuid(String targetObsUuid); 20 | } 21 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/searchParams/AdditionalSearchParam.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model.searchParams; 2 | 3 | public class AdditionalSearchParam { 4 | 5 | private String additionalSearchHandler; 6 | private String tests; 7 | 8 | public AdditionalSearchParam(String additionalSearchHandler, String tests) { 9 | this.additionalSearchHandler = additionalSearchHandler; 10 | this.tests = tests; 11 | } 12 | 13 | public AdditionalSearchParam() { 14 | } 15 | 16 | public String getAdditionalSearchHandler() { 17 | return additionalSearchHandler; 18 | } 19 | 20 | public void setAdditionalSearchHandler(String additionalSearchHandler) { 21 | this.additionalSearchHandler = additionalSearchHandler; 22 | } 23 | 24 | public String getTests(){ 25 | return tests; 26 | } 27 | 28 | public void setTests(String tests){ 29 | this.tests = tests; 30 | } 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /reference-data/omod/src/main/java/org/bahmni/module/referencedata/labconcepts/model/event/AllTestsPanelsConceptSetEvent.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.model.event; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.AllTestsAndPanels; 4 | import org.openmrs.Concept; 5 | import org.openmrs.api.context.Context; 6 | 7 | public class AllTestsPanelsConceptSetEvent extends ConceptOperationEvent { 8 | 9 | 10 | public AllTestsPanelsConceptSetEvent(String url, String category, String title) { 11 | super(url, category, title); 12 | } 13 | 14 | @Override 15 | public boolean isResourceConcept(Concept concept) { 16 | return isAllTestAndPanelConcept(concept); 17 | } 18 | 19 | private boolean isAllTestAndPanelConcept(Concept concept) { 20 | return concept.getName(Context.getLocale()) != null && 21 | concept.getName(Context.getLocale()).getName().equals(AllTestsAndPanels.ALL_TESTS_AND_PANELS); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/service/BahmniEncounterTransactionService.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.encountertransaction.service; 2 | 3 | import org.openmrs.Patient; 4 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniEncounterSearchParameters; 5 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniEncounterTransaction; 6 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 7 | 8 | import java.util.Date; 9 | 10 | public interface BahmniEncounterTransactionService { 11 | BahmniEncounterTransaction save(BahmniEncounterTransaction encounterTransaction); 12 | BahmniEncounterTransaction save(BahmniEncounterTransaction encounterTransaction, Patient patient, Date visitStartDate, Date visitEndDate); 13 | EncounterTransaction find(BahmniEncounterSearchParameters encounterSearchParameters); 14 | void delete(BahmniEncounterTransaction bahmniEncounterTransaction); 15 | } 16 | -------------------------------------------------------------------------------- /obs-relation/src/main/java/org/bahmni/module/obsrelationship/api/ObsRelationService.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.obsrelationship.api; 2 | 3 | 4 | import org.bahmni.module.obsrelationship.model.ObsRelationship; 5 | import org.bahmni.module.obsrelationship.model.ObsRelationshipType; 6 | import org.openmrs.Obs; 7 | 8 | import java.util.List; 9 | 10 | public interface ObsRelationService { 11 | ObsRelationship saveOrUpdate(ObsRelationship obsRelationship); 12 | ObsRelationshipType saveOrUpdateRelationshipType(ObsRelationshipType obsRelationshipType); 13 | ObsRelationship getRelationByUuid(String uuid); 14 | List getRelationsBy(Obs sourceObs, Obs targetObs); 15 | 16 | List getRelationsWhereSourceObsInEncounter(String encounterUuid); 17 | 18 | List getAllRelationshipTypes(); 19 | ObsRelationshipType getRelationshipTypeByName(String name); 20 | 21 | List getObsRelationshipsByTargetObsUuid(String targetObsUuid); 22 | } 23 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/impl/ApplicationDataDirectoryImpl.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao.impl; 2 | 3 | import org.bahmni.module.bahmnicore.dao.ApplicationDataDirectory; 4 | import org.openmrs.util.OpenmrsUtil; 5 | 6 | import java.io.File; 7 | 8 | public class ApplicationDataDirectoryImpl implements ApplicationDataDirectory { 9 | 10 | @Override 11 | public File getFile(String relativePath) { 12 | String applicationDataDirectory = OpenmrsUtil.getApplicationDataDirectory(); 13 | if (!applicationDataDirectory.endsWith(File.separator) && !relativePath.startsWith(File.separator)) { 14 | applicationDataDirectory += File.separator; 15 | } 16 | return new File(applicationDataDirectory + relativePath); 17 | } 18 | 19 | @Override 20 | public File getFileFromConfig(String relativePath) { 21 | return new File(OpenmrsUtil.getApplicationDataDirectory(),"bahmni_config"+ File.separator+relativePath); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/config/BahmniCoreModuleConfig.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.config; 2 | 3 | import org.bahmni.module.bahmnicommons.api.configuration.ModuleAppConfig; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | @Component 10 | public class BahmniCoreModuleConfig implements ModuleAppConfig { 11 | @Override 12 | public String getModuleName() { 13 | return "core"; 14 | } 15 | 16 | @Override 17 | public List getGlobalAppProperties() { 18 | return Arrays.asList( 19 | "bahmni.encounterType.default", 20 | "clinic.helpDeskNumber", 21 | "cdss.enable", 22 | "obs.conceptMappingsForOT", //should be moved to OT module 23 | "drugOrder.drugOther", 24 | "concept.reasonForDeath", 25 | "bahmni.relationshipTypeMap", 26 | "bahmni.primaryIdentifierType"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /admin/src/test/resources/trial.csv: -------------------------------------------------------------------------------- 1 | serialNumber,Registration Date,Patient.registrationNumber,Patient.name,Patient.age,Patient.gender,Patient.village,Patient.tehsil,Patient.district,Obs.HEIGHT,Obs.WEIGHT,Obs.BMI,Diagnsois.diagnosis 2 | 1,01/01/2014,200000,Anad xxx Kewat,49,M,Bharni,Takhatpur,Bilaspur,157,43,,2 3 | 2,01/01/2014,200001,ram milan xxxx,62,M,devrikala,pendra,Bilaspur,159,53.5,,2 4 | 3,01/01/2014,200002,shanti xxxx,65,F,manikpur,samnapur,Dindouri,148,55,,2 5 | 4,03/01/2014,200003,shatruhan singh xxxx,53,M,sakari,Takhatpur,Bilaspur,165,50.4,,2 6 | 5,03/01/2014,200004,Sharda bai xxxx,62,F,soniyamar,dindouri,Dindouri,152,41.2,,2 7 | 6,06/01/2014,200005,Itwariya bai xxxx,65,F,kaswahi,jaitpur,Shahdol,140,31.3,,2 8 | 7,06/01/2014,200006,dinesh kumar xxxx,42,M,hardi,janjgir,janjgir,162,55.2,,2 9 | 8,20/12/2013,200007,urmila bai xxxx,55,F,kanwahi,jaitpur,Shahdol,150,38.4,,2 10 | 9,13/01/2014,200008,prema bai xxxx,48,F,sodhi,mungelli,Bilaspur,153,37.6,,2 11 | 10,13/01/2014,200009,tulsiya bai xxxx,70,F,naraud,marwahi,Bilaspur,153,38.5,,2 -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/Panel.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.List; 4 | 5 | public class Panel extends Resource { 6 | private String description; 7 | private List tests; 8 | private Double sortOrder; 9 | public static final String LAB_SET_CONCEPT_CLASS = "LabSet"; 10 | 11 | public String getDescription() { 12 | return description; 13 | } 14 | 15 | public void setDescription(String description) { 16 | this.description = description; 17 | } 18 | 19 | public List getTests() { 20 | return tests; 21 | } 22 | 23 | public void setTests(List tests) { 24 | this.tests = tests; 25 | } 26 | 27 | public void setSortOrder(Double sortOrder) { 28 | this.sortOrder = sortOrder; 29 | } 30 | 31 | public Double getSortOrder() { 32 | return sortOrder; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/RowMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service; 2 | 3 | import org.openmrs.module.webservices.rest.SimpleObject; 4 | import org.springframework.jdbc.support.JdbcUtils; 5 | 6 | import java.sql.ResultSet; 7 | import java.sql.ResultSetMetaData; 8 | import java.sql.SQLException; 9 | 10 | public class RowMapper { 11 | 12 | public SimpleObject mapRow(ResultSet rs) throws SQLException { 13 | SimpleObject row = new SimpleObject(); 14 | ResultSetMetaData rsmd = rs.getMetaData(); 15 | int columnCount = rsmd.getColumnCount(); 16 | for (int index = 1; index <= columnCount; index++) { 17 | String column = JdbcUtils.lookupColumnName(rsmd, index); 18 | Object value = rs.getObject(column); 19 | if (value == null) { 20 | row.put(column, ""); 21 | } else { 22 | row.put(column, value); 23 | } 24 | } 25 | return row; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /admin/src/main/java/org/bahmni/module/admin/csv/models/PatientProgramRow.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.admin.csv.models; 2 | 3 | import org.bahmni.csv.CSVEntity; 4 | import org.bahmni.csv.KeyValue; 5 | import org.bahmni.csv.annotation.CSVHeader; 6 | import org.bahmni.csv.annotation.CSVRegexHeader; 7 | 8 | import java.text.ParseException; 9 | import java.util.Date; 10 | import java.util.List; 11 | 12 | import static org.bahmni.module.admin.csv.utils.CSVUtils.getDateFromString; 13 | 14 | public class PatientProgramRow extends CSVEntity { 15 | @CSVHeader(name = "Registration Number") 16 | public String patientIdentifier; 17 | 18 | @CSVRegexHeader(pattern = "Patient.*") 19 | public List patientAttributes; 20 | 21 | @CSVHeader(name = "Program") 22 | public String programName; 23 | 24 | @CSVHeader(name = "EnrollmentDate") 25 | public String enrollmentDateTime; 26 | 27 | public Date getEnrollmentDate() throws ParseException { 28 | return getDateFromString(enrollmentDateTime); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/pivottable/contract/PivotRow.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.pivottable.contract; 2 | 3 | import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniObservation; 4 | 5 | import java.util.ArrayList; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | public class PivotRow { 10 | private Map> columns = new HashMap<>(); 11 | 12 | public void addColumn(String name, BahmniObservation bahmniObservation) { 13 | ArrayList bahmniObs; 14 | bahmniObs = columns.get(name) != null ? columns.get(name) : new ArrayList(); 15 | bahmniObs.add(bahmniObservation); 16 | columns.put(name, bahmniObs); 17 | } 18 | 19 | public ArrayList getValue(String key) { 20 | return columns.get(key); 21 | } 22 | 23 | public Map> getColumns() { 24 | return columns; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/builder/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.builder; 2 | 3 | import org.openmrs.Person; 4 | import org.openmrs.PersonName; 5 | 6 | import java.util.HashSet; 7 | import java.util.Set; 8 | 9 | public class PersonBuilder { 10 | 11 | private final Person person; 12 | 13 | public PersonBuilder() { 14 | person = new Person(); 15 | } 16 | 17 | public PersonBuilder withUUID(String patientUuid) { 18 | person.setUuid(patientUuid); 19 | return this; 20 | } 21 | 22 | public PersonBuilder withPersonName(String personNameValue) { 23 | PersonName personName = new PersonName(); 24 | personName.setGivenName(personNameValue); 25 | personName.setId(2); 26 | Set personNames = new HashSet<>(); 27 | personNames.add(personName); 28 | person.setNames(personNames); 29 | return this; 30 | } 31 | 32 | public Person build() { 33 | return person; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/drugorder/mapper/BahmniProviderMapperTest.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.drugorder.mapper; 2 | 3 | import org.junit.Test; 4 | import org.openmrs.Provider; 5 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 6 | 7 | import static org.hamcrest.Matchers.equalTo; 8 | import static org.hamcrest.Matchers.is; 9 | import static org.junit.Assert.assertThat; 10 | 11 | public class BahmniProviderMapperTest { 12 | 13 | @Test 14 | public void shouldMapOpenMRSProviderToEncounterTransactionProvider() { 15 | Provider openMRSProvider = new Provider(); 16 | openMRSProvider.setUuid("86526ed5-3c11-11de-a0ba-001e378eb671"); 17 | openMRSProvider.setName("Superman"); 18 | EncounterTransaction.Provider provider = new BahmniProviderMapper().map(openMRSProvider); 19 | assertThat(provider.getUuid(), is(equalTo(openMRSProvider.getUuid()))); 20 | assertThat(provider.getName(), is(equalTo(openMRSProvider.getName()))); 21 | } 22 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/impl/EntityDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao.impl; 2 | 3 | import org.bahmni.module.bahmnicore.dao.EntityDao; 4 | import org.hibernate.Criteria; 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import java.util.List; 12 | 13 | @Repository 14 | public class EntityDaoImpl implements EntityDao { 15 | @Autowired 16 | private SessionFactory sessionFactory; 17 | 18 | @Override 19 | public T getByUuid(String uuid, Class className) { 20 | Session currentSession = sessionFactory.getCurrentSession(); 21 | Criteria criteria = currentSession.createCriteria(className); 22 | criteria.add(Restrictions.eq("uuid", uuid)); 23 | List list = criteria.list(); 24 | return list.size() > 0? (T) list.get(0) : null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vagrant-deploy/scripts/vagrant/vagrant_functions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ##################################################################################################### 4 | # This script can be used to call functions which will execute a command in your vagrant box. 5 | # -c option will be used to pass a command 6 | # -f option will be used to pass a full qualified file that contains commands 7 | # 8 | # It can also be used to SCP into the vagrant box 9 | ##################################################################################################### 10 | 11 | MACHINE_IP=192.168.33.10 12 | KEY_FILE=~/.vagrant.d/insecure_private_key 13 | TIMEOUT="-o ConnectTimeout=5" 14 | 15 | function run_in_vagrant { 16 | 17 | if [ "$1" == "-c" ]; then 18 | ssh vagrant@$MACHINE_IP -i $KEY_FILE $TIMEOUT "$2" 19 | elif [ "$1" == "-f" ]; then 20 | ssh vagrant@$MACHINE_IP -i $KEY_FILE $TIMEOUT < "$2" 21 | fi 22 | 23 | } 24 | 25 | # $1: Source $2: Dest 26 | function scp_to_vagrant { 27 | scp -i $KEY_FILE $TIMEOUT $1 vagrant@$MACHINE_IP:$2 28 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/pivottable/contract/PivotTable.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.pivottable.contract; 2 | 3 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 4 | 5 | import java.util.ArrayList; 6 | import java.util.LinkedHashSet; 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | public class PivotTable { 11 | private Set headers = new LinkedHashSet<>(); 12 | private List rows = new ArrayList<>(); 13 | 14 | public Set getHeaders() { 15 | return headers; 16 | } 17 | 18 | public void setHeaders(Set headers) { 19 | this.headers = headers; 20 | } 21 | 22 | public List getRows() { 23 | return rows; 24 | } 25 | 26 | public void setRows(List rows) { 27 | this.rows = rows; 28 | } 29 | 30 | public void addRow(int index, PivotRow row){ 31 | this.rows.add(index,row); 32 | } 33 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/util/AddressMother.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.util; 2 | 3 | import org.openmrs.PersonAddress; 4 | import org.openmrs.module.webservices.rest.SimpleObject; 5 | 6 | public class AddressMother { 7 | public SimpleObject getSimpleObjectForAddress() { 8 | return new SimpleObject() 9 | .add("address1", "House No. 23") 10 | .add("address2", "8th cross") 11 | .add("address3", "3rd block") 12 | .add("cityVillage", "Bengaluru") 13 | .add("countyDistrict", "Bengaluru south") 14 | .add("stateProvince", "Karnataka"); 15 | } 16 | 17 | public PersonAddress build() { 18 | PersonAddress personAddress = new PersonAddress(); 19 | personAddress.setCityVillage("village"); 20 | personAddress.setCountyDistrict("district"); 21 | personAddress.setAddress3("tehsil"); 22 | personAddress.setStateProvince("state"); 23 | return personAddress; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bahmnicore-api/src/test/java/org/bahmni/module/bahmnicore/util/NameMother.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.util; 2 | 3 | import org.openmrs.PersonName; 4 | import org.openmrs.module.webservices.rest.SimpleObject; 5 | 6 | public class NameMother { 7 | 8 | private String firstName; 9 | private String lastName; 10 | private String middleName; 11 | 12 | public NameMother() { 13 | firstName = "first"; 14 | lastName = "last"; 15 | middleName = "middle"; 16 | } 17 | 18 | public SimpleObject getSimpleObjectForName() { 19 | return new SimpleObject().add("givenName", firstName).add("familyName", lastName).add("middleName", middleName); 20 | } 21 | 22 | public NameMother withName(String firstName, String middleName, String lastName) { 23 | this.firstName = firstName; 24 | this.middleName = middleName; 25 | this.lastName = lastName; 26 | return this; 27 | } 28 | 29 | public PersonName build() { 30 | return new PersonName(firstName, middleName, lastName); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/test/java/org/openmrs/module/bahmniemrapi/builder/ETConceptBuilder.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.builder; 2 | 3 | import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; 4 | 5 | public class ETConceptBuilder { 6 | private EncounterTransaction.Concept concept; 7 | 8 | public ETConceptBuilder() { 9 | concept = new EncounterTransaction.Concept(); 10 | } 11 | 12 | public EncounterTransaction.Concept build() { 13 | return concept; 14 | } 15 | 16 | public ETConceptBuilder withName(String name) { 17 | concept.setName(name); 18 | return this; 19 | } 20 | 21 | public ETConceptBuilder withUuid(String uuid) { 22 | concept.setUuid(uuid); 23 | return this; 24 | } 25 | 26 | public ETConceptBuilder withSet(boolean isSet) { 27 | concept.setSet(isSet); 28 | return this; 29 | } 30 | 31 | public ETConceptBuilder withClass(String className) { 32 | concept.setConceptClass(className); 33 | return this; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/PanelMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.AllTestsAndPanels; 4 | import org.bahmni.module.referencedata.labconcepts.contract.LabTest; 5 | import org.bahmni.module.referencedata.labconcepts.contract.Panel; 6 | import org.openmrs.Concept; 7 | 8 | public class PanelMapper extends ResourceMapper { 9 | public PanelMapper() { 10 | super(AllTestsAndPanels.ALL_TESTS_AND_PANELS); 11 | } 12 | 13 | @Override 14 | public Panel map(Concept panelConcept) { 15 | Panel panel = new Panel(); 16 | panel = mapResource(panel, panelConcept); 17 | panel.setTests(ConceptExtension.getResourceReferencesOfConceptClasses(panelConcept.getSetMembers(), LabTest.LAB_TEST_CONCEPT_CLASSES)); 18 | panel.setSortOrder(getSortWeight(panelConcept)); 19 | panel.setDescription(ConceptExtension.getDescriptionOrName(panelConcept)); 20 | return panel; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/LabTestMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.AllTestsAndPanels; 4 | import org.bahmni.module.referencedata.labconcepts.contract.LabTest; 5 | import org.openmrs.Concept; 6 | 7 | public class LabTestMapper extends ResourceMapper { 8 | public LabTestMapper() { 9 | super(AllTestsAndPanels.ALL_TESTS_AND_PANELS); 10 | } 11 | 12 | @Override 13 | public LabTest map(Concept testConcept) { 14 | LabTest test = new LabTest(); 15 | test = mapResource(test, testConcept); 16 | test.setDescription(ConceptExtension.getDescriptionOrName(testConcept)); 17 | test.setResultType(testConcept.getDatatype().getName()); 18 | test.setTestUnitOfMeasure(ConceptExtension.getUnits(testConcept)); 19 | test.setSortOrder(getSortWeight(testConcept)); 20 | test.setCodedTestAnswer(testConcept.getAnswers()); 21 | return test; 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/compass/config.rb: -------------------------------------------------------------------------------- 1 | # Require any additional compass plugins here. 2 | 3 | # Set this to the root of your project when deployed: 4 | Encoding.default_external = "utf-8" 5 | http_path = "/" 6 | css_dir = "../webapp/resources/styles" 7 | sass_dir = "sass" 8 | images_dir = "images" 9 | javascripts_dir = "javascripts" 10 | add_import_path "sass-external/uicommons-scss" 11 | 12 | # You can select your preferred output style here (can be overridden via the command line): 13 | # output_style = :expanded or :nested or :compact or :compressed 14 | 15 | # To enable relative paths to assets via compass helper functions. Uncomment: 16 | # relative_assets = true 17 | 18 | # To disable debugging comments that display the original location of your selectors. Uncomment: 19 | # line_comments = false 20 | 21 | 22 | # If you prefer the indented syntax, you might want to regenerate this 23 | # project again passing --syntax sass, or you can uncomment this: 24 | # preferred_syntax = :sass 25 | # and then run: 26 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 27 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/AttributableResourceMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.openmrs.Concept; 4 | import org.bahmni.module.referencedata.labconcepts.contract.Resource; 5 | 6 | import java.util.HashMap; 7 | 8 | public class AttributableResourceMapper extends ResourceMapper { 9 | 10 | public AttributableResourceMapper() {super(null);} 11 | 12 | protected AttributableResourceMapper(String parentConceptName) { 13 | super(parentConceptName); 14 | } 15 | 16 | @Override 17 | public Resource map(Concept concept) { 18 | Resource resource = new Resource(); 19 | mapResource(resource, concept); 20 | HashMap properties = new HashMap<>(); 21 | concept.getActiveAttributes().stream().forEach(a -> properties.put(a.getAttributeType().getName(), a.getValueReference())); 22 | if (!properties.isEmpty()) { 23 | resource.setProperties(properties); 24 | } 25 | return resource; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/diagnosis/contract/BahmniDiagnosisRequest.java: -------------------------------------------------------------------------------- 1 | package org.openmrs.module.bahmniemrapi.diagnosis.contract; 2 | 3 | import org.codehaus.jackson.annotate.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public class BahmniDiagnosisRequest extends BahmniDiagnosis { 7 | private String previousObs; 8 | private String encounterUuid; 9 | private String creatorName; 10 | 11 | public String getPreviousObs() { 12 | return previousObs; 13 | } 14 | 15 | public void setPreviousObs(String previousObs) { 16 | this.previousObs = previousObs; 17 | } 18 | 19 | public void setEncounterUuid(String encounterUuid) { 20 | this.encounterUuid = encounterUuid; 21 | } 22 | 23 | public String getEncounterUuid() { 24 | return encounterUuid; 25 | } 26 | 27 | public String getCreatorName() { 28 | return this.creatorName; 29 | } 30 | 31 | public void setCreatorName(String creatorName) { 32 | this.creatorName = creatorName; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/diseasetemplate/DiseaseTemplateConfig.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.diseasetemplate; 2 | 3 | import org.codehaus.jackson.annotate.JsonIgnoreProperties; 4 | 5 | import java.util.List; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class DiseaseTemplateConfig { 9 | private String templateName; 10 | private List showOnly; 11 | 12 | public DiseaseTemplateConfig(String templateName, List showOnly) { 13 | this.templateName = templateName; 14 | this.showOnly = showOnly; 15 | } 16 | 17 | 18 | public DiseaseTemplateConfig() { 19 | } 20 | 21 | public String getTemplateName() { 22 | return templateName; 23 | } 24 | 25 | public void setTemplateName(String templateName) { 26 | this.templateName = templateName; 27 | } 28 | 29 | public List getShowOnly() { 30 | return showOnly; 31 | } 32 | 33 | public void setShowOnly(List showOnly) { 34 | this.showOnly = showOnly; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/impl/BahmniOrderSetServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.service.impl; 2 | 3 | import org.bahmni.module.bahmnicore.dao.BahmniOrderSetDao; 4 | import org.bahmni.module.bahmnicore.service.BahmniOrderSetService; 5 | import org.openmrs.OrderSet; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | @Component 13 | @Transactional 14 | public class BahmniOrderSetServiceImpl implements BahmniOrderSetService { 15 | 16 | private BahmniOrderSetDao bahmniOrderSetDao; 17 | 18 | @Autowired 19 | public BahmniOrderSetServiceImpl(BahmniOrderSetDao bahmniOrderSetDao) { 20 | this.bahmniOrderSetDao = bahmniOrderSetDao; 21 | } 22 | 23 | @Override 24 | @Transactional(readOnly = true) 25 | public List getOrderSetByQuery(String searchTerm) { 26 | return bahmniOrderSetDao.getOrderSetByQuery(searchTerm); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/java/org/bahmni/module/bahmnicore/web/v1_0/controller/WhoamiControllerIT.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0.controller; 2 | 3 | import org.bahmni.module.bahmnicore.web.v1_0.BaseIntegrationTest; 4 | import org.bahmni.module.bahmnicoreui.contract.Privilege; 5 | import org.codehaus.jackson.type.TypeReference; 6 | import org.junit.Test; 7 | 8 | import java.util.List; 9 | 10 | import static org.hamcrest.CoreMatchers.equalTo; 11 | import static org.hamcrest.CoreMatchers.is; 12 | import static org.hamcrest.MatcherAssert.assertThat; 13 | 14 | public class WhoamiControllerIT extends BaseIntegrationTest { 15 | 16 | @Test 17 | public void shouldRetrievePrivilegesForAValidSession() throws Exception { 18 | List privileges = deserialize(handle( 19 | newGetRequest("/rest/v1/bahmnicore/whoami")), 20 | new TypeReference>() { 21 | }); 22 | assertThat(privileges.size(),is(equalTo(0))); 23 | } 24 | 25 | 26 | //Need to add test cases where there is no logged in user 27 | } 28 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/contract/TestsAndPanels.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.contract; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class TestsAndPanels extends Resource { 7 | private Set tests; 8 | private Set panels; 9 | 10 | public Set getTests() { 11 | if (tests == null) { 12 | tests = new HashSet<>(); 13 | } 14 | return tests; 15 | } 16 | 17 | public void setTests(Set tests) { 18 | this.tests = tests; 19 | } 20 | 21 | public Set getPanels() { 22 | if (panels == null) { 23 | panels = new HashSet<>(); 24 | } 25 | return panels; 26 | } 27 | 28 | public void setPanels(Set panels) { 29 | this.panels = panels; 30 | } 31 | 32 | public void addTest(LabTest labTest) { 33 | getTests().add(labTest); 34 | } 35 | 36 | public void addPanel(Panel panel) { 37 | getPanels().add(panel); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 19 | -------------------------------------------------------------------------------- /admin/src/test/resources/TestingApplicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | classpath:hibernate.cfg.xml 11 | classpath:test-hibernate.cfg.xml 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | org.openmrs 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /jss-old-data/src/main/java/org/bahmni/datamigration/request/referencedata/PersonAttribute.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.datamigration.request.referencedata; 2 | 3 | import static org.bahmni.datamigration.DataScrub.scrubData; 4 | 5 | public class PersonAttribute { 6 | private String uuid; 7 | private String display; 8 | private String name; 9 | private String description; 10 | 11 | public String getUuid() { 12 | return uuid; 13 | } 14 | 15 | public void setUuid(String uuid) { 16 | this.uuid = uuid; 17 | } 18 | 19 | public String getDisplay() { 20 | return display; 21 | } 22 | 23 | public void setDisplay(String display) { 24 | this.display = display; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = scrubData(name); 33 | } 34 | 35 | public String getDescription() { 36 | return description; 37 | } 38 | 39 | public void setDescription(String description) { 40 | this.description = scrubData(description); 41 | } 42 | } -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/monitoring/response/TasksMonitoringResponse.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.monitoring.response; 2 | 3 | 4 | import java.util.Date; 5 | 6 | public class TasksMonitoringResponse { 7 | private final Boolean started; 8 | private final String taskClass; 9 | private final Date lastExecutionTime; 10 | private final Date nextExecutionTime; 11 | 12 | public TasksMonitoringResponse(Boolean started, String taskClass, Date lastExecutionTime, Date nextExecutionTime) { 13 | this.started = started; 14 | this.taskClass = taskClass; 15 | this.lastExecutionTime = lastExecutionTime; 16 | this.nextExecutionTime = nextExecutionTime; 17 | } 18 | 19 | public Boolean getStarted() { 20 | return started; 21 | } 22 | 23 | public String getTaskClass() { 24 | return taskClass; 25 | } 26 | 27 | public Date getLastExecutionTime() { 28 | return lastExecutionTime; 29 | } 30 | 31 | public Date getNextExecutionTime() { 32 | return nextExecutionTime; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/Provider.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import java.util.Objects; 4 | 5 | public class Provider { 6 | private String providerName; 7 | private String uuid; 8 | 9 | public String getProviderName() { 10 | return providerName; 11 | } 12 | 13 | public void setProviderName(String providerName) { 14 | this.providerName = providerName; 15 | } 16 | 17 | public String getUuid() { 18 | return uuid; 19 | } 20 | 21 | public void setUuid(String uuid) { 22 | this.uuid = uuid; 23 | } 24 | 25 | @Override 26 | public boolean equals(Object o) { 27 | if (this == o) return true; 28 | if (o == null || getClass() != o.getClass()) return false; 29 | Provider provider = (Provider) o; 30 | return Objects.equals(providerName, provider.providerName) && 31 | Objects.equals(uuid, provider.uuid); 32 | } 33 | 34 | @Override 35 | public int hashCode() { 36 | 37 | return Objects.hash(providerName, uuid); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /reference-data/api/src/main/java/org/bahmni/module/referencedata/labconcepts/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.referencedata.labconcepts.mapper; 2 | 3 | import org.bahmni.module.referencedata.labconcepts.contract.Department; 4 | import org.bahmni.module.referencedata.labconcepts.contract.LabTest; 5 | import org.openmrs.Concept; 6 | 7 | import static org.bahmni.module.referencedata.labconcepts.mapper.ConceptExtension.getResourceReferencesOfConceptClasses; 8 | 9 | public class DepartmentMapper extends ResourceMapper { 10 | 11 | public DepartmentMapper() { 12 | super(Department.DEPARTMENT_PARENT_CONCEPT_NAME); 13 | } 14 | 15 | @Override 16 | public Department map(Concept departmentConcept) { 17 | Department department = new Department(); 18 | department = mapResource(department, departmentConcept); 19 | department.setDescription(ConceptExtension.getDescriptionOrName(departmentConcept)); 20 | department.setTests(getResourceReferencesOfConceptClasses(departmentConcept.getSetMembers(), LabTest.LAB_TEST_CONCEPT_CLASSES)); 21 | return department; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /admin/src/test/resources/patientMatchingAlgorithm/IdAndNameMatch.groovy: -------------------------------------------------------------------------------- 1 | package patientMatchingAlgorithm 2 | 3 | import org.bahmni.csv.KeyValue 4 | import org.bahmni.module.admin.csv.patientmatchingalgorithm.PatientMatchingAlgorithm 5 | import org.openmrs.Patient 6 | 7 | public class IdAndNameMatch extends PatientMatchingAlgorithm{ 8 | @Override 9 | Patient run(List patientList, List patientAttributes) { 10 | String patientNameToMatch = getPatientGivenName(patientAttributes) 11 | 12 | for (Patient patient : patientList) { 13 | if (patient.getPatientIdentifier().getIdentifier().contains("GAN") && patient.getGivenName().equals(patientNameToMatch)) { 14 | return patient; 15 | } 16 | } 17 | return null; 18 | } 19 | 20 | private String getPatientGivenName(List patientAttributes) { 21 | for (KeyValue patientAttribute : patientAttributes) { 22 | if(patientAttribute.getKey().equals("given_name")){ 23 | return patientAttribute.getValue(); 24 | } 25 | } 26 | return null; 27 | } 28 | } -------------------------------------------------------------------------------- /bahmnicore-omod/src/test/resources/test-hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/encounter/data/ObservationData.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.encounter.data; 2 | 3 | public class ObservationData { 4 | private String conceptUUID; 5 | private String conceptName; 6 | private Object value; 7 | 8 | public ObservationData(String conceptUUID, String conceptName, Object value) { 9 | this.conceptUUID = conceptUUID; 10 | this.conceptName = conceptName; 11 | this.value = value; 12 | } 13 | 14 | public ObservationData() { 15 | } 16 | 17 | public String getConceptUUID() { 18 | return conceptUUID; 19 | } 20 | 21 | public Object getValue() { 22 | return value; 23 | } 24 | 25 | public void setConceptUUID(String conceptUUID) { 26 | this.conceptUUID = conceptUUID; 27 | } 28 | 29 | public void setValue(Object value) { 30 | this.value = value; 31 | } 32 | 33 | public String getConceptName() { 34 | return conceptName; 35 | } 36 | 37 | public void setConceptName(String conceptName) { 38 | this.conceptName = conceptName; 39 | } 40 | } -------------------------------------------------------------------------------- /openmrs-elis-atomfeed-client-omod/src/main/java/org/bahmni/module/elisatomfeedclient/api/worker/ProviderHelper.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.elisatomfeedclient.api.worker; 2 | 3 | import org.openmrs.Encounter; 4 | import org.openmrs.Provider; 5 | import org.openmrs.api.ProviderService; 6 | 7 | public class ProviderHelper { 8 | private ProviderService providerService; 9 | 10 | public ProviderHelper(ProviderService providerService) { 11 | this.providerService = providerService; 12 | } 13 | 14 | public static Provider getProviderFrom(Encounter encounter) { 15 | return encounter.getEncounterProviders().iterator().next().getProvider(); 16 | } 17 | 18 | public Provider getProviderByUuidOrReturnDefault(String providerUuid, String defaultProviderIdentifier) { 19 | Provider provider = providerService.getProviderByUuid(providerUuid); 20 | if (provider != null) { 21 | return provider; 22 | } 23 | if (defaultProviderIdentifier != null) { 24 | return providerService.getProviderByIdentifier(defaultProviderIdentifier); 25 | } 26 | return null; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/NoteType.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import org.openmrs.BaseOpenmrsData; 4 | 5 | import java.io.Serializable; 6 | 7 | public class NoteType extends BaseOpenmrsData implements Serializable { 8 | 9 | private Integer noteTypeId; 10 | 11 | private String name; 12 | 13 | private String description; 14 | public NoteType() { 15 | } 16 | public String getDescription() { 17 | return description; 18 | } 19 | public void setDescription(String description) { 20 | this.description = description; 21 | } 22 | public String getName() { 23 | return name; 24 | } 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | public Integer getNoteTypeId() { 29 | return noteTypeId; 30 | } 31 | public void setNoteTypeId(Integer noteTypeId) { 32 | this.noteTypeId = noteTypeId; 33 | } 34 | public Integer getId() { 35 | return getNoteTypeId(); 36 | } 37 | 38 | public void setId(Integer id) { 39 | setNoteTypeId(id); 40 | } 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /bahmnicore-omod/src/main/java/org/bahmni/module/bahmnicore/web/v1_0/contract/BahmniConceptAnswer.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.web.v1_0.contract; 2 | 3 | import org.openmrs.Concept; 4 | import org.openmrs.ConceptAnswer; 5 | import org.openmrs.Drug; 6 | 7 | public class BahmniConceptAnswer { 8 | private Drug drug; 9 | private Concept concept; 10 | 11 | public static BahmniConceptAnswer create(ConceptAnswer answer) { 12 | BahmniConceptAnswer bahmniConceptAnswer = new BahmniConceptAnswer(); 13 | if(answer.getAnswerDrug() != null){ 14 | bahmniConceptAnswer.setDrug(answer.getAnswerDrug()); 15 | } 16 | else{ 17 | bahmniConceptAnswer.setConcept(answer.getAnswerConcept()); 18 | } 19 | return bahmniConceptAnswer; 20 | } 21 | 22 | public Drug getDrug() { 23 | return drug; 24 | } 25 | 26 | public void setDrug(Drug drug) { 27 | this.drug = drug; 28 | } 29 | 30 | public Concept getConcept() { 31 | return concept; 32 | } 33 | 34 | public void setConcept(Concept concept) { 35 | this.concept = concept; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/drugorder/OrderFrequencyData.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.drugorder; 2 | 3 | import org.openmrs.OrderFrequency; 4 | 5 | public class OrderFrequencyData { 6 | 7 | private String uuid; 8 | private Double frequencyPerDay; 9 | private String name; 10 | 11 | public OrderFrequencyData(OrderFrequency orderFrequency) { 12 | this.setUuid(orderFrequency.getUuid()); 13 | this.setFrequencyPerDay(orderFrequency.getFrequencyPerDay()); 14 | this.setName(orderFrequency.getName()); 15 | } 16 | 17 | public void setUuid(String uuid) { 18 | this.uuid = uuid; 19 | } 20 | 21 | public String getUuid() { 22 | return uuid; 23 | } 24 | 25 | public void setFrequencyPerDay(Double frequencyPerDay) { 26 | this.frequencyPerDay = frequencyPerDay; 27 | } 28 | 29 | public Double getFrequencyPerDay() { 30 | return frequencyPerDay; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/dao/impl/PersonNameDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.dao.impl; 2 | 3 | import org.bahmni.module.bahmnicore.dao.PersonNameDao; 4 | import org.bahmni.module.bahmnicore.model.ResultList; 5 | import org.hibernate.Criteria; 6 | import org.hibernate.SessionFactory; 7 | import org.hibernate.criterion.Projections; 8 | import org.hibernate.criterion.Restrictions; 9 | import org.openmrs.PersonName; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Repository; 12 | 13 | @Repository 14 | public class PersonNameDaoImpl implements PersonNameDao { 15 | 16 | @Autowired 17 | private SessionFactory sessionFactory; 18 | 19 | @SuppressWarnings("unchecked") 20 | @Override 21 | public ResultList getUnique(String key, String query) { 22 | Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PersonName.class); 23 | criteria.add(Restrictions.ilike(key, query + "%")); 24 | criteria.setProjection(Projections.distinct(Projections.property(key))); 25 | criteria.setMaxResults(20); 26 | return new ResultList(criteria.list()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/contract/drugorder/ConceptData.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.contract.drugorder; 2 | 3 | 4 | import org.openmrs.Concept; 5 | import org.openmrs.api.context.Context; 6 | 7 | public class ConceptData { 8 | private String name; 9 | private String uuid; 10 | private String rootConcept; 11 | 12 | public ConceptData() { 13 | } 14 | 15 | public ConceptData(Concept concept) { 16 | if(concept != null){ 17 | this.name = concept.getName(Context.getLocale()).getName(); 18 | this.uuid = concept.getUuid(); 19 | } 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | 30 | public String getRootConcept() { 31 | return rootConcept; 32 | } 33 | 34 | public void setRootConcept(String rootConcept) { 35 | this.rootConcept = rootConcept; 36 | } 37 | 38 | public String getUuid() { 39 | return uuid; 40 | } 41 | 42 | public void setUuid(String uuid) { 43 | this.uuid = uuid; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/model/BahmniPersonAttribute.java: -------------------------------------------------------------------------------- 1 | package org.bahmni.module.bahmnicore.model; 2 | 3 | import java.util.LinkedHashMap; 4 | 5 | public class BahmniPersonAttribute { 6 | 7 | private String personAttributeUuid; 8 | 9 | private String value; 10 | 11 | public BahmniPersonAttribute(String personAttributeUuid, String value) { 12 | this.personAttributeUuid = personAttributeUuid; 13 | this.value = value; 14 | } 15 | 16 | public BahmniPersonAttribute(LinkedHashMap post) { 17 | SimpleObjectExtractor extractor = new SimpleObjectExtractor(post); 18 | personAttributeUuid = extractor.extract("attributeType"); 19 | Object extractValue = extractor.extract("value"); 20 | 21 | if (extractValue instanceof String) { 22 | value = (String) extractValue; 23 | } else { 24 | LinkedHashMap extractValue1 = (LinkedHashMap) extractValue; 25 | value = (String) extractValue1.get("display"); 26 | } 27 | } 28 | 29 | public String getPersonAttributeUuid() { 30 | return personAttributeUuid; 31 | } 32 | 33 | public String getValue() { 34 | return value; 35 | } 36 | } 37 | --------------------------------------------------------------------------------