Skip to content

Commit

Permalink
Add VHA vaccine
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-vd committed Nov 25, 2021
1 parent a19bac6 commit e62bbae
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
8 changes: 4 additions & 4 deletions opensrp-unicef-tunisia/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ android {
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100'
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '11'
buildConfigField "int", "VACCINE_SYNC_TIME", '0'
buildConfigField "int", "DATABASE_VERSION", '14'
buildConfigField "int", "DATABASE_VERSION", '15'
buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l"
buildConfigField "boolean", "TIME_CHECK", "true"
buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15'
Expand All @@ -148,7 +148,7 @@ android {
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100'
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '12'
buildConfigField "int", "VACCINE_SYNC_TIME", '0'
buildConfigField "int", "DATABASE_VERSION", '14'
buildConfigField "int", "DATABASE_VERSION", '15'
buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l"
buildConfigField "boolean", "TIME_CHECK", "true"
buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15'
Expand Down Expand Up @@ -180,7 +180,7 @@ android {
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100'
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '13'
buildConfigField "int", "VACCINE_SYNC_TIME", '0'
buildConfigField "int", "DATABASE_VERSION", '14'
buildConfigField "int", "DATABASE_VERSION", '15'
buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l"
buildConfigField "boolean", "TIME_CHECK", "true"
buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15'
Expand Down Expand Up @@ -274,7 +274,7 @@ dependencies {
exclude group: 'com.ibm.fhir', module: 'fhir-path'
}

implementation('org.smartregister:opensrp-client-immunization:3.0.11-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-immunization:4.0.3-SNAPSHOT@aar') {
transitive = true
exclude group: 'org.smartregister', module: 'opensrp-client-core'
exclude group: 'com.android.support', module: 'design'
Expand Down
24 changes: 24 additions & 0 deletions opensrp-unicef-tunisia/src/main/assets/preterm_vaccines.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,30 @@
}
]
}
},
{
"name": "VHA",
"type": "vha",
"openmrs_date": {
"parent_entity": "",
"entity": "concept",
"entity_id": "vha"
},
"openmrs_calculate": {
"parent_entity": "",
"entity": "concept",
"entity_id": "vha_calculation",
"calculation": 0
},
"schedule": {
"due": [
{
"reference": "dob",
"offset": "+360d",
"window": "+30d"
}
]
}
}
]
},
Expand Down
24 changes: 24 additions & 0 deletions opensrp-unicef-tunisia/src/main/assets/vaccines.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,30 @@
}
]
}
},
{
"name": "VHA",
"type": "vha",
"openmrs_date": {
"parent_entity": "",
"entity": "concept",
"entity_id": "vha"
},
"openmrs_calculate": {
"parent_entity": "",
"entity": "concept",
"entity_id": "vha_calculation",
"calculation": 0
},
"schedule": {
"due": [
{
"reference": "dob",
"offset": "+360d",
"window": "+30d"
}
]
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.smartregister.reporting.repository.IndicatorQueryRepository;
import org.smartregister.reporting.repository.IndicatorRepository;
import org.smartregister.repository.AlertRepository;
import org.smartregister.repository.AllSharedPreferences;
import org.smartregister.repository.EventClientRepository;
import org.smartregister.repository.Hia2ReportRepository;
import org.smartregister.repository.LocationRepository;
Expand Down Expand Up @@ -131,6 +132,8 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
break;
case 14:
upgradeToVersion14(db);
case 15:
upgradeToVersion15(db);
default:
break;
}
Expand Down Expand Up @@ -346,4 +349,16 @@ private void upgradeToVersion14(SQLiteDatabase db) {
db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_IS_VOIDED_COL);
db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_IS_VOIDED_COL_INDEX);
}

private void upgradeToVersion15(SQLiteDatabase db) {
try{
AllSharedPreferences sharedPreferences = UnicefTunisiaApplication.getInstance().context().userService()
.getAllSharedPreferences();
db.execSQL(VaccineRepository.UPDATE_TABLE_VACCINES_ADD_OUTREACH_COL);
db.execSQL(VaccineRepository.UPDATE_OUTREACH_QUERRY, new String[]{sharedPreferences.fetchDefaultLocalityId(sharedPreferences.fetchPioneerUser())});

} catch (Exception e) {
Timber.e(e, "upgradeToVersion15");
}
}
}
2 changes: 2 additions & 0 deletions opensrp-unicef-tunisia/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,6 @@
<!-- Card support strings -->
<string name="opensrp_id">IDV NUMBER</string>
<string name="percentage_sign">%1$s\%%</string>
<string name="vha">VHA</string>

</resources>

0 comments on commit e62bbae

Please sign in to comment.