Skip to content

Commit

Permalink
Merge pull request #1959 from opensrp/all_sprints_and_keycloak_migration
Browse files Browse the repository at this point in the history
All sprints and keycloak migration
  • Loading branch information
LZRS authored Apr 4, 2022
2 parents 87eed43 + 4f1dca9 commit 0f40f23
Show file tree
Hide file tree
Showing 122 changed files with 4,557 additions and 340 deletions.
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ allprojects {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url 'https://nexus.pentaho.org/content/groups/omni/' }
maven { url 'https://dl.bintray.com/ibm-watson-health/ibm-fhir-server-releases' }
maven {
url 'https://dl.bintray.com/ibm-watson-health/ibm-fhir-server-releases'
content {
// Does only include this group
includeGroup "com.ibm.fhir"
}
}
}
}

Expand Down
50 changes: 43 additions & 7 deletions opensrp-chw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ allprojects {
}
}


apply plugin: 'com.android.application'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
Expand All @@ -61,8 +62,14 @@ android {
checkReleaseBuilds false
abortOnError false
}
defaultConfig {
// Required when setting minSdkVersion to 20 or lower
multiDexEnabled true
}

compileOptions {
coreLibraryDesugaringEnabled true

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand Down Expand Up @@ -157,6 +164,7 @@ android {
buildConfigField "int", "STOCK_USAGE_REPORT_MINUTES", '1440'
buildConfigField "boolean", "USE_UNIFIED_REFERRAL_APPROACH", "true"
buildConfigField "boolean", "BUILD_FOR_BORESHA_AFYA_SOUTH", "false"
buildConfigField "boolean", "LOG_CRASHLYTICS", "true"
}

debug {
Expand All @@ -175,8 +183,14 @@ android {
buildConfigField "int", "STOCK_USAGE_REPORT_MINUTES", '1440'
buildConfigField "boolean", "USE_UNIFIED_REFERRAL_APPROACH", "true"
buildConfigField "boolean", "BUILD_FOR_BORESHA_AFYA_SOUTH", "false"
buildConfigField "boolean", "LOG_CRASHLYTICS", "false"
testCoverageEnabled true
}

preview {
initWith debug
buildConfigField "boolean", "LOG_CRASHLYTICS", "true"
}
}

packagingOptions {
Expand All @@ -203,6 +217,7 @@ android {
returnDefaultValues = true
includeAndroidResources = true
}

unitTests.all {
systemProperty 'robolectric.enabledSdks', '28'
jvmArgs '-noverify'
Expand Down Expand Up @@ -329,16 +344,18 @@ android {
dimension = 'baseDimension'
applicationIdSuffix ".lmh"
versionCode 2
versionName "0.1.7"
versionName "1.1.2"
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '100000'
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '50000'
buildConfigField "String", 'opensrp_url', '"https://lmh-liberia.smartregister.org/opensrp/"'
buildConfigField "String", 'guidebooks_url', '"https://opensrp.s3.amazonaws.com/media/lmh/"'
buildConfigField "String", 'opensrp_url_debug', '"https://lmh-stage.smartregister.org/opensrp/"'
buildConfigField "String", 'opensrp_url_debug', '"https://lmh-liberia-preview.smartregister.org/opensrp/"'
buildConfigField "String[]", "LOCATION_HIERACHY", '{"Country" , "County" , "District", "Clinics", "CHSS", "Village","Commune"}'
buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS", '{"Country" , "County" , "District", "Clinics", "CHSS", "Village","Commune"}'
buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Clinic" , "CHSS" , "CHA"}'
buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Country" , "County" , "District", "Clinics", "CHSS", "Village","Commune"}'
buildConfigField "String", 'DEFAULT_LOCATION', '"Commune"'
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHA"'
buildConfigField "int", "DATABASE_VERSION", '6'
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"Commune"'
buildConfigField "int", "DATABASE_VERSION", '7'
}
}

Expand All @@ -348,7 +365,11 @@ android {
}

dependencies {
implementation('org.smartregister:opensrp-client-chw-core:2.1.3-SNAPSHOT@aar') {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

implementation('com.google.android.gms:play-services-vision:17.0.2')

implementation('org.smartregister:opensrp-client-chw-core:2.1.4-LMH-Beta-04-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'androidx.legacy', module: 'legacy-support-v4'
Expand Down Expand Up @@ -379,6 +400,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'org.mockito:mockito-android:3.0.0'

//implementation 'com.github.lecho:hellocharts-android:1.5.8@aar'
//For viewing PDFs in the app
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'

Expand All @@ -391,6 +413,15 @@ dependencies {
testImplementation 'org.robolectric:shadows-multidex:4.3.1'
testImplementation 'org.robolectric:shadows-support-v4:3.4-rc2'
testImplementation 'androidx.test:core:1.3.0'
// testImplementation 'com.ibm.fhir:fhir-model:4.7.0'
// testImplementation 'com.ibm.fhir:fhir-path:4.7.0'

// unit test
def powerMockVersion = '2.0.7'
testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
testImplementation "org.powermock:powermock-module-junit4-rule:$powerMockVersion"
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
testImplementation "org.powermock:powermock-classloading-xstream:$powerMockVersion"
}

def flavors = android.productFlavors.collect { flavor -> flavor.name }
Expand Down Expand Up @@ -430,6 +461,11 @@ task jacocoTestReport(type: JacocoReport, dependsOn: [
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
maxHeapSize = "3g"

testLogging {
events "failed"
exceptionFormat "full"
}
}

tasks.coveralls {
Expand All @@ -439,4 +475,4 @@ tasks.coveralls {
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml"
sourceDirs = ["$project.projectDir/src/main/java"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.smartregister.chw.custom_view;

public class FamilyFloatingMenuFlv extends DefaultFamilyFloatingMenuFlv {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.apache.commons.lang3.tuple.Pair;
import org.smartregister.chw.core.activity.CoreStockInventoryReportActivity;
import org.smartregister.chw.core.activity.HIA2ReportsActivity;
import org.smartregister.chw.core.custom_views.NavigationMenu;
import org.smartregister.chw.core.utils.CoreConstants;
import org.smartregister.chw.referral.util.Constants;

Expand All @@ -15,7 +14,7 @@
import java.util.List;
import java.util.Locale;

public class NavigationMenuFlv implements NavigationMenu.Flavour {
public class NavigationMenuFlv extends DefaultNavigationMenuFlv {

@Override
public List<Pair<String, Locale>> getSupportedLanguages() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ protected void evaluateImmunization(Person baby) throws Exception {
.withBaseEntityID(baby.getBaseEntityID())
.withProcessingMode(BaseAncHomeVisitAction.ProcessingMode.SEPARATE)
.withDestinationFragment(BaseHomeVisitImmunizationFragment.getInstance(view, baby.getBaseEntityID(), details, displays))
.withHelper(new ImmunizationActionHelper(context, wrappers))
.withHelper(new ImmunizationActionHelper(context, () -> wrappers))
.build();
actionList.put(MessageFormat.format(context.getString(R.string.pnc_immunization_at_birth), baby.getFullName()), action);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.smartregister.chw.custom_view;

public class FamilyFloatingMenuFlv extends DefaultFamilyFloatingMenuFlv {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.smartregister.chw.custom_view;

public class FamilyFloatingMenuFlv extends DefaultFamilyFloatingMenuFlv {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.smartregister.chw.custom_view;

public class FamilyFloatingMenuFlv extends DefaultFamilyFloatingMenuFlv {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.smartregister.chw.custom_view;

public class FamilyFloatingMenuFlv extends DefaultFamilyFloatingMenuFlv {
}
17 changes: 13 additions & 4 deletions opensrp-chw/src/lmh/assets/json.form/child_enrollment.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"openmrs_entity_id": "first_name",
"openmrs_data_type": "text",
"type": "edit_text",
"edit_type": "name",
"hint": "{{child_enrollment.step1.first_name.hint}}",
"expanded": false,
"v_required": {
Expand All @@ -105,6 +106,7 @@
"openmrs_entity_id": "middle_name",
"openmrs_data_type": "text",
"type": "edit_text",
"edit_type": "name",
"hint": "{{child_enrollment.step1.middle_name.hint}}",
"expanded": false,
"v_regex": {
Expand Down Expand Up @@ -206,11 +208,18 @@
"openmrs_entity_parent": "",
"openmrs_entity": "person",
"openmrs_entity_id": "gender",
"type": "spinner",
"type": "native_radio",
"hint": "{{child_enrollment.step1.gender.hint}}",
"values": [
"{{child_enrollment.step1.gender.values[0]}}",
"{{child_enrollment.step1.gender.values[1]}}"
"label": "{{child_enrollment.step1.gender.hint}}",
"options": [
{
"key": "{{child_enrollment.step1.gender.values[0]}}",
"text": "{{child_enrollment.step1.gender.values[0]}}"
},
{
"key": "{{child_enrollment.step1.gender.values[1]}}",
"text": "{{child_enrollment.step1.gender.values[1]}}"
}
],
"v_required": {
"value": "true",
Expand Down
15 changes: 11 additions & 4 deletions opensrp-chw/src/lmh/assets/json.form/family_member_register.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,18 @@
"openmrs_entity_parent": "",
"openmrs_entity": "person",
"openmrs_entity_id": "gender",
"type": "spinner",
"type": "native_radio",
"label": "{{family_member_register.step1.sex.hint}}",
"hint": "{{family_member_register.step1.sex.hint}}",
"values": [
"{{family_member_register.step1.sex.values[0]}}",
"{{family_member_register.step1.sex.values[1]}}"
"options": [
{
"key": "{{family_member_register.step1.sex.values[0]}}",
"text": "{{family_member_register.step1.sex.values[0]}}"
},
{
"key": "{{family_member_register.step1.sex.values[1]}}",
"text":"{{family_member_register.step1.sex.values[1]}}"
}
],
"v_required": {
"value": "true",
Expand Down
21 changes: 15 additions & 6 deletions opensrp-chw/src/lmh/assets/json.form/family_register.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"validate_on_submit": true,
"validate_on_submit": false,
"show_errors_on_submit": false,
"count": "2",
"encounter_type": "Family Registration",
Expand Down Expand Up @@ -80,7 +80,8 @@
"openmrs_entity": "person_identifier",
"openmrs_entity_id": "opensrp_id",
"hidden": "true",
"type": "barcode",
"type": "edit_text",
"value": "0",
"barcode_type": "qrcode",
"hint": "{{family_register.step1.unique_id.hint}}",
"scanButtonText": "{{family_register.step1.unique_id.scanButtonText}}",
Expand All @@ -95,6 +96,7 @@
"openmrs_entity": "person_address",
"openmrs_entity_id": "cityVillage",
"type": "edit_text",
"edit_type": "name",
"hint": "{{family_register.step1.village_town.hint}}",
"v_required": {
"value": "true",
Expand Down Expand Up @@ -257,11 +259,18 @@
"openmrs_entity_parent": "",
"openmrs_entity": "person",
"openmrs_entity_id": "gender",
"type": "spinner",
"type": "native_radio",
"label": "{{family_register.step2.sex.hint}}",
"hint": "{{family_register.step2.sex.hint}}",
"values": [
"{{family_register.step2.sex.values[0]}}",
"{{family_register.step2.sex.values[1]}}"
"options": [
{
"key": "{{family_register.step2.sex.values[0]}}",
"text": "{{family_register.step2.sex.values[0]}}"
},
{
"key": "{{family_register.step2.sex.values[1]}}",
"text": "{{family_register.step2.sex.values[1]}}"
}
],
"v_required": {
"value": "true",
Expand Down
34 changes: 32 additions & 2 deletions opensrp-chw/src/lmh/assets/vaccines.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
{
"reference": "dob",
"offset": "+0d",
"window": "+5y"
"window": "+1y"
}
],
"expiry": [
{
"reference": "dob",
"offset": "+5y"
"offset": "+1y"
}
]
}
Expand Down Expand Up @@ -1020,6 +1020,36 @@
}
]
}
},
{
"name": "Typhoid",
"type": "Typhoid",
"openmrs_date": {
"parent_entity": "86022AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"entity": "concept",
"entity_id": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"openmrs_calculate": {
"parent_entity": "86022AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"entity": "concept",
"entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"calculation": 1
},
"schedule": {
"due": [
{
"reference": "dob",
"offset": "+9m",
"window": "+2y"
}
],
"expiry": [
{
"reference": "dob",
"offset": "+2y"
}
]
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ public void setVaccineHistoryView(String days, RelativeLayout layoutVaccineHisto
public String getToolbarTitleName(MemberObject memberObject) {
return memberObject.getFamilyName();
}

@Override
public boolean usesEligibleChildText(){
return true;
}
}
Loading

0 comments on commit 0f40f23

Please sign in to comment.